Skip to content

Commit 587fe4e

Browse files
author
Marius Cramer
committed
Merge branch 'master' of git.ispconfig.org:ispconfig/ispconfig3
2 parents 9d9ea6f + 28b5263 commit 587fe4e

File tree

9 files changed

+48
-15
lines changed

9 files changed

+48
-15
lines changed

docs/Remote_API_docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
The remote API documentation is in the remote_client/API-docs subfolder.
3+
The remote API documentation is in the remoting_client/API-docs subfolder.

interface/lib/classes/tools_sites.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function replacePrefix($name, $dataRecord) {
4747
$name=str_replace('['.$keyword.']', $this->getClientID($dataRecord), $name);
4848
break;
4949
case 'DOMAINID':
50-
$name=str_replace('['.$keyword.']', $dataRecord['parent_domain_id'], $name);
50+
$name=str_replace('['.$keyword.']', $dataRecord['parent_domain_id'] ? $dataRecord['parent_domain_id'] : '[DOMAINID]', $name);
5151
break;
5252
}
5353
}
@@ -92,7 +92,7 @@ function getClientName($dataRecord) {
9292
} elseif(isset($dataRecord['sys_groupid'])) {
9393
$client_group_id = $dataRecord['sys_groupid'];
9494
} else {
95-
$client_group_id = 0;
95+
return '[CLIENTNAME]';
9696
}
9797
}
9898

@@ -119,7 +119,7 @@ function getClientID($dataRecord) {
119119
} elseif(isset($dataRecord['sys_groupid'])) {
120120
$client_group_id = $dataRecord['sys_groupid'];
121121
} else {
122-
$client_group_id = 0;
122+
return '[CLIENTID]';
123123
}
124124
}
125125
$tmp = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = " . $app->functions->intval($client_group_id));

interface/web/mail/mail_domain_dkim_create.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function get_public_key($private_key) {
8080
require_once('../../lib/classes/validate_dkim.inc.php');
8181
$validate_dkim=new validate_dkim ();
8282
if($validate_dkim->validate_post('private',$private_key)) { /* validate the $_POST-value */
83-
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM',$pubkey,$result);
83+
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM 2> /dev/null',$pubkey,$result);
8484
$public_key=pub_key($pubkey);
8585
} else {
8686
$public_key='invalid key';
@@ -92,8 +92,8 @@ function get_public_key($private_key) {
9292

9393
switch ($_POST['action']) {
9494
case 'create': /* create DKIM Private-key */
95-
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096', $output, $result);
96-
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024', $privkey, $result);
95+
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096 2> /dev/null', $output, $result);
96+
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024 2> /dev/null', $privkey, $result);
9797
unlink("/usr/local/ispconfig/server/temp/random-data.bin");
9898
foreach($privkey as $values) $private_key=$private_key.$values."\n";
9999
break;

interface/web/sites/database_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ function onShowEnd() {
146146
$app->tpl->setVar("database_name", $app->tools_sites->removePrefix($this->dataRecord['database_name'], $this->dataRecord['database_name_prefix'], $dbname_prefix));
147147
}
148148

149-
$app->tpl->setVar("database_name_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_name_prefix'], $dbname_prefix, $global_config['dbname_prefix']));
149+
if($this->dataRecord['database_name'] == "") {
150+
$app->tpl->setVar("database_name_prefix", $dbname_prefix);
151+
} else {
152+
$app->tpl->setVar("database_name_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_name_prefix'], $dbname_prefix, $global_config['dbname_prefix']));
153+
}
150154

151155
if($this->id > 0) {
152156
//* we are editing a existing record

interface/web/sites/database_user_edit.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ function onShowEnd() {
103103
$app->tpl->setVar("database_user", $app->tools_sites->removePrefix($this->dataRecord['database_user'], $this->dataRecord['database_user_prefix'], $dbuser_prefix));
104104
}
105105

106-
107-
$app->tpl->setVar("database_user_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_user_prefix'], $dbuser_prefix, $global_config['dbuser_prefix']));
106+
if($this->dataRecord['database_user'] == "") {
107+
$app->tpl->setVar("database_user_prefix", $dbuser_prefix);
108+
} else {
109+
$app->tpl->setVar("database_user_prefix", $app->tools_sites->getPrefix($this->dataRecord['database_user_prefix'], $dbuser_prefix, $global_config['dbuser_prefix']));
110+
}
108111

109112
parent::onShowEnd();
110113
}

interface/web/sites/ftp_user_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ function onShowEnd() {
8282
$app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $ftpuser_prefix));
8383
}
8484

85-
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $ftpuser_prefix, $global_config['ftpuser_prefix']));
85+
if($this->dataRecord['username'] == "") {
86+
$app->tpl->setVar("username_prefix", $ftpuser_prefix);
87+
} else {
88+
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $ftpuser_prefix, $global_config['ftpuser_prefix']));
89+
}
8690

8791
parent::onShowEnd();
8892
}

interface/web/sites/shell_user_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ function onShowEnd() {
8282
$app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $shelluser_prefix));
8383
}
8484

85-
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix']));
85+
if($this->dataRecord['username'] == "") {
86+
$app->tpl->setVar("username_prefix", $shelluser_prefix);
87+
} else {
88+
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $shelluser_prefix, $global_config['shelluser_prefix']));
89+
}
8690

8791
if($this->id > 0) {
8892
//* we are editing a existing record

interface/web/sites/webdav_user_edit.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ function onShowEnd() {
8181
$app->tpl->setVar("username", $app->tools_sites->removePrefix($this->dataRecord['username'], $this->dataRecord['username_prefix'], $webdavuser_prefix));
8282
}
8383

84-
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $webdavuser_prefix, $global_config['webdavuser_prefix']));
84+
if($this->dataRecord['username'] == "") {
85+
$app->tpl->setVar("username_prefix", $webdavuser_prefix);
86+
} else {
87+
$app->tpl->setVar("username_prefix", $app->tools_sites->getPrefix($this->dataRecord['username_prefix'], $webdavuser_prefix, $global_config['webdavuser_prefix']));
88+
}
8589

8690
if($this->id > 0) {
8791
//* we are editing a existing record

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,21 @@ function check_system($data) {
123123

124124
if (!is_dir($mail_config['dkim_path'])) {
125125
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
126-
mkdir($mail_config['dkim_path'], 0750, true);
126+
if($app->system->is_user('amavis')) {
127+
$amavis_user='amavis';
128+
} elseif ($app->system->is_user('vscan')) {
129+
$amavis_user='vscan';
130+
}
131+
else {
132+
$amavis_user='';
133+
}
134+
if(!empty($amavis_user)) {
135+
mkdir($mail_config['dkim_path'], 0750, true);
136+
exec('chown '.$amavis_user.' /var/lib/amavis/dkim');
137+
unset($amavis_user);
138+
} else {
139+
mkdir($mail_config['dkim_path'], 0755, true);
140+
}
127141
}
128142

129143
if (!is_writeable($mail_config['dkim_path'])) {
@@ -173,7 +187,7 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
173187
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
174188
$success=true;
175189
/* now we get the DKIM Public-key */
176-
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout', $pubkey, $result);
190+
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout 2> /dev/null', $pubkey, $result);
177191
$public_key='';
178192
foreach($pubkey as $values) $public_key=$public_key.$values."\n";
179193
/* save the DKIM Public-key in dkim-dir */

0 commit comments

Comments
 (0)