Skip to content

Commit 71cae5d

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents 83bf799 + 3cf7f96 commit 71cae5d

File tree

215 files changed

+963
-637
lines changed

Some content is hidden

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

215 files changed

+963
-637
lines changed

install/lib/installer_base.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ public function configure_apps_vhost() {
20852085
$content = str_replace('{fpm_socket}', $fpm_socket, $content);
20862086
$content = str_replace('{cgi_socket}', $cgi_socket, $content);
20872087

2088-
if(file_exists('/var/run/php5-fpm.sock')){
2088+
if(file_exists('/var/run/php5-fpm.sock') || file_exists('/var/run/php/php7.0-fpm.sock')){
20892089
$use_tcp = '#';
20902090
$use_socket = '';
20912091
} else {

install/lib/update.lib.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ function updateDbAndIni() {
205205
$cmd = "mysql --default-character-set=".escapeshellarg($conf['mysql']['charset'])." --force -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." ".escapeshellarg($conf['mysql']['database'])." < ".$sql_patch_filename;
206206
}
207207

208-
if(in_array($next_db_version,explode(',',$silent_update_versions))) $cmd .= ' > /dev/null 2> /dev/null';
208+
if(in_array($next_db_version,explode(',',$silent_update_versions))) {
209+
$cmd .= ' > /dev/null 2> /dev/null';
210+
} else {
211+
$cmd .= ' > /var/log/ispconfig_install.log 2> /var/log/ispconfig_install.log';
212+
}
209213
system($cmd);
210214

211215
swriteln($inst->lng('Loading SQL patch file').': '.$sql_patch_filename);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ALTER TABLE `client` CHANGE `web_servers` `web_servers` TEXT NULL DEFAULT NULL;
2+
ALTER TABLE `client` CHANGE `mail_servers` `mail_servers` TEXT NULL DEFAULT NULL;
3+
ALTER TABLE `client` CHANGE `xmpp_servers` `xmpp_servers` TEXT NULL DEFAULT NULL;
4+
ALTER TABLE `client` CHANGE `db_servers` `db_servers` TEXT NULL DEFAULT NULL;
5+
ALTER TABLE `client` CHANGE `dns_servers` `dns_servers` TEXT NULL DEFAULT NULL;
6+
UPDATE client SET web_servers = default_webserver WHERE (web_servers = '' OR web_servers IS NULL);
7+
UPDATE client SET mail_servers = default_mailserver WHERE (mail_servers = '' OR mail_servers IS NULL);
8+
UPDATE client SET xmpp_servers = default_xmppserver WHERE (xmpp_servers = '' OR xmpp_servers IS NULL);
9+
UPDATE client SET db_servers = default_dbserver WHERE (db_servers = '' OR db_servers IS NULL);
10+
UPDATE client SET dns_servers = default_dnsserver WHERE (dns_servers = '' OR dns_servers IS NULL);
11+
ALTER TABLE `client_template` ADD `default_slave_dnsserver` INT NOT NULL DEFAULT '0' AFTER `limit_dns_slave_zone`;
12+
ALTER TABLE `client_template` ADD `mail_servers` TEXT NULL DEFAULT NULL AFTER `template_type`;
13+
ALTER TABLE `client_template` ADD `web_servers` TEXT NULL DEFAULT NULL AFTER `limit_xmpp_httparchive`;
14+
ALTER TABLE `client_template` ADD `dns_servers` TEXT NULL DEFAULT NULL AFTER `limit_aps`;
15+
ALTER TABLE `client_template` ADD `db_servers` TEXT NULL DEFAULT NULL AFTER `limit_dns_record`;
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +0,0 @@
1-
ALTER TABLE `client` CHANGE `web_servers` `web_servers` TEXT NULL DEFAULT NULL;
2-
ALTER TABLE `client` CHANGE `mail_servers` `mail_servers` TEXT NULL DEFAULT NULL;
3-
ALTER TABLE `client` CHANGE `xmpp_servers` `xmpp_servers` TEXT NULL DEFAULT NULL;
4-
ALTER TABLE `client` CHANGE `db_servers` `db_servers` TEXT NULL DEFAULT NULL;
5-
ALTER TABLE `client` CHANGE `dns_servers` `dns_servers` TEXT NULL DEFAULT NULL;
6-
UPDATE client SET web_servers = default_webserver WHERE (web_servers = '' OR web_servers IS NULL);
7-
UPDATE client SET mail_servers = default_mailserver WHERE (mail_servers = '' OR mail_servers IS NULL);
8-
UPDATE client SET xmpp_servers = default_xmppserver WHERE (xmpp_servers = '' OR xmpp_servers IS NULL);
9-
UPDATE client SET db_servers = default_dbserver WHERE (db_servers = '' OR db_servers IS NULL);
10-
UPDATE client SET dns_servers = default_dnsserver WHERE (dns_servers = '' OR dns_servers IS NULL);
11-
ALTER TABLE `client_template` ADD `default_slave_dnsserver` INT NOT NULL DEFAULT '0' AFTER `limit_dns_slave_zone`;
12-
ALTER TABLE `client_template` ADD `mail_servers` TEXT NULL DEFAULT NULL AFTER `template_type`;
13-
ALTER TABLE `client_template` ADD `web_servers` TEXT NULL DEFAULT NULL AFTER `limit_xmpp_httparchive`;
14-
ALTER TABLE `client_template` ADD `dns_servers` TEXT NULL DEFAULT NULL AFTER `limit_aps`;
15-
ALTER TABLE `client_template` ADD `db_servers` TEXT NULL DEFAULT NULL AFTER `limit_dns_record`;

install/tpl/apache_ispconfig.vhost.master

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ NameVirtualHost *:<tmpl_var name="vhost_port">
99
<VirtualHost _default_:<tmpl_var name="vhost_port">>
1010
ServerAdmin webmaster@localhost
1111

12-
<FilesMatch "\.ph(p3?|tml)$">
13-
SetHandler None
14-
</FilesMatch>
12+
<Directory /var/www/ispconfig/>
13+
<FilesMatch "\.ph(p3?|tml)$">
14+
SetHandler None
15+
</FilesMatch>
16+
</Directory>
17+
<Directory /usr/local/ispconfig/interface/web/>
18+
<FilesMatch "\.ph(p3?|tml)$">
19+
SetHandler None
20+
</FilesMatch>
21+
</Directory>
1522

1623
<IfModule mod_fcgid.c>
1724
DocumentRoot /var/www/ispconfig/

interface/lib/classes/client_templates.inc.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function update_client_templates($clientId, $templates = array()) {
1919
global $app, $conf;
2020

2121
if(!is_array($templates)) return false;
22-
2322
$new_tpl = array();
2423
$used_assigned = array();
2524
$needed_types = array();
@@ -155,7 +154,6 @@ function apply_client_templates($clientId) {
155154
/* we can remove this condition, but it is easier to debug with it (don't add ids and other non-limit values) */
156155
if (strpos($k, 'limit') !== false or strpos($k, 'default') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec'){
157156
$app->log('Template processing key ' . $k . ' for client ' . $clientId, LOGLEVEL_DEBUG);
158-
159157
/* process the numerical limits */
160158
if (is_numeric($v)){
161159
/* switch for special cases */
@@ -195,6 +193,24 @@ function apply_client_templates($clientId) {
195193
$limits[$k] = array();
196194
}
197195

196+
$limits_values = $limits[$k];
197+
if (is_string($limits[$k])){
198+
$limits_values = explode($form["tabs"]["limits"]["fields"][$k]["separator"], $limits[$k]);
199+
}
200+
$additional_values = explode($form["tabs"]["limits"]["fields"][$k]["separator"], $v);
201+
$app->log('Template processing key ' . $k . ' type CHECKBOXARRAY, lim / add: ' . implode(',', $limits_values) . ' / ' . implode(',', $additional_values) . ' for client ' . $clientId, LOGLEVEL_DEBUG);
202+
/* unification of limits_values (master template) and additional_values (additional template) */
203+
$limits_unified = array();
204+
foreach($form["tabs"]["limits"]["fields"][$k]["value"] as $key => $val){
205+
if (in_array($key, $limits_values) || in_array($key, $additional_values)) $limits_unified[] = $key;
206+
}
207+
$limits[$k] = implode($form["tabs"]["limits"]["fields"][$k]["separator"], $limits_unified);
208+
break;
209+
case 'MULTIPLE':
210+
if (!isset($limits[$k])){
211+
$limits[$k] = array();
212+
}
213+
198214
$limits_values = $limits[$k];
199215
if (is_string($limits[$k])){
200216
$limits_values = explode($form["tabs"]["limits"]["fields"][$k]["separator"], $limits[$k]);
@@ -245,7 +261,7 @@ function apply_client_templates($clientId) {
245261
if (strpos($k, 'default') !== false and $v == 0) {
246262
continue; // template doesn't define default server, client's default musn't be changed
247263
}
248-
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)){
264+
if ((strpos($k, 'limit') !== false or strpos($k, 'default') !== false or strpos($k, '_servers') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
249265
if ($update != '') $update .= ', ';
250266
$update .= '?? = ?';
251267
$update_values[] = $k;

interface/lib/classes/remote.d/sites.inc.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public function sites_web_vhost_aliasdomain_get($session_id, $primary_id)
481481
return false;
482482
}
483483
$app->uses('remoting_lib');
484-
$app->remoting_lib->loadFormDef('../sites/form/web_vhost_aliasdomain.tform.php');
484+
$app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php');
485485
return $app->remoting_lib->getDataRecord($primary_id);
486486
}
487487

@@ -505,7 +505,7 @@ public function sites_web_vhost_aliasdomain_add($session_id, $client_id, $params
505505
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
506506
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
507507

508-
$domain_id = $this->insertQuery('../sites/form/web_vhost_aliasdomain.tform.php', $client_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
508+
$domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
509509
return $domain_id;
510510
}
511511

@@ -523,7 +523,7 @@ public function sites_web_vhost_aliasdomain_update($session_id, $client_id, $pri
523523
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
524524
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
525525

526-
$affected_rows = $this->updateQuery('../sites/form/web_vhost_aliasdomain.tform.php', $client_id, $primary_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
526+
$affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $primary_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
527527
return $affected_rows;
528528
}
529529

@@ -534,7 +534,7 @@ public function sites_web_vhost_aliasdomain_delete($session_id, $primary_id)
534534
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
535535
return false;
536536
}
537-
$affected_rows = $this->deleteQuery('../sites/form/web_vhost_aliasdomain.tform.php', $primary_id);
537+
$affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id);
538538
return $affected_rows;
539539
}
540540

@@ -550,7 +550,7 @@ public function sites_web_vhost_subdomain_get($session_id, $primary_id)
550550
return false;
551551
}
552552
$app->uses('remoting_lib');
553-
$app->remoting_lib->loadFormDef('../sites/form/web_vhost_subdomain.tform.php');
553+
$app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php');
554554
return $app->remoting_lib->getDataRecord($primary_id);
555555
}
556556

@@ -574,7 +574,7 @@ public function sites_web_vhost_subdomain_add($session_id, $client_id, $params)
574574
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
575575
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
576576

577-
$domain_id = $this->insertQuery('../sites/form/web_vhost_subdomain.tform.php', $client_id, $params, 'sites:web_vhost_subdomain:on_after_insert');
577+
$domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_vhost_subdomain:on_after_insert');
578578
return $domain_id;
579579
}
580580

@@ -592,7 +592,7 @@ public function sites_web_vhost_subdomain_update($session_id, $client_id, $prima
592592
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
593593
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
594594

595-
$affected_rows = $this->updateQuery('../sites/form/web_vhost_subdomain.tform.php', $client_id, $primary_id, $params, 'sites:web_vhost_subdomain:on_after_insert');
595+
$affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $primary_id, $params, 'sites:web_vhost_subdomain:on_after_insert');
596596
return $affected_rows;
597597
}
598598

@@ -603,7 +603,7 @@ public function sites_web_vhost_subdomain_delete($session_id, $primary_id)
603603
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
604604
return false;
605605
}
606-
$affected_rows = $this->deleteQuery('../sites/form/web_vhost_subdomain.tform.php', $primary_id);
606+
$affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id);
607607
return $affected_rows;
608608
}
609609

@@ -619,7 +619,7 @@ public function sites_web_aliasdomain_get($session_id, $primary_id)
619619
return false;
620620
}
621621
$app->uses('remoting_lib');
622-
$app->remoting_lib->loadFormDef('../sites/form/web_aliasdomain.tform.php');
622+
$app->remoting_lib->loadFormDef('../sites/form/web_childdomain.tform.php');
623623
return $app->remoting_lib->getDataRecord($primary_id);
624624
}
625625

@@ -630,7 +630,7 @@ public function sites_web_aliasdomain_add($session_id, $client_id, $params)
630630
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
631631
return false;
632632
}
633-
return $this->insertQuery('../sites/form/web_aliasdomain.tform.php', $client_id, $params);
633+
return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params);
634634
}
635635

636636
//* Update a record
@@ -640,7 +640,7 @@ public function sites_web_aliasdomain_update($session_id, $client_id, $primary_i
640640
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
641641
return false;
642642
}
643-
$affected_rows = $this->updateQuery('../sites/form/web_aliasdomain.tform.php', $client_id, $primary_id, $params);
643+
$affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params);
644644
return $affected_rows;
645645
}
646646

@@ -651,7 +651,7 @@ public function sites_web_aliasdomain_delete($session_id, $primary_id)
651651
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
652652
return false;
653653
}
654-
$affected_rows = $this->deleteQuery('../sites/form/web_aliasdomain.tform.php', $primary_id);
654+
$affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id);
655655
return $affected_rows;
656656
}
657657

@@ -667,7 +667,7 @@ public function sites_web_subdomain_get($session_id, $primary_id)
667667
return false;
668668
}
669669
$app->uses('remoting_lib');
670-
$app->remoting_lib->loadFormDef('../sites/form/web_subdomain.tform.php');
670+
$app->remoting_lib->loadFormDef('../sites/form/web_childdomain.tform.php');
671671
return $app->remoting_lib->getDataRecord($primary_id);
672672
}
673673

@@ -678,7 +678,7 @@ public function sites_web_subdomain_add($session_id, $client_id, $params)
678678
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
679679
return false;
680680
}
681-
return $this->insertQuery('../sites/form/web_subdomain.tform.php', $client_id, $params);
681+
return $this->insertQuery('../sites/form/web_childdomain.tform.php', $client_id, $params);
682682
}
683683

684684
//* Update a record
@@ -688,7 +688,7 @@ public function sites_web_subdomain_update($session_id, $client_id, $primary_id,
688688
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
689689
return false;
690690
}
691-
$affected_rows = $this->updateQuery('../sites/form/web_subdomain.tform.php', $client_id, $primary_id, $params);
691+
$affected_rows = $this->updateQuery('../sites/form/web_childdomain.tform.php', $client_id, $primary_id, $params);
692692
return $affected_rows;
693693
}
694694

@@ -699,7 +699,7 @@ public function sites_web_subdomain_delete($session_id, $primary_id)
699699
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
700700
return false;
701701
}
702-
$affected_rows = $this->deleteQuery('../sites/form/web_subdomain.tform.php', $primary_id);
702+
$affected_rows = $this->deleteQuery('../sites/form/web_childdomain.tform.php', $primary_id);
703703
return $affected_rows;
704704
}
705705

interface/lib/classes/tform_base.inc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,8 +1488,10 @@ function showForm() {
14881488
$app->tpl->setVar('form_hint', $form_hint);
14891489

14901490
// Set Wordbook for this form
1491-
1492-
$app->tpl->setVar($this->wordbook);
1491+
foreach($this->wordbook as $key => $val) {
1492+
if(strstr($val,'\'')) $val = stripslashes($val);
1493+
$app->tpl->setVar($key,$val);
1494+
}
14931495
}
14941496

14951497
function getDataRecord($primary_id) {

interface/lib/classes/tools_sites.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function getDomainModuleDomains($not_used_in_table = null, $selected_domain = nu
157157
$field = "domain";
158158
$select = $field;
159159
}
160-
$sql .= " domain NOT IN (SELECT $select FROM ?? WHERE $field = ?) AND";
160+
$sql .= " domain NOT IN (SELECT $select FROM ?? WHERE $field != ?) AND";
161161
}
162162
if ($_SESSION["s"]["user"]["typ"] == 'admin') {
163163
$sql .= " 1";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,5 @@ $wb['xmpp_port_http_txt'] = 'HTTP';
280280
$wb['xmpp_port_https_txt'] = 'HTTPS';
281281
$wb['xmpp_port_pastebin_txt'] = 'Pastebin';
282282
$wb['xmpp_port_bosh_txt'] = 'BOSH';
283+
$wb['backup_time_txt'] = 'Backup time';
283284
?>

0 commit comments

Comments
 (0)