Skip to content

Commit 6250b7e

Browse files
committed
Merge remote-tracking branch 'ispc3master/master'
Conflicts: install/sql/incremental/upd_0063.sql
2 parents 11ccaaa + 88d47d2 commit 6250b7e

File tree

79 files changed

+1558
-239
lines changed

Some content is hidden

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

79 files changed

+1558
-239
lines changed

install/lib/install.lib.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,23 @@ function removeLine($filename, $search_pattern, $strict = 0) {
666666
}
667667
}
668668

669+
function hasLine($filename, $search_pattern, $strict = 0) {
670+
if($lines = @file($filename)) {
671+
foreach($lines as $line) {
672+
if($strict == 0) {
673+
if(stristr($line, $search_pattern)) {
674+
return true;
675+
}
676+
} else {
677+
if(trim($line) == $search_pattern) {
678+
return true;
679+
}
680+
}
681+
}
682+
}
683+
return false;
684+
}
685+
669686
function is_installed($appname) {
670687
exec('which '.escapeshellcmd($appname).' 2> /dev/null', $out, $returncode);
671688
if(isset($out[0]) && stristr($out[0], $appname) && $returncode == 0) {

install/lib/installer_base.lib.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,15 @@ public function configure_apache() {
12471247
replaceLine('/etc/apache2/ports.conf', 'Listen 443', 'Listen 443', 1);
12481248
}
12491249

1250+
if(is_file('/etc/apache2/apache.conf')) {
1251+
if(hasLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 1) == false) {
1252+
if(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.conf', 1) == false) {
1253+
replaceLine('/etc/apache2/apache.conf', 'Include sites-enabled/', 'Include sites-enabled/', 1, 1);
1254+
} elseif(hasLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 1) == false) {
1255+
replaceLine('/etc/apache2/apache.conf', 'IncludeOptional sites-enabled/*.vhost', 'IncludeOptional sites-enabled/*.vhost', 1, 1);
1256+
}
1257+
}
1258+
}
12501259

12511260
//* Copy the ISPConfig configuration include
12521261
$vhost_conf_dir = $conf['apache']['vhost_conf_dir'];
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
ALTER TABLE `client_template` CHANGE `limit_aps` `limit_aps` INT( 11 ) NOT NULL DEFAULT '-1';
2-
ALTER TABLE `web_backup` ADD `filesize` VARCHAR(10) NOT NULL AFTER `filename`;
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
ALTER TABLE `client_template` CHANGE `limit_aps` `limit_aps` INT( 11 ) NOT NULL DEFAULT '-1';
2-
ALTER TABLE `mail_domain` ADD `dkim_public` MEDIUMTEXT NOT NULL AFTER `domain`;
3-
ALTER TABLE `mail_domain` ADD `dkim_private` MEDIUMTEXT NOT NULL AFTER `domain`;
4-
ALTER TABLE `mail_domain` ADD `dkim` ENUM( 'n', 'y' ) NOT NULL AFTER `domain`;
51
ALTER TABLE `client` ADD `default_slave_dnsserver` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1' AFTER `limit_dns_zone`;
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
ALTER TABLE `web_backup` CHANGE `backup_type` `backup_type` enum('web','mongodb','mysql') NOT NULL DEFAULT 'web';
2-
ALTER TABLE `web_database_user` ADD `database_password_mongo` varchar(32) DEFAULT NULL AFTER `database_password`;
31
ALTER TABLE `sys_datalog` ADD `error` MEDIUMTEXT NULL DEFAULT NULL;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ALTER TABLE `web_backup` ADD `filesize` VARCHAR(10) NOT NULL AFTER `filename`;
2+
ALTER TABLE `client_template` CHANGE `limit_aps` `limit_aps` INT( 11 ) NOT NULL DEFAULT '-1';
3+
ALTER TABLE `mail_domain` ADD `dkim_public` MEDIUMTEXT NOT NULL AFTER `domain`;
4+
ALTER TABLE `mail_domain` ADD `dkim_private` MEDIUMTEXT NOT NULL AFTER `domain`;
5+
ALTER TABLE `mail_domain` ADD `dkim` ENUM( 'n', 'y' ) NOT NULL AFTER `domain`;
6+
ALTER TABLE `web_backup` CHANGE `backup_type` `backup_type` enum('web','mysql','mongodb') NOT NULL DEFAULT 'web';
7+
ALTER TABLE `web_database_user` ADD `database_password_mongo` varchar(32) DEFAULT NULL AFTER `database_password`;

install/sql/ispconfig3.sql

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ CREATE TABLE `client` (
219219
`limit_cron_frequency` int(11) NOT NULL DEFAULT '5',
220220
`limit_traffic_quota` int(11) NOT NULL DEFAULT '-1',
221221
`limit_client` int(11) NOT NULL DEFAULT '0',
222+
`limit_domainmodule` int(11) NOT NULL DEFAULT '0',
222223
`limit_mailmailinglist` int(11) NOT NULL DEFAULT '-1',
223224
`limit_openvz_vm` int(11) NOT NULL DEFAULT '0',
224225
`limit_openvz_vm_template_id` int(11) NOT NULL DEFAULT '0',
@@ -321,6 +322,7 @@ CREATE TABLE `client_template` (
321322
`limit_cron_frequency` int(11) NOT NULL default '5',
322323
`limit_traffic_quota` int(11) NOT NULL default '-1',
323324
`limit_client` int(11) NOT NULL default '0',
325+
`limit_domainmodule` int(11) NOT NULL DEFAULT '0',
324326
`limit_mailmailinglist` int(11) NOT NULL default '-1',
325327
`limit_openvz_vm` int(11) NOT NULL DEFAULT '0',
326328
`limit_openvz_vm_template_id` int(11) NOT NULL DEFAULT '0',
@@ -342,6 +344,30 @@ CREATE TABLE `client_template_assigned` (
342344
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
343345
-- --------------------------------------------------------
344346

347+
--
348+
-- Table structure for table `invoice_message_template`
349+
--
350+
351+
CREATE TABLE `client_message_template` (
352+
`client_message_template_id` bigint(20) NOT NULL AUTO_INCREMENT,
353+
`sys_userid` int(11) NOT NULL DEFAULT '0',
354+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
355+
`sys_perm_user` varchar(5) DEFAULT NULL,
356+
`sys_perm_group` varchar(5) DEFAULT NULL,
357+
`sys_perm_other` varchar(5) DEFAULT NULL,
358+
`template_type` varchar(255) DEFAULT NULL,
359+
`template_name` varchar(255) DEFAULT NULL,
360+
`subject` varchar(255) DEFAULT NULL,
361+
`message` text,
362+
PRIMARY KEY (`client_message_template_id`)
363+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
364+
365+
--
366+
-- Dumping data for table `invoice_message_template`
367+
--
368+
369+
-- --------------------------------------------------------
370+
345371
--
346372
-- Table structure for table `country`
347373
--
@@ -1379,6 +1405,11 @@ CREATE TABLE `spamfilter_policy` (
13791405
`spam_subject_tag2` varchar(64) default NULL,
13801406
`message_size_limit` int(11) unsigned default NULL,
13811407
`banned_rulenames` varchar(64) default NULL,
1408+
`policyd_quota_in` int(11) NOT NULL DEFAULT '-1',
1409+
`policyd_quota_in_period` int(11) NOT NULL DEFAULT '24',
1410+
`policyd_quota_out` int(11) NOT NULL DEFAULT '-1',
1411+
`policyd_quota_out_period` int(11) NOT NULL DEFAULT '24',
1412+
`policyd_greylist` ENUM( 'Y', 'N' ) NOT NULL DEFAULT 'N',
13821413
PRIMARY KEY (`id`)
13831414
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
13841415

@@ -1699,7 +1730,7 @@ CREATE TABLE `web_backup` (
16991730
`backup_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
17001731
`server_id` int(10) unsigned NOT NULL,
17011732
`parent_domain_id` int(10) unsigned NOT NULL,
1702-
`backup_type` enum('web','mongodb','mysql') NOT NULL DEFAULT 'web',
1733+
`backup_type` enum('web','mysql','mongodb') NOT NULL DEFAULT 'web',
17031734
`backup_mode` varchar(64) NOT NULL DEFAULT '',
17041735
`tstamp` int(10) unsigned NOT NULL,
17051736
`filename` varchar(255) NOT NULL,

interface/lib/classes/client_templates.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ function apply_client_templates($clientId) {
106106
/*
107107
* Get the master-template for the client
108108
*/
109-
$sql = "SELECT template_master, template_additional FROM client WHERE client_id = " . $app->functions->intval($clientId);
109+
$sql = "SELECT template_master, template_additional,limit_client FROM client WHERE client_id = " . $app->functions->intval($clientId);
110110
$record = $app->db->queryOneRecord($sql);
111111
$masterTemplateId = $record['template_master'];
112+
$is_reseller = ($record['limit_client'] > 0)?true:false;
112113

113114
if($record['template_additional'] != '') {
114115
// we have to call the update_client_templates function
@@ -222,6 +223,7 @@ function apply_client_templates($clientId) {
222223
* Write all back to the database
223224
*/
224225
$update = '';
226+
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.
225227
foreach($limits as $k => $v){
226228
if ((strpos($k, 'limit') !== false or $k == 'ssh_chroot' or $k == 'web_php_options' or $k == 'force_suexec') && !is_array($v)){
227229
if ($update != '') $update .= ', ';

interface/lib/classes/custom_datasource.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class custom_datasource {
3232

3333
function master_templates($field, $record) {
3434
global $app, $conf;
35-
$records = $app->db->queryAllRecords("SELECT template_id,template_name FROM client_template WHERE template_type ='m'");
35+
$records = $app->db->queryAllRecords("SELECT template_id,template_name FROM client_template WHERE template_type ='m' and ".$app->tform->getAuthSQL('r'));
3636
$records_new[0] = $app->lng('Custom');
3737
foreach($records as $rec) {
3838
$key = $rec['template_id'];

interface/lib/classes/ispcmail.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ private function detectHelo() {
223223
elseif(isset($_SERVER['SERVER_NAME'])) $this->smtp_helo = $_SERVER['SERVER_NAME'];
224224
else $this->smtp_helo = php_uname('n');
225225
if($this->smtp_helo == '') $this->smtp_helo = 'localhost';
226+
return $this->smtp_helo;
226227
}
227228

228229

0 commit comments

Comments
 (0)