add new IPTools class; add new callback to show link to domain in domain-overview; validate possible allowed_ip-ranges in FroxlorRPC; fix possible duplicate ips for mysql-access-host in installation

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-22 10:36:46 +02:00
parent d3ae4c5d72
commit b869c84f4d
11 changed files with 267 additions and 64 deletions

View File

@@ -779,6 +779,8 @@ class FroxlorInstall
$mysql_access_host_array[] = $this->_data['serverip'];
}
$mysql_access_host_array = array_unique($mysql_access_host_array);
foreach ($mysql_access_host_array as $mysql_access_host) {
$frox_db = str_replace('`', '', $this->_data['mysql_database']);
$this->_grantDbPrivilegesTo($db_root, $frox_db, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $mysql_access_host);

View File

@@ -1,7 +1,7 @@
<?php
use Froxlor\Database\Database;
use Froxlor\Settings;
use Froxlor\Validate\Validate;
use Froxlor\System\IPTools;
/**
* This file is part of the Froxlor project.
@@ -892,7 +892,7 @@ if (\Froxlor\Froxlor::isDatabaseVersion('202107210')) {
Database::pexecute($result_stmt);
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "` SET `ip` = :ip WHERE `id` = :id");
while ($iprow = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
if (Validate::is_ipv6($iprow['ip'])) {
if (IPTools::is_ipv6($iprow['ip'])) {
$ip = inet_ntop(inet_pton($iprow['ip']));
Database::pexecute($upd_stmt, [
'ip' => $ip,