From 84f5de42a90108684734512fd7bf9f85a90046ed Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 24 Feb 2022 08:49:36 +0100 Subject: [PATCH 01/22] move php-sessionclean script to scripts-dir instead of install/scripts/; add cronjob calling php-sessionclean if php-fpm is enabled; remove testing-note for let's encrypt in german language file Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cli/Action/PhpSessioncleanAction.php | 1 - lib/Froxlor/Cron/CronConfig.php | 6 ++++++ lng/german.lng.php | 4 ++-- {install/scripts => scripts}/php-sessionclean.php | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) rename {install/scripts => scripts}/php-sessionclean.php (93%) diff --git a/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php b/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php index 9ad09a15..ee93883b 100644 --- a/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php +++ b/lib/Froxlor/Cli/Action/PhpSessioncleanAction.php @@ -4,7 +4,6 @@ namespace Froxlor\Cli\Action; use Froxlor\Database\Database; use Froxlor\Settings; -use Froxlor\Cli\PhpSessioncleanCmd; class PhpSessioncleanAction extends \Froxlor\Cli\Action { diff --git a/lib/Froxlor/Cron/CronConfig.php b/lib/Froxlor/Cron/CronConfig.php index 774c5f51..83a954db 100644 --- a/lib/Froxlor/Cron/CronConfig.php +++ b/lib/Froxlor/Cron/CronConfig.php @@ -106,6 +106,12 @@ class CronConfig } } + // php sessionclean if enabled + if ((int) Settings::Get('phpfpm.enabled') == 1) { + $cronfile .= "# Look for and purge old sessions every 30 minutes".PHP_EOL; + $cronfile .= "09,39 * * * * root " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL; + } + if (\Froxlor\FileDir::isFreeBSD()) { // FreeBSD handles the cron-stuff in another way. We need to directly // write to the crontab file as there is not cron.d/froxlor file diff --git a/lng/german.lng.php b/lng/german.lng.php index 4f267204..bb5a380b 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1481,9 +1481,9 @@ $lng['admin']['mod_fcgid_umask']['title'] = 'Umask (Standard: 022)'; // Added for let's encrypt $lng['admin']['letsencrypt']['title'] = 'SSL Zertifikat erstellen (Let\'s Encrypt)'; -$lng['admin']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von Let\'s Encrypt. Das Zertifikat wird automatisch erstellt und verlängert.
ACHTUNG: Wenn Wildcards aktiviert sind, wird diese Option automatisch deaktiviert. Dieses Feature befindet sich noch im Test.'; +$lng['admin']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von Let\'s Encrypt. Das Zertifikat wird automatisch erstellt und verlängert.
ACHTUNG: Wenn Wildcards aktiviert sind, wird diese Option automatisch deaktiviert.'; $lng['customer']['letsencrypt']['title'] = 'SSL Zertifikat erstellen (Let\'s Encrypt)'; -$lng['customer']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von Let\'s Encrypt. Das Zertifikat wird automatisch erstellt und verlängert.
ACHTUNG: Dieses Feature befindet sich noch im Test.'; +$lng['customer']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von Let\'s Encrypt. Das Zertifikat wird automatisch erstellt und verlängert.'; $lng['error']['sslredirectonlypossiblewithsslipport'] = 'Die Nutzung von Let\'s Encrypt ist nur möglich, wenn die Domain mindestens eine IP/Port - Kombination mit aktiviertem SSL zugewiesen hat.'; $lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt kann mittels ACME Wildcard-Domains nur via DNS validieren, sorry. Bitte den ServerAlias auf WWW setzen oder deaktivieren'; $lng['panel']['letsencrypt'] = 'Benutzt Let\'s encrypt'; diff --git a/install/scripts/php-sessionclean.php b/scripts/php-sessionclean.php similarity index 93% rename from install/scripts/php-sessionclean.php rename to scripts/php-sessionclean.php index 41f633db..c97c2aed 100755 --- a/install/scripts/php-sessionclean.php +++ b/scripts/php-sessionclean.php @@ -21,7 +21,7 @@ if (@php_sapi_name() !== 'cli') { die('This script will only work in the shell.'); } -require dirname(dirname(__DIR__)) . '/vendor/autoload.php'; +require dirname(__DIR__) . '/vendor/autoload.php'; // give control to command line handler try { From ae74cdda530da2e99bdf1d1cfcaf8ed47848a531 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 7 Mar 2022 09:28:01 +0100 Subject: [PATCH 02/22] update debian/ubuntu instructions Signed-off-by: Michael Kaufmann --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9407c022..14fceed2 100644 --- a/README.md +++ b/README.md @@ -54,24 +54,24 @@ May be found in [COPYING](COPYING) ### Tarball https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](https://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1) -### Debian repository +### Debian / Ubutnu repository [HowTo](https://docs.froxlor.org/general/installation/aptpackage.html) -``` -apt-get -y install apt-transport-https lsb-release ca-certificates -wget -O - https://deb.froxlor.org/froxlor.gpg | apt-key add - -echo "deb https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list -``` - -### Ubuntu repository - -[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html) +#### Debian ``` -apt-get -y install apt-transport-https lsb-release ca-certificates -wget -O - https://deb.froxlor.org/froxlor.gpg | apt-key add - -echo "deb https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list +apt-get -y install apt-transport-https lsb-release ca-certificates curl +curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg +echo sh -c '"deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' +``` + +#### Ubuntu + +``` +apt-get -y install apt-transport-https lsb-release ca-certificates curl +curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg +echo sh -c '"deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' ``` ## Contributing From 0d45e03f194ce8ab2ac5b702506234b1d98ecc70 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 7 Mar 2022 16:37:40 +0100 Subject: [PATCH 03/22] fix missing $ for a variable in Lighttpd-class Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Lighttpd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Cron/Http/Lighttpd.php b/lib/Froxlor/Cron/Http/Lighttpd.php index d6a08d6e..50d160e8 100644 --- a/lib/Froxlor/Cron/Http/Lighttpd.php +++ b/lib/Froxlor/Cron/Http/Lighttpd.php @@ -251,7 +251,7 @@ class Lighttpd extends HttpConfigBase // check for existence, #1485 if (! file_exists($domain['ssl_ca_file'])) { $this->logger->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_ERR, $ip . ':' . $port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! Cannot create ssl-directives'); - echo $ip . ':' . port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! SSL-directives might not be working' . "\n"; + echo $ip . ':' . $port . ' :: certificate CA file "' . $domain['ssl_ca_file'] . '" does not exist! SSL-directives might not be working' . "\n"; } else { $this->lighttpd_data[$vhost_filename] .= 'ssl.ca-file = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_ca_file']) . '"' . "\n"; } From a2f8d02b16bec815ce4d7996c9c2ff6b9bc62593 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 7 Mar 2022 18:40:31 +0100 Subject: [PATCH 04/22] fix installation for mariadb-10.5; fix warnings for not used feature; thx to Akecheta for the hints and testing Signed-off-by: Michael Kaufmann --- install/lib/class.FroxlorInstall.php | 31 +++++++++++++++++++++++++--- lib/Froxlor/Config/ConfigParser.php | 6 +++--- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/install/lib/class.FroxlorInstall.php b/install/lib/class.FroxlorInstall.php index 30855bfa..b0e5c4a2 100644 --- a/install/lib/class.FroxlorInstall.php +++ b/install/lib/class.FroxlorInstall.php @@ -550,16 +550,23 @@ class FroxlorInstall $this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level'); } + /* + * not yet used in configfiles + * -> 0.11.x + * $distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml'); foreach ($distros as $_distribution) { if ($this->_data['distribution'] == str_replace(".xml", "", strtolower(basename($_distribution)))) { $dist = new \Froxlor\Config\ConfigParser($_distribution); $defaults = $dist->getDefaults(); - foreach ($defaults->property as $property) { - $this->_updateSetting($upd_stmt, $property->value, $property->settinggroup, $property->varname); + if (!empty($defaults)) { + foreach ($defaults as $property) { + $this->_updateSetting($upd_stmt, $property->attributes()->value, $property->attributes()->settinggroup, $property->attributes()->varname); + } } } } + */ $this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed'); $this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath'); @@ -734,8 +741,26 @@ class FroxlorInstall private function _grantDbPrivilegesTo(&$db_root, $database, $username, $password, $access_host) { + // mariadb + if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) { + // create user + $stmt = $db_root->prepare(" + CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password + "); + $stmt->execute(array( + "password" => $password + )); + // grant privileges + $stmt = $db_root->prepare(" + GRANT ALL ON `" . $database . "`.* TO :username@:host + "); + $stmt->execute(array( + "username" => $username, + "host" => $access_host + )); + } // mysql8 compatibility - if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) { + elseif (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) { // create user $stmt = $db_root->prepare(" CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password diff --git a/lib/Froxlor/Config/ConfigParser.php b/lib/Froxlor/Config/ConfigParser.php index c881bcdd..037eabe1 100644 --- a/lib/Froxlor/Config/ConfigParser.php +++ b/lib/Froxlor/Config/ConfigParser.php @@ -182,7 +182,7 @@ class ConfigParser } /** - * Parse the XML and populate $this->services + * Parse the XML and populate $this->defaults * * @return bool */ @@ -194,9 +194,9 @@ class ConfigParser } // Get all defaults - $defaults = $this->xml->xpath('//defaults'); + $defaults = $this->xml->xpath('//defaults/default'); foreach ($defaults as $default) { - $this->defaults = $default; + $this->defaults[] = $default; } // Switch flag to indicate we parsed our data From 54876efc8ceffdffd1a789111ee09ddfd0b3cbe3 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 8 Mar 2022 07:55:31 +0100 Subject: [PATCH 05/22] fix sh command in install howto Signed-off-by: Michael Kaufmann --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14fceed2..71bc7d6a 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.fro ``` apt-get -y install apt-transport-https lsb-release ca-certificates curl curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg -echo sh -c '"deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' +sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' ``` #### Ubuntu @@ -71,7 +71,7 @@ echo sh -c '"deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] htt ``` apt-get -y install apt-transport-https lsb-release ca-certificates curl curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg -echo sh -c '"deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' +sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list' ``` ## Contributing From 02d0194b9ffc5439296d56932fb1aa13ee776b52 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 24 Mar 2022 14:30:34 +0100 Subject: [PATCH 06/22] add empty index.html file to all folders to avoid accidental folder-content disclosure if 'Options Indexes' is set for a (parent)folder containing froxlor in webserver-config Signed-off-by: Michael Kaufmann --- actions/admin/index.html | 0 actions/admin/settings/index.html | 0 actions/index.html | 0 css/images/index.html | 0 css/index.html | 0 doc/example/index.html | 0 doc/index.html | 0 install/index.html | 0 install/lib/index.html | 0 install/lng/index.html | 0 install/scripts/index.html | 0 install/templates/assets/css/index.html | 0 install/templates/assets/index.html | 0 install/templates/index.html | 0 install/updates/froxlor/0.10/index.html | 0 install/updates/froxlor/0.9/index.html | 0 install/updates/froxlor/index.html | 0 install/updates/index.html | 0 install/updates/preconfig/0.10/index.html | 0 install/updates/preconfig/0.9/index.html | 0 install/updates/preconfig/index.html | 0 js/index.html | 0 js/plugins/index.html | 0 lib/Froxlor/Api/Commands/index.html | 0 lib/Froxlor/Api/index.html | 0 lib/Froxlor/Bulk/index.html | 0 lib/Froxlor/Cli/Action/index.html | 0 lib/Froxlor/Cli/index.html | 0 lib/Froxlor/Config/index.html | 0 lib/Froxlor/Cron/Dns/index.html | 0 lib/Froxlor/Cron/Http/LetsEncrypt/index.html | 0 lib/Froxlor/Cron/Http/Php/index.html | 0 lib/Froxlor/Cron/Http/index.html | 0 lib/Froxlor/Cron/System/index.html | 0 lib/Froxlor/Cron/Traffic/index.html | 0 lib/Froxlor/Cron/index.html | 0 lib/Froxlor/Customer/index.html | 0 lib/Froxlor/Database/Manager/index.html | 0 lib/Froxlor/Database/index.html | 0 lib/Froxlor/Dns/index.html | 0 lib/Froxlor/Domain/index.html | 0 lib/Froxlor/Http/index.html | 0 lib/Froxlor/Idna/index.html | 0 lib/Froxlor/Settings/index.html | 0 lib/Froxlor/System/index.html | 0 lib/Froxlor/UI/index.html | 0 lib/Froxlor/Validate/Form/index.html | 0 lib/Froxlor/Validate/index.html | 0 lib/Froxlor/index.html | 0 lib/configfiles/index.html | 0 lib/formfields/admin/admin/index.html | 0 lib/formfields/admin/cronjobs/index.html | 0 lib/formfields/admin/customer/index.html | 0 lib/formfields/admin/domains/index.html | 0 lib/formfields/admin/index.html | 0 lib/formfields/admin/ipsandports/index.html | 0 lib/formfields/admin/phpconfig/index.html | 0 lib/formfields/admin/plans/index.html | 0 lib/formfields/admin/templates/index.html | 0 lib/formfields/customer/domains/index.html | 0 lib/formfields/customer/email/index.html | 0 lib/formfields/customer/extras/index.html | 0 lib/formfields/customer/ftp/index.html | 0 lib/formfields/customer/index.html | 0 lib/formfields/customer/mysql/index.html | 0 lib/formfields/index.html | 0 lib/index.html | 0 lib/navigation/index.html | 0 lng/index.html | 0 scripts/index.html | 0 templates/Sparkle/2fa/index.html | 0 templates/Sparkle/admin/admins/index.html | 0 templates/Sparkle/admin/configfiles/index.html | 0 templates/Sparkle/admin/cronjobs/index.html | 0 templates/Sparkle/admin/customers/index.html | 0 templates/Sparkle/admin/domains/index.html | 0 templates/Sparkle/admin/index.html | 0 templates/Sparkle/admin/index/index.html | 0 templates/Sparkle/admin/ipsandports/index.html | 0 templates/Sparkle/admin/logger/index.html | 0 templates/Sparkle/admin/message/index.html | 0 templates/Sparkle/admin/phpconfig/index.html | 0 templates/Sparkle/admin/plans/index.html | 0 templates/Sparkle/admin/settings/apcuinfo/index.html | 0 templates/Sparkle/admin/settings/importexport/index.html | 0 templates/Sparkle/admin/settings/index.html | 0 templates/Sparkle/admin/settings/opcacheinfo/index.html | 0 templates/Sparkle/admin/settings/phpinfo/index.html | 0 templates/Sparkle/admin/templates/index.html | 0 templates/Sparkle/admin/traffic/index.html | 0 templates/Sparkle/admin/update/index.html | 0 templates/Sparkle/api_keys/index.html | 0 templates/Sparkle/assets/css/index.html | 0 templates/Sparkle/assets/index.html | 0 templates/Sparkle/assets/js/index.html | 0 templates/Sparkle/customer/domains/index.html | 0 templates/Sparkle/customer/email/index.html | 0 templates/Sparkle/customer/extras/index.html | 0 templates/Sparkle/customer/ftp/index.html | 0 templates/Sparkle/customer/index.html | 0 templates/Sparkle/customer/index/index.html | 0 templates/Sparkle/customer/logger/index.html | 0 templates/Sparkle/customer/mysql/index.html | 0 templates/Sparkle/customer/traffic/index.html | 0 templates/Sparkle/dns_editor/index.html | 0 templates/Sparkle/formfields/index.html | 0 templates/Sparkle/index.html | 0 templates/Sparkle/logfiles_viewer/index.html | 0 templates/Sparkle/login/index.html | 0 templates/Sparkle/misc/form/index.html | 0 templates/Sparkle/misc/index.html | 0 templates/Sparkle/ssl_certificates/index.html | 0 templates/misc/index.html | 0 templates/misc/php/index.html | 0 114 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 actions/admin/index.html create mode 100644 actions/admin/settings/index.html create mode 100644 actions/index.html create mode 100644 css/images/index.html create mode 100644 css/index.html create mode 100644 doc/example/index.html create mode 100644 doc/index.html create mode 100644 install/index.html create mode 100644 install/lib/index.html create mode 100644 install/lng/index.html create mode 100644 install/scripts/index.html create mode 100644 install/templates/assets/css/index.html create mode 100644 install/templates/assets/index.html create mode 100644 install/templates/index.html create mode 100644 install/updates/froxlor/0.10/index.html create mode 100644 install/updates/froxlor/0.9/index.html create mode 100644 install/updates/froxlor/index.html create mode 100644 install/updates/index.html create mode 100644 install/updates/preconfig/0.10/index.html create mode 100644 install/updates/preconfig/0.9/index.html create mode 100644 install/updates/preconfig/index.html create mode 100644 js/index.html create mode 100644 js/plugins/index.html create mode 100644 lib/Froxlor/Api/Commands/index.html create mode 100644 lib/Froxlor/Api/index.html create mode 100644 lib/Froxlor/Bulk/index.html create mode 100644 lib/Froxlor/Cli/Action/index.html create mode 100644 lib/Froxlor/Cli/index.html create mode 100644 lib/Froxlor/Config/index.html create mode 100644 lib/Froxlor/Cron/Dns/index.html create mode 100644 lib/Froxlor/Cron/Http/LetsEncrypt/index.html create mode 100644 lib/Froxlor/Cron/Http/Php/index.html create mode 100644 lib/Froxlor/Cron/Http/index.html create mode 100644 lib/Froxlor/Cron/System/index.html create mode 100644 lib/Froxlor/Cron/Traffic/index.html create mode 100644 lib/Froxlor/Cron/index.html create mode 100644 lib/Froxlor/Customer/index.html create mode 100644 lib/Froxlor/Database/Manager/index.html create mode 100644 lib/Froxlor/Database/index.html create mode 100644 lib/Froxlor/Dns/index.html create mode 100644 lib/Froxlor/Domain/index.html create mode 100644 lib/Froxlor/Http/index.html create mode 100644 lib/Froxlor/Idna/index.html create mode 100644 lib/Froxlor/Settings/index.html create mode 100644 lib/Froxlor/System/index.html create mode 100644 lib/Froxlor/UI/index.html create mode 100644 lib/Froxlor/Validate/Form/index.html create mode 100644 lib/Froxlor/Validate/index.html create mode 100644 lib/Froxlor/index.html create mode 100644 lib/configfiles/index.html create mode 100644 lib/formfields/admin/admin/index.html create mode 100644 lib/formfields/admin/cronjobs/index.html create mode 100644 lib/formfields/admin/customer/index.html create mode 100644 lib/formfields/admin/domains/index.html create mode 100644 lib/formfields/admin/index.html create mode 100644 lib/formfields/admin/ipsandports/index.html create mode 100644 lib/formfields/admin/phpconfig/index.html create mode 100644 lib/formfields/admin/plans/index.html create mode 100644 lib/formfields/admin/templates/index.html create mode 100644 lib/formfields/customer/domains/index.html create mode 100644 lib/formfields/customer/email/index.html create mode 100644 lib/formfields/customer/extras/index.html create mode 100644 lib/formfields/customer/ftp/index.html create mode 100644 lib/formfields/customer/index.html create mode 100644 lib/formfields/customer/mysql/index.html create mode 100644 lib/formfields/index.html create mode 100644 lib/index.html create mode 100644 lib/navigation/index.html create mode 100644 lng/index.html create mode 100644 scripts/index.html create mode 100644 templates/Sparkle/2fa/index.html create mode 100644 templates/Sparkle/admin/admins/index.html create mode 100644 templates/Sparkle/admin/configfiles/index.html create mode 100644 templates/Sparkle/admin/cronjobs/index.html create mode 100644 templates/Sparkle/admin/customers/index.html create mode 100644 templates/Sparkle/admin/domains/index.html create mode 100644 templates/Sparkle/admin/index.html create mode 100644 templates/Sparkle/admin/index/index.html create mode 100644 templates/Sparkle/admin/ipsandports/index.html create mode 100644 templates/Sparkle/admin/logger/index.html create mode 100644 templates/Sparkle/admin/message/index.html create mode 100644 templates/Sparkle/admin/phpconfig/index.html create mode 100644 templates/Sparkle/admin/plans/index.html create mode 100644 templates/Sparkle/admin/settings/apcuinfo/index.html create mode 100644 templates/Sparkle/admin/settings/importexport/index.html create mode 100644 templates/Sparkle/admin/settings/index.html create mode 100644 templates/Sparkle/admin/settings/opcacheinfo/index.html create mode 100644 templates/Sparkle/admin/settings/phpinfo/index.html create mode 100644 templates/Sparkle/admin/templates/index.html create mode 100644 templates/Sparkle/admin/traffic/index.html create mode 100644 templates/Sparkle/admin/update/index.html create mode 100644 templates/Sparkle/api_keys/index.html create mode 100644 templates/Sparkle/assets/css/index.html create mode 100644 templates/Sparkle/assets/index.html create mode 100644 templates/Sparkle/assets/js/index.html create mode 100644 templates/Sparkle/customer/domains/index.html create mode 100644 templates/Sparkle/customer/email/index.html create mode 100644 templates/Sparkle/customer/extras/index.html create mode 100644 templates/Sparkle/customer/ftp/index.html create mode 100644 templates/Sparkle/customer/index.html create mode 100644 templates/Sparkle/customer/index/index.html create mode 100644 templates/Sparkle/customer/logger/index.html create mode 100644 templates/Sparkle/customer/mysql/index.html create mode 100644 templates/Sparkle/customer/traffic/index.html create mode 100644 templates/Sparkle/dns_editor/index.html create mode 100644 templates/Sparkle/formfields/index.html create mode 100644 templates/Sparkle/index.html create mode 100644 templates/Sparkle/logfiles_viewer/index.html create mode 100644 templates/Sparkle/login/index.html create mode 100644 templates/Sparkle/misc/form/index.html create mode 100644 templates/Sparkle/misc/index.html create mode 100644 templates/Sparkle/ssl_certificates/index.html create mode 100644 templates/misc/index.html create mode 100644 templates/misc/php/index.html diff --git a/actions/admin/index.html b/actions/admin/index.html new file mode 100644 index 00000000..e69de29b diff --git a/actions/admin/settings/index.html b/actions/admin/settings/index.html new file mode 100644 index 00000000..e69de29b diff --git a/actions/index.html b/actions/index.html new file mode 100644 index 00000000..e69de29b diff --git a/css/images/index.html b/css/images/index.html new file mode 100644 index 00000000..e69de29b diff --git a/css/index.html b/css/index.html new file mode 100644 index 00000000..e69de29b diff --git a/doc/example/index.html b/doc/example/index.html new file mode 100644 index 00000000..e69de29b diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/index.html b/install/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/lib/index.html b/install/lib/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/lng/index.html b/install/lng/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/scripts/index.html b/install/scripts/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/templates/assets/css/index.html b/install/templates/assets/css/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/templates/assets/index.html b/install/templates/assets/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/templates/index.html b/install/templates/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/froxlor/0.10/index.html b/install/updates/froxlor/0.10/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/froxlor/0.9/index.html b/install/updates/froxlor/0.9/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/froxlor/index.html b/install/updates/froxlor/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/index.html b/install/updates/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/preconfig/0.10/index.html b/install/updates/preconfig/0.10/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/preconfig/0.9/index.html b/install/updates/preconfig/0.9/index.html new file mode 100644 index 00000000..e69de29b diff --git a/install/updates/preconfig/index.html b/install/updates/preconfig/index.html new file mode 100644 index 00000000..e69de29b diff --git a/js/index.html b/js/index.html new file mode 100644 index 00000000..e69de29b diff --git a/js/plugins/index.html b/js/plugins/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Api/Commands/index.html b/lib/Froxlor/Api/Commands/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Api/index.html b/lib/Froxlor/Api/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Bulk/index.html b/lib/Froxlor/Bulk/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cli/Action/index.html b/lib/Froxlor/Cli/Action/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cli/index.html b/lib/Froxlor/Cli/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Config/index.html b/lib/Froxlor/Config/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/Dns/index.html b/lib/Froxlor/Cron/Dns/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/Http/LetsEncrypt/index.html b/lib/Froxlor/Cron/Http/LetsEncrypt/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/Http/Php/index.html b/lib/Froxlor/Cron/Http/Php/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/Http/index.html b/lib/Froxlor/Cron/Http/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/System/index.html b/lib/Froxlor/Cron/System/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/Traffic/index.html b/lib/Froxlor/Cron/Traffic/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Cron/index.html b/lib/Froxlor/Cron/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Customer/index.html b/lib/Froxlor/Customer/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Database/Manager/index.html b/lib/Froxlor/Database/Manager/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Database/index.html b/lib/Froxlor/Database/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Dns/index.html b/lib/Froxlor/Dns/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Domain/index.html b/lib/Froxlor/Domain/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Http/index.html b/lib/Froxlor/Http/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Idna/index.html b/lib/Froxlor/Idna/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Settings/index.html b/lib/Froxlor/Settings/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/System/index.html b/lib/Froxlor/System/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/UI/index.html b/lib/Froxlor/UI/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Validate/Form/index.html b/lib/Froxlor/Validate/Form/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/Validate/index.html b/lib/Froxlor/Validate/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/Froxlor/index.html b/lib/Froxlor/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/configfiles/index.html b/lib/configfiles/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/admin/index.html b/lib/formfields/admin/admin/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/cronjobs/index.html b/lib/formfields/admin/cronjobs/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/customer/index.html b/lib/formfields/admin/customer/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/domains/index.html b/lib/formfields/admin/domains/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/index.html b/lib/formfields/admin/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/ipsandports/index.html b/lib/formfields/admin/ipsandports/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/phpconfig/index.html b/lib/formfields/admin/phpconfig/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/plans/index.html b/lib/formfields/admin/plans/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/admin/templates/index.html b/lib/formfields/admin/templates/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/domains/index.html b/lib/formfields/customer/domains/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/email/index.html b/lib/formfields/customer/email/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/extras/index.html b/lib/formfields/customer/extras/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/ftp/index.html b/lib/formfields/customer/ftp/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/index.html b/lib/formfields/customer/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/customer/mysql/index.html b/lib/formfields/customer/mysql/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/formfields/index.html b/lib/formfields/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/index.html b/lib/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lib/navigation/index.html b/lib/navigation/index.html new file mode 100644 index 00000000..e69de29b diff --git a/lng/index.html b/lng/index.html new file mode 100644 index 00000000..e69de29b diff --git a/scripts/index.html b/scripts/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/2fa/index.html b/templates/Sparkle/2fa/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/admins/index.html b/templates/Sparkle/admin/admins/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/configfiles/index.html b/templates/Sparkle/admin/configfiles/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/cronjobs/index.html b/templates/Sparkle/admin/cronjobs/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/customers/index.html b/templates/Sparkle/admin/customers/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/domains/index.html b/templates/Sparkle/admin/domains/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/index.html b/templates/Sparkle/admin/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/index/index.html b/templates/Sparkle/admin/index/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/ipsandports/index.html b/templates/Sparkle/admin/ipsandports/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/logger/index.html b/templates/Sparkle/admin/logger/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/message/index.html b/templates/Sparkle/admin/message/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/phpconfig/index.html b/templates/Sparkle/admin/phpconfig/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/plans/index.html b/templates/Sparkle/admin/plans/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/settings/apcuinfo/index.html b/templates/Sparkle/admin/settings/apcuinfo/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/settings/importexport/index.html b/templates/Sparkle/admin/settings/importexport/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/settings/index.html b/templates/Sparkle/admin/settings/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/settings/opcacheinfo/index.html b/templates/Sparkle/admin/settings/opcacheinfo/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/settings/phpinfo/index.html b/templates/Sparkle/admin/settings/phpinfo/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/templates/index.html b/templates/Sparkle/admin/templates/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/traffic/index.html b/templates/Sparkle/admin/traffic/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/admin/update/index.html b/templates/Sparkle/admin/update/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/api_keys/index.html b/templates/Sparkle/api_keys/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/assets/css/index.html b/templates/Sparkle/assets/css/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/assets/index.html b/templates/Sparkle/assets/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/assets/js/index.html b/templates/Sparkle/assets/js/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/domains/index.html b/templates/Sparkle/customer/domains/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/email/index.html b/templates/Sparkle/customer/email/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/extras/index.html b/templates/Sparkle/customer/extras/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/ftp/index.html b/templates/Sparkle/customer/ftp/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/index.html b/templates/Sparkle/customer/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/index/index.html b/templates/Sparkle/customer/index/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/logger/index.html b/templates/Sparkle/customer/logger/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/mysql/index.html b/templates/Sparkle/customer/mysql/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/customer/traffic/index.html b/templates/Sparkle/customer/traffic/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/dns_editor/index.html b/templates/Sparkle/dns_editor/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/formfields/index.html b/templates/Sparkle/formfields/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/index.html b/templates/Sparkle/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/logfiles_viewer/index.html b/templates/Sparkle/logfiles_viewer/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/login/index.html b/templates/Sparkle/login/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/misc/form/index.html b/templates/Sparkle/misc/form/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/misc/index.html b/templates/Sparkle/misc/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/Sparkle/ssl_certificates/index.html b/templates/Sparkle/ssl_certificates/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/misc/index.html b/templates/misc/index.html new file mode 100644 index 00000000..e69de29b diff --git a/templates/misc/php/index.html b/templates/misc/php/index.html new file mode 100644 index 00000000..e69de29b From c8c1f7e691a1ac486ebe959c61db6cc3486853ba Mon Sep 17 00:00:00 2001 From: FliegenKLATSCH Date: Sat, 26 Mar 2022 13:54:32 +0100 Subject: [PATCH 07/22] Set RC 1 if an exception occured (#1013) --- install/scripts/config-services.php | 1 + install/scripts/switch-server-ip.php | 1 + 2 files changed, 2 insertions(+) diff --git a/install/scripts/config-services.php b/install/scripts/config-services.php index f95f7dc1..1db14065 100755 --- a/install/scripts/config-services.php +++ b/install/scripts/config-services.php @@ -28,4 +28,5 @@ try { \Froxlor\Cli\ConfigServicesCmd::processParameters($argc, $argv); } catch (Exception $e) { \Froxlor\Cli\ConfigServicesCmd::printerr($e->getMessage()); + exit 1; } diff --git a/install/scripts/switch-server-ip.php b/install/scripts/switch-server-ip.php index 7727dd36..e1032687 100755 --- a/install/scripts/switch-server-ip.php +++ b/install/scripts/switch-server-ip.php @@ -28,4 +28,5 @@ try { \Froxlor\Cli\SwitchServerIpCmd::processParameters($argc, $argv); } catch (Exception $e) { \Froxlor\Cli\SwitchServerIpCmd::printerr($e->getMessage()); + exit 1; } From 3c16fab92c573305d4e5f55f2b6562dec3cd6097 Mon Sep 17 00:00:00 2001 From: FliegenKLATSCH Date: Sun, 27 Mar 2022 11:10:43 +0200 Subject: [PATCH 08/22] Fix distro in postfix smtpd banner (#1014) --- lib/configfiles/focal.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/configfiles/focal.xml b/lib/configfiles/focal.xml index ccfd88ea..ceae7ed1 100644 --- a/lib/configfiles/focal.xml +++ b/lib/configfiles/focal.xml @@ -1600,7 +1600,7 @@ root: root@ # is /etc/mailname. #myorigin = /etc/mailname -smtpd_banner = $myhostname ESMTP $mail_name (@@DISTRO@@) +smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. From 4546c00adb12dec79abf15f830b761834beead55 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 1 Apr 2022 09:27:45 +0200 Subject: [PATCH 09/22] validate sql_search and sql_orderby API parameters, set version to 0.10.34 for security release Signed-off-by: Michael Kaufmann --- install/froxlor.sql | 2 +- .../updates/froxlor/0.10/update_0.10.inc.php | 5 +++++ lib/Froxlor/Api/ApiCommand.php | 17 +++++++++++++++++ lib/Froxlor/Froxlor.php | 2 +- lng/german.lng.php | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/install/froxlor.sql b/install/froxlor.sql index 5b5a8b0a..8697fe82 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,7 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), - ('panel', 'version', '0.10.33'), + ('panel', 'version', '0.10.34'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 7889077e..10c56853 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -970,3 +970,8 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.32')) { showUpdateStep("Updating from 0.10.32 to 0.10.33", false); \Froxlor\Froxlor::updateToVersion('0.10.33'); } + +if (\Froxlor\Froxlor::isFroxlorVersion('0.10.33')) { + showUpdateStep("Updating from 0.10.33 to 0.10.34", false); + \Froxlor\Froxlor::updateToVersion('0.10.34'); +} diff --git a/lib/Froxlor/Api/ApiCommand.php b/lib/Froxlor/Api/ApiCommand.php index f561ccf8..c93d5cbb 100644 --- a/lib/Froxlor/Api/ApiCommand.php +++ b/lib/Froxlor/Api/ApiCommand.php @@ -297,6 +297,10 @@ abstract class ApiCommand extends ApiParameter $sortfield[$id] = $sfield; } $field = implode('.', $sortfield); + if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) { + // skip + continue; + } if (! $first) { $condition .= ' AND '; } @@ -313,6 +317,14 @@ abstract class ApiCommand extends ApiParameter } elseif (strtolower($valoper['op']) == 'in' && is_array($valoper['value']) && count($valoper['value']) > 0) { $condition .= $field . ' ' . $valoper['op'] . ' ('; foreach ($valoper['value'] as $incnt => $invalue) { + if (!is_numeric($incnt)) { + // skip + continue; + } + if (!empty($invalue) && preg_match('/^([a-z0-9\-\._`]+)$/i', $invalue) == false) { + // skip + continue; + } $condition .= ":" . $cleanfield . $incnt . ", "; $query_fields[':' . $cleanfield . $incnt] = $invalue ?? ''; } @@ -398,6 +410,10 @@ abstract class ApiCommand extends ApiParameter $sortfield[$id] = $sfield; } $field = implode('.', $sortfield); + if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) { + // skip + continue; + } $by = strtoupper($by); if (! in_array($by, [ 'ASC', @@ -423,6 +439,7 @@ abstract class ApiCommand extends ApiParameter return $order; } + /** * return logger instance * diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 804aab8e..9203d50c 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -7,7 +7,7 @@ final class Froxlor { // Main version variable - const VERSION = '0.10.33'; + const VERSION = '0.10.34'; // Database version (YYYYMMDDC where C is a daily counter) const DBVERSION = '202112310'; diff --git a/lng/german.lng.php b/lng/german.lng.php index bb5a380b..e40d4878 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -410,7 +410,7 @@ $lng['admin']['ipsandports']['port'] = 'Port'; // ADDED IN 1.2.13-rc3 -$lng['error']['cantchangesystemip'] = 'Sie können die letzte System-IP-Adresse nicht löschen. Entweder legen Sie eine neue IP/Port-Kombination an oder Sie ändern die System-IP-Adresse.'; +$lng['error']['cantchangesystemip'] = 'Sie können die letzte System-IP-Adresse nicht ändern. Entweder legen Sie eine neue IP/Port-Kombination an oder Sie ändern die System-IP-Adresse.'; $lng['question']['admin_domain_reallydocrootoutofcustomerroot'] = 'Sind Sie sicher, dass der DocumentRoot dieser Domain außerhalb des Heimatverzeichnisses des Kunden liegen soll?'; // ADDED IN 1.2.14-rc1 From 652a998188241acdb5ba7aa1c8557d07a5396f0d Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 1 Apr 2022 12:01:06 +0200 Subject: [PATCH 10/22] don't rely on executable flag for php-sessionclean script Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/CronConfig.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/Froxlor/Cron/CronConfig.php b/lib/Froxlor/Cron/CronConfig.php index 83a954db..5233c708 100644 --- a/lib/Froxlor/Cron/CronConfig.php +++ b/lib/Froxlor/Cron/CronConfig.php @@ -1,4 +1,5 @@ /dev/null\n"; } } // php sessionclean if enabled if ((int) Settings::Get('phpfpm.enabled') == 1) { - $cronfile .= "# Look for and purge old sessions every 30 minutes".PHP_EOL; - $cronfile .= "09,39 * * * * root " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL; + $cronfile .= "# Look for and purge old sessions every 30 minutes" . PHP_EOL; + $cronfile .= "09,39 * * * * root " . $binpath . " " . \Froxlor\FileDir::makeCorrectFile(\Froxlor\Froxlor::getInstallDir() . "/scripts/php-sessionclean.php") . " --froxlor-dir=" . escapeshellarg(\Froxlor\Froxlor::getInstallDir()) . " 1> /dev/null" . PHP_EOL; } if (\Froxlor\FileDir::isFreeBSD()) { @@ -127,7 +129,7 @@ class CronConfig $newcrontab = ""; foreach ($crontablines as $ctl) { $ctl = trim($ctl); - if (! empty($ctl) && ! preg_match("/(.*)froxlor_master_cronjob\.php(.*)/", $ctl)) { + if (!empty($ctl) && !preg_match("/(.*)froxlor_master_cronjob\.php(.*)/", $ctl)) { $newcrontab .= $ctl . "\n"; } } From 11533c2d7528586af4468ecade74f74a6368d36e Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sat, 2 Apr 2022 18:07:36 +0200 Subject: [PATCH 11/22] fix exit statement in cli scripts Signed-off-by: Michael Kaufmann --- install/scripts/config-services.php | 2 +- install/scripts/switch-server-ip.php | 2 +- scripts/php-sessionclean.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/install/scripts/config-services.php b/install/scripts/config-services.php index 1db14065..9ba08d08 100755 --- a/install/scripts/config-services.php +++ b/install/scripts/config-services.php @@ -28,5 +28,5 @@ try { \Froxlor\Cli\ConfigServicesCmd::processParameters($argc, $argv); } catch (Exception $e) { \Froxlor\Cli\ConfigServicesCmd::printerr($e->getMessage()); - exit 1; + exit(1); } diff --git a/install/scripts/switch-server-ip.php b/install/scripts/switch-server-ip.php index e1032687..b76e5b3c 100755 --- a/install/scripts/switch-server-ip.php +++ b/install/scripts/switch-server-ip.php @@ -28,5 +28,5 @@ try { \Froxlor\Cli\SwitchServerIpCmd::processParameters($argc, $argv); } catch (Exception $e) { \Froxlor\Cli\SwitchServerIpCmd::printerr($e->getMessage()); - exit 1; + exit(1); } diff --git a/scripts/php-sessionclean.php b/scripts/php-sessionclean.php index c97c2aed..b63100b5 100755 --- a/scripts/php-sessionclean.php +++ b/scripts/php-sessionclean.php @@ -28,4 +28,5 @@ try { \Froxlor\Cli\PhpSessioncleanCmd::processParameters($argc, $argv); } catch (Exception $e) { \Froxlor\Cli\PhpSessioncleanCmd::printerr($e->getMessage()); + exit(1); } From 3fbc9815ea6f49a4ea0664f965eb4683ff681253 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 3 Apr 2022 14:34:20 +0200 Subject: [PATCH 12/22] respect domain.writeerrorlog and domain.writeaccesslog when using log-to-pipe Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Apache.php | 38 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/Froxlor/Cron/Http/Apache.php b/lib/Froxlor/Cron/Http/Apache.php index 9a1efe9f..182587c1 100644 --- a/lib/Froxlor/Cron/Http/Apache.php +++ b/lib/Froxlor/Cron/Http/Apache.php @@ -772,21 +772,29 @@ class Apache extends HttpConfigBase $logtype = 'vhost_combined'; } - if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != '') { - // replace for error_log - $command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array( - 'LOGFILE' => $error_log, - 'DOMAIN' => $domain['domain'], - 'CUSTOMER' => $domain['loginname'] - )); - $logfiles_text .= ' ErrorLog "|' . $command . "\"\n"; - // replace for access_log - $command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array( - 'LOGFILE' => $access_log, - 'DOMAIN' => $domain['domain'], - 'CUSTOMER' => $domain['loginname'] - )); - $logfiles_text .= ' CustomLog "|' . $command . '" ' . $logtype . "\n"; + if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != ''z) { + if ($domain['writeerrorlog']) { + // replace for error_log + $command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array( + 'LOGFILE' => $error_log, + 'DOMAIN' => $domain['domain'], + 'CUSTOMER' => $domain['loginname'] + )); + $logfiles_text .= ' ErrorLog "|' . $command . "\"\n"; + } else { + $logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n"; + } + if ($domain['writeaccesslog']) { + // replace for access_log + $command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array( + 'LOGFILE' => $access_log, + 'DOMAIN' => $domain['domain'], + 'CUSTOMER' => $domain['loginname'] + )); + $logfiles_text .= ' CustomLog "|' . $command . '" ' . $logtype . "\n"; + } else { + $logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n"; + } } else { $logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n"; $logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n"; From 7f6810c5bd03e307bf98af2ea5f58168a6c6042f Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 3 Apr 2022 14:43:37 +0200 Subject: [PATCH 13/22] remove accidentally added character Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Apache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Cron/Http/Apache.php b/lib/Froxlor/Cron/Http/Apache.php index 182587c1..d194c659 100644 --- a/lib/Froxlor/Cron/Http/Apache.php +++ b/lib/Froxlor/Cron/Http/Apache.php @@ -772,7 +772,7 @@ class Apache extends HttpConfigBase $logtype = 'vhost_combined'; } - if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != ''z) { + if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != '') { if ($domain['writeerrorlog']) { // replace for error_log $command = \Froxlor\PhpHelper::replaceVariables(Settings::Get('system.logfiles_script'), array( From 989b4fee0ec5d4e88a9f7031205194b89a0dca91 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 13 Apr 2022 12:46:16 +0200 Subject: [PATCH 14/22] set version to 0.10.34.1 for upcoming bugfix release Signed-off-by: Michael Kaufmann --- install/froxlor.sql | 2 +- install/updates/froxlor/0.10/update_0.10.inc.php | 5 +++++ lib/Froxlor/Froxlor.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install/froxlor.sql b/install/froxlor.sql index 8697fe82..c894cf85 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,7 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), - ('panel', 'version', '0.10.34'), + ('panel', 'version', '0.10.34.1'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 10c56853..60a17e3a 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -975,3 +975,8 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.33')) { showUpdateStep("Updating from 0.10.33 to 0.10.34", false); \Froxlor\Froxlor::updateToVersion('0.10.34'); } + +if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) { + showUpdateStep("Updating from 0.10.34 to 0.10.34.1", false); + \Froxlor\Froxlor::updateToVersion('0.10.34.1'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 9203d50c..75c3ead4 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -7,7 +7,7 @@ final class Froxlor { // Main version variable - const VERSION = '0.10.34'; + const VERSION = '0.10.34.1'; // Database version (YYYYMMDDC where C is a daily counter) const DBVERSION = '202112310'; From ae39a1759a88e5dd71d8c03f05e2cf36dda8d35b Mon Sep 17 00:00:00 2001 From: FliegenKLATSCH Date: Wed, 20 Apr 2022 15:09:19 +0200 Subject: [PATCH 15/22] Silence some php 8.1 warnings (#1029) --- admin_admins.php | 2 +- admin_customers.php | 2 +- admin_domains.php | 4 ++-- customer_domains.php | 8 ++++---- lib/Froxlor/Api/Commands/Admins.php | 2 +- lib/Froxlor/Api/Commands/Customers.php | 2 +- lib/Froxlor/PhpHelper.php | 2 +- lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php | 5 +++-- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/admin_admins.php b/admin_admins.php index 3c8031d8..9dbfe602 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -260,7 +260,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') { $dec_places = Settings::Get('panel.decimal_places'); $result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places); $result['diskspace'] = round($result['diskspace'] / 1024, $dec_places); - $result['email'] = $idna_convert->decode($result['email']); + $result['email'] = $idna_convert->decode($result['email'] ?? ''); $customers_ul = \Froxlor\UI\HTML::makecheckbox('customers_ul', $lng['customer']['unlimited'], '-1', false, $result['customers'], true, true); if ($result['customers'] == '-1') { diff --git a/admin_customers.php b/admin_customers.php index ac393f73..dd46f5a3 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -395,7 +395,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') { $dec_places = Settings::Get('panel.decimal_places'); $result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places); $result['diskspace'] = round($result['diskspace'] / 1024, $dec_places); - $result['email'] = $idna_convert->decode($result['email']); + $result['email'] = $idna_convert->decode($result['email'] ?? ''); $diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true); if ($result['diskspace'] == '-1') { diff --git a/admin_domains.php b/admin_domains.php index fc88f711..78bfda32 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -674,7 +674,7 @@ if ($page == 'domains' || $page == 'overview') { function formatDomainEntry(&$row, &$idna_convert) { $row['domain'] = $idna_convert->decode($row['domain']); - $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']); + $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? ''); $row['ipandport'] = ''; foreach ($row['ipsandports'] as $rowip) { @@ -685,7 +685,7 @@ function formatDomainEntry(&$row, &$idna_convert) } } $row['ipandport'] = substr($row['ipandport'], 0, - 1); - $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); + $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? ''); $row['termination_css'] = ""; if ($row['termination_date'] != "") { diff --git a/customer_domains.php b/customer_domains.php index 26fe3833..b2d651a4 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -83,7 +83,7 @@ if ($page == 'overview') { $statsapp = 'webalizer'; } $row = [ - 'domain' => $idna_convert->decode($parentdomain) + 'domain' => $idna_convert->decode($parentdomain ?? '') ]; eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";"); @@ -472,8 +472,8 @@ if ($page == 'overview') { function formatDomainEntry(&$row, &$idna_convert) { $row['domain'] = $idna_convert->decode($row['domain']); - $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']); - $row['domainalias'] = $idna_convert->decode($row['domainalias']); + $row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? ''); + $row['domainalias'] = $idna_convert->decode($row['domainalias'] ?? ''); /** * check for set ssl-certs to show different state-icons @@ -503,7 +503,7 @@ function formatDomainEntry(&$row, &$idna_convert) } } - $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); + $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? ''); $row['termination_css'] = ""; if ($row['termination_date'] != "") { diff --git a/lib/Froxlor/Api/Commands/Admins.php b/lib/Froxlor/Api/Commands/Admins.php index 747edfc9..0d39e53c 100644 --- a/lib/Froxlor/Api/Commands/Admins.php +++ b/lib/Froxlor/Api/Commands/Admins.php @@ -472,7 +472,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt // parameters $name = $this->getParam('name', true, $result['name']); $idna_convert = new \Froxlor\Idna\IdnaWrapper(); - $email = $this->getParam('email', true, $idna_convert->decode($result['email'])); + $email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? '')); $password = $this->getParam('admin_password', true, ''); $def_language = $this->getParam('def_language', true, $result['def_language']); $custom_notes = $this->getParam('custom_notes', true, $result['custom_notes']); diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index b1dd1034..d5b9fb4c 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -950,7 +950,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource $move_to_admin = (int) ($this->getParam('move_to_admin', true, 0)); $idna_convert = new \Froxlor\Idna\IdnaWrapper(); - $email = $this->getParam('email', true, $idna_convert->decode($result['email'])); + $email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? '')); $name = $this->getParam('name', true, $result['name']); $firstname = $this->getParam('firstname', true, $result['firstname']); $company_required = empty($result['company']) && ((! empty($name) && empty($firstname)) || (empty($name) && ! empty($firstname)) || (empty($name) && empty($firstname))); diff --git a/lib/Froxlor/PhpHelper.php b/lib/Froxlor/PhpHelper.php index 5b7c0b14..f9069fcb 100644 --- a/lib/Froxlor/PhpHelper.php +++ b/lib/Froxlor/PhpHelper.php @@ -63,7 +63,7 @@ class PhpHelper $subject[$field] = self::htmlentitiesArray($subject[$field], $fields, $quote_style, $charset); } } - } else { + } elseif (!empty($subject)) { $subject = htmlentities($subject, $quote_style, $charset); } diff --git a/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php b/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php index 97f8a6ba..51cf6e1b 100644 --- a/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php +++ b/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php @@ -10,8 +10,9 @@ namespace Froxlor\System; class IgnorantRecursiveDirectoryIterator extends \RecursiveDirectoryIterator { - public function getChildren() - { + #[\ReturnTypeWillChange] + public function getChildren() + { try { return new IgnorantRecursiveDirectoryIterator($this->getPathname()); } catch (\UnexpectedValueException $e) { From 10b4de4cf9e0595b32bb1bc594e6a5ba6b83d498 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 20 Apr 2022 15:11:48 +0200 Subject: [PATCH 16/22] remove unused IgnorantRecursiveDirectoryIterator and fix uninitialized variables Signed-off-by: Michael Kaufmann --- actions/admin/settings/131.ssl.php | 2 +- lib/Froxlor/Cron/Http/Lighttpd.php | 2 ++ lib/Froxlor/Cron/System/TasksCron.php | 4 ++-- lib/Froxlor/FileDir.php | 2 +- .../IgnorantRecursiveDirectoryIterator.php | 22 ------------------- 5 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php index 2d30bf3c..4479229c 100644 --- a/actions/admin/settings/131.ssl.php +++ b/actions/admin/settings/131.ssl.php @@ -229,7 +229,7 @@ return array( 'default' => true, 'save_method' => 'storeSettingField' ), - 'system_disable_le_selfcheck' => array( + 'system_le_domain_dnscheck' => array( 'label' => $lng['serversettings']['le_domain_dnscheck'], 'settinggroup' => 'system', 'varname' => 'le_domain_dnscheck', diff --git a/lib/Froxlor/Cron/Http/Lighttpd.php b/lib/Froxlor/Cron/Http/Lighttpd.php index 50d160e8..04355999 100644 --- a/lib/Froxlor/Cron/Http/Lighttpd.php +++ b/lib/Froxlor/Cron/Http/Lighttpd.php @@ -760,6 +760,7 @@ class Lighttpd extends HttpConfigBase 'customerid' => $domain['customerid'] )); + $diroption_text = ''; while ($row_htpasswds = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { if ($this->auth_backend_loaded[$domain['ipandport']] != 'yes' && $this->auth_backend_loaded[$domain['ssl_ipandport']] != 'yes') { $filename = $domain['customerid'] . '.htpasswd'; @@ -836,6 +837,7 @@ class Lighttpd extends HttpConfigBase } } + $servernames_text = ''; for ($i = 0; $i < sizeof($server_string); $i ++) { $data = $server_string[$i]; diff --git a/lib/Froxlor/Cron/System/TasksCron.php b/lib/Froxlor/Cron/System/TasksCron.php index 99c93944..b2690c86 100644 --- a/lib/Froxlor/Cron/System/TasksCron.php +++ b/lib/Froxlor/Cron/System/TasksCron.php @@ -324,8 +324,8 @@ class TasksCron extends \Froxlor\Cron\FroxlorCron if (file_exists($logsdir) && $logsdir != '/' && $logsdir != \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.logfiles_directory')) && substr($logsdir, 0, strlen(Settings::Get('system.logfiles_directory'))) == Settings::Get('system.logfiles_directory')) { // build up wildcard for webX-{access,error}.log{*} - $logfiles .= '-*'; - \Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg($logfiles)); + $logsdir .= '-*'; + \Froxlor\FileDir::safe_exec('rm -f ' . escapeshellarg($logsdir)); } } } diff --git a/lib/Froxlor/FileDir.php b/lib/Froxlor/FileDir.php index f19a4271..f71e5b7c 100644 --- a/lib/Froxlor/FileDir.php +++ b/lib/Froxlor/FileDir.php @@ -494,7 +494,7 @@ class FileDir }; // create RecursiveIteratorIterator - $its = new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator(new System\IgnorantRecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), $filter)); + $its = new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), $filter)); // we can limit the recursion-depth, but will it be helpful or // will people start asking "why do I only see 2 subdirectories, i want to use /a/b/c" // let's keep this in mind and see whether it will be useful diff --git a/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php b/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php deleted file mode 100644 index 51cf6e1b..00000000 --- a/lib/Froxlor/System/IgnorantRecursiveDirectoryIterator.php +++ /dev/null @@ -1,22 +0,0 @@ -getPathname()); - } catch (\UnexpectedValueException $e) { - return new \RecursiveArrayIterator(array()); - } - } -} From c6830d8e7a4e9a1ce96c8da2e8258424ff8363d7 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 9 May 2022 08:34:38 +0200 Subject: [PATCH 17/22] set default-ca for acme.sh after updating acme.sh Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php index da0c796a..14aba1b0 100644 --- a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php +++ b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php @@ -635,6 +635,9 @@ EOC; $acmesh_result = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --upgrade --auto-upgrade 0"); // check for activated cron $acmesh_result2 = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --install-cronjob"); - FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result) . "\n" . implode("\n", $acmesh_result2)); + // set default CA + $acmesh_result3 = \Froxlor\FileDir::safe_exec(self::getAcmeSh() . " --set-default-ca --server " . self::$apiserver); + // log messages + FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Checking for LetsEncrypt client upgrades before renewing certificates:\n" . implode("\n", $acmesh_result) . "\n" . implode("\n", $acmesh_result2) . "\n" . implode("\n", $acmesh_result3)); } } From 4750dad9e2ced4efb188e6659512bd49892ee762 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 25 May 2022 18:54:15 +0200 Subject: [PATCH 18/22] fix wrong number of bound variables when customers_see_all == 0 Signed-off-by: Michael Kaufmann --- admin_domains.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_domains.php b/admin_domains.php index 78bfda32..4a9349a1 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -148,7 +148,7 @@ if ($page == 'domains' || $page == 'overview') { $customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true); $result_customers_stmt = Database::prepare(" SELECT `customerid`, `loginname`, `name`, `firstname`, `company` - FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC"); + FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC"); $params = array(); if ($userinfo['customers_see_all'] == '0') { $params['adminid'] = $userinfo['adminid']; From d46b2d1d806f9657ae4d8103b03164ff042f2744 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 31 May 2022 10:43:39 +0200 Subject: [PATCH 19/22] add USERNAME replacer to all email templates; fixes #1032 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/EmailAccounts.php | 1 + lib/Froxlor/Api/Commands/Ftps.php | 1 + lib/Froxlor/Api/Commands/Mysqls.php | 1 + lib/Froxlor/Cron/Traffic/ReportsCron.php | 6 ++++-- .../Sparkle/admin/templates/templates_add_2.tpl | 12 ++++-------- templates/Sparkle/admin/templates/templates_edit.tpl | 12 ++++-------- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index 9ee1d16c..8b652f88 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -197,6 +197,7 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso 'NAME' => $customer['name'], 'FIRSTNAME' => $customer['firstname'], 'COMPANY' => $customer['company'], + 'USERNAME' => $customer['loginname'], 'CUSTOMER_NO' => $customer['customernumber'] ); diff --git a/lib/Froxlor/Api/Commands/Ftps.php b/lib/Froxlor/Api/Commands/Ftps.php index 5b05cf13..1195c046 100644 --- a/lib/Froxlor/Api/Commands/Ftps.php +++ b/lib/Froxlor/Api/Commands/Ftps.php @@ -243,6 +243,7 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit 'NAME' => $customer['name'], 'FIRSTNAME' => $customer['firstname'], 'COMPANY' => $customer['company'], + 'USERNAME' => $customer['loginname'], 'CUSTOMER_NO' => $customer['customernumber'], 'USR_NAME' => $username, 'USR_PASS' => htmlentities(htmlentities($password)), diff --git a/lib/Froxlor/Api/Commands/Mysqls.php b/lib/Froxlor/Api/Commands/Mysqls.php index e759ede2..6cac1c7d 100644 --- a/lib/Froxlor/Api/Commands/Mysqls.php +++ b/lib/Froxlor/Api/Commands/Mysqls.php @@ -141,6 +141,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt 'NAME' => $userinfo['name'], 'FIRSTNAME' => $userinfo['firstname'], 'COMPANY' => $userinfo['company'], + 'USERNAME' => $userinfo['loginname'], 'CUSTOMER_NO' => $userinfo['customernumber'], 'DB_NAME' => $username, 'DB_PASS' => htmlentities(htmlentities($password)), diff --git a/lib/Froxlor/Cron/Traffic/ReportsCron.php b/lib/Froxlor/Cron/Traffic/ReportsCron.php index bd24d0ac..852c26f7 100644 --- a/lib/Froxlor/Cron/Traffic/ReportsCron.php +++ b/lib/Froxlor/Cron/Traffic/ReportsCron.php @@ -36,7 +36,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron if ((int) Settings::Get('system.report_trafficmax') > 0) { // Warn the customers at xx% traffic-usage $result_stmt = Database::prepare(" - SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, + SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`, `a`.`name` AS `adminname`, `a`.`email` AS `adminmail`, (SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`) @@ -67,6 +67,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron 'NAME' => $rep_userinfo['name'], 'FIRSTNAME' => $rep_userinfo['firstname'], 'COMPANY' => $rep_userinfo['company'], + 'USERNAME' => $rep_userinfo['loginname'], 'CUSTOMER_NO' => $rep_userinfo['customernumber'], 'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */ 'TRAFFICUSED' => round(($row['traffic_used'] / 1024), 2), /* traffic is stored in KB, template uses MB */ @@ -354,7 +355,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron * report about diskusage for customers */ $result_stmt = Database::query(" - SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, + SELECT `c`.`customerid`, `c`.`loginname`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`, `a`.`name` AS `adminname`, `a`.`email` AS `adminmail` FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c` @@ -380,6 +381,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron 'NAME' => $rep_userinfo['name'], 'FIRSTNAME' => $rep_userinfo['firstname'], 'COMPANY' => $rep_userinfo['company'], + 'USERNAME' => $rep_userinfo['loginname'], 'CUSTOMER_NO' => $rep_userinfo['customernumber'], 'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2), /* traffic is stored in KB, template uses MB */ 'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */ diff --git a/templates/Sparkle/admin/templates/templates_add_2.tpl b/templates/Sparkle/admin/templates/templates_add_2.tpl index 7077f924..978c643a 100644 --- a/templates/Sparkle/admin/templates/templates_add_2.tpl +++ b/templates/Sparkle/admin/templates/templates_add_2.tpl @@ -60,11 +60,11 @@ $header {CUSTOMER_NO} {$lng['admin']['templates']['CUSTOMER_NO']} + + {USERNAME} + {$lng['admin']['templates']['USERNAME']} + - - {USERNAME} - {$lng['admin']['templates']['USERNAME']} - {PASSWORD} {$lng['admin']['templates']['PASSWORD']} @@ -92,10 +92,6 @@ $header - - {USERNAME} - {$lng['admin']['templates']['USERNAME']} - {LINK} {$lng['admin']['templates']['LINK']} diff --git a/templates/Sparkle/admin/templates/templates_edit.tpl b/templates/Sparkle/admin/templates/templates_edit.tpl index 875ef050..86d955e5 100644 --- a/templates/Sparkle/admin/templates/templates_edit.tpl +++ b/templates/Sparkle/admin/templates/templates_edit.tpl @@ -62,11 +62,11 @@ $header {CUSTOMER_NO} {$lng['admin']['templates']['CUSTOMER_NO']} + + {USERNAME} + {$lng['admin']['templates']['USERNAME']} + - - {USERNAME} - {$lng['admin']['templates']['USERNAME']} - {PASSWORD} {$lng['admin']['templates']['PASSWORD']} @@ -94,10 +94,6 @@ $header - - {USERNAME} - {$lng['admin']['templates']['USERNAME']} - {LINK} {$lng['admin']['templates']['LINK']} From 25f20e4a7d0613211939e807b92df35a870e0dcb Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 3 Jun 2022 08:28:15 +0200 Subject: [PATCH 20/22] set version to 0.10.35 for upcoming maintenance release Signed-off-by: Michael Kaufmann --- install/froxlor.sql | 2 +- install/updates/froxlor/0.10/update_0.10.inc.php | 5 +++++ lib/Froxlor/Froxlor.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install/froxlor.sql b/install/froxlor.sql index c894cf85..2d288410 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,7 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), - ('panel', 'version', '0.10.34.1'), + ('panel', 'version', '0.10.35'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 60a17e3a..47d05dfb 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -980,3 +980,8 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) { showUpdateStep("Updating from 0.10.34 to 0.10.34.1", false); \Froxlor\Froxlor::updateToVersion('0.10.34.1'); } + +if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34.1')) { + showUpdateStep("Updating from 0.10.34.1 to 0.10.35", false); + \Froxlor\Froxlor::updateToVersion('0.10.34'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 75c3ead4..5a04a045 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -7,7 +7,7 @@ final class Froxlor { // Main version variable - const VERSION = '0.10.34.1'; + const VERSION = '0.10.35'; // Database version (YYYYMMDDC where C is a daily counter) const DBVERSION = '202112310'; From 3b990704962db0deee65a88c80dc74b7b7cb0475 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 3 Jun 2022 08:57:01 +0200 Subject: [PATCH 21/22] argh, typo in the version to update to Signed-off-by: Michael Kaufmann --- install/updates/froxlor/0.10/update_0.10.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index 47d05dfb..bec63dc7 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -983,5 +983,5 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) { if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34.1')) { showUpdateStep("Updating from 0.10.34.1 to 0.10.35", false); - \Froxlor\Froxlor::updateToVersion('0.10.34'); + \Froxlor\Froxlor::updateToVersion('0.10.35'); } From 3682116ba2aeeebfcb6ebbad129494055ac227d5 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 3 Jun 2022 08:58:31 +0200 Subject: [PATCH 22/22] set version to 0.10.35.1 for bugfix release Signed-off-by: Michael Kaufmann --- install/froxlor.sql | 2 +- install/updates/froxlor/0.10/update_0.10.inc.php | 6 ++++++ lib/Froxlor/Froxlor.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install/froxlor.sql b/install/froxlor.sql index 2d288410..c8aef3e6 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -723,7 +723,7 @@ opcache.validate_timestamps'), ('panel', 'logo_image_login', ''), ('panel', 'logo_overridetheme', '0'), ('panel', 'logo_overridecustom', '0'), - ('panel', 'version', '0.10.35'), + ('panel', 'version', '0.10.35.1'), ('panel', 'db_version', '202112310'); diff --git a/install/updates/froxlor/0.10/update_0.10.inc.php b/install/updates/froxlor/0.10/update_0.10.inc.php index bec63dc7..04f30612 100644 --- a/install/updates/froxlor/0.10/update_0.10.inc.php +++ b/install/updates/froxlor/0.10/update_0.10.inc.php @@ -985,3 +985,9 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34.1')) { showUpdateStep("Updating from 0.10.34.1 to 0.10.35", false); \Froxlor\Froxlor::updateToVersion('0.10.35'); } + + +if (\Froxlor\Froxlor::isFroxlorVersion('0.10.35')) { + showUpdateStep("Updating from 0.10.35 to 0.10.35.1", false); + \Froxlor\Froxlor::updateToVersion('0.10.35.1'); +} diff --git a/lib/Froxlor/Froxlor.php b/lib/Froxlor/Froxlor.php index 5a04a045..f2e37a79 100644 --- a/lib/Froxlor/Froxlor.php +++ b/lib/Froxlor/Froxlor.php @@ -7,7 +7,7 @@ final class Froxlor { // Main version variable - const VERSION = '0.10.35'; + const VERSION = '0.10.35.1'; // Database version (YYYYMMDDC where C is a daily counter) const DBVERSION = '202112310';