Skip to content

Commit a859549

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
2 parents b34b1ad + 8e584ee commit a859549

File tree

231 files changed

+3553
-1164
lines changed

Some content is hidden

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

231 files changed

+3553
-1164
lines changed

install/dist/tpl/gentoo/jk_init.ini.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ directories = /etc/joe, /etc/terminfo, /usr/share/vim, /usr/share/terminfo, /usr
9999
comment = several internet utilities like wget, ftp, rsync, scp, ssh
100100
executables = /usr/bin/wget, /usr/bin/lynx, /usr/bin/ftp, /usr/bin/host, /usr/bin/rsync, /usr/bin/smbclient
101101
includesections = netbasics, ssh, sftp, scp
102+
directories = /etc/ssl/certs/
103+
regularfiles = /usr/lib/ssl/certs
102104

103105
[apacheutils]
104106
comment = htpasswd utility

install/lib/installer_base.lib.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2478,24 +2478,13 @@ public function install_ispconfig() {
24782478
//* copy the ISPConfig security part
24792479
$command = 'cp -rf ../security '.$install_dir;
24802480
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
2481-
2482-
//* Apply changed security_settings.ini values to new security_settings.ini file
2483-
if(is_file('/usr/local/ispconfig/security/security_settings.ini~')) {
2484-
$security_settings_old = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini~'));
2485-
$security_settings_new = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini'));
2486-
if(is_array($security_settings_new) && is_array($security_settings_old)) {
2487-
foreach($security_settings_new as $section => $sval) {
2488-
if(is_array($sval)) {
2489-
foreach($sval as $key => $val) {
2490-
if(isset($security_settings_old[$section]) && isset($security_settings_old[$section][$key])) {
2491-
$security_settings_new[$section][$key] = $security_settings_old[$section][$key];
2492-
}
2493-
}
2494-
}
2495-
}
2496-
file_put_contents('/usr/local/ispconfig/security/security_settings.ini',array_to_ini($security_settings_new));
2497-
}
2481+
2482+
$configfile = 'security_settings.ini';
2483+
if(is_file($install_dir.'/security/'.$configfile)) {
2484+
copy($install_dir.'/security/'.$configfile, $install_dir.'/security/'.$configfile.'~');
24982485
}
2486+
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
2487+
wf($install_dir.'/security/'.$configfile, $content);
24992488

25002489
//* Create a symlink, so ISPConfig is accessible via web
25012490
// Replaced by a separate vhost definition for port 8080

install/sql/README.txt

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ then follow these steps:
99
1) Add the field or table in the ispconfig3.sql file. This file contains the
1010
complete database dump which is used when ISPConfig gets installed.
1111

12-
2) Create a new file in the "incremental" subfolder wich contains the alter
13-
table, or if it is a complete new table then the add table, statement(s) in
14-
MySQL syntax which is/are required to modify the current ispconfig database
15-
during update. The naming scheme of the sql patch update files is
16-
upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that
17-
you choose for the new file is a +1 increment of the number of the last
18-
existing file and that the number is formatted with 4 digits.
12+
2) Add your ALTER TABLE, or if it is a complete new table then the add table,
13+
statement(s) in MySQL syntax which is/are required to modify the current
14+
ispconfig database during update to the file upd_dev_collection.sql in the
15+
sql/incremental subfolder.
1916

20-
A patch file may contain one or more alter table statements. Every patch file
21-
gets executed once in the database, so do not modify older (already released)
22-
patch files, they will not get executed again if the update was already run
23-
once on a system.
17+
Please do not create new patch sql files as those will be generated on
18+
new releases from the upd_dev_collection.sql file. Also please do not
19+
modify older (already released) patch files, they will not get executed
20+
again if the update was already run once on a system.
2421

2522
After a patch has been executed, the dbversion field in the server table gets
2623
increeased to the version number of the last installed patch.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
-- add new proxy_protocol column
22
ALTER TABLE `web_domain`
33
ADD COLUMN `proxy_protocol` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `log_retention`;
4+
5+
-- backup format
6+
ALTER TABLE `web_domain` ADD `backup_format_web` VARCHAR( 255 ) NOT NULL default 'default' AFTER `backup_copies`;
7+
ALTER TABLE `web_domain` ADD `backup_format_db` VARCHAR( 255 ) NOT NULL default 'gzip' AFTER `backup_format_web`;
8+
-- end of backup format
9+
10+
-- backup encryption
11+
ALTER TABLE `web_domain` ADD `backup_encrypt` enum('n','y') NOT NULL DEFAULT 'n' AFTER `backup_format_db`;
12+
ALTER TABLE `web_domain` ADD `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `backup_encrypt`;
13+
ALTER TABLE `web_backup` ADD `backup_format` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER `backup_mode`;
14+
ALTER TABLE `web_backup` ADD `backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `filesize`;
15+
-- end of backup encryption

install/sql/ispconfig3.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,9 +1922,11 @@ CREATE TABLE `web_backup` (
19221922
`parent_domain_id` int(10) unsigned NOT NULL DEFAULT '0',
19231923
`backup_type` enum('web','mysql','mongodb') NOT NULL DEFAULT 'web',
19241924
`backup_mode` varchar(64) NOT NULL DEFAULT '',
1925+
`backup_format` varchar(64) NOT NULL DEFAULT '',
19251926
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
19261927
`filename` varchar(255) NOT NULL DEFAULT '',
19271928
`filesize` VARCHAR(20) NOT NULL DEFAULT '',
1929+
`backup_password` VARCHAR(255) NOT NULL DEFAULT '',
19281930
PRIMARY KEY (`backup_id`)
19291931
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
19301932

@@ -2055,6 +2057,10 @@ CREATE TABLE `web_domain` (
20552057
`custom_php_ini` mediumtext,
20562058
`backup_interval` VARCHAR( 255 ) NOT NULL DEFAULT 'none',
20572059
`backup_copies` INT NOT NULL DEFAULT '1',
2060+
`backup_format_web` VARCHAR( 255 ) NOT NULL default 'default',
2061+
`backup_format_db` VARCHAR( 255 ) NOT NULL default 'gzip',
2062+
`backup_encrypt` enum('n','y') NOT NULL DEFAULT 'n',
2063+
`backup_password` VARCHAR( 255 ) NOT NULL DEFAULT '',
20582064
`backup_excludes` mediumtext,
20592065
`active` enum('n','y') NOT NULL default 'y',
20602066
`traffic_quota_lock` enum('n','y') NOT NULL default 'n',

install/tpl/jk_init.ini.master

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ directories = /etc/joe, /etc/terminfo, /usr/share/vim, /usr/share/terminfo, /lib
9696
comment = several internet utilities like wget, ftp, rsync, scp, ssh
9797
executables = /usr/bin/wget, /usr/bin/lynx, /usr/bin/ftp, /usr/bin/host, /usr/bin/rsync, /usr/bin/smbclient
9898
includesections = netbasics, ssh, sftp, scp
99+
directories = /etc/ssl/certs/
100+
regularfiles = /usr/lib/ssl/certs
99101

100102
[apacheutils]
101103
comment = htpasswd utility

interface/lib/classes/aps_guicontroller.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ public function createDatabaseForPackageInstance(&$settings, $websrv) {
340340
"remote_access" => $mysql_db_remote_access,
341341
"remote_ips" => $mysql_db_remote_ips,
342342
"backup_copies" => $websrv['backup_copies'],
343+
"backup_format_web" => $websrv['backup_format_web'],
344+
"backup_format_db" => $websrv['backup_format_db'],
343345
"active" => 'y',
344346
"backup_interval" => $websrv['backup_interval']
345347
);

interface/lib/classes/listform_actions.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public function prepareDataRow($rec)
189189
//* substitute value for select fields
190190
if(is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) {
191191
foreach($app->listform->listDef['item'] as $field) {
192+
if($rec['active'] == 'n') $rec['warn_inactive'] = 'y';
192193
$key = $field['field'];
193194
if(isset($field['formtype']) && $field['formtype'] == 'SELECT') {
194195
if(strtolower($rec[$key]) == 'y' or strtolower($rec[$key]) == 'n') {

interface/lib/classes/plugin_backuplist.inc.php

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,34 @@ class plugin_backuplist extends plugin_base {
3737
var $formdef;
3838
var $options;
3939

40+
/**
41+
* Process request to make a backup. This request is triggered manually by the user in the ISPConfig interface.
42+
* @param string $message
43+
* @param string $error
44+
* @param string[] $wb language text
45+
* @author Ramil Valitov <ramilvalitov@gmail.com>
46+
* @uses backup_plugin::make_backup_callback() this method is called later in the plugin to run the backup
47+
*/
48+
protected function makeBackup(&$message, &$error, $wb)
49+
{
50+
global $app;
51+
52+
$mode = $_GET['make_backup'];
53+
$action_type = ($mode == 'web') ? 'backup_web_files' : 'backup_database';
54+
$domain_id = intval($this->form->id);
55+
56+
$sql = "SELECT count(action_id) as number FROM sys_remoteaction WHERE action_state = 'pending' AND action_type = ? AND action_param = ?";
57+
$tmp = $app->db->queryOneRecord($sql, $action_type, $domain_id);
58+
if ($tmp['number'] == 0) {
59+
$server_id = $this->form->dataRecord['server_id'];
60+
$message .= $wb['backup_info_txt'];
61+
$sql = "INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) VALUES (?, UNIX_TIMESTAMP(), ?, ?, 'pending', '')";
62+
$app->db->query($sql, $server_id, $action_type, $domain_id);
63+
} else {
64+
$error .= $wb['backup_pending_txt'];
65+
}
66+
}
67+
4068
function onShow() {
4169

4270
global $app;
@@ -52,6 +80,10 @@ function onShow() {
5280
$message = '';
5381
$error = '';
5482

83+
if (isset($_GET['make_backup'])) {
84+
$this->makeBackup($message, $error, $wb);
85+
}
86+
5587
if(isset($_GET['backup_action'])) {
5688
$backup_id = $app->functions->intval($_GET['backup_id']);
5789

@@ -137,7 +169,30 @@ function onShow() {
137169
$rec["bgcolor"] = $bgcolor;
138170

139171
$rec['date'] = date($app->lng('conf_format_datetime'), $rec['tstamp']);
140-
$rec['backup_type'] = $wb[('backup_type_'.$rec['backup_type'])];
172+
$backup_format = $rec['backup_format'];
173+
if (empty($backup_format)) {
174+
//We have a backup from old version of ISPConfig
175+
switch ($rec['backup_type']) {
176+
case 'mysql':
177+
$backup_format = 'gzip';
178+
break;
179+
case 'web':
180+
$backup_format = ($rec['backup_mode'] == 'userzip') ? 'zip' : 'tar_gzip';
181+
break;
182+
default:
183+
$app->log('Unsupported backup type "' . $rec['backup_type'] . '" for backup id ' . $rec['backup_id'], LOGLEVEL_ERROR);
184+
break;
185+
}
186+
}
187+
$rec['backup_type'] = $wb[('backup_type_' . $rec['backup_type'])];
188+
$backup_format = (!empty($backup_format)) ? $wb[('backup_format_' . $backup_format . '_txt')] : $wb["backup_format_unknown_txt"];
189+
if (empty($backup_format))
190+
$backup_format = $wb["backup_format_unknown_txt"];
191+
192+
$rec['backup_format'] = $backup_format;
193+
$rec['backup_encrypted'] = empty($rec['backup_password']) ? $wb["no_txt"] : $wb["yes_txt"];
194+
$backup_manual_prefix = 'manual-';
195+
$rec['backup_job'] = (substr($rec['filename'], 0, strlen($backup_manual_prefix)) == $backup_manual_prefix) ? $wb["backup_job_manual_txt"] : $wb["backup_job_auto_txt"];
141196

142197
$rec['download_available'] = true;
143198
if($rec['server_id'] != $web['server_id']) $rec['download_available'] = false;

0 commit comments

Comments
 (0)