Skip to content

Commit 45e9406

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents 5e82da8 + dad105f commit 45e9406

File tree

10 files changed

+106
-124
lines changed

10 files changed

+106
-124
lines changed

TODO.txt

Lines changed: 2 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,4 @@
11

2-
---------------------------------------
3-
- ISPConfig 3 ToDo list
4-
---------------------------------------
2+
Please see issue tracker for feature requests and bug reports.
53

6-
Please feel free to edit this file, add new tasks,
7-
remove done tasks or assign yourself to a task.
8-
9-
Form Validators
10-
--------------------------------------
11-
12-
Installer
13-
--------------------------------------
14-
15-
- Add a function to let a server join a existing installation.
16-
- Add Package haveged to requirements (at least if entropy is low) as it raises available entropy significantly which is very needed for DNSSEC Key-generation
17-
If it is not installed and entropy is low generating dnssec-keys lasts minutes (and would time out the server thus is not done) and new signing keys are not generated.
18-
If there are no keys the zones can not be signed and will only be availableas a unsigned copy.
19-
20-
Uninstaller
21-
--------------------------------------
22-
23-
- Add a function to remove ispconfig user
24-
25-
Server
26-
--------------------------------------
27-
28-
29-
Mail module
30-
--------------------------------------
31-
32-
33-
Administration module
34-
--------------------------------------
35-
36-
37-
- Firewall Solution -- Andrew lathama Latham lathama@gmail.com
38-
* Monitor existing IPTABLES rules is done and in the monitor page.
39-
* Add IPTABLES rules
40-
semi-functional and in development also functional in multiserver
41-
* Delete IPTABLES rules
42-
semi-functional and in development also functional in multiserver
43-
* Merge IPTABLES rules made from the CLI with those made from ISPConfig3
44-
Interesting topic about merging control with with the GUI and the CLI
45-
interface for a systems adminitstrator who might add a rule during an
46-
attack or for trouble shooting and forget to remove it.
47-
* Fail2Ban
48-
Add configuration for fail2ban on certian systems. Imagine an admin
49-
wishes to use fail2ban on one service but not others. Rare but an issue
50-
when a large number of clients use a single NAT for all users and failed
51-
logins and traffic looks like an attack. Maybe a whitelist configuration
52-
as an optional setting.
53-
* Remoting
54-
Enable remoting hooks for updating IPTABLES
55-
* Service Checks
56-
Adding saftey checks to make sure that the admin does not lock his/herself
57-
out of the system by accident. We all make mistakes.
58-
59-
-- Note: I'd love a pure iptables firewall as well. I've made such a script for
60-
my work, which uses a simple config file to open/close ports and support for
61-
ip exclusions. I think we could use it as a base to start with, it's up on the dev forum
62-
url: http://www.howtoforge.com/forums/showthread.php?p=261311 (Mark_NL)
63-
64-
Clients module
65-
--------------------------------------
66-
67-
68-
Sites (web) module
69-
--------------------------------------
70-
71-
72-
BE-Designer module
73-
--------------------------------------
74-
75-
WARNING: Please do not use the BE Designer at the moment, the serializing
76-
function of the module editor may break some of the existing modules.
77-
78-
79-
Remoting framework
80-
--------------------------------------
81-
- Add more connections to other data. Remoting hooks for FS and Email Quota
82-
83-
Interface
84-
--------------------------------------
85-
- Enhance the paging in lists (e.g. like this: [1 2 3 4 ... 10])
86-
- DNS: Add Checkbox to switch dnssec_wanted between Y and N to templates and/or wizard. I recommend doing it in the wizard though.
87-
88-
General tasks
89-
--------------------------------------
90-
91-
- Add, extend or modify comments in PEAR syntax so that they can be read with
92-
phpdocumentor.
93-
94-
- Doxygen might be a good idea (phpdocumentor looks nice but no active development)
95-
-- http://drupal.org/node/1354 may have some good ideas.
96-
-- http://engineeredweb.com/blog/10/9/4-reasons-consider-doxygen-over-phpdocumentor
4+
http://git.ispconfig.org/ispconfig/ispconfig3/issues

install/lib/installer_base.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,12 @@ public function configure_database() {
217217
//* check sql-mode
218218
$check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode");
219219

220-
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION');
220+
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
221+
echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
222+
echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
223+
echo"to the mysqld-section in /etc/mysql/my.cnf and restart mysqld afterwards\n";
224+
die();
225+
}
221226

222227
//** Create the database
223228
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) {

install/lib/update.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ function updateDbAndIni() {
125125

126126
//* check sql-mode
127127
$check_sql_mode = $inst->db->queryOneRecord("SELECT @@sql_mode");
128-
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION');
128+
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
129+
echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
130+
echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
131+
echo"to the mysqld-section in /etc/mysql/my.cnf and restart mysqld afterwards\n";
132+
die();
133+
}
129134

130135
//* Update $conf array with values from the server.ini that shall be preserved
131136
$tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']);

install/uninstall.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
require_once "/usr/local/ispconfig/server/lib/config.inc.php";
3838
require_once "/usr/local/ispconfig/server/lib/app.inc.php";
39-
require "/usr/local/ispconfig/server/mysql_clientdb.conf";
39+
require "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
4040

4141
//** The banner on the command line
4242
echo "\n\n".str_repeat('-', 80)."\n";
@@ -51,7 +51,7 @@
5151
echo "\n".str_repeat('-', 80)."\n";
5252
echo "\n\n>> Uninstall \n\n";
5353

54-
echo "Are you sure you want to uninsatll ISPConfig? [no]";
54+
echo "Are you sure you want to uninstall ISPConfig? [no]";
5555
$input = fgets(STDIN);
5656
$do_uninstall = rtrim($input);
5757

@@ -62,11 +62,11 @@
6262

6363
$link = mysqli_connect($clientdb_host, $clientdb_user, $clientdb_password);
6464
if (!$link) {
65-
echo "Unable to connect to the database'.mysql_error($link)";
65+
echo "Unable to connect to the database. mysql_error($link)";
6666
} else {
67-
$result=mysqli_query($link,"DROP DATABASE ".$conf['db_database']."';");
67+
$result=mysqli_query($link,"DROP DATABASE ".$conf['db_database'].";");
6868
if (!$result) echo "Unable to remove the ispconfig-database ".$conf['db_database']." ".mysqli_error($link)."\n";
69-
$result=mysqli_query($link,"DROP USER '".$conf['db_user'] ."';");
69+
$result=mysqli_query($link,"DROP USER '".$conf['db_user']."'@'".$conf['db_host']."';");
7070
if (!$result) echo "Unable to remove the ispconfig-database-user ".$conf['db_user']." ".mysqli_error($link)."\n";
7171
}
7272
mysqli_close($link);
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
/**
4+
Copyright (c) 2016, Florian Schaal, schaal @it
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
30+
@author Florian Schaal, info@schaal-24.de
31+
*/
32+
33+
34+
class validate_server {
35+
36+
function get_error($errmsg) {
37+
global $app;
38+
if(isset($app->tform->wordbook[$errmsg])) {
39+
return $app->tform->wordbook[$errmsg]."<br>\r\n";
40+
} else {
41+
return $errmsg."<br>\r\n";
42+
}
43+
}
44+
45+
/**
46+
* Validator function for server-ip
47+
*/
48+
function check_server_ip($field_name, $field_value, $validator) {
49+
if($_POST['ip_type'] == 'IPv4') {
50+
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
51+
return $this->get_error($validator['errmsg']);
52+
}
53+
} elseif ($_POST['ip_type'] == 'IPv6') {
54+
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
55+
return $this->get_error($validator['errmsg']);
56+
}
57+
} else return $this->get_error($validator['errmsg']);
58+
}
59+
60+
}
61+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
'ip_address' => array (
122122
'datatype' => 'VARCHAR',
123123
'formtype' => 'TEXT',
124-
'validators' => array ( 0 => array ( 'type' => 'ISIP',
124+
'validators' => array ( 0 => array ( 'type' => 'CUSTOM', 'class' => 'validate_server', 'function' => 'check_server_ip',
125125
'errmsg'=> 'ip_error_wrong'),
126126
1 => array ( 'type' => 'UNIQUE',
127127
'errmsg'=> 'ip_error_unique'),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
'datatype' => 'VARCHAR',
7070
'formtype' => 'TEXT',
7171
'validators' => array (
72-
0 => array ( 'type' => 'ISIP', 'errmsg'=> 'ip_error_wrong'),
72+
0 => array ( 'type' => 'ISIPV4', 'errmsg'=> 'ip_error_wrong'),
7373
1 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'destination_ip_empty'),
7474
),
7575
'default' => '',

server/plugins-available/apache2_plugin.inc.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,14 +1119,7 @@ function update($event_name, $data) {
11191119
}
11201120
*/
11211121

1122-
//* Generate Let's Encrypt SSL certificat
1123-
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1124-
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1125-
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1126-
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1127-
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1128-
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain
1129-
)) {
1122+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') {
11301123
if(substr($domain, 0, 2) === '*.') {
11311124
// wildcard domain not yet supported by letsencrypt!
11321125
$app->log('Wildcard domains not yet supported by letsencrypt, so changing ' . $domain . ' to ' . substr($domain, 2), LOGLEVEL_WARN);
@@ -1135,7 +1128,16 @@ function update($event_name, $data) {
11351128

11361129
$data['new']['ssl_domain'] = $domain;
11371130
$vhost_data['ssl_domain'] = $domain;
1131+
}
11381132

1133+
//* Generate Let's Encrypt SSL certificat
1134+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1135+
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1136+
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1137+
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1138+
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1139+
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on aliasdomain
1140+
)) {
11391141
// default values
11401142
$temp_domains = array();
11411143
$lddomain = $domain;
@@ -1709,7 +1711,7 @@ function update($event_name, $data) {
17091711
$data['new']['ipv6_address'] = implode(':', $explode_v6);
17101712
}
17111713
}
1712-
1714+
if($data['new']['ipv6_address'] == '*') $data['new']['ipv6_address'] = '::';
17131715
$tmp_vhost_arr = array('ip_address' => '['.$data['new']['ipv6_address'].']', 'ssl_enabled' => 0, 'port' => 80);
17141716
if(count($rewrite_rules) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('redirects' => $rewrite_rules);
17151717
if(count($alias_seo_redirects) > 0) $tmp_vhost_arr = $tmp_vhost_arr + array('alias_seo_redirects' => $alias_seo_redirects);

server/plugins-available/network_settings_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function update($event_name, $data) {
110110
/*
111111
* don't insert the main-ip again!
112112
*/
113-
if ($rec['ip_address'] != $server_config['ip_address'])
113+
if ($rec['ip_address'] != $server_config['ip_address'] && filter_var($rec['ip_address'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
114114
{
115115
$ip_records[$n] = array(
116116
'id' => $n,
@@ -188,7 +188,7 @@ function update($event_name, $data) {
188188
/*
189189
* don't insert the main-ip again!
190190
*/
191-
if ($rec['ip_address'] != $server_config['ip_address'])
191+
if ($rec['ip_address'] != $server_config['ip_address'] && filter_var($rec['ip_address'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
192192
{
193193
$ip_records[$n] = array(
194194
'id' => $n,

server/plugins-available/nginx_plugin.inc.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,15 +1232,7 @@ function update($event_name, $data) {
12321232

12331233
$tpl->setVar('ssl_letsencrypt', "n");
12341234

1235-
//* Generate Let's Encrypt SSL certificat
1236-
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1237-
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1238-
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1239-
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1240-
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1241-
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain
1242-
)) {
1243-
1235+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y') {
12441236
//* be sure to have good domain
12451237
if(substr($domain, 0, 2) === '*.') {
12461238
// wildcard domain not yet supported by letsencrypt!
@@ -1250,7 +1242,16 @@ function update($event_name, $data) {
12501242

12511243
$data['new']['ssl_domain'] = $domain;
12521244
$vhost_data['ssl_domain'] = $domain;
1253-
1245+
}
1246+
1247+
//* Generate Let's Encrypt SSL certificat
1248+
if($data['new']['ssl'] == 'y' && $data['new']['ssl_letsencrypt'] == 'y' && ( // ssl and let's encrypt is active
1249+
($data['old']['ssl'] == 'n' || $data['old']['ssl_letsencrypt'] == 'n') // we have new let's encrypt configuration
1250+
|| ($data['old']['domain'] != $data['new']['domain']) // we have domain update
1251+
|| ($data['old']['subdomain'] != $data['new']['subdomain']) // we have new or update on "auto" subdomain
1252+
|| ($data['new']['type'] == 'subdomain') // we have new or update on subdomain
1253+
|| ($data['old']['type'] == 'alias' || $data['new']['type'] == 'alias') // we have new or update on alias domain
1254+
)) {
12541255
// default values
12551256
$temp_domains = array();
12561257
$lddomain = $domain;

0 commit comments

Comments
 (0)