Skip to content

Commit 8edb9c1

Browse files
author
Florian Schaal
committed
Merge branch 'master' of git.ispconfig.org:ispconfig/ispconfig3
2 parents f17718f + c3570e5 commit 8edb9c1

38 files changed

+321
-47
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
#### Config ################################
3+
4+
DBHOST="localhost"
5+
DBUSER="powerdns"
6+
DBPASS="password"
7+
DATABASE="powerdns"
8+
9+
DEBUG="no"
10+
11+
#### End of Config #########################
12+
13+
REQUIRED_COMMANDS="
14+
mysql
15+
host
16+
grep
17+
awk
18+
tail
19+
"
20+
21+
# print debug messages to STDERR
22+
function debug {
23+
if [ "${DEBUG}" == "yes" ] ; then
24+
echo "DEBUG: $@" >&2
25+
fi
26+
}
27+
28+
for CMD in ${REQUIRED_COMMANDS} ; do
29+
CMDNAME=`echo ${CMD} | awk '{print toupper($1) }' | sed -e s@"-"@""@g`
30+
export $(eval "echo ${CMDNAME}")=`which ${CMD} 2>/dev/null`
31+
if [ -z "${!CMDNAME}" ] ; then
32+
debug "Command: ${CMD} not found!"
33+
exit 1
34+
else
35+
debug "Found command $(echo $CMDNAME) in ${!CMDNAME}"
36+
fi
37+
done
38+
39+
MYSQLCMD="${MYSQL} -h ${DBHOST} -u ${DBUSER} -p${DBPASS} --skip-column-name --silent -e"
40+
41+
check() {
42+
AUTH=`${HOST} -t SOA ${2} ${1} | ${TAIL} -n1 | ${GREP} "has no SOA record"`
43+
if [ "${AUTH}" == "${2} has no SOA record" ]; then
44+
debug "Server ${1} has no SOA for ${2} - removing zone..."
45+
DOMAIN_ID=`${MYSQLCMD} "USE ${DATABASE}; SELECT id FROM domains WHERE name='${2}' AND type='SLAVE' AND master='${1}' LIMIT 1;"`
46+
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM records WHERE domain_id='${DOMAIN_ID}';"
47+
${MYSQLCMD} "USE ${DATABASE}; DELETE FROM domains WHERE id='${DOMAIN_ID}';"
48+
fi
49+
}
50+
51+
MASTERS=(`${MYSQLCMD} "USE ${DATABASE}; SELECT DISTINCT ip FROM supermasters;"`)
52+
for m in "${MASTERS[@]}"; do
53+
NAMES=(`${MYSQLCMD} "USE ${DATABASE}; SELECT name FROM domains WHERE type = 'SLAVE' AND master = '${m}';"`)
54+
for d in "${NAMES[@]}"; do
55+
check ${m} ${d}
56+
done
57+
done

install/autoupdate.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@
228228
$inst->configure_spamassassin();
229229

230230
//** Configure Amavis
231-
swriteln('Configuring Amavisd');
232-
$inst->configure_amavis();
231+
if($conf['amavis']['installed'] == true) {
232+
swriteln('Configuring Amavisd');
233+
$inst->configure_amavis();
234+
}
233235

234236
//** Configure Getmail
235237
swriteln('Configuring Getmail');

install/install.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@
216216
$inst->configure_spamassassin();
217217

218218
//* Configure Amavis
219-
swriteln('Configuring Amavisd');
220-
$inst->configure_amavis();
219+
if($conf['amavis']['installed'] == true) {
220+
swriteln('Configuring Amavisd');
221+
$inst->configure_amavis();
222+
}
221223

222224
//* Configure Getmail
223225
swriteln('Configuring Getmail');

install/tpl/apps_php_fpm_pool.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[{fpm_pool}]
1+
[{fpm_pool}-{fpm_domain}]
22

33
listen = {fpm_socket}
44
listen.owner = {fpm_user}

install/update.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@
289289
$inst->configure_spamassassin();
290290

291291
//** Configure Amavis
292-
swriteln('Configuring Amavisd');
293-
$inst->configure_amavis();
292+
if($conf['amavis']['installed'] == true) {
293+
swriteln('Configuring Amavisd');
294+
$inst->configure_amavis();
295+
}
294296

295297
//** Configure Getmail
296298
swriteln('Configuring Getmail');

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

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,74 @@ public function server_ip_delete($session_id, $ip_id)
9191
$affected_rows = $this->deleteQuery('../admin/form/server_ip.tform.php', $ip_id);
9292
return $affected_rows;
9393
}
94+
95+
/**
96+
Gets the server configuration
97+
@param int session id
98+
@param int server id
99+
@param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
100+
@author Julio Montoya <gugli100@gmail.com> BeezNest 2010
101+
*/
102+
103+
104+
public function server_get($session_id, $server_id, $section ='') {
105+
global $app;
106+
if(!$this->checkPerm($session_id, 'server_get')) {
107+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
108+
return false;
109+
}
110+
if (!empty($session_id) && !empty($server_id)) {
111+
$app->uses('remoting_lib , getconf');
112+
$section_config = $app->getconf->get_server_config($server_id, $section);
113+
return $section_config;
114+
} else {
115+
return false;
116+
}
117+
}
118+
119+
/**
120+
Gets the server_id by server_name
121+
@param int session_id
122+
@param int server_name
123+
@author Sascha Bay <info@space2place.de> TheCry 2013
124+
*/
125+
public function server_get_serverid_by_name($session_id, $server_name)
126+
{
127+
global $app;
128+
if(!$this->checkPerm($session_id, 'server_get')) {
129+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
130+
return false;
131+
}
132+
if (!empty($session_id) && !empty($server_name)) {
133+
$sql = "SELECT server_id FROM server WHERE server_name = '$server_name' LIMIT 1 ";
134+
$all = $app->db->queryAllRecords($sql);
135+
return $all;
136+
} else {
137+
return false;
138+
}
139+
}
140+
141+
/**
142+
Gets the functions of a server by server_id
143+
@param int session_id
144+
@param int server_id
145+
@author Sascha Bay <info@space2place.de> TheCry 2013
146+
*/
147+
public function server_get_functions($session_id, $server_id)
148+
{
149+
global $app;
150+
if(!$this->checkPerm($session_id, 'server_get')) {
151+
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
152+
return false;
153+
}
154+
if (!empty($session_id) && !empty($server_id)) {
155+
$sql = "SELECT mail_server, web_server, dns_server, file_server, db_server, vserver_server, proxy_server, firewall_server FROM server WHERE server_id = '$server_id' LIMIT 1 ";
156+
$all = $app->db->queryAllRecords($sql);
157+
return $all;
158+
} else {
159+
return false;
160+
}
161+
}
94162

95163
}
96164

interface/lib/plugins/mail_user_filter_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function mail_user_filter_get_rule($page_form) {
149149
} elseif ($page_form->dataRecord["op"] == 'is') {
150150
$content .= $searchterm."$";
151151
} elseif ($page_form->dataRecord["op"] == 'begins') {
152-
$content .= " ".$searchterm."";
152+
$content .= "^".$searchterm.".*";
153153
} elseif ($page_form->dataRecord["op"] == 'ends') {
154154
$content .= ".*".$searchterm."$";
155155
}

interface/web/dns/dns_wizard.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@
202202

203203
if(isset($_POST['ip']) && $_POST['ip'] == '') $error .= $app->lng('error_ip_empty').'<br />';
204204

205+
if(isset($_POST['ipv6']) && $_POST['ipv6'] == '') $error .= $app->lng('error_ipv6_empty').'<br />';
206+
205207
if(isset($_POST['ns1']) && $_POST['ns1'] == '') $error .= $app->lng('error_ns1_empty').'<br />';
206208
elseif(isset($_POST['ns1']) && !preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z0-9]{2,30}$/', $_POST['ns1'])) $error .= $app->lng('error_ns1_regex').'<br />';
207209

@@ -238,6 +240,7 @@
238240
$tpl_content = $template_record['template'];
239241
if($_POST['domain'] != '') $tpl_content = str_replace('{DOMAIN}', $_POST['domain'], $tpl_content);
240242
if($_POST['ip'] != '') $tpl_content = str_replace('{IP}', $_POST['ip'], $tpl_content);
243+
if($_POST['ipv6'] != '') $tpl_content = str_replace('{IPV6}',$_POST['ipv6'],$tpl_content);
241244
if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
242245
if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
243246
if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);

interface/web/dns/form/dns_template.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'formtype' => 'CHECKBOXARRAY',
7575
'default' => '',
7676
'separator' => ',',
77-
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
77+
'value' => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM (use TXT|{DOMAIN}.|{DKIM} in your Template)'),
7878
'validators' => array ( 0 => array ('type' => 'CUSTOM',
7979
'class' => 'validate_dkim',
8080
'function' => 'check_template',

interface/web/dns/lib/lang/ar_dns_wizard.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $wb['email_txt'] = 'Email';
99
$wb['ns1_txt'] = 'NS 1';
1010
$wb['ns2_txt'] = 'NS 2';
1111
$wb['ip_txt'] = 'IP Address';
12+
$wb['ipv6_txt'] = 'IPv6 Address';
1213
$wb['error_origin_empty'] = 'Origin empty.';
1314
$wb['error_ns_empty'] = 'NS empty.';
1415
$wb['error_mbox_empty'] = 'Mbox empty.';
@@ -19,6 +20,7 @@ $wb['error_minimum_empty'] = 'Minimum empty.';
1920
$wb['error_ttl_empty'] = 'TTL empty.';
2021
$wb['error_domain_empty'] = 'Domain empty';
2122
$wb['error_ip_empty'] = 'IP empty.';
23+
$wb['error_ipv6_empty'] = 'IPv6 empty.';
2224
$wb['error_ns1_empty'] = 'NS1 empty.';
2325
$wb['error_ns2_empty'] = 'NS2 empty.';
2426
$wb['error_email_empty'] = 'EMail empty.';

0 commit comments

Comments
 (0)