Skip to content

Commit ba58f0a

Browse files
committed
Merge branch 'develop' of git.ispconfig.org:ispconfig/ispconfig3 into develop
2 parents 6183781 + 1adea00 commit ba58f0a

File tree

20 files changed

+229
-119
lines changed

20 files changed

+229
-119
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
-- drop old php column because new installations don't have them (fails in multi-server)
22
ALTER TABLE `web_domain` DROP COLUMN `fastcgi_php_version`;
3+
4+
-- add php_fpm_socket_dir column to server_php
5+
ALTER TABLE `server_php` ADD `php_fpm_socket_dir` varchar(255) DEFAULT NULL AFTER `php_fpm_pool_dir`;
6+
7+
-- fix #5939
8+
UPDATE `ftp_user` SET `expires` = NULL WHERE `expires` = '0000-00-00 00:00:00';

install/sql/ispconfig3.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ CREATE TABLE `server_php` (
14261426
`php_fpm_init_script` varchar(255) DEFAULT NULL,
14271427
`php_fpm_ini_dir` varchar(255) DEFAULT NULL,
14281428
`php_fpm_pool_dir` varchar(255) DEFAULT NULL,
1429+
`php_fpm_socket_dir` varchar(255) DEFAULT NULL,
14291430
`active` enum('n','y') NOT NULL DEFAULT 'y',
14301431
PRIMARY KEY (`server_php_id`)
14311432
) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -2507,7 +2508,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
25072508
-- Dumping data for table `dns_template`
25082509
--
25092510

2510-
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\ndnssec_algo=ECDSAP256SHA256\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
2511+
INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\nxfer=\nalso_notify=\ndnssec_wanted=N\ndnssec_algo=ECDSAP256SHA256\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
25112512

25122513

25132514
-- --------------------------------------------------------

install/tpl/pureftpd_mysql.conf.master

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ MYSQLCrypt crypt
5959

6060
# Query to execute in order to fetch the password
6161

62-
MYSQLGetPW SELECT password FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
62+
MYSQLGetPW SELECT password FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires > NOW())
6363

6464

6565
# Query to execute in order to fetch the system user name or uid
6666

67-
MYSQLGetUID SELECT uid FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
67+
MYSQLGetUID SELECT uid FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires > NOW())
6868

6969

7070
# Optional : default UID - if set this overrides MYSQLGetUID
@@ -74,7 +74,7 @@ MYSQLGetUID SELECT uid FROM ftp_user WHERE active = 'y' AND server_id = '{se
7474

7575
# Query to execute in order to fetch the system user group or gid
7676

77-
MYSQLGetGID SELECT gid FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
77+
MYSQLGetGID SELECT gid FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires > NOW())
7878

7979

8080
# Optional : default GID - if set this overrides MYSQLGetGID
@@ -84,34 +84,34 @@ MYSQLGetGID SELECT gid FROM ftp_user WHERE active = 'y' AND server_id = '{se
8484

8585
# Query to execute in order to fetch the home directory
8686

87-
MYSQLGetDir SELECT dir FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
87+
MYSQLGetDir SELECT dir FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND username="\L" AND (expires IS NULL OR expires > NOW())
8888

8989

90-
# Optional : query to get the maximal number of files
90+
# Optional : query to get the maximal number of files
9191
# Pure-FTPd must have been compiled with virtual quotas support.
9292

93-
MySQLGetQTAFS SELECT quota_files FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
93+
MySQLGetQTAFS SELECT quota_files FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
9494

9595

9696
# Optional : query to get the maximal disk usage (virtual quotas)
9797
# The number should be in Megabytes.
9898
# Pure-FTPd must have been compiled with virtual quotas support.
9999

100-
MySQLGetQTASZ SELECT quota_size FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_size != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
100+
MySQLGetQTASZ SELECT quota_size FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_size != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
101101

102102

103103
# Optional : ratios. The server has to be compiled with ratio support.
104104

105-
MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_ratio != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
106-
MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_ratio != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
105+
MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_ratio != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
106+
MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_ratio != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
107107

108108

109109
# Optional : bandwidth throttling.
110110
# The server has to be compiled with throttling support.
111111
# Values are in KB/s .
112112

113-
MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_bandwidth != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
114-
MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_bandwidth != '-1' AND username="\L" AND (expires IS NULL OR expires="0000-00-00 00:00:00" OR expires > NOW())
113+
MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_bandwidth != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
114+
MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_bandwidth != '-1' AND username="\L" AND (expires IS NULL OR expires > NOW())
115115

116116
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
117117
# 1) You know what you are doing.

interface/web/admin/form/server_php.tform.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,20 @@
229229
'width' => '40',
230230
'maxlength' => '255'
231231
),
232+
'php_fpm_socket_dir' => array(
233+
'datatype' => 'VARCHAR',
234+
'formtype' => 'TEXT',
235+
'filters' => array(
236+
0 => array( 'event' => 'SAVE',
237+
'type' => 'STRIPTAGS'),
238+
1 => array( 'event' => 'SAVE',
239+
'type' => 'STRIPNL')
240+
),
241+
'default' => '',
242+
'value' => '',
243+
'width' => '40',
244+
'maxlength' => '255'
245+
),
232246
//#################################
233247
// END Datatable fields
234248
//#################################

interface/web/admin/templates/server_php_fpm_edit.htm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<div class="form-group">
88
<label for="php_fpm_pool_dir" class="col-sm-3 control-label">{tmpl_var name='php_fpm_pool_dir_txt'}</label>
99
<div class="col-sm-9"><input type="text" name="php_fpm_pool_dir" id="php_fpm_pool_dir" value="{tmpl_var name='php_fpm_pool_dir'}" class="form-control" /></div></div>
10+
<div class="form-group">
11+
<label for="php_fpm_socket_dir" class="col-sm-3 control-label">{tmpl_var name='php_fpm_socket_dir'}</label>
12+
<div class="col-sm-9"><input type="text" name="php_fpm_socket_dir" id="php_fpm_socket_dir" value="{tmpl_var name='php_fpm_socket_dir'}" class="form-control" /></div></div>
1013

1114

1215
<input type="hidden" name="id" value="{tmpl_var name='id'}">

interface/web/dashboard/ajax_get_json.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,14 @@ function _search($module, $section, $additional_sql = '', $params = ''){
194194
if(is_array($results) && !empty($results)){
195195
$lng_file = '../'.$module.'/lib/lang/'.$_SESSION['s']['language'].'_'.$section.'.lng';
196196
if(is_file($lng_file)) include $lng_file;
197+
198+
// Get the real result count, without LIMIT.
199+
$sql_real_rows = "SELECT COUNT(*) as `c` FROM ?? WHERE ".$where_clause.$authsql.$order_clause;
200+
201+
$result_count = $app->db->queryOneRecord($sql_real_rows, $db_table);
202+
197203
$result_array['cheader'] = array('title' => $category_title,
198-
'total' => count($results),
204+
'total' => $result_count['c'],
199205
'limit' => count($results)
200206
);
201207
foreach($results as $result){

interface/web/dns/dns_alias_edit.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ protected function checkDuplicate() {
5151
if($tmp['number'] > 0) return true;
5252
return false;
5353
}
54+
55+
function onSubmit() {
56+
global $app, $conf;
57+
// Get the parent soa record of the domain
58+
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]);
59+
// Replace @ to example.com. in data field
60+
if($this->dataRecord["data"] === '@') {
61+
$this->dataRecord["data"] = $soa['origin'];
62+
}
63+
parent::onSubmit();
64+
}
5465
}
5566

5667
$page = new page_action;

interface/web/dns/dns_cname_edit.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ protected function checkDuplicate() {
5353
return false;
5454
}
5555

56+
function onSubmit() {
57+
global $app, $conf;
58+
// Get the parent soa record of the domain
59+
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]);
60+
// Replace @ to example.com. in data field
61+
if($this->dataRecord["data"] === '@') {
62+
$this->dataRecord["data"] = $soa['origin'];
63+
}
64+
parent::onSubmit();
65+
}
5666
}
5767

5868
$page = new page_action;

interface/web/dns/dns_dname_edit.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ protected function checkDuplicate() {
5252
if($tmp['number'] > 0) return true;
5353
return false;
5454
}
55+
56+
function onSubmit() {
57+
global $app, $conf;
58+
// Get the parent soa record of the domain
59+
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ? AND " . $app->tform->getAuthSQL('r'), $_POST["zone"]);
60+
// Replace @ to example.com. in data field
61+
if($this->dataRecord["data"] === '@') {
62+
$this->dataRecord["data"] = $soa['origin'];
63+
}
64+
parent::onSubmit();
65+
}
5566
}
5667

5768
$page = new page_action;

interface/web/dns/dns_edit_base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function onSubmit() {
104104
$client_group_id = intval($_SESSION["s"]["user"]["default_group"]);
105105
$client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
106106

107-
// Check if the user may add another mailbox.
107+
// Check if the user may add another record.
108108
if($this->id == 0 && $client["limit_dns_record"] >= 0) {
109109
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = ?", $client_group_id);
110110
if($tmp["number"] >= $client["limit_dns_record"]) {

0 commit comments

Comments
 (0)