Skip to content

Commit cf646e9

Browse files
author
Marius Cramer
committed
Merge remote-tracking branch 'origin/stable-3.0.5'
Conflicts: interface/lib/classes/remoting.inc.php interface/web/sites/web_domain_edit.php server/lib/classes/monitor_tools.inc.php server/plugins-available/maildeliver_plugin.inc.php
2 parents 6a7cf70 + 08462d0 commit cf646e9

Some content is hidden

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

71 files changed

+1367
-143
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ALTER TABLE `client` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0';
2+
ALTER TABLE `client_template` ADD `limit_domainmodule` INT NOT NULL DEFAULT '0';
3+
CREATE TABLE `client_message_template` (
4+
`client_message_template_id` bigint(20) NOT NULL AUTO_INCREMENT,
5+
`sys_userid` int(11) NOT NULL DEFAULT '0',
6+
`sys_groupid` int(11) NOT NULL DEFAULT '0',
7+
`sys_perm_user` varchar(5) DEFAULT NULL,
8+
`sys_perm_group` varchar(5) DEFAULT NULL,
9+
`sys_perm_other` varchar(5) DEFAULT NULL,
10+
`template_type` varchar(255) DEFAULT NULL,
11+
`template_name` varchar(255) DEFAULT NULL,
12+
`subject` varchar(255) DEFAULT NULL,
13+
`message` text,
14+
PRIMARY KEY (`client_message_template_id`)
15+
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
16+
ALTER TABLE `spamfilter_policy` ADD `policyd_quota_in` int(11) NOT NULL DEFAULT '-1',
17+
ADD `policyd_quota_in_period` int(11) NOT NULL DEFAULT '24',
18+
ADD `policyd_quota_out` int(11) NOT NULL DEFAULT '-1',
19+
ADD `policyd_quota_out_period` int(11) NOT NULL DEFAULT '24',
20+
ADD `policyd_greylist` ENUM( 'Y', 'N' ) NOT NULL DEFAULT 'N';

install/sql/ispconfig3.sql

Lines changed: 31 additions & 0 deletions
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
--
@@ -1378,6 +1404,11 @@ CREATE TABLE `spamfilter_policy` (
13781404
`spam_subject_tag2` varchar(64) default NULL,
13791405
`message_size_limit` int(11) unsigned default NULL,
13801406
`banned_rulenames` varchar(64) default NULL,
1407+
`policyd_quota_in` int(11) NOT NULL DEFAULT '-1',
1408+
`policyd_quota_in_period` int(11) NOT NULL DEFAULT '24',
1409+
`policyd_quota_out` int(11) NOT NULL DEFAULT '-1',
1410+
`policyd_quota_out_period` int(11) NOT NULL DEFAULT '24',
1411+
`policyd_greylist` ENUM( 'Y', 'N' ) NOT NULL DEFAULT 'N',
13811412
PRIMARY KEY (`id`)
13821413
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
13831414

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

interface/lib/classes/remoting.inc.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ public function logout($session_id)
187187

188188
//** protected functions -----------------------------------------------------------------------------------
189189

190-
191190
protected function klientadd($formdef_file, $reseller_id, $params)
192191
{
193192
global $app;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

33
$function_list['server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_add,server_ip_update,server_ip_delete'] = 'Server functions';
4+
$function_list['admin_record_permissions'] = 'Record permission changes';
45

56
?>

interface/web/admin/templates/server_config_web_edit.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ <h2><tmpl_var name="list_head_txt"></h2>
145145
</div>
146146
<div class="ctrlHolder">
147147
<label for="CA_path">{tmpl_var name='CA_path_txt'}</label>
148-
<input name="CA_path" id="CA_path" value="{tmpl_var name='CA_path'}" size="40" maxlength="255" type="text" class="textInput" />
148+
<input name="CA_path" id="CA_path" value="{tmpl_var name='CA_path'}" size="40" maxlength="255" type="text" autocomplete="off" class="textInput" />
149149
</div>
150150
<div class="ctrlHolder">
151151
<label for="CA_pass">{tmpl_var name='CA_pass_txt'}</label>
152-
<input name="CA_pass" id="CA_pass" value="{tmpl_var name='CA_pass'}" size="40" maxlength="255" type="password" class="textInput" />
152+
<input name="CA_pass" id="CA_pass" value="{tmpl_var name='CA_pass'}" size="40" maxlength="255" type="password" autocomplete="off" class="textInput" />
153153
</div>
154154
</div>
155155
<div class="subsectiontoggle"><span></span>{tmpl_var name='permissions_txt'}<em></em></div>

0 commit comments

Comments
 (0)