Skip to content

Commit 72773a6

Browse files
author
Marius Cramer
committed
Merge branch 'stable-3.0.5'
Conflicts: install/dist/lib/fedora.lib.php install/dist/lib/opensuse.lib.php install/lib/installer_base.lib.php install/sql/ispconfig3.sql install/tpl/config.inc.php.master interface/lib/classes/aps_crawler.inc.php interface/lib/classes/auth.inc.php interface/lib/classes/plugin_backuplist.inc.php interface/lib/config.inc.php interface/lib/plugins/mail_user_filter_plugin.inc.php interface/web/login/password_reset.php interface/web/sites/templates/web_backup_list.htm interface/web/sites/webdav_user_edit.php interface/web/themes/blue/ispconfig_version server/plugins-available/backup_plugin.inc.php server/plugins-available/shelluser_base_plugin.inc.php
2 parents c247017 + 0d73295 commit 72773a6

File tree

12 files changed

+181
-63
lines changed

12 files changed

+181
-63
lines changed

install/dist/conf/centos70.conf.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@
171171
$conf['bind']['installed'] = false; // will be detected automatically during installation
172172
$conf['bind']['bind_user'] = 'named';
173173
$conf['bind']['bind_group'] = 'named';
174-
$conf['bind']['bind_zonefiles_dir'] = '/var/named/chroot/var/named/';
175-
$conf['bind']['named_conf_path'] = '/var/named/chroot/etc/named.conf';
176-
$conf['bind']['named_conf_local_path'] = '/var/named/chroot/var/named/named.local';
174+
$conf['bind']['bind_zonefiles_dir'] = '/var/named';
175+
$conf['bind']['named_conf_path'] = '/etc/named.conf';
176+
$conf['bind']['named_conf_local_path'] = '/etc/named.conf.local';
177177
$conf['bind']['init_script'] = 'named';
178178

179179
//* Jailkit

install/dist/lib/fedora.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ public function configure_bind() {
679679

680680
//* Chown the slave subdirectory to $conf['bind']['bind_user']
681681
exec('chown '.$conf['bind']['bind_user'].':'.$conf['bind']['bind_group'].' '.$content);
682-
exec('chmod 770 '.$content);
682+
exec('chmod 2770 '.$content);
683683

684684
}
685685

install/dist/lib/opensuse.lib.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,6 @@ public function install_ispconfig()
14061406
if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400);
14071407
if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
14081408
if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400);
1409-
14101409
}
14111410

14121411
}

install/lib/install.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ function get_distname() {
181181
$distid = 'debian60';
182182
$distbaseid = 'debian';
183183
swriteln("Operating System: Debian 7.0 (Wheezy/Sid) or compatible\n");
184+
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') {
185+
$distname = 'Debian';
186+
$distver = 'Jessie';
187+
$distid = 'debian60';
188+
$distbaseid = 'debian';
189+
swriteln("Operating System: Debian 8.0 (Jessie) or compatible\n");
184190
} else {
185191
$distname = 'Debian';
186192
$distver = 'Unknown';

install/lib/installer_base.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,12 @@ public function configure_bind() {
13211321

13221322
//* Create the slave subdirectory
13231323
$content .= 'slave';
1324-
if(!@is_dir($content)) mkdir($content, 0770, true);
1324+
if(!@is_dir($content)) mkdir($content, 2770, true);
13251325

13261326
//* Chown the slave subdirectory to $conf['bind']['bind_user']
13271327
chown($content, $conf['bind']['bind_user']);
13281328
chgrp($content, $conf['bind']['bind_group']);
1329+
chmod($content, 2770);
13291330

13301331
}
13311332

@@ -2386,8 +2387,6 @@ public function install_ispconfig() {
23862387
if(is_file($conf['amavis']['config_dir'].'/50-user~')) chmod($conf['amavis']['config_dir'].'/50-user~', 0400);
23872388
if(is_file($conf['amavis']['config_dir'].'/amavisd.conf')) chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
23882389
if(is_file($conf['amavis']['config_dir'].'/amavisd.conf~')) chmod($conf['amavis']['config_dir'].'/amavisd.conf~', 0400);
2389-
2390-
23912390
}
23922391

23932392
public function configure_dbserver() {

interface/lib/classes/aps_crawler.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ public function startCrawler()
460460
}
461461
}
462462
//var_dump($apps);
463+
//echo print_r($apps_to_dl).'<br>-------------------<br>';
463464

464465
// For memory reasons, unset the current vendor and his apps
465466
unset($apps);

interface/lib/classes/plugin_backuplist.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function onShow() {
100100
}
101101

102102
//* Get the data
103-
$server_ids = array_unique($server_ids);
103+
$server_ids = array();
104104
$web = $app->db->queryOneRecord("SELECT server_id FROM web_domain WHERE domain_id = ?", $this->form->id);
105105
$databases = $app->db->queryAllRecords("SELECT server_id FROM web_database WHERE parent_domain_id = ?", $this->form->id);
106106
if($app->functions->intval($web['server_id']) > 0) $server_ids[] = $app->functions->intval($web['server_id']);

interface/lib/plugins/mail_user_filter_plugin.inc.php

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -135,41 +135,69 @@ private function mail_user_filter_get_rule($page_form) {
135135
$content .= '### BEGIN FILTER_ID:'.$page_form->id."\n";
136136

137137
//$content .= 'require ["fileinto", "regex", "vacation"];'."\n";
138-
139-
$content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["';
140-
141-
$searchterm = preg_quote($page_form->dataRecord["searchterm"]);
142-
$searchterm = str_replace(
143-
array(
144-
'"',
145-
'\\[',
146-
'\\]'
147-
),
148-
array(
149-
'\\"',
150-
'\\\\[',
151-
'\\\\]'
152-
), $searchterm);
153-
154-
if($page_form->dataRecord["op"] == 'contains') {
155-
$content .= ".*".$searchterm;
156-
} elseif ($page_form->dataRecord["op"] == 'is') {
157-
$content .= "^".$searchterm."$";
158-
} elseif ($page_form->dataRecord["op"] == 'begins') {
159-
$content .= "^".$searchterm.".*";
160-
} elseif ($page_form->dataRecord["op"] == 'ends') {
161-
$content .= ".*".$searchterm."$";
138+
139+
if($page_form->dataRecord["op"] == 'domain') {
140+
$content .= 'if address :domain :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n";
141+
} elseif ($page_form->dataRecord["op"] == 'localpart') {
142+
$content .= 'if address :localpart :is "'.strtolower($page_form->dataRecord["source"]).'" "'.$page_form->dataRecord["searchterm"].'" {'."\n";
143+
} elseif ($page_form->dataRecord["source"] == 'Size') {
144+
if(substr(trim($page_form->dataRecord["searchterm"]),-1) == 'k' || substr(trim($page_form->dataRecord["searchterm"]),-1) == 'K') {
145+
$unit = 'k';
146+
} else {
147+
$unit = 'm';
148+
}
149+
$content .= 'if size :over '.intval($page_form->dataRecord["searchterm"]).$unit.' {'."\n";
150+
} else {
151+
152+
if($page_form->dataRecord["source"] == 'Header') {
153+
$parts = explode(':',trim($page_form->dataRecord["searchterm"]));
154+
$page_form->dataRecord["source"] = trim($parts[0]);
155+
unset($parts[0]);
156+
$page_form->dataRecord["searchterm"] = trim(implode(':',$parts));
157+
unset($parts);
158+
}
159+
160+
$content .= 'if header :regex ["'.strtolower($page_form->dataRecord["source"]).'"] ["';
161+
162+
$searchterm = preg_quote($page_form->dataRecord["searchterm"]);
163+
$searchterm = str_replace(
164+
array(
165+
'"',
166+
'\\[',
167+
'\\]'
168+
),
169+
array(
170+
'\\"',
171+
'\\\\[',
172+
'\\\\]'
173+
), $searchterm);
174+
175+
if($page_form->dataRecord["op"] == 'contains') {
176+
$content .= ".*".$searchterm;
177+
} elseif ($page_form->dataRecord["op"] == 'is') {
178+
$content .= "^".$searchterm."$";
179+
} elseif ($page_form->dataRecord["op"] == 'begins') {
180+
$content .= " ".$searchterm."";
181+
} elseif ($page_form->dataRecord["op"] == 'ends') {
182+
$content .= ".*".$searchterm."$";
183+
}
184+
185+
$content .= '"] {'."\n";
162186
}
163187

164-
$content .= '"] {'."\n";
165-
166188
if($page_form->dataRecord["action"] == 'move') {
167-
$content .= ' fileinto "'.$page_form->dataRecord["target"].'";' . "\n";
189+
$content .= ' fileinto "'.$page_form->dataRecord["target"].'";' . "\n stop;\n";
190+
} elseif ($page_form->dataRecord["action"] == 'keep') {
191+
$content .= " keep;\n";
192+
} elseif ($page_form->dataRecord["action"] == 'stop') {
193+
$content .= " stop;\n";
194+
} elseif ($page_form->dataRecord["action"] == 'reject') {
195+
$content .= ' reject "'.$page_form->dataRecord["target"].'"; stop;\n\n';
168196
} else {
169-
$content .= " discard;\n";
197+
$content .= " discard;\n stop;\n";
170198
}
171199

172-
$content .= " stop;\n}\n";
200+
$content .= "}\n";
173201

174202
$content .= '### END FILTER_ID:'.$page_form->id."\n";
175203

interface/web/sites/webdav_user_edit.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ function onBeforeInsert() {
137137

138138
/* restrict the names */
139139
$this->dataRecord['username'] = $webdavuser_prefix . $this->dataRecord['username'];
140+
141+
/*
142+
* Get the data of the domain, owning the webdav user
143+
*/
144+
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
145+
/* The server is the server of the domain */
146+
$this->dataRecord["server_id"] = $web["server_id"];
147+
/* The Webdav user shall be owned by the same group then the website */
148+
$this->dataRecord["sys_groupid"] = $web['sys_groupid'];
140149
}
141150

142151
parent::onBeforeInsert();
@@ -159,7 +168,6 @@ function onAfterInsert() {
159168

160169
$sql = "UPDATE webdav_user SET server_id = ?, sys_groupid = ?, password = ? WHERE webdav_user_id = ?";
161170
$app->db->query($sql, $server_id, $sys_groupid, $this->dataRecord["password"], $this->id);
162-
163171
}
164172

165173
function onBeforeUpdate() {

server/lib/classes/monitor_tools.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ public function get_distname() {
152152
$distver = 'Wheezy/Sid';
153153
$distid = 'debian60';
154154
$distbaseid = 'debian';
155+
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') {
156+
$distname = 'Debian';
157+
$distver = 'Jessie';
158+
$distid = 'debian60';
159+
$distbaseid = 'debian';
155160
} else {
156161
$distname = 'Debian';
157162
$distver = 'Unknown';

0 commit comments

Comments
 (0)