Compare commits

..

94 Commits

Author SHA1 Message Date
Michael Kaufmann
13767df562 set version to 0.10.15 for bugfix release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-08 07:39:39 +01:00
Michael Kaufmann
02c5f80854 correct chmod value for userdata.inc.php file to be written on installation; fixes #815
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-08 07:35:19 +01:00
Michael Kaufmann
d7550ae58a fix deactivated check in api
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-06 22:10:01 +01:00
Michael Kaufmann
cf2c7fa31c deny api access to deactivated users with valid api-key
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-06 22:03:41 +01:00
Michael Kaufmann
32b6285589 set version to 0.10.14 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-06 20:47:20 +01:00
Michael Kaufmann
7e361274c5 forgot one escapeshellarg() and enhanced security on userdata.inc.php creation when installing
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-06 20:44:17 +01:00
Michael Kaufmann
62ce21c9ec secure shell-execution of mysqldump on installation if given database-name exists
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-04 19:35:57 +01:00
Michael Kaufmann
6b09720ef8 use unpredictable tmpfile-name in installation if lib/userdata.inc.php cannot be written due to permission
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-04 19:34:18 +01:00
Michael Kaufmann
8807ae7dad allow private ip ranges in ips-and-ports as some configurations require that; fixes #802
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-02 09:51:44 +01:00
Michael Kaufmann
5f3f208534 remove superfluous comma in sql query which causes invalid sql
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-03-01 09:16:47 +01:00
Michael Kaufmann
f11ceacf89 store ace-string of domain besides idn-converted string to have correct sorting in the frontend; fixes #809
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-29 09:50:29 +01:00
Michael Kaufmann
26e43077c2 make customer firstname,name,company and customer-no available for all templates; fixes #808
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-29 08:16:55 +01:00
Michael Kaufmann
d6c8b92523 add Froxlor.integrityCheck() API call to externally run integrity/consistency check, fixes #801
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-15 07:30:56 +01:00
Michael Kaufmann
03450dcfa2 fix listing of customer email addresses if 'domain' section is hidden via settings, fixes #803
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-15 07:25:23 +01:00
Michael Kaufmann
f39aab6f32 disable sslsessiontickets-option in domain-add/edit if globally disabled in the settings
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-15 07:11:28 +01:00
Michael Kaufmann
7f999302fa do not require enabled vhost-container for froxlor-vhost to change sslsessiontickets-setting
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-14 19:26:06 +01:00
Michael Kaufmann
8294985588 require set password complexity for admins too when resetting password; display correct error message if password complexity is not satisfied
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-08 10:03:41 +01:00
Michael Kaufmann
a7653551b2 set version to 0.10.13 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-02-07 16:37:06 +01:00
Michael Kaufmann
734c02e33f update php-fpm defaults; update paths for current stable php-7.3; read froxlor default php.ini from file rather then using phpconfig with id=1; fixes #796
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-31 13:17:49 +01:00
Michael Kaufmann
ace18cb7c9 use correct default-versions for configuration-step to disable mod_php for debian buster and ubuntu bionic
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-31 12:58:04 +01:00
Michael Kaufmann
1270204cd9 fix wrongly initialized resource-usage when re-calculating it; fixes #797
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-31 09:49:29 +01:00
Michael Kaufmann
2831923708 Merge pull request #795 from lpedretti/master
Fixed the case that the spf record is not inserted with it's quotes, and so the condition fails and 2 spf records are inserted in the domain
2020-01-24 16:58:10 +01:00
Leonardo Pedretti
6b1ae648b4 Fixed the case that the spf record is not inserted with it's quotes, and so the condition fails and 2 spf records are inserted in the domain 2020-01-23 11:59:28 -03:00
Michael Kaufmann
6c43f1bc56 fix Domains.update() if called as admin/reseller without change_serversettings privileges, thx to rseffner
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-22 09:14:07 +01:00
Michael Kaufmann
2e273a41b5 fix IpsAndPorts when checking for system.ipaddress in update() and delete()
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-19 10:45:48 +01:00
Michael Kaufmann
2004bbe38d dont access db result arrays directly without checking whether it's false due to an error (php7.4 related)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-19 10:13:28 +01:00
Michael Kaufmann
e44e07784f validate nameserver ip-addresses for binds allow-transfer block; fixes #791
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-19 10:08:06 +01:00
Michael Kaufmann
8d6275e1aa set version to 0.10.12 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-10 17:41:20 +01:00
Michael Kaufmann
f21d4f8770 when not using awstats, disable awstats-related settings; add minor tweaks to unit-tests
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-10 16:44:13 +01:00
Michael Kaufmann
fc97b4d4e9 Merge pull request #786 from patschi/logformat-awstats
Allow configuring awstats LogFormat
2020-01-10 16:32:33 +01:00
Patrik Kernstock
05051309c7 Merge branch 'master' into logformat-awstats 2020-01-09 23:24:26 +00:00
Patrik Kernstock
0f025a6627 Language file update
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2020-01-09 23:21:11 +00:00
Michael Kaufmann
f6f5765b54 avoid settig more than one catchall address for one domain in Emails.update(), thx to mrairstone
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-09 14:45:51 +01:00
Michael Kaufmann
ac82aa80d2 correct logfiles_format migration; only needed if setting is non-empty
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-09 14:14:04 +01:00
Michael Kaufmann
57503d9c6e try to touch logfile from settings in order for is_writable to work correctly, thx to rubberduck
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-09 14:10:50 +01:00
Michael Kaufmann
f55ad16d82 Merge pull request #785 from patschi/logformat
Allow using more advanced webserver LogFormat
2020-01-09 09:16:03 +01:00
Patrik Kernstock
ea7834c1d1 Added small notice to lng for awstats LogFormat
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2020-01-08 22:08:15 +00:00
Patrik Kernstock
b355711de9 Improvements as suggested by @d00p
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2020-01-08 22:08:15 +00:00
Michael Kaufmann
a5287726a4 fix issue in PhpHelper::trimArray() returning an empty array, fixes #751
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-03 23:32:21 +01:00
Patrik Kernstock
b393c7d6e6 Merge branch 'master' into logformat 2020-01-03 22:32:45 +01:00
Michael Kaufmann
dd2782771a set version to 0.10.11 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-03 13:24:31 +01:00
Michael Kaufmann
25d0bbb766 switch from algo26-matthias/idna-covert to our own fork as we cannot update to >2.1 without having a minimum requirement for php-7.2 but we need a few fixes for php-7.4 support later on
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-03 12:48:01 +01:00
Michael Kaufmann
b4dedca3db Update README.md 2020-01-02 13:53:22 +01:00
Patrik Kernstock
09aed61dbf Merge branch 'master' into logformat-awstats 2020-01-02 12:44:35 +01:00
Patrik Kernstock
ca39501530 Fixed awstats_logformat field for new installs
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2020-01-02 12:39:25 +01:00
Patrik Kernstock
28fd88e53e Merge branch 'master' into logformat 2020-01-02 12:31:51 +01:00
Michael Kaufmann
e01c2e02fb fix update query for new fpm-custom_config value, refs #783
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2020-01-02 12:28:48 +01:00
Michael Kaufmann
762bfae61a Merge pull request #783 from patschi/phpfpm-custom-settings
Ability to add custom config to PHPFPM version
2020-01-02 10:19:19 +01:00
Patrik Kernstock
a4d4e16efc Small comment added to escaping double-quote
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 22:46:03 +01:00
Patrik Kernstock
7f83ad31f4 Fixed dbversion in SQL/Froxlor.php
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 22:30:54 +01:00
Patrik Kernstock
e143ba4577 Allow configuring awstats LogFormat
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 22:29:29 +01:00
Patrik Kernstock
6799a56ba1 Allow using more advanced LogFormat
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 20:18:52 +01:00
Patrik Kernstock
484fe8acbc Fixed db_DBVERISON in Froxlor.php
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 17:22:37 +01:00
Patrik Kernstock
550af5b943 Fixed german lng, fixed db_version in SQL
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 17:18:17 +01:00
Patrik Kernstock
7ae59477af New update step, changed order of lang strings
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 16:14:26 +01:00
Michael Kaufmann
acefa41806 Merge pull request #781 from patschi/accesslog-logtype
Use logtype for access_log for IPsAndPorts too
2019-12-31 16:01:42 +01:00
Patrik Kernstock
b39c8029cd Merge branch 'master' into phpfpm-custom-settings 2019-12-31 15:51:27 +01:00
Patrik Kernstock
69ff416361 Fixed SQL, minor comments/lng updates
Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 15:34:46 +01:00
Michael Kaufmann
3eb1718fe0 add option to disable SSL sessiontickets globally for older systems, fixes #784
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-31 12:27:35 +01:00
Michael Kaufmann
37c434d4fc testsystem does not listen on socket for mysql
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-31 09:29:09 +01:00
Michael Kaufmann
1eb14d7564 update composer-dependencies; add connection-test to Mysqls.update() when changing passwords; validate ssl-certificates to avoid private/public key mismatch and a failed webserver start, fixes #778
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-31 09:23:28 +01:00
Michael Kaufmann
1c17df69d2 Merge pull request #782 from patschi/fix-dhparams-indent
Fix dhparam indent
2019-12-31 08:11:40 +01:00
Patrik Kernstock
c61b3b73bd Ability to add custom config to PHPFPM version
Addresses #643

Signed-off-by: Patrik Kernstock <patrik@kernstock.net>
2019-12-31 05:48:36 +01:00
Patrik Kernstock
18c87baec8 Fix dhparam indent 2019-12-31 03:53:12 +01:00
Patrik Kernstock
631b2b59a5 Use logtype for access_log for IPsAndPorts too 2019-12-31 03:51:19 +01:00
Michael Kaufmann
1e0510a43d fix SysLog.delete(), SysLog.listing() and SysLog.listingCount() when called as admin/reseller withouth customers_see_all permission
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-21 15:12:51 +01:00
Michael Kaufmann
e62f675c4c apply 'notryfiles', 'writeaccesslog' and 'writeerrorlog' flags to subdomains when editing a domain
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-18 08:44:02 +01:00
Michael Kaufmann
fe389ab208 setting version to 0.10.10 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-13 16:23:43 +01:00
Michael Kaufmann
63d915804a lowercase domainnames when adding new (sub)domain to avoid issues with certificates on filesystem
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-11 20:12:51 +01:00
Michael Kaufmann
466c09137b add new 'ssl-enabled' flag for domains and subdomains so ssl can be deactivated (by a customer too) even if there are ssl-ip/ports assigned; introduce new honorcipherorder and sessiontickets flags for more control over ssl-related settings on a per domain base (admin only); fixes #767 and fixes #769
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-10 10:21:35 +01:00
Michael Kaufmann
3a738b7070 fix mysql8 issue with group by and sorting within; fixes #774
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-08 10:43:12 +01:00
Michael Kaufmann
5ee9d3064a add new API function Froxlor.generatePassword() to return a random password based on froxlor settings regarding min-length, included characters, etc.; fixes #768
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-06 11:51:40 +01:00
Michael Kaufmann
adb5c6734a set version to 0.10.9 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-06 10:20:01 +01:00
Michael Kaufmann
7dff46b63e set production Lets Encrypt endpoint as default in settings like the installation does; do nat-sorting only on username-related fields, fixes #765
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-05 07:52:11 +01:00
Michael Kaufmann
12883bafd6 check for valid result when reading database usage from information_schema; fixes #766
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-12-04 07:15:28 +01:00
Michael Kaufmann
c2b88200f0 Merge pull request #763 from RipClaw2971/bugfix
SQL error in lib/Froxlor/Api/Commands/Certificates.php
2019-11-29 19:52:13 +01:00
Andreas Grundler
634199780b Bugfix 2019-11-29 19:22:43 +01:00
Michael Kaufmann
e0275840ab set version to 0.10.8 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-29 17:14:02 +01:00
Michael Kaufmann
bae8c86901 fix removing of ssl-ip-relation to domain if no ssl-ip is selected via interface, thx to Patient Nr0
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-27 18:32:27 +01:00
Michael Kaufmann
e8be3ee643 use correct apiendpoint for lets encrypt; pass debug-flag onto acme.sh; fixes #762
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-27 07:42:23 +01:00
Michael Kaufmann
35ecdfa2f5 fix searching for alias-domains by link in customer_domains
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-24 12:52:25 +01:00
Michael Kaufmann
3e4a3ef4b0 fix duplicate domain entries in customer-domain-list when domain has aliases, thx to crazy4chrissi
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-24 11:33:10 +01:00
Michael Kaufmann
cdf02ceab6 set version to 0.10.7 for upcoming maintenance release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-22 16:14:13 +01:00
Michael Kaufmann
d24056c925 fix vhost-merging of specialsettings in nginx; fixes #757
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-22 16:12:11 +01:00
Michael Kaufmann
d2852fbd5d add new setting to set default value of domain-edit-setting 'Apply specialsettings to all subdomains' and 'Apply php-config to all subdomains'
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-22 16:10:27 +01:00
Michael Kaufmann
d76ebc7c06 fix sort-ordering parameter for pagination
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-20 13:08:36 +01:00
Michael Kaufmann
4fbaacb159 fix domain listing for admin-domains
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-20 12:20:20 +01:00
Michael Kaufmann
2d43a8714d let's try to fix the mysql-user-create/update issue, fingers crossed; refs #758
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-20 11:06:21 +01:00
Michael Kaufmann
620a22bf3e fix listing of subdomains for customers, fixes #759
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-20 09:33:28 +01:00
Michael Kaufmann
5e01018f30 fix typo in SysLog.delete(), thx to Wolfgang
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-18 14:47:56 +01:00
Michael Kaufmann
c84732a0cd fix issue when adding new database users with already-hashed passwords, refs #758
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-18 10:48:31 +01:00
Michael Kaufmann
dfce1fea3c re-add \Froxlor\UI\Paging as it's still required for api_keys.php because they are not (yet) listable via API
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-17 15:20:46 +01:00
Michael Kaufmann
e6dad6c6d0 Use authentication_string for mysql-5.7 and mysql-8 (not password-field) - let's see what happens
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-17 14:29:37 +01:00
Michael Kaufmann
605d2340d1 first unittest for mysql-users and their password, refs #758
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2019-11-17 13:42:35 +01:00
89 changed files with 2147 additions and 636 deletions

View File

@@ -53,14 +53,21 @@ https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.fro
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian) [HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian)
/etc/apt/sources.list.d/froxlor.list ```
> deb http://debian.froxlor.org {stretch|buster} main 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
```
### Gentoo repository ### Ubuntu repository
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-gentoo) [HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-ubuntu)
https://files.froxlor.org/gentoo/repositories.xml ```
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
```
## Contributing ## Contributing

View File

@@ -253,7 +253,23 @@ return array(
'type' => 'hiddenString', 'type' => 'hiddenString',
'default' => '', 'default' => '',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
) ),
'system_apply_specialsettings_default' => array(
'label' => $lng['serversettings']['apply_specialsettings_default'],
'settinggroup' => 'system',
'varname' => 'apply_specialsettings_default',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField'
),
'system_apply_phpconfigs_default' => array(
'label' => $lng['serversettings']['apply_phpconfigs_default'],
'settinggroup' => 'system',
'varname' => 'apply_phpconfigs_default',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField'
),
) )
) )
) )

View File

@@ -105,6 +105,30 @@ return array(
'hasVhostContainerEnabled' 'hasVhostContainerEnabled'
), true) ), true)
), ),
'system_honorcipherorder' => array(
'label' => $lng['admin']['domain_honorcipherorder'],
'settinggroup' => 'system',
'varname' => 'honorcipherorder',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array(
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
), true)
),
'system_sessiontickets' => array(
'label' => $lng['admin']['domain_sessiontickets'],
'settinggroup' => 'system',
'varname' => 'sessiontickets',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array(
'\Froxlor\Settings\FroxlorVhostSettings',
'hasVhostContainerEnabled'
), true)
),
/** /**
* FCGID * FCGID
*/ */

View File

@@ -173,7 +173,8 @@ return array(
'websrv_avail' => array( 'websrv_avail' => array(
'apache2', 'apache2',
'nginx' 'nginx'
) ),
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
), ),
'system_logfiles_type' => array( 'system_logfiles_type' => array(
'label' => $lng['serversettings']['logfiles_type'], 'label' => $lng['serversettings']['logfiles_type'],

View File

@@ -62,7 +62,7 @@ return array(
'string_emptyallowed' => true, 'string_emptyallowed' => true,
'default' => '', 'default' => '',
'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, 'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1,
'save_method' => 'storeSettingField', 'save_method' => 'storeSettingField'
), ),
'system_ssl_cert_file' => array( 'system_ssl_cert_file' => array(
'label' => $lng['serversettings']['ssl']['ssl_cert_file'], 'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
@@ -115,6 +115,15 @@ return array(
'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1, 'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1,
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'
), ),
'system_sessionticketsenabled' => array(
'label' => $lng['admin']['domain_sessionticketsenabled'],
'settinggroup' => 'system',
'varname' => 'sessionticketsenabled',
'type' => 'bool',
'default' => true,
'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1))
),
'system_leenabled' => array( 'system_leenabled' => array(
'label' => $lng['serversettings']['leenabled'], 'label' => $lng['serversettings']['leenabled'],
'settinggroup' => 'system', 'settinggroup' => 'system',
@@ -150,10 +159,10 @@ return array(
'settinggroup' => 'system', 'settinggroup' => 'system',
'varname' => 'letsencryptca', 'varname' => 'letsencryptca',
'type' => 'option', 'type' => 'option',
'default' => 'testing', 'default' => 'production',
'option_mode' => 'one', 'option_mode' => 'one',
'option_options' => array( 'option_options' => array(
'testing' => 'https://acme-staging' . (\Froxlor\Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)', 'testing' => 'https://acme-staging-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Test)',
'production' => 'https://acme-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)' 'production' => 'https://acme-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)'
), ),
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField'

View File

@@ -33,7 +33,8 @@ return array(
1 => $lng['admin']['webalizer']['quiet'], 1 => $lng['admin']['webalizer']['quiet'],
2 => $lng['admin']['webalizer']['veryquiet'] 2 => $lng['admin']['webalizer']['veryquiet']
), ),
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 0
), ),
'system_awstats_enabled' => array( 'system_awstats_enabled' => array(
'label' => $lng['serversettings']['awstats_enabled'], 'label' => $lng['serversettings']['awstats_enabled'],
@@ -50,7 +51,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/bin/', 'default' => '/usr/bin/',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
), ),
'system_awstats_awstatspath' => array( 'system_awstats_awstatspath' => array(
'label' => $lng['serversettings']['awstats_awstatspath'], 'label' => $lng['serversettings']['awstats_awstatspath'],
@@ -59,7 +61,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/bin/', 'default' => '/usr/bin/',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
), ),
'system_awstats_conf' => array( 'system_awstats_conf' => array(
'label' => $lng['serversettings']['awstats_conf'], 'label' => $lng['serversettings']['awstats_conf'],
@@ -68,7 +71,8 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/etc/awstats/', 'default' => '/etc/awstats/',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
), ),
'system_awstats_icons' => array( 'system_awstats_icons' => array(
'label' => $lng['serversettings']['awstats_icons'], 'label' => $lng['serversettings']['awstats_icons'],
@@ -77,7 +81,17 @@ return array(
'type' => 'string', 'type' => 'string',
'string_type' => 'dir', 'string_type' => 'dir',
'default' => '/usr/share/awstats/icon/', 'default' => '/usr/share/awstats/icon/',
'save_method' => 'storeSettingField' 'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
),
'system_awstats_logformat' => array(
'label' => $lng['serversettings']['awstats']['logformat'],
'settinggroup' => 'system',
'varname' => 'awstats_logformat',
'type' => 'string',
'default' => '1',
'save_method' => 'storeSettingField',
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
) )
) )
) )

View File

@@ -39,7 +39,7 @@ if ($page == 'domains' || $page == 'overview') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
$fields = array( $fields = array(
'd.domain' => $lng['domains']['domainname'], 'd.domain_ace' => $lng['domains']['domainname'],
'c.name' => $lng['customer']['name'], 'c.name' => $lng['customer']['name'],
'c.firstname' => $lng['customer']['firstname'], 'c.firstname' => $lng['customer']['firstname'],
'c.company' => $lng['customer']['company'], 'c.company' => $lng['customer']['company'],
@@ -64,47 +64,20 @@ if ($page == 'domains' || $page == 'overview') {
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
$searchcode = $paging->getHtmlSearchCode($lng); $searchcode = $paging->getHtmlSearchCode($lng);
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
$domain_array = array();
foreach ($result['list'] as $row) {
formatDomainEntry($row, $idna_convert);
if (! isset($domain_array[$row['domain']])) {
$domain_array[$row['domain']] = $row;
} else {
$domain_array[$row['domain']] = array_merge($row, $domain_array[$row['domain']]);
}
if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
if (! isset($domain_array[$row['aliasdomain']])) {
$domain_array[$row['aliasdomain']] = array();
}
$domain_array[$row['aliasdomain']]['domainaliasid'] = $row['id'];
$domain_array[$row['aliasdomain']]['domainalias'] = $row['domain'];
}
}
/**
* We need ksort/krsort here to make sure idna-domains are also sorted correctly
*/
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
ksort($domain_array);
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
krsort($domain_array);
}
$count = 0; $count = 0;
foreach ($domain_array as $row) { foreach ($result['list'] as $row) {
formatDomainEntry($row, $idna_convert);
if (isset($row['domain']) && $row['domain'] != '') { $row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row); $row = \Froxlor\PhpHelper::htmlentitiesArray($row);
$row = \Froxlor\PhpHelper::htmlentitiesArray($row); // display a nice list of IP's if it's not an alias for another domain
// display a nice list of IP's if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
$row['ipandport'] = sprintf($lng['domains']['isaliasdomainof'], $row['aliasdomain']);
} else {
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']); $row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
$count ++;
} }
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
$count++;
} }
$domainscount = $paging->getEntries(); $domainscount = $paging->getEntries();
@@ -409,7 +382,7 @@ if ($page == 'domains' || $page == 'overview') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
try { try {
// remove ssl ip/ports if set is empty // remove ssl ip/ports if set is empty
if (isset($_POST['ssl_ipandport']) && empty($_POST['ssl_ipandport'])) { if (!isset($_POST['ssl_ipandport']) || empty($_POST['ssl_ipandport'])) {
$_POST['remove_ssl_ipandport'] = true; $_POST['remove_ssl_ipandport'] = true;
} }
Domains::getLocal($userinfo, $_POST)->update(); Domains::getLocal($userinfo, $_POST)->update();

View File

@@ -160,5 +160,14 @@ if ($page == 'ipsandports' || $page == 'overview') {
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";");
} }
} }
} elseif ($action == 'jqCheckIP') {
$ip = $_POST['ip'] ?? "";
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE) == false) {
// returns notice if private network detected so we can display it
echo json_encode($lng['admin']['ipsandports']['ipnote']);
} else {
echo 0;
}
exit();
} }
} }

View File

@@ -81,8 +81,16 @@ if ($page == 'overview') {
)); ));
} else { } else {
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1"); if (file_exists(\Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
$result = $result_stmt->fetch(PDO::FETCH_ASSOC); require_once \Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
$result = [
'phpsettings' => DEFAULT_PHPINI
];
} else {
// use first php-config as fallback
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
}
$fpmconfigs = ''; $fpmconfigs = '';
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC"); $configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
@@ -90,9 +98,9 @@ if ($page == 'overview') {
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true); $fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true);
} }
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true); $pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true); $pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true); $pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php'; $phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data); $phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
@@ -234,9 +242,9 @@ if ($page == 'overview') {
)); ));
} else { } else {
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true); $pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true); $pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true); $pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php'; $fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data); $fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);

View File

@@ -46,7 +46,7 @@
"phpmailer/phpmailer": "~6.0", "phpmailer/phpmailer": "~6.0",
"monolog/monolog": "^1.24", "monolog/monolog": "^1.24",
"robthree/twofactorauth": "^1.6", "robthree/twofactorauth": "^1.6",
"algo26-matthias/idna-convert": "^2.1" "froxlor/idna-convert-legacy": "^2.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "8.4.1", "phpunit/phpunit": "8.4.1",

416
composer.lock generated
View File

@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5699c65bbdcd2a61a9ced0ac7be84d64", "content-hash": "a7ba15333ffb4a758ea65039b589545b",
"packages": [ "packages": [
{ {
"name": "algo26-matthias/idna-convert", "name": "froxlor/idna-convert-legacy",
"version": "v2.1.0", "version": "v2.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/algo26-matthias/idna-convert.git", "url": "https://github.com/Froxlor/idna-convert-legacy.git",
"reference": "2717d05713454991936bc581d068c6cea0d84e3b" "reference": "09c1db623ba19e1ed8f2f9dabc15eeda9dc713b7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/algo26-matthias/idna-convert/zipball/2717d05713454991936bc581d068c6cea0d84e3b", "url": "https://api.github.com/repos/Froxlor/idna-convert-legacy/zipball/09c1db623ba19e1ed8f2f9dabc15eeda9dc713b7",
"reference": "2717d05713454991936bc581d068c6cea0d84e3b", "reference": "09c1db623ba19e1ed8f2f9dabc15eeda9dc713b7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -43,6 +43,11 @@
"name": "Matthias Sommerfeld", "name": "Matthias Sommerfeld",
"email": "matthias.sommerfeld@algo26.de", "email": "matthias.sommerfeld@algo26.de",
"role": "Developer" "role": "Developer"
},
{
"name": "Michael Kaufmann (d00p)",
"email": "d00p@froxlor.org",
"role": "Developer"
} }
], ],
"description": "A library for encoding and decoding internationalized domain names", "description": "A library for encoding and decoding internationalized domain names",
@@ -52,20 +57,20 @@
"idna", "idna",
"php" "php"
], ],
"time": "2019-03-04T17:07:46+00:00" "time": "2019-12-31T12:16:30+00:00"
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "1.25.1", "version": "1.25.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" "reference": "fa82921994db851a8becaf3787a9e73c5976b6f1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fa82921994db851a8becaf3787a9e73c5976b6f1",
"reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", "reference": "fa82921994db851a8becaf3787a9e73c5976b6f1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -130,20 +135,20 @@
"logging", "logging",
"psr-3" "psr-3"
], ],
"time": "2019-09-06T13:49:17+00:00" "time": "2019-12-20T14:15:16+00:00"
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.1.1", "version": "v6.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "26bd96350b0b2fcbf0ef4e6f0f9cf3528302a9d8" "reference": "c5e61d0729507049cec9673aa1a679f9adefd683"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/26bd96350b0b2fcbf0ef4e6f0f9cf3528302a9d8", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c5e61d0729507049cec9673aa1a679f9adefd683",
"reference": "26bd96350b0b2fcbf0ef4e6f0f9cf3528302a9d8", "reference": "c5e61d0729507049cec9673aa1a679f9adefd683",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -152,13 +157,9 @@
"php": ">=5.5.0" "php": ">=5.5.0"
}, },
"require-dev": { "require-dev": {
"doctrine/annotations": "1.2.*", "doctrine/annotations": "^1.2",
"friendsofphp/php-cs-fixer": "^2.2", "friendsofphp/php-cs-fixer": "^2.2",
"phpdocumentor/phpdocumentor": "2.*", "phpunit/phpunit": "^4.8 || ^5.7"
"phpunit/phpunit": "^4.8 || ^5.7",
"zendframework/zend-eventmanager": "3.0.*",
"zendframework/zend-i18n": "2.7.3",
"zendframework/zend-serializer": "2.7.*"
}, },
"suggest": { "suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset", "ext-mbstring": "Needed to send email in multibyte encoding charset",
@@ -196,7 +197,7 @@
} }
], ],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2019-09-27T21:33:43+00:00" "time": "2019-12-10T11:17:38+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",
@@ -299,17 +300,61 @@
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "doctrine/instantiator", "name": "composer/xdebug-handler",
"version": "1.2.0", "version": "1.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/instantiator.git", "url": "https://github.com/composer/xdebug-handler.git",
"reference": "a2c590166b2133a4633738648b6b064edae0814a" "reference": "cbe23383749496fe0f373345208b79568e4bc248"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248",
"reference": "a2c590166b2133a4633738648b6b064edae0814a", "reference": "cbe23383749496fe0f373345208b79568e4bc248",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0",
"psr/log": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
},
"type": "library",
"autoload": {
"psr-4": {
"Composer\\XdebugHandler\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "John Stevenson",
"email": "john-stevenson@blueyonder.co.uk"
}
],
"description": "Restarts a process without Xdebug.",
"keywords": [
"Xdebug",
"performance"
],
"time": "2019-11-06T16:40:04+00:00"
},
{
"name": "doctrine/instantiator",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
"reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -352,20 +397,20 @@
"constructor", "constructor",
"instantiate" "instantiate"
], ],
"time": "2019-03-17T17:37:11+00:00" "time": "2019-10-21T16:45:58+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.9.3", "version": "1.9.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7",
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -400,20 +445,20 @@
"object", "object",
"object graph" "object graph"
], ],
"time": "2019-08-09T12:45:53+00:00" "time": "2019-12-15T19:12:40+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v4.2.5", "version": "v4.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2" "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/b76bbc3c51f22c570648de48e8c2d941ed5e2cf2", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2", "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -421,7 +466,7 @@
"php": ">=7.0" "php": ">=7.0"
}, },
"require-dev": { "require-dev": {
"ircmaxell/php-yacc": "0.0.4", "ircmaxell/php-yacc": "0.0.5",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
}, },
"bin": [ "bin": [
@@ -430,7 +475,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.2-dev" "dev-master": "4.3-dev"
} }
}, },
"autoload": { "autoload": {
@@ -452,36 +497,43 @@
"parser", "parser",
"php" "php"
], ],
"time": "2019-10-25T18:33:07+00:00" "time": "2019-11-08T13:50:10+00:00"
}, },
{ {
"name": "pdepend/pdepend", "name": "pdepend/pdepend",
"version": "2.5.2", "version": "2.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pdepend/pdepend.git", "url": "https://github.com/pdepend/pdepend.git",
"reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239" "reference": "395b0f356bc0881ef88864bffb4ba1423ca0d111"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", "url": "https://api.github.com/repos/pdepend/pdepend/zipball/395b0f356bc0881ef88864bffb4ba1423ca0d111",
"reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", "reference": "395b0f356bc0881ef88864bffb4ba1423ca0d111",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.7", "php": ">=5.3.7",
"symfony/config": "^2.3.0|^3|^4", "symfony/config": "^2.3.0|^3|^4|^5",
"symfony/dependency-injection": "^2.3.0|^3|^4", "symfony/dependency-injection": "^2.3.0|^3|^4|^5",
"symfony/filesystem": "^2.3.0|^3|^4" "symfony/filesystem": "^2.3.0|^3|^4|^5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8|^5.7", "easy-doc/easy-doc": "0.0.0 || ^1.2.3",
"gregwar/rst": "^1.0",
"phpunit/phpunit": "^4.8.35|^5.7",
"squizlabs/php_codesniffer": "^2.0.0" "squizlabs/php_codesniffer": "^2.0.0"
}, },
"bin": [ "bin": [
"src/bin/pdepend" "src/bin/pdepend"
], ],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"PDepend\\": "src/main/php/PDepend" "PDepend\\": "src/main/php/PDepend"
@@ -492,7 +544,7 @@
"BSD-3-Clause" "BSD-3-Clause"
], ],
"description": "Official version of pdepend to be handled with Composer", "description": "Official version of pdepend to be handled with Composer",
"time": "2017-12-13T13:21:38+00:00" "time": "2019-12-21T16:33:56+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@@ -598,16 +650,16 @@
}, },
{ {
"name": "phpcompatibility/php-compatibility", "name": "phpcompatibility/php-compatibility",
"version": "9.3.2", "version": "9.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
"reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58" "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/bfca2be3992f40e92206e5a7ebe5eaee37280b58", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
"reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -652,7 +704,7 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2019-10-16T21:24:24+00:00" "time": "2019-12-27T09:44:58+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
@@ -708,16 +760,16 @@
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "4.3.2", "version": "4.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -729,6 +781,7 @@
"require-dev": { "require-dev": {
"doctrine/instantiator": "^1.0.5", "doctrine/instantiator": "^1.0.5",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"phpdocumentor/type-resolver": "0.4.*",
"phpunit/phpunit": "^6.4" "phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
@@ -755,7 +808,7 @@
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2019-09-12T14:27:41+00:00" "time": "2019-12-28T18:55:12+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
@@ -855,24 +908,26 @@
}, },
{ {
"name": "phpmd/phpmd", "name": "phpmd/phpmd",
"version": "2.7.0", "version": "2.8.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpmd/phpmd.git", "url": "https://github.com/phpmd/phpmd.git",
"reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c" "reference": "5664b95d484797582f5af9536238deb9ecde58a1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpmd/phpmd/zipball/a05a999c644f4bc9a204846017db7bb7809fbe4c", "url": "https://api.github.com/repos/phpmd/phpmd/zipball/5664b95d484797582f5af9536238deb9ecde58a1",
"reference": "a05a999c644f4bc9a204846017db7bb7809fbe4c", "reference": "5664b95d484797582f5af9536238deb9ecde58a1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"composer/xdebug-handler": "^1.0",
"ext-xml": "*", "ext-xml": "*",
"pdepend/pdepend": "^2.5", "pdepend/pdepend": "^2.6",
"php": ">=5.3.9" "php": ">=5.3.9"
}, },
"require-dev": { "require-dev": {
"easy-doc/easy-doc": "0.0.0 || ^1.3.2",
"gregwar/rst": "^1.0", "gregwar/rst": "^1.0",
"mikey179/vfsstream": "^1.6.4", "mikey179/vfsstream": "^1.6.4",
"phpunit/phpunit": "^4.8.36 || ^5.7.27", "phpunit/phpunit": "^4.8.36 || ^5.7.27",
@@ -919,37 +974,37 @@
"phpmd", "phpmd",
"pmd" "pmd"
], ],
"time": "2019-07-30T21:13:32+00:00" "time": "2019-12-27T11:09:06+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
"version": "1.9.0", "version": "1.10.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpspec/prophecy.git", "url": "https://github.com/phpspec/prophecy.git",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/instantiator": "^1.0.2", "doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0", "php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/comparator": "^1.2.3|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0" "sebastian/recursion-context": "^1.0|^2.0|^3.0"
}, },
"require-dev": { "require-dev": {
"phpspec/phpspec": "^2.5|^3.2", "phpspec/phpspec": "^2.5 || ^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.8.x-dev" "dev-master": "1.10.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -982,20 +1037,20 @@
"spy", "spy",
"stub" "stub"
], ],
"time": "2019-10-03T11:07:50+00:00" "time": "2019-12-22T21:05:45+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "7.0.8", "version": "7.0.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f" "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa0d179a13284c7420fc281fc32750e6cc7c9e2f", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf",
"reference": "aa0d179a13284c7420fc281fc32750e6cc7c9e2f", "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1045,7 +1100,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-09-17T06:24:36+00:00" "time": "2019-11-20T13:55:58+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@@ -1535,16 +1590,16 @@
}, },
{ {
"name": "sebastian/environment", "name": "sebastian/environment",
"version": "4.2.2", "version": "4.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/environment.git", "url": "https://github.com/sebastianbergmann/environment.git",
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
"reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1584,7 +1639,7 @@
"environment", "environment",
"hhvm" "hhvm"
], ],
"time": "2019-05-05T09:05:15+00:00" "time": "2019-11-20T08:46:58+00:00"
}, },
{ {
"name": "sebastian/exporter", "name": "sebastian/exporter",
@@ -2075,16 +2130,16 @@
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "3.5.2", "version": "3.5.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb",
"reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2122,36 +2177,36 @@
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2019-10-28T04:36:32+00:00" "time": "2019-12-04T04:46:47+00:00"
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "v4.3.6", "version": "v5.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/config.git", "url": "https://github.com/symfony/config.git",
"reference": "f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15" "reference": "7f930484966350906185ba0a604728f7898b7ba0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15", "url": "https://api.github.com/repos/symfony/config/zipball/7f930484966350906185ba0a604728f7898b7ba0",
"reference": "f4ee0ebb91b16ca1ac105aa39f9284f3cac19a15", "reference": "7f930484966350906185ba0a604728f7898b7ba0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.2.5",
"symfony/filesystem": "~3.4|~4.0", "symfony/filesystem": "^4.4|^5.0",
"symfony/polyfill-ctype": "~1.8" "symfony/polyfill-ctype": "~1.8"
}, },
"conflict": { "conflict": {
"symfony/finder": "<3.4" "symfony/finder": "<4.4"
}, },
"require-dev": { "require-dev": {
"symfony/dependency-injection": "~3.4|~4.0", "symfony/event-dispatcher": "^4.4|^5.0",
"symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "^4.4|^5.0",
"symfony/finder": "~3.4|~4.0", "symfony/messenger": "^4.4|^5.0",
"symfony/messenger": "~4.1", "symfony/service-contracts": "^1.1|^2",
"symfony/yaml": "~3.4|~4.0" "symfony/yaml": "^4.4|^5.0"
}, },
"suggest": { "suggest": {
"symfony/yaml": "To use the yaml reference dumper" "symfony/yaml": "To use the yaml reference dumper"
@@ -2159,7 +2214,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.3-dev" "dev-master": "5.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2186,31 +2241,32 @@
], ],
"description": "Symfony Config Component", "description": "Symfony Config Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-10-30T13:18:51+00:00" "time": "2019-12-18T13:50:31+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v4.3.6", "version": "v4.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78" "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/136c4bd62ea871d00843d1bc0316de4c4a84bb78", "url": "https://api.github.com/repos/symfony/console/zipball/82437719dab1e6bdd28726af14cb345c2ec816d0",
"reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78", "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.1.3",
"symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8", "symfony/polyfill-php73": "^1.8",
"symfony/service-contracts": "^1.1" "symfony/service-contracts": "^1.1|^2"
}, },
"conflict": { "conflict": {
"symfony/dependency-injection": "<3.4", "symfony/dependency-injection": "<3.4",
"symfony/event-dispatcher": "<4.3", "symfony/event-dispatcher": "<4.3|>=5",
"symfony/lock": "<4.4",
"symfony/process": "<3.3" "symfony/process": "<3.3"
}, },
"provide": { "provide": {
@@ -2218,12 +2274,12 @@
}, },
"require-dev": { "require-dev": {
"psr/log": "~1.0", "psr/log": "~1.0",
"symfony/config": "~3.4|~4.0", "symfony/config": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "~3.4|~4.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0",
"symfony/event-dispatcher": "^4.3", "symfony/event-dispatcher": "^4.3",
"symfony/lock": "~3.4|~4.0", "symfony/lock": "^4.4|^5.0",
"symfony/process": "~3.4|~4.0", "symfony/process": "^3.4|^4.0|^5.0",
"symfony/var-dumper": "^4.3" "symfony/var-dumper": "^4.3|^5.0"
}, },
"suggest": { "suggest": {
"psr/log": "For using the console logger", "psr/log": "For using the console logger",
@@ -2234,7 +2290,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.3-dev" "dev-master": "4.4-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2261,41 +2317,41 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-10-30T12:58:49+00:00" "time": "2019-12-17T10:32:23+00:00"
}, },
{ {
"name": "symfony/dependency-injection", "name": "symfony/dependency-injection",
"version": "v4.3.6", "version": "v5.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/dependency-injection.git", "url": "https://github.com/symfony/dependency-injection.git",
"reference": "fc036941dfafa037a7485714b62593c7eaf68edd" "reference": "f9dbfbf487d08f60b1c83220edcd16559d1e40a2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/fc036941dfafa037a7485714b62593c7eaf68edd", "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f9dbfbf487d08f60b1c83220edcd16559d1e40a2",
"reference": "fc036941dfafa037a7485714b62593c7eaf68edd", "reference": "f9dbfbf487d08f60b1c83220edcd16559d1e40a2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.2.5",
"psr/container": "^1.0", "psr/container": "^1.0",
"symfony/service-contracts": "^1.1.6" "symfony/service-contracts": "^1.1.6|^2"
}, },
"conflict": { "conflict": {
"symfony/config": "<4.3", "symfony/config": "<5.0",
"symfony/finder": "<3.4", "symfony/finder": "<4.4",
"symfony/proxy-manager-bridge": "<3.4", "symfony/proxy-manager-bridge": "<4.4",
"symfony/yaml": "<3.4" "symfony/yaml": "<4.4"
}, },
"provide": { "provide": {
"psr/container-implementation": "1.0", "psr/container-implementation": "1.0",
"symfony/service-implementation": "1.0" "symfony/service-implementation": "1.0"
}, },
"require-dev": { "require-dev": {
"symfony/config": "^4.3", "symfony/config": "^5.0",
"symfony/expression-language": "~3.4|~4.0", "symfony/expression-language": "^4.4|^5.0",
"symfony/yaml": "~3.4|~4.0" "symfony/yaml": "^4.4|^5.0"
}, },
"suggest": { "suggest": {
"symfony/config": "", "symfony/config": "",
@@ -2307,7 +2363,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.3-dev" "dev-master": "5.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2334,30 +2390,30 @@
], ],
"description": "Symfony DependencyInjection Component", "description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-10-28T17:07:32+00:00" "time": "2019-12-19T16:01:11+00:00"
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v4.3.6", "version": "v5.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" "reference": "1d71f670bc5a07b9ccc97dc44f932177a322d4e6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", "url": "https://api.github.com/repos/symfony/filesystem/zipball/1d71f670bc5a07b9ccc97dc44f932177a322d4e6",
"reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", "reference": "1d71f670bc5a07b9ccc97dc44f932177a322d4e6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.2.5",
"symfony/polyfill-ctype": "~1.8" "symfony/polyfill-ctype": "~1.8"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.3-dev" "dev-master": "5.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2384,20 +2440,20 @@
], ],
"description": "Symfony Filesystem Component", "description": "Symfony Filesystem Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-08-20T14:07:54+00:00" "time": "2019-11-26T23:25:11+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v4.3.6", "version": "v4.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" "reference": "ce8743441da64c41e2a667b8eb66070444ed911e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e",
"reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", "reference": "ce8743441da64c41e2a667b8eb66070444ed911e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2406,7 +2462,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.3-dev" "dev-master": "4.4-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2433,20 +2489,20 @@
], ],
"description": "Symfony Finder Component", "description": "Symfony Finder Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2019-10-30T12:53:54+00:00" "time": "2019-11-17T21:56:56+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.12.0", "version": "v1.13.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4" "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4", "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2458,7 +2514,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.12-dev" "dev-master": "1.13-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2491,20 +2547,20 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2019-08-06T08:03:45+00:00" "time": "2019-11-27T13:56:44+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.12.0", "version": "v1.13.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f",
"reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2516,7 +2572,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.12-dev" "dev-master": "1.13-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2550,20 +2606,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2019-08-06T08:03:45+00:00" "time": "2019-11-27T14:18:11+00:00"
}, },
{ {
"name": "symfony/polyfill-php73", "name": "symfony/polyfill-php73",
"version": "v1.12.0", "version": "v1.13.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php73.git", "url": "https://github.com/symfony/polyfill-php73.git",
"reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f",
"reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2572,7 +2628,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.12-dev" "dev-master": "1.13-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2608,24 +2664,24 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2019-08-06T08:03:45+00:00" "time": "2019-11-27T16:25:15+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v1.1.7", "version": "v2.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" "reference": "144c5e51266b281231e947b51223ba14acf1a749"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749",
"reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", "reference": "144c5e51266b281231e947b51223ba14acf1a749",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1.3", "php": "^7.2.5",
"psr/container": "^1.0" "psr/container": "^1.0"
}, },
"suggest": { "suggest": {
@@ -2634,7 +2690,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.1-dev" "dev-master": "2.0-dev"
} }
}, },
"autoload": { "autoload": {
@@ -2666,7 +2722,7 @@
"interoperability", "interoperability",
"standards" "standards"
], ],
"time": "2019-09-17T11:12:18+00:00" "time": "2019-11-18T17:27:11+00:00"
}, },
{ {
"name": "theseer/directoryscanner", "name": "theseer/directoryscanner",
@@ -2888,31 +2944,29 @@
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.5.0", "version": "1.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozart/assert.git",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" "reference": "573381c0a64f155a0d9a23f4b0c797194805b925"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "reference": "573381c0a64f155a0d9a23f4b0c797194805b925",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0", "php": "^5.3.3 || ^7.0",
"symfony/polyfill-ctype": "^1.8" "symfony/polyfill-ctype": "^1.8"
}, },
"conflict": {
"vimeo/psalm": "<3.6.0"
},
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13" "phpunit/phpunit": "^4.8.36 || ^7.5.13"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Webmozart\\Assert\\": "src/" "Webmozart\\Assert\\": "src/"
@@ -2934,7 +2988,7 @@
"check", "check",
"validate" "validate"
], ],
"time": "2019-08-24T08:43:50+00:00" "time": "2019-11-24T13:36:37+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -42,7 +42,8 @@ if ($page == 'overview') {
if ($action == '') { if ($action == '') {
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains"); $log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
$fields = array( $fields = array(
'd.domain' => $lng['domains']['domainname'] 'd.domain_ace' => $lng['domains']['domainname'],
'd.aliasdomain' => $lng['domains']['aliasdomain']
); );
try { try {
// get total count // get total count
@@ -71,19 +72,24 @@ if ($page == 'overview') {
if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') { if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {
$parentdomains_count ++; $parentdomains_count ++;
} }
$domain_array[$row['parentdomainid']][] = $row; $domain_array[$row['parentdomainname']][] = $row;
} }
if (isset($domain_array[0])) { foreach ($domain_array as $parentdomain => $sdomains) {
foreach ($domain_array[0] as $pdomain) { // PARENTDOMAIN
// PARENTDOMAIN if (Settings::Get('system.awstats_enabled') == '1') {
$row = \Froxlor\PhpHelper::htmlentitiesArray($pdomain); $statsapp = 'awstats';
if (Settings::Get('system.awstats_enabled') == '1') { } else {
$statsapp = 'awstats'; $statsapp = 'webalizer';
} else { }
$statsapp = 'webalizer'; $row = [
} 'domain' => $idna_convert->decode($parentdomain)
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";"); ];
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
foreach ($sdomains as $domain) {
$row = \Froxlor\PhpHelper::htmlentitiesArray($domain);
// show docroot nicely // show docroot nicely
if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) { if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) {
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot'])); $row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot']));
@@ -94,23 +100,6 @@ if ($page == 'overview') {
$show_ssledit = true; $show_ssledit = true;
} }
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";"); eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
// every domain below the parentdomain
if (isset($domain_array[$pdomain['id']])) {
$mydomains = $domain_array[$pdomain['id']];
foreach ($mydomains as $row) {
// show docroot nicely
if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) {
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot']));
}
// get ssl-ips if activated
$show_ssledit = false;
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
$show_ssledit = true;
}
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
}
}
} }
} }

View File

@@ -19,7 +19,6 @@
define('AREA', 'customer'); define('AREA', 'customer');
require './lib/init.php'; require './lib/init.php';
use Froxlor\Api\Commands\SubDomains;
use Froxlor\Database\Database; use Froxlor\Database\Database;
use Froxlor\Settings; use Froxlor\Settings;
use Froxlor\Api\Commands\Emails as Emails; use Froxlor\Api\Commands\Emails as Emails;
@@ -44,7 +43,7 @@ if ($page == 'overview') {
if ($action == '') { if ($action == '') {
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails"); $log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
$fields = array( $fields = array(
'd.domain' => $lng['domains']['domainname'], 'd.domain_ace' => $lng['domains']['domainname'],
'm.email_full' => $lng['emails']['emailaddress'], 'm.email_full' => $lng['emails']['emailaddress'],
'm.destination' => $lng['emails']['forwarders'] 'm.destination' => $lng['emails']['forwarders']
); );
@@ -76,7 +75,7 @@ if ($page == 'overview') {
$emails[$row['domain']][$row['email_full']] = $row; $emails[$row['domain']][$row['email_full']] = $row;
} }
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') { if ($paging->sortfield == 'd.domain_ace' && $paging->sortorder == 'desc') {
krsort($emails); krsort($emails);
} else { } else {
ksort($emails); ksort($emails);
@@ -129,16 +128,15 @@ if ($page == 'overview') {
} }
} }
$json_result = SubDomains::getLocal($userinfo, [ $result_stmt = Database::prepare("
'sql_search' => [ SELECT COUNT(`id`) as emaildomains
'd.isemaildomain' => [ FROM `" . TABLE_PANEL_DOMAINS . "`
'value' => 1, WHERE `customerid`= :cid AND `isemaildomain` = '1'
'op' => '=' ");
] $result = Database::pexecute_first($result_stmt, array(
] "cid" => $userinfo['customerid']
])->listing(); ));
$result = json_decode($json_result, true)['data']; $emaildomains_count = $result['emaildomains'];
$emaildomains_count = $result['count'];
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";");
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
@@ -196,7 +194,7 @@ if ($page == 'overview') {
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` $result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
WHERE `customerid`= :cid WHERE `customerid`= :cid
AND `isemaildomain`='1' AND `isemaildomain`='1'
ORDER BY `domain` ASC"); ORDER BY `domain_ace` ASC");
Database::pexecute($result_stmt, array( Database::pexecute($result_stmt, array(
"cid" => $userinfo['customerid'] "cid" => $userinfo['customerid']
)); ));

View File

@@ -112,11 +112,14 @@ if (! is_null($month) && ! is_null($year)) {
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";"); eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
} else { } else {
$result_stmt = Database::prepare("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail $result_stmt = Database::prepare("
SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
FROM `" . TABLE_PANEL_TRAFFIC . "` FROM `" . TABLE_PANEL_TRAFFIC . "`
WHERE `customerid` = :customerid WHERE `customerid` = :customerid
GROUP BY `year` DESC, `month` DESC GROUP BY `year`, `month`
LIMIT 12"); ORDER BY `year` DESC, `month` DESC
LIMIT 12
");
Database::pexecute($result_stmt, array( Database::pexecute($result_stmt, array(
"customerid" => $userinfo['customerid'] "customerid" => $userinfo['customerid']
)); ));

View File

@@ -393,7 +393,7 @@ if ($action == 'forgotpwd') {
if (isset($_POST['send']) && $_POST['send'] == 'send') { if (isset($_POST['send']) && $_POST['send'] == 'send') {
$loginname = \Froxlor\Validate\Validate::validate($_POST['loginname'], 'loginname'); $loginname = \Froxlor\Validate\Validate::validate($_POST['loginname'], 'loginname');
$email = \Froxlor\Validate\Validate::validateEmail($_POST['loginemail'], 'email'); $email = \Froxlor\Validate\Validate::validateEmail($_POST['loginemail'], 'email');
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "` $result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `customernumber`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `loginname`= :loginname WHERE `loginname`= :loginname
AND `email`= :email"); AND `email`= :email");
Database::pexecute($result_stmt, array( Database::pexecute($result_stmt, array(
@@ -481,6 +481,10 @@ if ($action == 'forgotpwd') {
$replace_arr = array( $replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($user), 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($user),
'NAME' => $user['name'],
'FIRSTNAME' => $user['firstname'] ?? "",
'COMPANY' => $user['company'] ?? "",
'CUSTOMER_NO' => $user['customernumber'] ?? 0,
'USERNAME' => $loginname, 'USERNAME' => $loginname,
'LINK' => $activationlink 'LINK' => $activationlink
); );
@@ -598,21 +602,18 @@ if ($action == 'resetpwd') {
)); ));
if ($result !== false) { if ($result !== false) {
if ($result['admin'] == 1) { try {
$new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password'); $new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], true);
$new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm'); $new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], true);
} else { } catch (Exception $e) {
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password'); $message = $e->getMessage();
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
} }
if ($new_password == '') { if (empty($message) && (empty($new_password) || $new_password != $new_password_confirm)) {
$message = $new_password; $message = $lng['error']['newpasswordconfirmerror'];
} elseif ($new_password_confirm == '') { }
$message = $new_password_confirm;
} elseif ($new_password != $new_password_confirm) { if (empty($message)) {
$message = $new_password . " != " . $new_password_confirm;
} else {
// Update user password // Update user password
if ($result['admin'] == 1) { if ($result['admin'] == 1) {
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "` $stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`

View File

@@ -84,7 +84,7 @@ CREATE TABLE `panel_activation` (
`creation` int(11) unsigned NOT NULL default '0', `creation` int(11) unsigned NOT NULL default '0',
`activationcode` varchar(50) default NULL, `activationcode` varchar(50) default NULL,
PRIMARY KEY (id) PRIMARY KEY (id)
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci; ) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `panel_admins`; DROP TABLE IF EXISTS `panel_admins`;
@@ -224,6 +224,7 @@ DROP TABLE IF EXISTS `panel_domains`;
CREATE TABLE `panel_domains` ( CREATE TABLE `panel_domains` (
`id` int(11) unsigned NOT NULL auto_increment, `id` int(11) unsigned NOT NULL auto_increment,
`domain` varchar(255) NOT NULL default '', `domain` varchar(255) NOT NULL default '',
`domain_ace` varchar(255) NOT NULL default '',
`adminid` int(11) unsigned NOT NULL default '0', `adminid` int(11) unsigned NOT NULL default '0',
`customerid` int(11) unsigned NOT NULL default '0', `customerid` int(11) unsigned NOT NULL default '0',
`aliasdomain` int(11) unsigned NULL, `aliasdomain` int(11) unsigned NULL,
@@ -271,6 +272,9 @@ CREATE TABLE `panel_domains` (
`ssl_protocols` text, `ssl_protocols` text,
`ssl_cipher_list` text, `ssl_cipher_list` text,
`tlsv13_cipher_list` text, `tlsv13_cipher_list` text,
`ssl_enabled` tinyint(1) DEFAULT '1',
`ssl_honorcipherorder` tinyint(1) DEFAULT '0',
`ssl_sessiontickets` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `customerid` (`customerid`), KEY `customerid` (`customerid`),
KEY `parentdomain` (`parentdomainid`), KEY `parentdomain` (`parentdomainid`),
@@ -569,6 +573,7 @@ opcache.interned_strings_buffer'),
('system', 'stdsubdomain', ''), ('system', 'stdsubdomain', ''),
('system', 'awstats_path', '/usr/bin/'), ('system', 'awstats_path', '/usr/bin/'),
('system', 'awstats_conf', '/etc/awstats/'), ('system', 'awstats_conf', '/etc/awstats/'),
('system', 'awstats_logformat', '1'),
('system', 'defaultttl', '604800'), ('system', 'defaultttl', '604800'),
('system', 'mod_fcgid_defaultini', '1'), ('system', 'mod_fcgid_defaultini', '1'),
('system', 'ftpserver', 'proftpd'), ('system', 'ftpserver', 'proftpd'),
@@ -652,6 +657,9 @@ opcache.interned_strings_buffer'),
('system', 'disable_le_selfcheck', '0'), ('system', 'disable_le_selfcheck', '0'),
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'), ('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
('system', 'tlsv13_cipher_list', ''), ('system', 'tlsv13_cipher_list', ''),
('system', 'honorcipherorder', '0'),
('system', 'sessiontickets', '1'),
('system', 'sessionticketsenabled', '1'),
('system', 'logfiles_format', ''), ('system', 'logfiles_format', ''),
('system', 'logfiles_type', '1'), ('system', 'logfiles_type', '1'),
('system', 'logfiles_piped', '0'), ('system', 'logfiles_piped', '0'),
@@ -660,6 +668,8 @@ opcache.interned_strings_buffer'),
('system', 'errorlog_level', 'warn'), ('system', 'errorlog_level', 'warn'),
('system', 'leecc', '0'), ('system', 'leecc', '0'),
('system', 'froxloraliases', ''), ('system', 'froxloraliases', ''),
('system', 'apply_specialsettings_default', '1'),
('system', 'apply_phpconfigs_default', '1'),
('api', 'enabled', '0'), ('api', 'enabled', '0'),
('2fa', 'enabled', '1'), ('2fa', 'enabled', '1'),
('panel', 'decimal_places', '4'), ('panel', 'decimal_places', '4'),
@@ -694,8 +704,8 @@ opcache.interned_strings_buffer'),
('panel', 'password_special_char', '!?<>§$%+#=@'), ('panel', 'password_special_char', '!?<>§$%+#=@'),
('panel', 'customer_hide_options', ''), ('panel', 'customer_hide_options', ''),
('panel', 'is_configured', '0'), ('panel', 'is_configured', '0'),
('panel', 'version', '0.10.6'), ('panel', 'version', '0.10.15'),
('panel', 'db_version', '201911130'); ('panel', 'db_version', '202002290');
DROP TABLE IF EXISTS `panel_tasks`; DROP TABLE IF EXISTS `panel_tasks`;
@@ -833,14 +843,15 @@ CREATE TABLE `panel_fpmdaemons` (
`description` varchar(50) NOT NULL, `description` varchar(50) NOT NULL,
`reload_cmd` varchar(255) NOT NULL, `reload_cmd` varchar(255) NOT NULL,
`config_dir` varchar(255) NOT NULL, `config_dir` varchar(255) NOT NULL,
`pm` varchar(15) NOT NULL DEFAULT 'static', `pm` varchar(15) NOT NULL DEFAULT 'dynamic',
`max_children` int(4) NOT NULL DEFAULT '1', `max_children` int(4) NOT NULL DEFAULT '5',
`start_servers` int(4) NOT NULL DEFAULT '20', `start_servers` int(4) NOT NULL DEFAULT '2',
`min_spare_servers` int(4) NOT NULL DEFAULT '5', `min_spare_servers` int(4) NOT NULL DEFAULT '1',
`max_spare_servers` int(4) NOT NULL DEFAULT '35', `max_spare_servers` int(4) NOT NULL DEFAULT '3',
`max_requests` int(4) NOT NULL DEFAULT '0', `max_requests` int(4) NOT NULL DEFAULT '0',
`idle_timeout` int(4) NOT NULL DEFAULT '30', `idle_timeout` int(4) NOT NULL DEFAULT '10',
`limit_extensions` varchar(255) NOT NULL default '.php', `limit_extensions` varchar(255) NOT NULL default '.php',
`custom_config` text,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `reload` (`reload_cmd`), UNIQUE KEY `reload` (`reload_cmd`),
UNIQUE KEY `config` (`config_dir`) UNIQUE KEY `config` (`config_dir`)
@@ -849,7 +860,7 @@ CREATE TABLE `panel_fpmdaemons` (
INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES
(1, 'System default', 'service php7.0-fpm restart', '/etc/php/7.0/fpm/pool.d/'); (1, 'System default', 'service php7.3-fpm restart', '/etc/php/7.3/fpm/pool.d/');
@@ -869,13 +880,13 @@ CREATE TABLE `panel_phpconfigs` (
`fpmsettingid` int(11) NOT NULL DEFAULT '1', `fpmsettingid` int(11) NOT NULL DEFAULT '1',
`pass_authorizationheader` tinyint(1) NOT NULL default '0', `pass_authorizationheader` tinyint(1) NOT NULL default '0',
`override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0', `override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0',
`pm` varchar(15) NOT NULL DEFAULT 'static', `pm` varchar(15) NOT NULL DEFAULT 'dynamic',
`max_children` int(4) NOT NULL DEFAULT '1', `max_children` int(4) NOT NULL DEFAULT '5',
`start_servers` int(4) NOT NULL DEFAULT '20', `start_servers` int(4) NOT NULL DEFAULT '2',
`min_spare_servers` int(4) NOT NULL DEFAULT '5', `min_spare_servers` int(4) NOT NULL DEFAULT '1',
`max_spare_servers` int(4) NOT NULL DEFAULT '35', `max_spare_servers` int(4) NOT NULL DEFAULT '3',
`max_requests` int(4) NOT NULL DEFAULT '0', `max_requests` int(4) NOT NULL DEFAULT '0',
`idle_timeout` int(4) NOT NULL DEFAULT '30', `idle_timeout` int(4) NOT NULL DEFAULT '10',
`limit_extensions` varchar(255) NOT NULL default '.php', `limit_extensions` varchar(255) NOT NULL default '.php',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `fpmsettingid` (`fpmsettingid`) KEY `fpmsettingid` (`fpmsettingid`)
@@ -884,8 +895,8 @@ CREATE TABLE `panel_phpconfigs` (
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'), (1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = Off\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 30\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = ""\r\n'); (2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = On\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 60\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = ""\r\n');
DROP TABLE IF EXISTS `cronjobs_run`; DROP TABLE IF EXISTS `cronjobs_run`;

View File

@@ -333,20 +333,26 @@ class FroxlorInstall
// test if we can store the userdata.inc.php in ../lib // test if we can store the userdata.inc.php in ../lib
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php'; $userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
if ($fp = @fopen($userdata_file, 'w')) { if (@touch($userdata_file) && @chmod($userdata_file, 0600) && @is_writable($userdata_file)) {
$result = @fputs($fp, $userdata, strlen($userdata)); $fp = @fopen($userdata_file, 'w');
@fputs($fp, $userdata, strlen($userdata));
@fclose($fp); @fclose($fp);
$content .= $this->_status_message('green', 'OK'); $content .= $this->_status_message('green', 'OK');
chmod($userdata_file, 0440);
} elseif ($fp = @fopen('/tmp/userdata.inc.php', 'w')) {
$result = @fputs($fp, $userdata, strlen($userdata));
@fclose($fp);
$content .= $this->_status_message('orange', $this->_lng['install']['creating_configfile_temp']);
chmod('/tmp/userdata.inc.php', 0440);
} else { } else {
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']); @unlink($userdata_file);
$escpduserdata = nl2br(htmlspecialchars($userdata)); // try creating it in a temporary file
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";"); $temp_file = @tempnam(sys_get_temp_dir(), 'fx');
if ($temp_file) {
chmod($temp_file, 0600);
$fp = @fopen($temp_file, 'w');
@fputs($fp, $userdata, strlen($userdata));
@fclose($fp);
$content .= $this->_status_message('orange', sprintf($this->_lng['install']['creating_configfile_temp'], $temp_file));
} else {
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']);
$escpduserdata = nl2br(htmlspecialchars($userdata));
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
}
} }
return $content; return $content;
@@ -563,7 +569,7 @@ class FroxlorInstall
for ($i = 0; $i < sizeof($sql_query); $i ++) { for ($i = 0; $i < sizeof($sql_query); $i ++) {
if (trim($sql_query[$i]) != '') { if (trim($sql_query[$i]) != '') {
try { try {
$result = $db->query($sql_query[$i]); $db->query($sql_query[$i]);
} catch (\PDOException $e) { } catch (\PDOException $e) {
$content .= $this->_status_message('red', $e->getMessage()); $content .= $this->_status_message('red', $e->getMessage());
$fatal_fail = true; $fatal_fail = true;
@@ -730,7 +736,7 @@ class FroxlorInstall
} }
if ($do_backup) { if ($do_backup) {
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename; $command = $mysql_dump . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --password='" . escapeshellarg($this->_data['mysql_root_pass']) . "' --result-file=" . $filename;
$output = exec($command); $output = exec($command);
if (stristr($output, "error")) { if (stristr($output, "error")) {
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']); $content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);

View File

@@ -86,7 +86,7 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
$lng['install']['creating_entries'] = 'Inserting new values...'; $lng['install']['creating_entries'] = 'Inserting new values...';
$lng['install']['adding_admin_user'] = 'Creating admin-account...'; $lng['install']['adding_admin_user'] = 'Creating admin-account...';
$lng['install']['creating_configfile'] = 'Creating configfile...'; $lng['install']['creating_configfile'] = 'Creating configfile...';
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to ' . dirname(dirname(__DIR__)) . '/lib/.'; $lng['install']['creating_configfile_temp'] = 'File was saved in %s, please move to ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
$lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:'; $lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';

View File

@@ -76,7 +76,7 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...'; $lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...'; $lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...'; $lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/.'; $lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans %s, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
$lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:'; $lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';

View File

@@ -86,7 +86,7 @@ $lng['install']['changing_data'] = 'Einstellungen anpassen...';
$lng['install']['creating_entries'] = 'Trage neue Werte ein...'; $lng['install']['creating_entries'] = 'Trage neue Werte ein...';
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...'; $lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...'; $lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/ verschieben.'; $lng['install']['creating_configfile_temp'] = 'Datei wurde in %s gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php verschieben.';
$lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:'; $lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.'; $lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';

View File

@@ -482,3 +482,123 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.10.5')) {
showUpdateStep("Updating from 0.10.5 to 0.10.6", false); showUpdateStep("Updating from 0.10.5 to 0.10.6", false);
\Froxlor\Froxlor::updateToVersion('0.10.6'); \Froxlor\Froxlor::updateToVersion('0.10.6');
} }
if (\Froxlor\Froxlor::isDatabaseVersion('201911130')) {
showUpdateStep("Adding new settings for domain edit form default values");
Settings::AddNew("system.apply_specialsettings_default", '1');
Settings::AddNew("system.apply_phpconfigs_default", '1');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('201911220');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.6')) {
showUpdateStep("Updating from 0.10.6 to 0.10.7", false);
\Froxlor\Froxlor::updateToVersion('0.10.7');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.7')) {
showUpdateStep("Updating from 0.10.7 to 0.10.8", false);
\Froxlor\Froxlor::updateToVersion('0.10.8');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.8')) {
showUpdateStep("Updating from 0.10.8 to 0.10.9", false);
\Froxlor\Froxlor::updateToVersion('0.10.9');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201911220')) {
showUpdateStep("Adding enhanced SSL control over domains");
// customer domains
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_enabled` tinyint(1) DEFAULT '1';");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_honorcipherorder` tinyint(1) DEFAULT '0' AFTER `ssl_enabled`;");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_sessiontickets` tinyint(1) DEFAULT '1' AFTER `ssl_honorcipherorder`;");
// as setting for froxlor vhost
Settings::AddNew("system.honorcipherorder", '0');
Settings::AddNew("system.sessiontickets", '1');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('201912100');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.9')) {
showUpdateStep("Updating from 0.10.9 to 0.10.10", false);
\Froxlor\Froxlor::updateToVersion('0.10.10');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201912100')) {
showUpdateStep("Adding option to disable SSL sessiontickets for older systems");
Settings::AddNew("system.sessionticketsenabled", '1');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('201912310');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201912310')) {
showUpdateStep("Adding custom phpfpm pool configuration field");
Database::query("ALTER TABLE `" . TABLE_PANEL_FPMDAEMONS . "` ADD `custom_config` text AFTER `limit_extensions`;");
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('201912311');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.10')) {
showUpdateStep("Updating from 0.10.10 to 0.10.11", false);
\Froxlor\Froxlor::updateToVersion('0.10.11');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201912311')) {
showUpdateStep("Migrate logfiles_format setting");
$current_format = Settings::Set('system.logfiles_format');
if (! empty($current_format)) {
Settings::Set('system.logfiles_format', '"' . Settings::Get('system.logfiles_format') . '"');
lastStepStatus(0);
} else {
lastStepStatus(0, 'not needed');
}
\Froxlor\Froxlor::updateToDbVersion('201912312');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201912312')) {
showUpdateStep("Adding option change awstats LogFormat");
Settings::AddNew("system.awstats_logformat", '1');
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('201912313');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.11')) {
showUpdateStep("Updating from 0.10.11 to 0.10.12", false);
\Froxlor\Froxlor::updateToVersion('0.10.12');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.12')) {
showUpdateStep("Updating from 0.10.12 to 0.10.13", false);
\Froxlor\Froxlor::updateToVersion('0.10.13');
}
if (\Froxlor\Froxlor::isDatabaseVersion('201912313')) {
showUpdateStep("Adding new field to domains table");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `domain_ace` varchar(255) NOT NULL default '' AFTER `domain`;");
lastStepStatus(0);
showUpdateStep("Updating domain entries");
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `domain_ace` = :ace WHERE `id` = :domainid");
$sel_stmt = Database::prepare("SELECT id, domain FROM `" . TABLE_PANEL_DOMAINS . "` ORDER BY id ASC");
Database::pexecute($sel_stmt);
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
while ($domain = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
Database::pexecute($upd_stmt, [
'ace' => $idna_convert->decode($domain['domain']),
'domainid' => $domain['id']
]);
}
lastStepStatus(0);
\Froxlor\Froxlor::updateToDbVersion('202002290');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.13')) {
showUpdateStep("Updating from 0.10.13 to 0.10.14", false);
\Froxlor\Froxlor::updateToVersion('0.10.14');
}
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.14')) {
showUpdateStep("Updating from 0.10.14 to 0.10.15", false);
\Froxlor\Froxlor::updateToVersion('0.10.15');
}

View File

@@ -331,15 +331,30 @@ abstract class ApiCommand extends ApiParameter
* *
* @param array $sql_orderby * @param array $sql_orderby
* optional array with index = fieldname and value = ASC|DESC * optional array with index = fieldname and value = ASC|DESC
* @param boolean $append
* optional append to ORDER BY clause rather then create new one, default false [internal]
* *
* @return string * @return string
*/ */
protected function getOrderBy() protected function getOrderBy($append = false)
{ {
$orderby = $this->getParam('sql_orderby', true, array()); $orderby = $this->getParam('sql_orderby', true, array());
$order = ""; $order = "";
if (! empty($orderby)) { if (! empty($orderby)) {
$order .= " ORDER BY "; if ($append) {
$order .= ", ";
} else {
$order .= " ORDER BY ";
}
$nat_fields = [
'`c`.`loginname`',
'`a`.`loginname`',
'`adminname`',
'`databasename`',
'`username`'
];
foreach ($orderby as $field => $by) { foreach ($orderby as $field => $by) {
$sortfield = explode('.', $field); $sortfield = explode('.', $field);
foreach ($sortfield as $id => $sfield) { foreach ($sortfield as $id => $sfield) {
@@ -359,7 +374,7 @@ abstract class ApiCommand extends ApiParameter
])) { ])) {
$by = 'ASC'; $by = 'ASC';
} }
if (\Froxlor\Settings::Get('panel.natsorting') == 1) { if (\Froxlor\Settings::Get('panel.natsorting') == 1 && in_array($field, $nat_fields)) {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556 // Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$order .= "CONCAT( IF( ASCII( LEFT( " . $field . ", 5 ) ) > 57, $order .= "CONCAT( IF( ASCII( LEFT( " . $field . ", 5 ) ) > 57,
LEFT( " . $field . ", 1 ), 0 ), LEFT( " . $field . ", 1 ), 0 ),
@@ -568,8 +583,12 @@ abstract class ApiCommand extends ApiParameter
"group" => $group, "group" => $group,
"var" => $varname "var" => $varname
), true, true); ), true, true);
$content = $default;
if ($result) {
$content = $result['value'] ?? $default;
}
// @fixme html_entity_decode // @fixme html_entity_decode
$content = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result['value'] != '') ? $result['value'] : $default), $replace_arr)); $content = html_entity_decode(\Froxlor\PhpHelper::replaceVariables($content, $replace_arr));
return $content; return $content;
} }

View File

@@ -265,7 +265,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
'login' => $loginname 'login' => $loginname
), true, true); ), true, true);
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) { if (($loginname_check && strtolower($loginname_check['loginname']) == strtolower($loginname)) || ($loginname_check_admin && strtolower($loginname_check_admin['loginname']) == strtolower($loginname))) {
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true); \Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
} elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) { } elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) {
// Accounts which match systemaccounts are not allowed, filtering them // Accounts which match systemaccounts are not allowed, filtering them

View File

@@ -209,7 +209,7 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
} else { } else {
$certs_stmt_query .= "1 "; $certs_stmt_query .= "1 ";
} }
$certs_stmt = Database::prepare($certs_stmt_query . $this->getSearchWhere($query_fields) . $this->getOrderBy() . $this->getLimit()); $certs_stmt = Database::prepare($certs_stmt_query . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit());
$qry_params = array_merge($qry_params, $query_fields); $qry_params = array_merge($qry_params, $query_fields);
Database::pexecute($certs_stmt, $qry_params, true, true); Database::pexecute($certs_stmt, $qry_params, true, true);
$result = array(); $result = array();

View File

@@ -411,7 +411,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
), true, true); ), true, true);
$mysql_maxlen = \Froxlor\Database\Database::getSqlUsernameLength() - strlen(Settings::Get('customer.mysqlprefix')); $mysql_maxlen = \Froxlor\Database\Database::getSqlUsernameLength() - strlen(Settings::Get('customer.mysqlprefix'));
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) { if (($loginname_check && strtolower($loginname_check['loginname']) == strtolower($loginname)) || ($loginname_check_admin && strtolower($loginname_check_admin['loginname']) == strtolower($loginname))) {
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true); \Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
} elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), $mysql_maxlen)) { } elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), $mysql_maxlen)) {
if (strlen($loginname) > $mysql_maxlen) { if (strlen($loginname) > $mysql_maxlen) {
@@ -689,6 +689,7 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'name' => $name, 'name' => $name,
'company' => $company 'company' => $company
)), )),
'CUSTOMER_NO' => $customernumber,
'USERNAME' => $loginname, 'USERNAME' => $loginname,
'PASSWORD' => $password, 'PASSWORD' => $password,
'SERVER_HOSTNAME' => $srv_hostname, 'SERVER_HOSTNAME' => $srv_hostname,

View File

@@ -96,7 +96,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
), true, true); ), true, true);
// duplicate check // duplicate check
if ($path_dupe_check['path'] == $path) { if ($path_dupe_check && $path_dupe_check['path'] == $path) {
\Froxlor\UI\Response::standard_error('errordocpathdupe', $userpath, true); \Froxlor\UI\Response::standard_error('errordocpathdupe', $userpath, true);
} }
@@ -309,8 +309,7 @@ class DirOptions extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$query_fields = array(); $query_fields = array();
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`
WHERE `customerid` IN (" . implode(', ', $customer_ids) . ")" . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit() WHERE `customerid` IN (" . implode(', ', $customer_ids) . ")" . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit());
);
Database::pexecute($result_stmt, $query_fields, true, true); Database::pexecute($result_stmt, $query_fields, true, true);
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
$result[] = $row; $result[] = $row;

View File

@@ -81,7 +81,7 @@ class DirProtections extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Res
$password_enc = \Froxlor\System\Crypt::makeCryptPassword($password, true); $password_enc = \Froxlor\System\Crypt::makeCryptPassword($password, true);
// duplicate check // duplicate check
if ($username_path_check['username'] == $username && $username_path_check['path'] == $path) { if ($username_path_check && $username_path_check['username'] == $username && $username_path_check['path'] == $path) {
\Froxlor\UI\Response::standard_error('userpathcombinationdupe', '', true); \Froxlor\UI\Response::standard_error('userpathcombinationdupe', '', true);
} elseif ($password == $username) { } elseif ($password == $username) {
\Froxlor\UI\Response::standard_error('passwordshouldnotbeusername', '', true); \Froxlor\UI\Response::standard_error('passwordshouldnotbeusername', '', true);

View File

@@ -168,14 +168,15 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* get ips connected to given domain as array * get ips connected to given domain as array
* *
* @param number $domain_id * @param number $domain_id
* @param bool $ssl_only
* optional, return only ssl enabled ip's, default false
* @return array * @return array
*/ */
private function getIpsForDomain($domain_id = 0) private function getIpsForDomain($domain_id = 0, $ssl_only = false)
{ {
$resultips_stmt = Database::prepare(" $resultips_stmt = Database::prepare("
SELECT `ips`.* FROM `" . TABLE_DOMAINTOIP . "` AS `dti`, `" . TABLE_PANEL_IPSANDPORTS . "` AS `ips` SELECT `ips`.* FROM `" . TABLE_DOMAINTOIP . "` AS `dti`, `" . TABLE_PANEL_IPSANDPORTS . "` AS `ips`
WHERE `dti`.`id_ipandports` = `ips`.`id` AND `dti`.`id_domain` = :domainid WHERE `dti`.`id_ipandports` = `ips`.`id` AND `dti`.`id_domain` = :domainid " . ($ssl_only ? " AND `ips`.`ssl` = '1'" : ""));
");
Database::pexecute($resultips_stmt, array( Database::pexecute($resultips_stmt, array(
'domainid' => $domain_id 'domainid' => $domain_id
@@ -260,6 +261,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional, list of ssl-enabled ip/port id's to assign to this domain, default empty * optional, list of ssl-enabled ip/port id's to assign to this domain, default empty
* @param bool $dont_use_default_ssl_ipandport_if_empty * @param bool $dont_use_default_ssl_ipandport_if_empty
* optional, do NOT set the systems default ssl ip addresses if none are given via $ssl_ipandport parameter * optional, do NOT set the systems default ssl ip addresses if none are given via $ssl_ipandport parameter
* @param bool $sslenabled
* optional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (true)
* @param bool $http2 * @param bool $http2
* optional, whether to enable http/2 for this domain (requires to be enabled in the settings), default 0 (false) * optional, whether to enable http/2 for this domain (requires to be enabled in the settings), default 0 (false)
* @param int $hsts_maxage * @param int $hsts_maxage
@@ -270,6 +273,10 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional whether or not to preload HSTS header value * optional whether or not to preload HSTS header value
* @param bool $ocsp_stapling * @param bool $ocsp_stapling
* optional whether to enable ocsp-stapling for this domain. default 0 (false), requires SSL * optional whether to enable ocsp-stapling for this domain. default 0 (false), requires SSL
* @param bool $honorcipherorder
* optional whether to honor the (server) cipher order for this domain. default 0 (false), requires SSL
* @param bool $sessiontickets
* optional whether to enable or disable TLS sessiontickets (RFC 5077) for this domain. default 1 (true), requires SSL
* @param bool $override_tls * @param bool $override_tls
* optional whether or not to override system-tls settings like protocol, ssl-ciphers and if applicable tls-1.3 ciphers, requires change_serversettings flag for the admin, default false * optional whether or not to override system-tls settings like protocol, ssl-ciphers and if applicable tls-1.3 ciphers, requires change_serversettings flag for the admin, default false
* @param array $ssl_protocols * @param array $ssl_protocols
@@ -324,11 +331,14 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$letsencrypt = $this->getBoolParam('letsencrypt', true, 0); $letsencrypt = $this->getBoolParam('letsencrypt', true, 0);
$dont_use_default_ssl_ipandport_if_empty = $this->getBoolParam('dont_use_default_ssl_ipandport_if_empty', true, 0); $dont_use_default_ssl_ipandport_if_empty = $this->getBoolParam('dont_use_default_ssl_ipandport_if_empty', true, 0);
$p_ssl_ipandports = $this->getParam('ssl_ipandport', true, $dont_use_default_ssl_ipandport_if_empty ? array() : explode(',', Settings::Get('system.defaultsslip'))); $p_ssl_ipandports = $this->getParam('ssl_ipandport', true, $dont_use_default_ssl_ipandport_if_empty ? array() : explode(',', Settings::Get('system.defaultsslip')));
$sslenabled = $this->getBoolParam('sslenabled', true, 1);
$http2 = $this->getBoolParam('http2', true, 0); $http2 = $this->getBoolParam('http2', true, 0);
$hsts_maxage = $this->getParam('hsts_maxage', true, 0); $hsts_maxage = $this->getParam('hsts_maxage', true, 0);
$hsts_sub = $this->getBoolParam('hsts_sub', true, 0); $hsts_sub = $this->getBoolParam('hsts_sub', true, 0);
$hsts_preload = $this->getBoolParam('hsts_preload', true, 0); $hsts_preload = $this->getBoolParam('hsts_preload', true, 0);
$ocsp_stapling = $this->getBoolParam('ocsp_stapling', true, 0); $ocsp_stapling = $this->getBoolParam('ocsp_stapling', true, 0);
$honorcipherorder = $this->getBoolParam('honorcipherorder', true, 0);
$sessiontickets = $this->getBoolParam('sessiontickets', true, 1);
$override_tls = $this->getBoolParam('override_tls', true, 0); $override_tls = $this->getBoolParam('override_tls', true, 0);
$p_ssl_protocols = array(); $p_ssl_protocols = array();
@@ -344,7 +354,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
} }
// validation // validation
if ($p_domain == Settings::Get('system.hostname')) { $p_domain = strtolower($p_domain);
if ($p_domain == strtolower(Settings::Get('system.hostname'))) {
\Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true); \Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true);
} }
@@ -663,9 +674,9 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
), '', true); ), '', true);
} elseif ($customerid == 0) { } elseif ($customerid == 0) {
\Froxlor\UI\Response::standard_error('adduserfirst', '', true); \Froxlor\UI\Response::standard_error('adduserfirst', '', true);
} elseif (strtolower($domain_check['domain']) == strtolower($domain)) { } elseif ($domain_check && strtolower($domain_check['domain']) == strtolower($domain)) {
\Froxlor\UI\Response::standard_error('domainalreadyexists', $idna_convert->decode($domain), true); \Froxlor\UI\Response::standard_error('domainalreadyexists', $idna_convert->decode($domain), true);
} elseif ($aliasdomain_check['id'] != $aliasdomain) { } elseif ($aliasdomain_check && $aliasdomain_check['id'] != $aliasdomain) {
\Froxlor\UI\Response::standard_error('domainisaliasorothercustomer', '', true); \Froxlor\UI\Response::standard_error('domainisaliasorothercustomer', '', true);
} else { } else {
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0'; $wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
@@ -673,6 +684,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$ins_data = array( $ins_data = array(
'domain' => $domain, 'domain' => $domain,
'domain_ace' => $idna_convert->decode($domain),
'customerid' => $customerid, 'customerid' => $customerid,
'adminid' => $adminid, 'adminid' => $adminid,
'documentroot' => $documentroot, 'documentroot' => $documentroot,
@@ -712,12 +724,16 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'override_tls' => $override_tls, 'override_tls' => $override_tls,
'ssl_protocols' => implode(",", $ssl_protocols), 'ssl_protocols' => implode(",", $ssl_protocols),
'ssl_cipher_list' => $ssl_cipher_list, 'ssl_cipher_list' => $ssl_cipher_list,
'tlsv13_cipher_list' => $tlsv13_cipher_list 'tlsv13_cipher_list' => $tlsv13_cipher_list,
'sslenabled' => $sslenabled,
'honorcipherorder' => $honorcipherorder,
'sessiontickets' => $sessiontickets
); );
$ins_stmt = Database::prepare(" $ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
`domain` = :domain, `domain` = :domain,
`domain_ace` = :domain_ace,
`customerid` = :customerid, `customerid` = :customerid,
`adminid` = :adminid, `adminid` = :adminid,
`documentroot` = :documentroot, `documentroot` = :documentroot,
@@ -760,7 +776,10 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
`override_tls` = :override_tls, `override_tls` = :override_tls,
`ssl_protocols` = :ssl_protocols, `ssl_protocols` = :ssl_protocols,
`ssl_cipher_list` = :ssl_cipher_list, `ssl_cipher_list` = :ssl_cipher_list,
`tlsv13_cipher_list` = :tlsv13_cipher_list `tlsv13_cipher_list` = :tlsv13_cipher_list,
`ssl_enabled` = :sslenabled,
`ssl_honorcipherorder` = :honorcipherorder,
`ssl_sessiontickets`= :sessiontickets
"); ");
Database::pexecute($ins_stmt, $ins_data, true, true); Database::pexecute($ins_stmt, $ins_data, true, true);
$domainid = Database::lastInsertId(); $domainid = Database::lastInsertId();
@@ -865,7 +884,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* @param bool $include_specialsettings * @param bool $include_specialsettings
* optional, whether or not to include non-ssl specialsettings in the generated ssl-vhost, default false * optional, whether or not to include non-ssl specialsettings in the generated ssl-vhost, default false
* @param bool $specialsettingsforsubdomains * @param bool $specialsettingsforsubdomains
* optional, whether to apply specialsettings to all subdomains of this domain, default 0 (false) * optional, whether to apply specialsettings to all subdomains of this domain, default is read from setting system.apply_specialsettings_default
* @param bool $notryfiles * @param bool $notryfiles
* optional, [nginx only] do not generate the default try-files directive, default 0 (false) * optional, [nginx only] do not generate the default try-files directive, default 0 (false)
* @param bool $writeaccesslog * @param bool $writeaccesslog
@@ -877,7 +896,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* @param bool $phpenabled * @param bool $phpenabled
* optional, whether php is enabled for this domain, default 0 (false) * optional, whether php is enabled for this domain, default 0 (false)
* @param bool $phpsettingsforsubdomains * @param bool $phpsettingsforsubdomains
* optional, whether to apply php-setting to apply to all subdomains of this domain, default 0 (false) * optional, whether to apply php-setting to apply to all subdomains of this domain, default is read from setting system.apply_phpconfigs_default
* @param bool $openbasedir * @param bool $openbasedir
* optional, whether to activate openbasedir restriction for this domain, default 0 (false) * optional, whether to activate openbasedir restriction for this domain, default 0 (false)
* @param int $phpsettingid * @param int $phpsettingid
@@ -894,6 +913,8 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional, list of ssl-enabled ip/port id's to assign to this domain, if left empty, the current set value is being used, to remove all ssl ips use $remove_ssl_ipandport * optional, list of ssl-enabled ip/port id's to assign to this domain, if left empty, the current set value is being used, to remove all ssl ips use $remove_ssl_ipandport
* @param bool $remove_ssl_ipandport * @param bool $remove_ssl_ipandport
* optional, if set to true and no $ssl_ipandport value is given, the ip's get removed, otherwise, the currently set value is used, default false * optional, if set to true and no $ssl_ipandport value is given, the ip's get removed, otherwise, the currently set value is used, default false
* @param bool $sslenabled
* optional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (true)
* @param bool $http2 * @param bool $http2
* optional, whether to enable http/2 for this domain (requires to be enabled in the settings), default 0 (false) * optional, whether to enable http/2 for this domain (requires to be enabled in the settings), default 0 (false)
* @param int $hsts_maxage * @param int $hsts_maxage
@@ -904,6 +925,10 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
* optional whether or not to preload HSTS header value * optional whether or not to preload HSTS header value
* @param bool $ocsp_stapling * @param bool $ocsp_stapling
* optional whether to enable ocsp-stapling for this domain. default 0 (false), requires SSL * optional whether to enable ocsp-stapling for this domain. default 0 (false), requires SSL
* @param bool $honorcipherorder
* optional whether to honor the (server) cipher order for this domain. default 0 (false), requires SSL
* @param bool $sessiontickets
* optional whether to enable or disable TLS sessiontickets (RFC 5077) for this domain. default 1 (true), requires SSL
* *
* @access admin * @access admin
* @throws \Exception * @throws \Exception
@@ -947,13 +972,13 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$specialsettings = $this->getParam('specialsettings', true, $result['specialsettings']); $specialsettings = $this->getParam('specialsettings', true, $result['specialsettings']);
$ssl_specialsettings = $this->getParam('ssl_specialsettings', true, $result['ssl_specialsettings']); $ssl_specialsettings = $this->getParam('ssl_specialsettings', true, $result['ssl_specialsettings']);
$include_specialsettings = $this->getBoolParam('include_specialsettings', true, $result['include_specialsettings']); $include_specialsettings = $this->getBoolParam('include_specialsettings', true, $result['include_specialsettings']);
$ssfs = $this->getBoolParam('specialsettingsforsubdomains', true, 0); $ssfs = $this->getBoolParam('specialsettingsforsubdomains', true, \Froxlor\Settings::Get('system.apply_specialsettings_default'));
$notryfiles = $this->getBoolParam('notryfiles', true, $result['notryfiles']); $notryfiles = $this->getBoolParam('notryfiles', true, $result['notryfiles']);
$writeaccesslog = $this->getBoolParam('writeaccesslog', true, $result['writeaccesslog']); $writeaccesslog = $this->getBoolParam('writeaccesslog', true, $result['writeaccesslog']);
$writeerrorlog = $this->getBoolParam('writeerrorlog', true, $result['writeerrorlog']); $writeerrorlog = $this->getBoolParam('writeerrorlog', true, $result['writeerrorlog']);
$documentroot = $this->getParam('documentroot', true, $result['documentroot']); $documentroot = $this->getParam('documentroot', true, $result['documentroot']);
$phpenabled = $this->getBoolParam('phpenabled', true, $result['phpenabled']); $phpenabled = $this->getBoolParam('phpenabled', true, $result['phpenabled']);
$phpfs = $this->getBoolParam('phpsettingsforsubdomains', true, 0); $phpfs = $this->getBoolParam('phpsettingsforsubdomains', true, \Froxlor\Settings::Get('system.apply_phpconfigs_default'));
$openbasedir = $this->getBoolParam('openbasedir', true, $result['openbasedir']); $openbasedir = $this->getBoolParam('openbasedir', true, $result['openbasedir']);
$phpsettingid = $this->getParam('phpsettingid', true, $result['phpsettingid']); $phpsettingid = $this->getParam('phpsettingid', true, $result['phpsettingid']);
$mod_fcgid_starter = $this->getParam('mod_fcgid_starter', true, $result['mod_fcgid_starter']); $mod_fcgid_starter = $this->getParam('mod_fcgid_starter', true, $result['mod_fcgid_starter']);
@@ -964,11 +989,14 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$p_ssl_ipandports = $this->getParam('ssl_ipandport', true, $remove_ssl_ipandport ? array( $p_ssl_ipandports = $this->getParam('ssl_ipandport', true, $remove_ssl_ipandport ? array(
- 1 - 1
) : null); ) : null);
$sslenabled = $this->getBoolParam('sslenabled', true, $result['ssl_enabled']);
$http2 = $this->getBoolParam('http2', true, $result['http2']); $http2 = $this->getBoolParam('http2', true, $result['http2']);
$hsts_maxage = $this->getParam('hsts_maxage', true, $result['hsts']); $hsts_maxage = $this->getParam('hsts_maxage', true, $result['hsts']);
$hsts_sub = $this->getBoolParam('hsts_sub', true, $result['hsts_sub']); $hsts_sub = $this->getBoolParam('hsts_sub', true, $result['hsts_sub']);
$hsts_preload = $this->getBoolParam('hsts_preload', true, $result['hsts_preload']); $hsts_preload = $this->getBoolParam('hsts_preload', true, $result['hsts_preload']);
$ocsp_stapling = $this->getBoolParam('ocsp_stapling', true, $result['ocsp_stapling']); $ocsp_stapling = $this->getBoolParam('ocsp_stapling', true, $result['ocsp_stapling']);
$honorcipherorder = $this->getBoolParam('honorcipherorder', true, $result['ssl_honorcipherorder']);
$sessiontickets = $this->getBoolParam('sessiontickets', true, $result['ssl_sessiontickets']);
$override_tls = $this->getBoolParam('override_tls', true, $result['override_tls']); $override_tls = $this->getBoolParam('override_tls', true, $result['override_tls']);
@@ -1197,7 +1225,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$writeaccesslog = $result['writeaccesslog']; $writeaccesslog = $result['writeaccesslog'];
$writeerrorlog = $result['writeerrorlog']; $writeerrorlog = $result['writeerrorlog'];
$documentroot = $result['documentroot']; $documentroot = $result['documentroot'];
$ssl_protocols = $p_ssl_protocols;
$override_tls = $result['override_tls']; $override_tls = $result['override_tls'];
} }
@@ -1546,6 +1574,9 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$update_data['ssl_protocols'] = implode(",", $ssl_protocols); $update_data['ssl_protocols'] = implode(",", $ssl_protocols);
$update_data['ssl_cipher_list'] = $ssl_cipher_list; $update_data['ssl_cipher_list'] = $ssl_cipher_list;
$update_data['tlsv13_cipher_list'] = $tlsv13_cipher_list; $update_data['tlsv13_cipher_list'] = $tlsv13_cipher_list;
$update_data['sslenabled'] = $sslenabled;
$update_data['honorcipherorder'] = $honorcipherorder;
$update_data['sessiontickets'] = $sessiontickets;
$update_data['id'] = $id; $update_data['id'] = $id;
$update_stmt = Database::prepare(" $update_stmt = Database::prepare("
@@ -1588,7 +1619,10 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
`override_tls` = :override_tls, `override_tls` = :override_tls,
`ssl_protocols` = :ssl_protocols, `ssl_protocols` = :ssl_protocols,
`ssl_cipher_list` = :ssl_cipher_list, `ssl_cipher_list` = :ssl_cipher_list,
`tlsv13_cipher_list` = :tlsv13_cipher_list `tlsv13_cipher_list` = :tlsv13_cipher_list,
`ssl_enabled` = :sslenabled,
`ssl_honorcipherorder` = :honorcipherorder,
`ssl_sessiontickets` = :sessiontickets
WHERE `id` = :id WHERE `id` = :id
"); ");
Database::pexecute($update_stmt, $update_data, true, true); Database::pexecute($update_stmt, $update_data, true, true);
@@ -1599,10 +1633,15 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
$_update_data['openbasedir'] = $openbasedir; $_update_data['openbasedir'] = $openbasedir;
$_update_data['mod_fcgid_starter'] = $mod_fcgid_starter; $_update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests; $_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
$_update_data['notryfiles'] = $notryfiles;
$_update_data['writeaccesslog'] = $writeaccesslog;
$_update_data['writeerrorlog'] = $writeerrorlog;
$_update_data['override_tls'] = $override_tls; $_update_data['override_tls'] = $override_tls;
$_update_data['ssl_protocols'] = implode(",", $ssl_protocols); $_update_data['ssl_protocols'] = implode(",", $ssl_protocols);
$_update_data['ssl_cipher_list'] = $ssl_cipher_list; $_update_data['ssl_cipher_list'] = $ssl_cipher_list;
$_update_data['tlsv13_cipher_list'] = $tlsv13_cipher_list; $_update_data['tlsv13_cipher_list'] = $tlsv13_cipher_list;
$_update_data['honorcipherorder'] = $honorcipherorder;
$_update_data['sessiontickets'] = $sessiontickets;
$_update_data['parentdomainid'] = $id; $_update_data['parentdomainid'] = $id;
// if php config is to be set for all subdomains, check here // if php config is to be set for all subdomains, check here
@@ -1627,10 +1666,15 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
`openbasedir` = :openbasedir, `openbasedir` = :openbasedir,
`mod_fcgid_starter` = :mod_fcgid_starter, `mod_fcgid_starter` = :mod_fcgid_starter,
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests, `mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
`notryfiles` = :notryfiles,
`writeaccesslog` = :writeaccesslog,
`writeerrorlog` = :writeerrorlog,
`override_tls` = :override_tls, `override_tls` = :override_tls,
`ssl_protocols` = :ssl_protocols, `ssl_protocols` = :ssl_protocols,
`ssl_cipher_list` = :ssl_cipher_list, `ssl_cipher_list` = :ssl_cipher_list,
`tlsv13_cipher_list` = :tlsv13_cipher_list `tlsv13_cipher_list` = :tlsv13_cipher_list,
`ssl_honorcipherorder` = :honorcipherorder,
`ssl_sessiontickets` = :sessiontickets
" . $update_phpconfig . $upd_specialsettings . $updatechildren . $update_sslredirect . " " . $update_phpconfig . $upd_specialsettings . $updatechildren . $update_sslredirect . "
WHERE `parentdomainid` = :parentdomainid WHERE `parentdomainid` = :parentdomainid
"); ");

View File

@@ -192,7 +192,12 @@ class EmailAccounts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Reso
$replace_arr = array( $replace_arr = array(
'EMAIL' => $email_full, 'EMAIL' => $email_full,
'USERNAME' => $username, 'USERNAME' => $username,
'PASSWORD' => $password 'PASSWORD' => $password,
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
'NAME' => $customer['name'],
'FIRSTNAME' => $customer['firstname'],
'COMPANY' => $customer['company'],
'CUSTOMER_NO' => $customer['customernumber']
); );
// get the customers admin // get the customers admin

View File

@@ -106,10 +106,12 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
); );
$email_check = Database::pexecute_first($stmt, $params, true, true); $email_check = Database::pexecute_first($stmt, $params, true, true);
if (strtolower($email_check['email_full']) == strtolower($email_full)) { if ($email_check) {
\Froxlor\UI\Response::standard_error('emailexistalready', $email_full, true); if (strtolower($email_check['email_full']) == strtolower($email_full)) {
} elseif ($email_check['email'] == $email) { \Froxlor\UI\Response::standard_error('emailexistalready', $email_full, true);
\Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true); } elseif ($email_check['email'] == $email) {
\Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true);
}
} }
$stmt = Database::prepare(" $stmt = Database::prepare("
@@ -233,6 +235,19 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$iscatchall = '1'; $iscatchall = '1';
$email_parts = explode('@', $result['email_full']); $email_parts = explode('@', $result['email_full']);
$email = '@' . $email_parts[1]; $email = '@' . $email_parts[1];
// catchall check
$stmt = Database::prepare("
SELECT `email_full` FROM `" . TABLE_MAIL_VIRTUAL . "`
WHERE `email` = :email AND `customerid` = :cid AND `iscatchall` = '1'
");
$params = array(
"email" => $email,
"cid" => $customer['customerid']
);
$email_check = Database::pexecute_first($stmt, $params, true, true);
if ($email_check) {
\Froxlor\UI\Response::standard_error('youhavealreadyacatchallforthisdomain', '', true);
}
} else { } else {
$iscatchall = '0'; $iscatchall = '0';
$email = $result['email_full']; $email = $result['email_full'];
@@ -273,7 +288,7 @@ class Emails extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
* optional specify offset for resultset * optional specify offset for resultset
* @param array $sql_orderby * @param array $sql_orderby
* optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields
* *
* @access admin, customer * @access admin, customer
* @throws \Exception * @throws \Exception
* @return string json-encoded array count|list * @return string json-encoded array count|list

View File

@@ -32,7 +32,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
* optional specify offset for resultset * optional specify offset for resultset
* @param array $sql_orderby * @param array $sql_orderby
* optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields * optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields
* *
* @access admin * @access admin
* @throws \Exception * @throws \Exception
* @return string json-encoded array count|list * @return string json-encoded array count|list
@@ -135,21 +135,23 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
* @param string $reload_cmd * @param string $reload_cmd
* @param string $config_dir * @param string $config_dir
* @param string $pm * @param string $pm
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static' * optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'dynamic'
* @param int $max_children * @param int $max_children
* optional, default 0 * optional, default 5
* @param int $start_servers * @param int $start_servers
* optional, default 0 * optional, default 2
* @param int $min_spare_servers * @param int $min_spare_servers
* optional, default 0 * optional, default 1
* @param int $max_spare_servers * @param int $max_spare_servers
* optional, default 0 * optional, default 3
* @param int $max_requests * @param int $max_requests
* optional, default 0 * optional, default 0
* @param int $idle_timeout * @param int $idle_timeout
* optional, default 0 * optional, default 10
* @param string $limit_extensions * @param string $limit_extensions
* optional, limit execution to the following extensions, default '.php' * optional, limit execution to the following extensions, default '.php'
* @param string $custom_config
* optional, custom settings appended to phpfpm pool configuration
* *
* @access admin * @access admin
* @throws \Exception * @throws \Exception
@@ -165,14 +167,15 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$config_dir = $this->getParam('config_dir'); $config_dir = $this->getParam('config_dir');
// parameters // parameters
$pmanager = $this->getParam('pm', true, 'static'); $pmanager = $this->getParam('pm', true, 'dynamic');
$max_children = $this->getParam('max_children', true, 0); $max_children = $this->getParam('max_children', true, 5);
$start_servers = $this->getParam('start_servers', true, 0); $start_servers = $this->getParam('start_servers', true, 2);
$min_spare_servers = $this->getParam('min_spare_servers', true, 0); $min_spare_servers = $this->getParam('min_spare_servers', true, 1);
$max_spare_servers = $this->getParam('max_spare_servers', true, 0); $max_spare_servers = $this->getParam('max_spare_servers', true, 3);
$max_requests = $this->getParam('max_requests', true, 0); $max_requests = $this->getParam('max_requests', true, 0);
$idle_timeout = $this->getParam('idle_timeout', true, 0); $idle_timeout = $this->getParam('idle_timeout', true, 10);
$limit_extensions = $this->getParam('limit_extensions', true, '.php'); $limit_extensions = $this->getParam('limit_extensions', true, '.php');
$custom_config = $this->getParam('custom_config', true, '');
// validation // validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true); $description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
@@ -206,7 +209,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
`max_spare_servers` = :max_spare_servers, `max_spare_servers` = :max_spare_servers,
`max_requests` = :max_requests, `max_requests` = :max_requests,
`idle_timeout` = :idle_timeout, `idle_timeout` = :idle_timeout,
`limit_extensions` = :limit_extensions `limit_extensions` = :limit_extensions,
`custom_config` = :custom_config
"); ");
$ins_data = array( $ins_data = array(
'desc' => $description, 'desc' => $description,
@@ -219,7 +223,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'max_spare_servers' => $max_spare_servers, 'max_spare_servers' => $max_spare_servers,
'max_requests' => $max_requests, 'max_requests' => $max_requests,
'idle_timeout' => $idle_timeout, 'idle_timeout' => $idle_timeout,
'limit_extensions' => $limit_extensions 'limit_extensions' => $limit_extensions,
'custom_config' => $custom_config
); );
Database::pexecute($ins_stmt, $ins_data); Database::pexecute($ins_stmt, $ins_data);
$id = Database::lastInsertId(); $id = Database::lastInsertId();
@@ -246,21 +251,23 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
* @param string $config_dir * @param string $config_dir
* optional * optional
* @param string $pm * @param string $pm
* optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'static' * optional, process-manager, one of 'static', 'dynamic' or 'ondemand', default 'dynamic'
* @param int $max_children * @param int $max_children
* optional, default 0 * optional, default 5
* @param int $start_servers * @param int $start_servers
* optional, default 0 * optional, default 2
* @param int $min_spare_servers * @param int $min_spare_servers
* optional, default 0 * optional, default 1
* @param int $max_spare_servers * @param int $max_spare_servers
* optional, default 0 * optional, default 3
* @param int $max_requests * @param int $max_requests
* optional, default 0 * optional, default 0
* @param int $idle_timeout * @param int $idle_timeout
* optional, default 0 * optional, default 10
* @param string $limit_extensions * @param string $limit_extensions
* optional, limit execution to the following extensions, default '.php' * optional, limit execution to the following extensions, default '.php'
* @param string $custom_config
* optional, custom settings appended to phpfpm pool configuration
* *
* @access admin * @access admin
* @throws \Exception * @throws \Exception
@@ -289,6 +296,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$max_requests = $this->getParam('max_requests', true, $result['max_requests']); $max_requests = $this->getParam('max_requests', true, $result['max_requests']);
$idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']); $idle_timeout = $this->getParam('idle_timeout', true, $result['idle_timeout']);
$limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']); $limit_extensions = $this->getParam('limit_extensions', true, $result['limit_extensions']);
$custom_config = $this->getParam('custom_config', true, $result['custom_config']);
// validation // validation
$description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true); $description = \Froxlor\Validate\Validate::validate($description, 'description', '', '', array(), true);
@@ -322,7 +330,8 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
`max_spare_servers` = :max_spare_servers, `max_spare_servers` = :max_spare_servers,
`max_requests` = :max_requests, `max_requests` = :max_requests,
`idle_timeout` = :idle_timeout, `idle_timeout` = :idle_timeout,
`limit_extensions` = :limit_extensions `limit_extensions` = :limit_extensions,
`custom_config` = :custom_config
WHERE `id` = :id WHERE `id` = :id
"); ");
$upd_data = array( $upd_data = array(
@@ -337,6 +346,7 @@ class FpmDaemons extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'max_requests' => $max_requests, 'max_requests' => $max_requests,
'idle_timeout' => $idle_timeout, 'idle_timeout' => $idle_timeout,
'limit_extensions' => $limit_extensions, 'limit_extensions' => $limit_extensions,
'custom_config' => $custom_config,
'id' => $id 'id' => $id
); );
Database::pexecute($upd_stmt, $upd_data, true, true); Database::pexecute($upd_stmt, $upd_data, true, true);

View File

@@ -42,7 +42,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
try { try {
$latestversion = \Froxlor\Http\HttpClient::urlGet(UPDATE_URI, true, 3); $latestversion = \Froxlor\Http\HttpClient::urlGet(UPDATE_URI, true, 3);
} catch (\Exception $e) { } catch (\Exception $e) {
$latestversion = \Froxlor\Froxlor::getVersion()."|Version-check currently unavailable, please try again later"; $latestversion = \Froxlor\Froxlor::getVersion() . "|Version-check currently unavailable, please try again later";
} }
$latestversion = explode('|', $latestversion); $latestversion = explode('|', $latestversion);
@@ -216,7 +216,7 @@ class Froxlor extends \Froxlor\Api\ApiCommand
*/ */
public function updateSetting() public function updateSetting()
{ {
// currently not implemented as it required validation too so no wrong settings are being stored via API // currently not implemented as it requires validation too so no wrong settings are being stored via API
throw new \Exception("Not available yet.", 501); throw new \Exception("Not available yet.", 501);
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
@@ -232,6 +232,37 @@ class Froxlor extends \Froxlor\Api\ApiCommand
throw new \Exception("Not allowed to execute given command.", 403); throw new \Exception("Not allowed to execute given command.", 403);
} }
/**
* returns a random password based on froxlor settings for min-length, included characters, etc.
*
* @access admin, customer
* @return string
*/
public function generatePassword()
{
return $this->response(200, "successfull", \Froxlor\System\Crypt::generatePassword());
}
/**
* can be used to remotely run the integritiy checks froxlor implements
*
* @access admin
* @throws \Exception
* @return string
*/
public function integrityCheck()
{
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$integrity = new \Froxlor\Database\IntegrityCheck();
$result = $integrity->checkAll();
if ($result) {
return $this->response(200, "successfull", "OK");
}
throw new \Exception("Some checks failed.", 406);
}
throw new \Exception("Not allowed to execute given command.", 403);
}
/** /**
* returns a list of all available api functions * returns a list of all available api functions
* *

View File

@@ -227,6 +227,10 @@ class Ftps extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEntit
$replace_arr = array( $replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer), 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($customer),
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($customer), // < keep this for compatibility 'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($customer), // < keep this for compatibility
'NAME' => $customer['name'],
'FIRSTNAME' => $customer['firstname'],
'COMPANY' => $customer['company'],
'CUSTOMER_NO' => $customer['customernumber'],
'USR_NAME' => $username, 'USR_NAME' => $username,
'USR_PASS' => $password, 'USR_PASS' => $password,
'USR_PATH' => \Froxlor\FileDir::makeCorrectDir(str_replace($customer['documentroot'], "/", $path)) 'USR_PATH' => \Froxlor\FileDir::makeCorrectDir(str_replace($customer['documentroot'], "/", $path))

View File

@@ -170,7 +170,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
{ {
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) { if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip'), false, 'invalidip', false, false, false, false, true); $ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip'), false, 'invalidip', false, true, false, false, true);
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array( $port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, 80), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
'stringisempty', 'stringisempty',
'myport' 'myport'
@@ -255,7 +255,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'port' => $port 'port' => $port
)); ));
if ($result_checkfordouble['id'] != '') { if ($result_checkfordouble && $result_checkfordouble['id'] != '') {
\Froxlor\UI\Response::standard_error('myipnotdouble', '', true); \Froxlor\UI\Response::standard_error('myipnotdouble', '', true);
} }
@@ -367,7 +367,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'id' => $id 'id' => $id
)); ));
$ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, false, false, false, true); $ip = \Froxlor\Validate\Validate::validate_ip2($this->getParam('ip', true, $result['ip']), false, 'invalidip', false, true, false, false, true);
$port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array( $port = \Froxlor\Validate\Validate::validate($this->getParam('port', true, $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(
'stringisempty', 'stringisempty',
'myport' 'myport'
@@ -462,9 +462,9 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$docroot = ''; $docroot = '';
} }
if ($result['ip'] != $ip && $result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport['id'] == '') { if ($result['ip'] != $ip && $result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport == false) {
\Froxlor\UI\Response::standard_error('cantchangesystemip', '', true); \Froxlor\UI\Response::standard_error('cantchangesystemip', '', true);
} elseif ($result_checkfordouble['id'] != '' && $result_checkfordouble['id'] != $id) { } elseif ($result_checkfordouble && $result_checkfordouble['id'] != '' && $result_checkfordouble['id'] != $id) {
\Froxlor\UI\Response::standard_error('myipnotdouble', '', true); \Froxlor\UI\Response::standard_error('myipnotdouble', '', true);
} else { } else {
@@ -540,7 +540,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
)); ));
$result_checkdomain_stmt = Database::prepare(" $result_checkdomain_stmt = Database::prepare("
SELECT `id_domain` as `id` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports` = :id SELECT `id_domain` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports` = :id
"); ");
$result_checkdomain = Database::pexecute_first($result_checkdomain_stmt, array( $result_checkdomain = Database::pexecute_first($result_checkdomain_stmt, array(
'id' => $id 'id' => $id
@@ -560,7 +560,7 @@ class IpsAndPorts extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
'ip' => $result['ip'] 'ip' => $result['ip']
)); ));
if (($result['ip'] != Settings::Get('system.ipaddress')) || ($result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport['id'] != '')) { if (($result['ip'] != Settings::Get('system.ipaddress')) || ($result['ip'] == Settings::Get('system.ipaddress') && $result_sameipotherport == false)) {
$del_stmt = Database::prepare(" $del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "` DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "`

View File

@@ -125,6 +125,10 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
$replace_arr = array( $replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo), 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($userinfo),
'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility 'CUST_NAME' => \Froxlor\User::getCorrectUserSalutation($userinfo), // < keep this for compatibility
'NAME' => $userinfo['name'],
'FIRSTNAME' => $userinfo['firstname'],
'COMPANY' => $userinfo['company'],
'CUSTOMER_NO' => $userinfo['customernumber'],
'DB_NAME' => $username, 'DB_NAME' => $username,
'DB_PASS' => $password, 'DB_PASS' => $password,
'DB_DESC' => $databasedescription, 'DB_DESC' => $databasedescription,
@@ -252,7 +256,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
), true, true); ), true, true);
$mbdata = $mbdata_stmt->fetch(\PDO::FETCH_ASSOC); $mbdata = $mbdata_stmt->fetch(\PDO::FETCH_ASSOC);
Database::needRoot(false); Database::needRoot(false);
$result['size'] = $mbdata['MB']; $result['size'] = $mbdata['MB'] ?? 0;
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get database '" . $result['databasename'] . "'"); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "[API] get database '" . $result['databasename'] . "'");
return $this->response(200, "successfull", $result); return $this->response(200, "successfull", $result);
} }
@@ -411,7 +415,7 @@ class Mysqls extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
"table_schema" => $row['databasename'] "table_schema" => $row['databasename']
), true, true); ), true, true);
$mbdata = $mbdata_stmt->fetch(\PDO::FETCH_ASSOC); $mbdata = $mbdata_stmt->fetch(\PDO::FETCH_ASSOC);
$row['size'] = $mbdata['MB']; $row['size'] = $mbdata['MB'] ?? 0;
$result[] = $row; $result[] = $row;
} }
Database::needRoot(false); Database::needRoot(false);

View File

@@ -50,8 +50,7 @@ class PhpSettings extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resour
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT c.*, fd.description as fpmdesc SELECT c.*, fd.description as fpmdesc
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fd ON fd.id = c.fpmsettingid" . $this->getSearchWhere($query_fields) . $this->getOrderBy() . $this->getLimit() LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fd ON fd.id = c.fpmsettingid" . $this->getSearchWhere($query_fields) . $this->getOrderBy() . $this->getLimit());
);
Database::pexecute($result_stmt, $query_fields, true, true); Database::pexecute($result_stmt, $query_fields, true, true);
$phpconfigs = array(); $phpconfigs = array();
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {

View File

@@ -41,6 +41,8 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
* optional, php-settings-id, if empty the $domain value is used * optional, php-settings-id, if empty the $domain value is used
* @param int $redirectcode * @param int $redirectcode
* optional, redirect-code-id from TABLE_PANEL_REDIRECTCODES * optional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
* @param bool $sslenabled
* optional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (true)
* @param bool $ssl_redirect * @param bool $ssl_redirect
* optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled * optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled
* @param bool $letsencrypt * @param bool $letsencrypt
@@ -76,6 +78,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$redirectcode = $this->getParam('redirectcode', true, Settings::Get('customredirect.default')); $redirectcode = $this->getParam('redirectcode', true, Settings::Get('customredirect.default'));
$isemaildomain = $this->getParam('isemaildomain', true, 0); $isemaildomain = $this->getParam('isemaildomain', true, 0);
if (Settings::Get('system.use_ssl')) { if (Settings::Get('system.use_ssl')) {
$sslenabled = $this->getBoolParam('sslenabled', true, 1);
$ssl_redirect = $this->getBoolParam('ssl_redirect', true, 0); $ssl_redirect = $this->getBoolParam('ssl_redirect', true, 0);
$letsencrypt = $this->getBoolParam('letsencrypt', true, 0); $letsencrypt = $this->getBoolParam('letsencrypt', true, 0);
$http2 = $this->getBoolParam('http2', true, 0); $http2 = $this->getBoolParam('http2', true, 0);
@@ -83,6 +86,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$hsts_sub = $this->getBoolParam('hsts_sub', true, 0); $hsts_sub = $this->getBoolParam('hsts_sub', true, 0);
$hsts_preload = $this->getBoolParam('hsts_preload', true, 0); $hsts_preload = $this->getBoolParam('hsts_preload', true, 0);
} else { } else {
$sslenabled = 0;
$ssl_redirect = 0; $ssl_redirect = 0;
$letsencrypt = 0; $letsencrypt = 0;
$http2 = 0; $http2 = 0;
@@ -95,6 +99,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$customer = $this->getCustomerData('subdomains'); $customer = $this->getCustomerData('subdomains');
// validation // validation
$subdomain = strtolower($subdomain);
if (substr($subdomain, 0, 4) == 'xn--') { if (substr($subdomain, 0, 4) == 'xn--') {
\Froxlor\UI\Response::standard_error('domain_nopunycode', '', true); \Froxlor\UI\Response::standard_error('domain_nopunycode', '', true);
} }
@@ -114,7 +119,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'mydomain' 'mydomain'
), '', true); ), '', true);
} }
if ($completedomain == Settings::Get('system.hostname')) { if ($completedomain == strtolower(Settings::Get('system.hostname'))) {
\Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true); \Froxlor\UI\Response::standard_error('admin_domain_emailsystemhostname', '', true);
} }
@@ -190,7 +195,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
} elseif ($subdomain == 'www' && $domain_check['wwwserveralias'] == '1') { } elseif ($subdomain == 'www' && $domain_check['wwwserveralias'] == '1') {
// you cannot add 'www' as subdomain when the maindomain generates a www-alias // you cannot add 'www' as subdomain when the maindomain generates a www-alias
\Froxlor\UI\Response::standard_error('wwwnotallowed', '', true); \Froxlor\UI\Response::standard_error('wwwnotallowed', '', true);
} elseif (strtolower($completedomain_check['domain']) == strtolower($completedomain)) { } elseif ($completedomain_check && strtolower($completedomain_check['domain']) == strtolower($completedomain)) {
// the domain does already exist as main-domain // the domain does already exist as main-domain
\Froxlor\UI\Response::standard_error('domainexistalready', $completedomain, true); \Froxlor\UI\Response::standard_error('domainexistalready', $completedomain, true);
} }
@@ -251,6 +256,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
`customerid` = :customerid, `customerid` = :customerid,
`adminid` = :adminid, `adminid` = :adminid,
`domain` = :domain, `domain` = :domain,
`domain_ace` = :domain_ace,
`documentroot` = :documentroot, `documentroot` = :documentroot,
`aliasdomain` = :aliasdomain, `aliasdomain` = :aliasdomain,
`parentdomainid` = :parentdomainid, `parentdomainid` = :parentdomainid,
@@ -275,12 +281,14 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
`override_tls` = :override_tls, `override_tls` = :override_tls,
`ssl_protocols` = :ssl_protocols, `ssl_protocols` = :ssl_protocols,
`ssl_cipher_list` = :ssl_cipher_list, `ssl_cipher_list` = :ssl_cipher_list,
`tlsv13_cipher_list` = :tlsv13_cipher_list `tlsv13_cipher_list` = :tlsv13_cipher_list,
`ssl_enabled` = :sslenabled
"); ");
$params = array( $params = array(
"customerid" => $customer['customerid'], "customerid" => $customer['customerid'],
"adminid" => $customer['adminid'], "adminid" => $customer['adminid'],
"domain" => $completedomain, "domain" => $completedomain,
"domain_ace" => $idna_convert->decode($completedomain),
"documentroot" => $path, "documentroot" => $path,
"aliasdomain" => $aliasdomain != 0 ? $aliasdomain : null, "aliasdomain" => $aliasdomain != 0 ? $aliasdomain : null,
"parentdomainid" => $domain_check['id'], "parentdomainid" => $domain_check['id'],
@@ -305,7 +313,8 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
"override_tls" => $domain_check['override_tls'], "override_tls" => $domain_check['override_tls'],
"ssl_protocols" => $domain_check['ssl_protocols'], "ssl_protocols" => $domain_check['ssl_protocols'],
"ssl_cipher_list" => $domain_check['ssl_cipher_list'], "ssl_cipher_list" => $domain_check['ssl_cipher_list'],
"tlsv13_cipher_list" => $domain_check['tlsv13_cipher_list'] "tlsv13_cipher_list" => $domain_check['tlsv13_cipher_list'],
"sslenabled" => $sslenabled
); );
Database::pexecute($stmt, $params, true, true); Database::pexecute($stmt, $params, true, true);
$subdomain_id = Database::lastInsertId(); $subdomain_id = Database::lastInsertId();
@@ -446,6 +455,8 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
* optional, php-settings-id, if empty the $domain value is used * optional, php-settings-id, if empty the $domain value is used
* @param int $redirectcode * @param int $redirectcode
* optional, redirect-code-id from TABLE_PANEL_REDIRECTCODES * optional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
* @param bool $sslenabled
* optional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (true)
* @param bool $ssl_redirect * @param bool $ssl_redirect
* optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled * optional, whether to generate a https-redirect or not, default false; requires SSL to be enabled
* @param bool $letsencrypt * @param bool $letsencrypt
@@ -493,6 +504,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$phpsettingid = $this->getParam('phpsettingid', true, $result['phpsettingid']); $phpsettingid = $this->getParam('phpsettingid', true, $result['phpsettingid']);
$redirectcode = $this->getParam('redirectcode', true, \Froxlor\Domain\Domain::getDomainRedirectId($id)); $redirectcode = $this->getParam('redirectcode', true, \Froxlor\Domain\Domain::getDomainRedirectId($id));
if (Settings::Get('system.use_ssl')) { if (Settings::Get('system.use_ssl')) {
$sslenabled = $this->getBoolParam('sslenabled', true, $result['ssl_enabled']);
$ssl_redirect = $this->getBoolParam('ssl_redirect', true, $result['ssl_redirect']); $ssl_redirect = $this->getBoolParam('ssl_redirect', true, $result['ssl_redirect']);
$letsencrypt = $this->getBoolParam('letsencrypt', true, $result['letsencrypt']); $letsencrypt = $this->getBoolParam('letsencrypt', true, $result['letsencrypt']);
$http2 = $this->getBoolParam('http2', true, $result['http2']); $http2 = $this->getBoolParam('http2', true, $result['http2']);
@@ -500,6 +512,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$hsts_sub = $this->getBoolParam('hsts_sub', true, $result['hsts_sub']); $hsts_sub = $this->getBoolParam('hsts_sub', true, $result['hsts_sub']);
$hsts_preload = $this->getBoolParam('hsts_preload', true, $result['hsts_preload']); $hsts_preload = $this->getBoolParam('hsts_preload', true, $result['hsts_preload']);
} else { } else {
$sslenabled = 0;
$ssl_redirect = 0; $ssl_redirect = 0;
$letsencrypt = 0; $letsencrypt = 0;
$http2 = 0; $http2 = 0;
@@ -610,14 +623,15 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
if ($path != $result['documentroot'] || $isemaildomain != $result['isemaildomain'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $aliasdomain != $result['aliasdomain'] || $openbasedir_path != $result['openbasedir_path'] || $ssl_redirect != $result['ssl_redirect'] || $letsencrypt != $result['letsencrypt'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload'] || $phpsettingid != $result['phpsettingid']) { if ($path != $result['documentroot'] || $isemaildomain != $result['isemaildomain'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $aliasdomain != $result['aliasdomain'] || $openbasedir_path != $result['openbasedir_path'] || $ssl_redirect != $result['ssl_redirect'] || $letsencrypt != $result['letsencrypt'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload'] || $phpsettingid != $result['phpsettingid']) {
$stmt = Database::prepare(" $stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
`documentroot`= :documentroot, `documentroot` = :documentroot,
`isemaildomain`= :isemaildomain, `isemaildomain` = :isemaildomain,
`wwwserveralias`= :wwwserveralias, `wwwserveralias` = :wwwserveralias,
`iswildcarddomain`= :iswildcarddomain, `iswildcarddomain` = :iswildcarddomain,
`aliasdomain`= :aliasdomain, `aliasdomain` = :aliasdomain,
`openbasedir_path`= :openbasedir_path, `openbasedir_path` = :openbasedir_path,
`ssl_redirect`= :ssl_redirect, `ssl_enabled` = :sslenabled,
`letsencrypt`= :letsencrypt, `ssl_redirect` = :ssl_redirect,
`letsencrypt` = :letsencrypt,
`http2` = :http2, `http2` = :http2,
`hsts` = :hsts, `hsts` = :hsts,
`hsts_sub` = :hsts_sub, `hsts_sub` = :hsts_sub,
@@ -632,6 +646,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
"iswildcarddomain" => $iswildcarddomain, "iswildcarddomain" => $iswildcarddomain,
"aliasdomain" => ($aliasdomain != 0 && $alias_check == 0) ? $aliasdomain : null, "aliasdomain" => ($aliasdomain != 0 && $alias_check == 0) ? $aliasdomain : null,
"openbasedir_path" => $openbasedir_path, "openbasedir_path" => $openbasedir_path,
"sslenabled" => $sslenabled,
"ssl_redirect" => $ssl_redirect, "ssl_redirect" => $ssl_redirect,
"letsencrypt" => $letsencrypt, "letsencrypt" => $letsencrypt,
"http2" => $http2, "http2" => $http2,
@@ -752,6 +767,7 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
'`d`.`id`', '`d`.`id`',
'`d`.`customerid`', '`d`.`customerid`',
'`d`.`domain`', '`d`.`domain`',
'`d`.`domain_ace`',
'`d`.`documentroot`', '`d`.`documentroot`',
'`d`.`isbinddomain`', '`d`.`isbinddomain`',
'`d`.`isemaildomain`', '`d`.`isemaildomain`',
@@ -767,13 +783,14 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
// prepare select statement // prepare select statement
$domains_stmt = Database::prepare(" $domains_stmt = Database::prepare("
SELECT " . implode(",", $select_fields) . ", `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` SELECT " . implode(",", $select_fields) . ", IF(`d`.`parentdomainid` > 0, `pd`.`domain_ace`, `d`.`domain_ace`) AS `parentdomainname`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias`
FROM `" . TABLE_PANEL_DOMAINS . "` `d` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON `pd`.`id`=`d`.`parentdomainid`
WHERE `d`.`customerid` IN (" . implode(', ', $customer_ids) . ") WHERE `d`.`customerid` IN (" . implode(', ', $customer_ids) . ")
AND `d`.`email_only` = '0' AND `d`.`email_only` = '0'
AND `d`.`id` NOT IN (" . implode(', ', $customer_stdsubs) . ")" . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit()); AND `d`.`id` NOT IN (" . implode(', ', $customer_stdsubs) . ")" . $this->getSearchWhere($query_fields, true) . " GROUP BY `d`.`id` ORDER BY `parentdomainname` " . $this->getOrderBy(true) . $this->getLimit());
$result = array(); $result = array();
Database::pexecute($domains_stmt, $query_fields, true, true); Database::pexecute($domains_stmt, $query_fields, true, true);
@@ -839,8 +856,6 @@ class SubDomains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resourc
$domains_stmt = Database::prepare(" $domains_stmt = Database::prepare("
SELECT COUNT(*) as num_subdom SELECT COUNT(*) as num_subdom
FROM `" . TABLE_PANEL_DOMAINS . "` `d` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
WHERE `d`.`customerid` IN (" . implode(', ', $customer_ids) . ") WHERE `d`.`customerid` IN (" . implode(', ', $customer_ids) . ")
AND `d`.`email_only` = '0' AND `d`.`email_only` = '0'
AND `d`.`id` NOT IN (" . implode(', ', $customer_stdsubs) . ") AND `d`.`id` NOT IN (" . implode(', ', $customer_stdsubs) . ")

View File

@@ -55,7 +55,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
if (count($customer_names) > 0) { if (count($customer_names) > 0) {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_LOG . "` SELECT * FROM `" . TABLE_PANEL_LOG . "`
WHERE `user` = :loginname OR `user` IN (" . implode(', ', $customer_names) . ")" . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit()); WHERE `user` = :loginname OR `user` IN ('" . implode("', '", $customer_names) . "')" . $this->getSearchWhere($query_fields, true) . $this->getOrderBy() . $this->getLimit());
} else { } else {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_LOG . "` SELECT * FROM `" . TABLE_PANEL_LOG . "`
@@ -105,7 +105,7 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
if (count($customer_names) > 0) { if (count($customer_names) > 0) {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT COUNT(*) as num_logs FROM `" . TABLE_PANEL_LOG . "` SELECT COUNT(*) as num_logs FROM `" . TABLE_PANEL_LOG . "`
WHERE `user` = :loginname OR `user` IN (" . implode(', ', $customer_names) . ") WHERE `user` = :loginname OR `user` IN ('" . implode("', '", $customer_names) . "')
"); ");
} else { } else {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
@@ -190,20 +190,19 @@ class SysLog extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
} }
if (count($customer_names) > 0) { if (count($customer_names) > 0) {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc AND `user` = :loginname OR `user` IN (" . implode(', ', $customer_names) . ") DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc AND `user` = :loginname OR `user` IN ('" . implode("', '", $customer_names) . "')
"); ");
} else { } else {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT COUNT(*) as num_logs FROM `" . TABLE_PANEL_LOG . "` DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc AND `user` = :loginname
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc AND `user` = :loginname ");
");
} }
$params = [ $params = [
'loginname' => $this->getUserDetail('loginname') 'loginname' => $this->getUserDetail('loginname')
]; ];
} }
$params['trunc'] = $truncatedate; $params['trunc'] = $truncatedate;
Database::execute($result_stmt, $params, true, true); Database::pexecute($result_stmt, $params, true, true);
$this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog"); $this->logger()->logAction($this->isAdmin() ? \Froxlor\FroxlorLogger::ADM_ACTION : \Froxlor\FroxlorLogger::USR_ACTION, LOG_WARNING, "[API] truncated the froxlor syslog");
return $this->response(200, "successfull", true); return $this->response(200, "successfull", true);
} }

View File

@@ -56,7 +56,7 @@ class FroxlorRPC
private static function validateAuth($key, $secret) private static function validateAuth($key, $secret)
{ {
$sel_stmt = \Froxlor\Database\Database::prepare(" $sel_stmt = \Froxlor\Database\Database::prepare("
SELECT ak.*, a.api_allowed as admin_api_allowed, c.api_allowed as cust_api_allowed SELECT ak.*, a.api_allowed as admin_api_allowed, c.api_allowed as cust_api_allowed, c.deactivated
FROM `api_keys` ak FROM `api_keys` ak
LEFT JOIN `panel_admins` a ON a.adminid = ak.adminid LEFT JOIN `panel_admins` a ON a.adminid = ak.adminid
LEFT JOIN `panel_customers` c ON c.customerid = ak.customerid LEFT JOIN `panel_customers` c ON c.customerid = ak.customerid
@@ -67,7 +67,7 @@ class FroxlorRPC
'as' => $secret 'as' => $secret
), true, true); ), true, true);
if ($result) { if ($result) {
if ($result['apikey'] == $key && $result['secret'] == $secret && ($result['valid_until'] == - 1 || $result['valid_until'] >= time()) && (($result['customerid'] == 0 && $result['admin_api_allowed'] == 1) || ($result['customerid'] > 0 && $result['cust_api_allowed'] == 1))) { if ($result['apikey'] == $key && $result['secret'] == $secret && ($result['valid_until'] == - 1 || $result['valid_until'] >= time()) && (($result['customerid'] == 0 && $result['admin_api_allowed'] == 1) || ($result['customerid'] > 0 && $result['cust_api_allowed'] == 1 && $result['deactivated'] == 0))) {
// get user to check whether api call is allowed // get user to check whether api call is allowed
if (! empty($result['allowed_from'])) { if (! empty($result['allowed_from'])) {
// @todo allow specification and validating of whole subnets later // @todo allow specification and validating of whole subnets later

View File

@@ -112,7 +112,10 @@ class Bind extends DnsBase
if (count($this->ns) > 0) { if (count($this->ns) > 0) {
foreach ($this->ns as $ns) { foreach ($this->ns as $ns) {
foreach ($ns["ips"] as $ip) { foreach ($ns["ips"] as $ip) {
$bindconf_file .= ' ' . $ip . ";\n"; $ip = \Froxlor\Validate\Validate::validate_ip2($ip, true, 'invalidip', true, true, true);
if ($ip) {
$bindconf_file .= ' ' . $ip . ";\n";
}
} }
} }
} }

View File

@@ -442,7 +442,9 @@ class Apache extends HttpConfigBase
'loginname' => 'froxlor.panel', 'loginname' => 'froxlor.panel',
'documentroot' => $mypath, 'documentroot' => $mypath,
'customerroot' => $mypath, 'customerroot' => $mypath,
'parentdomainid' => 0 'parentdomainid' => 0,
'ssl_honorcipherorder' => Settings::Get('system.honorcipherorder'),
'ssl_sessiontickets' => Settings::Get('system.sessiontickets')
); );
// override corresponding array values // override corresponding array values
@@ -478,9 +480,12 @@ class Apache extends HttpConfigBase
$this->virtualhosts_data[$vhosts_filename] .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n"; $this->virtualhosts_data[$vhosts_filename] .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n";
} }
$this->virtualhosts_data[$vhosts_filename] .= ' SSLCompression Off' . "\n"; $this->virtualhosts_data[$vhosts_filename] .= ' SSLCompression Off' . "\n";
if (Settings::Get('system.sessionticketsenabled') == '1') {
$this->virtualhosts_data[$vhosts_filename] .= ' SSLSessionTickets ' . ($domain['ssl_sessiontickets'] == '1' ? 'on' : 'off') . "\n";
}
} }
// this makes it more secure, thx to Marcel (08/2013)
$this->virtualhosts_data[$vhosts_filename] .= ' SSLHonorCipherOrder On' . "\n"; $this->virtualhosts_data[$vhosts_filename] .= ' SSLHonorCipherOrder ' . ($domain['ssl_honorcipherorder'] == '1' ? 'on' : 'off') . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n"; $this->virtualhosts_data[$vhosts_filename] .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n";
$protocols = array_map('trim', explode(",", Settings::Get('system.ssl_protocols'))); $protocols = array_map('trim', explode(",", Settings::Get('system.ssl_protocols')));
if (in_array("TLSv1.3", $protocols) && ! empty(Settings::Get('system.tlsv13_cipher_list')) && Settings::Get('system.apache24') == 1) { if (in_array("TLSv1.3", $protocols) && ! empty(Settings::Get('system.tlsv13_cipher_list')) && Settings::Get('system.apache24') == 1) {
@@ -755,7 +760,7 @@ class Apache extends HttpConfigBase
$logtype = 'combined'; $logtype = 'combined';
if (Settings::Get('system.logfiles_format') != '') { if (Settings::Get('system.logfiles_format') != '') {
$logtype = 'frx_custom'; $logtype = 'frx_custom';
$logfiles_text .= ' LogFormat "' . Settings::Get('system.logfiles_format') . '" ' . $logtype . "\n"; $logfiles_text .= ' LogFormat ' . Settings::Get('system.logfiles_format') . ' ' . $logtype . "\n";
} }
if (Settings::Get('system.logfiles_type') == '2' && Settings::Get('system.logfiles_format') == '') { if (Settings::Get('system.logfiles_type') == '2' && Settings::Get('system.logfiles_format') == '') {
$logtype = 'vhost_combined'; $logtype = 'vhost_combined';
@@ -986,9 +991,11 @@ class Apache extends HttpConfigBase
$vhost_content .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n"; $vhost_content .= ' SSLOpenSSLConfCmd DHParameters "' . $dhparams . '"' . "\n";
} }
$vhost_content .= ' SSLCompression Off' . "\n"; $vhost_content .= ' SSLCompression Off' . "\n";
if (Settings::Get('system.sessionticketsenabled') == '1') {
$vhost_content .= ' SSLSessionTickets ' . ($domain['ssl_sessiontickets'] == '1' ? 'on' : 'off') . "\n";
}
} }
// this makes it more secure, thx to Marcel (08/2013) $vhost_content .= ' SSLHonorCipherOrder ' . ($domain['ssl_honorcipherorder'] == '1' ? 'on' : 'off') . "\n";
$vhost_content .= ' SSLHonorCipherOrder On' . "\n";
$vhost_content .= ' SSLCipherSuite ' . $ssl_cipher_list . "\n"; $vhost_content .= ' SSLCipherSuite ' . $ssl_cipher_list . "\n";
$protocols = array_map('trim', explode(",", $ssl_protocols)); $protocols = array_map('trim', explode(",", $ssl_protocols));
if (in_array("TLSv1.3", $protocols) && ! empty($tlsv13_cipher_list) && Settings::Get('system.apache24') == 1) { if (in_array("TLSv1.3", $protocols) && ! empty($tlsv13_cipher_list) && Settings::Get('system.apache24') == 1) {
@@ -1114,7 +1121,7 @@ class Apache extends HttpConfigBase
// Create vhost without ssl // Create vhost without ssl
$this->virtualhosts_data[$vhosts_filename] .= $this->getVhostContent($domain, false); $this->virtualhosts_data[$vhosts_filename] .= $this->getVhostContent($domain, false);
if ($domain['ssl'] == '1' || $domain['ssl_redirect'] == '1') { if ($domain['ssl_enabled'] == '1' && ($domain['ssl'] == '1' || $domain['ssl_redirect'] == '1')) {
// Adding ssl stuff if enabled // Adding ssl stuff if enabled
$vhosts_filename_ssl = $this->getVhostFilename($domain, true); $vhosts_filename_ssl = $this->getVhostFilename($domain, true);
$this->virtualhosts_data[$vhosts_filename_ssl] = '# Domain ID: ' . $domain['id'] . ' (SSL) - CustomerID: ' . $domain['customerid'] . ' - CustomerLogin: ' . $domain['loginname'] . "\n"; $this->virtualhosts_data[$vhosts_filename_ssl] = '# Domain ID: ' . $domain['id'] . ' (SSL) - CustomerID: ' . $domain['customerid'] . ' - CustomerLogin: ' . $domain['loginname'] . "\n";

View File

@@ -68,6 +68,11 @@ class DomainSSL
'ssl_key_file' => \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.key') 'ssl_key_file' => \Froxlor\FileDir::makeCorrectFile($sslcertpath . '/' . $domain['domain'] . '.key')
); );
if (! $this->validateCertificate($dom_certs)) {
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_ERR, 'Given SSL private key for ' . $domain['domain'] . ' does not seem to match the certificate. Cannot create ssl-directives');
return;
}
if (Settings::Get('system.webserver') == 'lighttpd') { if (Settings::Get('system.webserver') == 'lighttpd') {
// put my.crt and my.key together for lighty. // put my.crt and my.key together for lighty.
$dom_certs['ssl_cert_file'] = trim($dom_certs['ssl_cert_file']) . "\n" . trim($dom_certs['ssl_key_file']) . "\n"; $dom_certs['ssl_cert_file'] = trim($dom_certs['ssl_cert_file']) . "\n" . trim($dom_certs['ssl_key_file']) . "\n";
@@ -112,4 +117,9 @@ class DomainSSL
return; return;
} }
private function validateCertificate($dom_certs = array())
{
return openssl_x509_check_private_key($dom_certs['ssl_cert_file'], $dom_certs['ssl_key_file']);
}
} }

View File

@@ -84,7 +84,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
) )
"); ");
$customer_ssl = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC); $customer_ssl = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
if (!$customer_ssl) { if (! $customer_ssl) {
$customer_ssl = array(); $customer_ssl = array();
} }
@@ -96,7 +96,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
(`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `expirationdate` IS NULL) (`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `expirationdate` IS NULL)
"); ");
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt); $froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
if (!$froxlor_ssl) { if (! $froxlor_ssl) {
$froxlor_ssl = array(); $froxlor_ssl = array();
} }
} }
@@ -126,7 +126,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
self::checkInstall(); self::checkInstall();
self::$apiserver = 'https://acme-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org/directory'; self::$apiserver = 'https://acme-'.(Settings::Get('system.letsencryptca') == 'testing' ? 'staging-' : '').'v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org/directory';
FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Requesting/renewing Let's Encrypt certificates"); FroxlorLogger::getInstanceOf()->logAction(FroxlorLogger::CRON_ACTION, LOG_INFO, "Requesting/renewing Let's Encrypt certificates");
@@ -339,6 +339,9 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
if ($force) { if ($force) {
$acmesh_cmd .= " --force"; $acmesh_cmd .= " --force";
} }
if (defined('CRON_DEBUG_FLAG')) {
$acmesh_cmd .= " --debug";
}
$acme_result = \Froxlor\FileDir::safe_exec($acmesh_cmd); $acme_result = \Froxlor\FileDir::safe_exec($acmesh_cmd);
// debug output of acme.sh run // debug output of acme.sh run

View File

@@ -432,7 +432,7 @@ class Lighttpd extends HttpConfigBase
protected function getVhostContent($domain, $ssl_vhost = false, $ipid = 0) protected function getVhostContent($domain, $ssl_vhost = false, $ipid = 0)
{ {
if ($ssl_vhost === true && $domain['ssl'] != '1' && $domain['ssl_redirect'] != '1') { if ($ssl_vhost === true && $domain['ssl'] != '1' && $domain['ssl_enabled'] != '1' && $domain['ssl_redirect'] != '1') {
return ''; return '';
} }
@@ -586,7 +586,7 @@ class Lighttpd extends HttpConfigBase
$ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n"; $ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n";
$ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n"; $ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n";
$ssl_settings .= 'ssl.cipher-list = "' . $ssl_cipher_list . '"' . "\n"; $ssl_settings .= 'ssl.cipher-list = "' . $ssl_cipher_list . '"' . "\n";
$ssl_settings .= 'ssl.honor-cipher-order = "enable"' . "\n"; $ssl_settings .= 'ssl.honor-cipher-order = ' . ($domain['ssl_honorcipherorder'] == '1' ? '"enable"' : '"disable"') . "\n";
$ssl_settings .= 'ssl.pemfile = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n"; $ssl_settings .= 'ssl.pemfile = "' . \Froxlor\FileDir::makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
if ($domain['ssl_ca_file'] != '') { if ($domain['ssl_ca_file'] != '') {

View File

@@ -71,7 +71,7 @@ class Nginx extends HttpConfigBase
} }
$logtype = 'frx_custom'; $logtype = 'frx_custom';
$this->nginx_data[$vhosts_filename] = 'log_format ' . $logtype . ' "' . Settings::Get('system.logfiles_format') . '";' . "\n"; $this->nginx_data[$vhosts_filename] = 'log_format ' . $logtype . ' ' . Settings::Get('system.logfiles_format') . ';' . "\n";
} }
} }
@@ -226,7 +226,12 @@ class Nginx extends HttpConfigBase
$aliases = " " . trim($aliases); $aliases = " " . trim($aliases);
} }
$this->nginx_data[$vhost_filename] .= "\t" . 'server_name ' . Settings::Get('system.hostname') . $aliases . ';' . "\n"; $this->nginx_data[$vhost_filename] .= "\t" . 'server_name ' . Settings::Get('system.hostname') . $aliases . ';' . "\n";
$this->nginx_data[$vhost_filename] .= "\t" . 'access_log /var/log/nginx/access.log;' . "\n";
$logtype = 'combined';
if (Settings::Get('system.logfiles_format') != '') {
$logtype = 'frx_custom';
}
$this->nginx_data[$vhost_filename] .= "\t" . 'access_log /var/log/nginx/access.log ' . $logtype . ';' . "\n";
if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.leenabled') == '1' && Settings::Get('system.le_froxlor_enabled') == '1') { if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.leenabled') == '1' && Settings::Get('system.le_froxlor_enabled') == '1') {
$acmeConfFilename = Settings::Get('system.letsencryptacmeconf'); $acmeConfFilename = Settings::Get('system.letsencryptacmeconf');
@@ -272,6 +277,8 @@ class Nginx extends HttpConfigBase
*/ */
if ($row_ipsandports['ssl'] == '1') { if ($row_ipsandports['ssl'] == '1') {
$row_ipsandports['domain'] = Settings::Get('system.hostname'); $row_ipsandports['domain'] = Settings::Get('system.hostname');
$row_ipsandports['ssl_honorcipherorder'] = Settings::Get('system.honorcipherorder');
$row_ipsandports['ssl_sessiontickets'] = Settings::Get('system.sessiontickets');
$this->nginx_data[$vhost_filename] .= $this->composeSslSettings($row_ipsandports); $this->nginx_data[$vhost_filename] .= $this->composeSslSettings($row_ipsandports);
if ($row_ipsandports['ssl_specialsettings'] != '') { if ($row_ipsandports['ssl_specialsettings'] != '') {
$this->nginx_data[$vhost_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], array( $this->nginx_data[$vhost_filename] .= $this->processSpecialConfigTemplate($row_ipsandports['ssl_specialsettings'], array(
@@ -537,7 +544,7 @@ class Nginx extends HttpConfigBase
} }
if ($domain['ssl_specialsettings'] != '' && $ssl_vhost == true) { if ($domain['ssl_specialsettings'] != '' && $ssl_vhost == true) {
$vhost_content .= $this->processSpecialConfigTemplate($domain['ssl_specialsettings'], $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n"; $vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate($domain['ssl_specialsettings'], $domain, $domain['ip'], $domain['port'], $ssl_vhost));
} }
if ($_vhost_content != '') { if ($_vhost_content != '') {
@@ -549,7 +556,7 @@ class Nginx extends HttpConfigBase
} }
if (Settings::Get('system.default_sslvhostconf') != '' && $ssl_vhost == true) { if (Settings::Get('system.default_sslvhostconf') != '' && $ssl_vhost == true) {
$vhost_content .= $this->processSpecialConfigTemplate(Settings::Get('system.default_sslvhostconf'), $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n"; $vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate(Settings::Get('system.default_sslvhostconf'), $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n");
} }
} }
} }
@@ -562,6 +569,8 @@ class Nginx extends HttpConfigBase
{ {
// Remove windows linebreaks // Remove windows linebreaks
$vhost = str_replace("\r", "\n", $vhost); $vhost = str_replace("\r", "\n", $vhost);
// remove comments
$vhost = implode("\n", preg_replace('/^(\s+)?#(.*)$/', '', explode("\n", $vhost)));
// Break blocks into lines // Break blocks into lines
$vhost = str_replace(array( $vhost = str_replace(array(
"{", "{",
@@ -691,14 +700,17 @@ class Nginx extends HttpConfigBase
if (! file_exists($dhparams)) { if (! file_exists($dhparams)) {
\Froxlor\FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096'); \Froxlor\FileDir::safe_exec('openssl dhparam -out ' . escapeshellarg($dhparams) . ' 4096');
} }
$sslsettings .= 'ssl_dhparam ' . $dhparams . ';' . "\n"; $sslsettings .= "\t" . 'ssl_dhparam ' . $dhparams . ';' . "\n";
} }
// When <1.11.0: Defaults to prime256v1, similar to first curve recommendation by Mozilla. // When <1.11.0: Defaults to prime256v1, similar to first curve recommendation by Mozilla.
// (When specifyng just one, there's no fallback when specific curve is not supported by client.) // (When specifyng just one, there's no fallback when specific curve is not supported by client.)
// When >1.11.0: Defaults to auto, using recommended curves provided by OpenSSL. // When >1.11.0: Defaults to auto, using recommended curves provided by OpenSSL.
// see https://github.com/Froxlor/Froxlor/issues/652 // see https://github.com/Froxlor/Froxlor/issues/652
// $sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n"; // $sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n"; $sslsettings .= "\t" . 'ssl_prefer_server_ciphers ' . (isset($domain_or_ip['ssl_honorcipherorder']) && $domain_or_ip['ssl_honorcipherorder'] == '1' ? 'on' : 'off') . ';' . "\n";
if (Settings::Get('system.sessionticketsenabled') == '1') {
$sslsettings .= "\t" . 'ssl_session_tickets ' . (isset($domain_or_ip['ssl_sessiontickets']) && $domain_or_ip['ssl_sessiontickets'] == '1' ? 'on' : 'off') . ';' . "\n";
}
$sslsettings .= "\t" . 'ssl_session_cache shared:SSL:10m;' . "\n"; $sslsettings .= "\t" . 'ssl_session_cache shared:SSL:10m;' . "\n";
$sslsettings .= "\t" . 'ssl_certificate ' . \Froxlor\FileDir::makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n"; $sslsettings .= "\t" . 'ssl_certificate ' . \Froxlor\FileDir::makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";

View File

@@ -115,6 +115,7 @@ class Fpm
$fpm_requests = (int) $this->fpm_cfg['max_requests']; $fpm_requests = (int) $this->fpm_cfg['max_requests'];
$fpm_process_idle_timeout = (int) $this->fpm_cfg['idle_timeout']; $fpm_process_idle_timeout = (int) $this->fpm_cfg['idle_timeout'];
$fpm_limit_extensions = $this->fpm_cfg['limit_extensions']; $fpm_limit_extensions = $this->fpm_cfg['limit_extensions'];
$fpm_custom_config = $this->fpm_cfg['custom_config'];
if ($fpm_children == 0) { if ($fpm_children == 0) {
$fpm_children = 1; $fpm_children = 1;
@@ -260,6 +261,12 @@ class Fpm
$fpm_config .= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f ' . $this->domain['email'] . "\n"; $fpm_config .= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f ' . $this->domain['email'] . "\n";
} }
// append custom phpfpm configuration
if (! empty($fpm_custom_config)) {
$fpm_config .= "\n; Custom Configuration\n";
$fpm_config .= \Froxlor\PhpHelper::replaceVariables($fpm_custom_config, $php_ini_variables);
}
fwrite($fh, $fpm_config, strlen($fpm_config)); fwrite($fh, $fpm_config, strlen($fpm_config));
fclose($fh); fclose($fh);
} }

View File

@@ -36,7 +36,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
if ((int) Settings::Get('system.report_trafficmax') > 0) { if ((int) Settings::Get('system.report_trafficmax') > 0) {
// Warn the customers at xx% traffic-usage // Warn the customers at xx% traffic-usage
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`, `c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`, `a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,
(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`) (SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)
@@ -60,11 +60,15 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
$rep_userinfo = array( $rep_userinfo = array(
'name' => $row['name'], 'name' => $row['name'],
'firstname' => $row['firstname'], 'firstname' => $row['firstname'],
'company' => $row['company'] 'company' => $row['company'],
'customernumber' => $row['customernumber']
); );
$replace_arr = array( $replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo), 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
'NAME' => $row['name'], // < keep this for compatibility 'NAME' => $rep_userinfo['name'],
'FIRSTNAME' => $rep_userinfo['firstname'],
'COMPANY' => $rep_userinfo['company'],
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */ '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 */ 'TRAFFICUSED' => round(($row['traffic_used'] / 1024), 2), /* traffic is stored in KB, template uses MB */
'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2), 'USAGE_PERCENT' => round(($row['traffic_used'] * 100) / $row['traffic'], 2),
@@ -168,8 +172,8 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
$replace_arr = array( $replace_arr = array(
'NAME' => $row['name'], 'NAME' => $row['name'],
'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */ 'TRAFFIC' => round(($row['traffic'] / 1024), 2), /* traffic is stored in KB, template uses MB */
'TRAFFICUSED' => round(($row['traffic_used_total'] / 1024), 2), /* traffic is stored in KB, template uses MB */ 'TRAFFICUSED' => round(($row['traffic_used_total'] / 1024), 2), /* traffic is stored in KB, template uses MB */
'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2), 'USAGE_PERCENT' => round(($row['traffic_used_total'] * 100) / $row['traffic'], 2),
'MAX_PERCENT' => Settings::Get('system.report_trafficmax') 'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
); );
@@ -343,7 +347,7 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
* report about diskusage for customers * report about diskusage for customers
*/ */
$result_stmt = Database::query(" $result_stmt = Database::query("
SELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`, SELECT `c`.`customerid`, `c`.`customernumber`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,
`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`, `c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,
`a`.`name` AS `adminname`, `a`.`email` AS `adminmail` `a`.`name` AS `adminname`, `a`.`email` AS `adminmail`
FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c` FROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`
@@ -361,11 +365,15 @@ class ReportsCron extends \Froxlor\Cron\FroxlorCron
$rep_userinfo = array( $rep_userinfo = array(
'name' => $row['name'], 'name' => $row['name'],
'firstname' => $row['firstname'], 'firstname' => $row['firstname'],
'company' => $row['company'] 'company' => $row['company'],
'customernumber' => $row['customernumber']
); );
$replace_arr = array( $replace_arr = array(
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo), 'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($rep_userinfo),
'NAME' => $row['name'], // < keep this for compatibility 'NAME' => $rep_userinfo['name'],
'FIRSTNAME' => $rep_userinfo['firstname'],
'COMPANY' => $rep_userinfo['company'],
'CUSTOMER_NO' => $rep_userinfo['customernumber'],
'DISKAVAILABLE' => round(($row['diskspace'] / 1024), 2), /* traffic is stored in KB, template uses MB */ '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 */ 'DISKUSED' => round($row['diskspace_used'] / 1024, 2), /* traffic is stored in KB, template uses MB */
'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2), 'USAGE_PERCENT' => round(($row['diskspace_used'] * 100) / $row['diskspace'], 2),

View File

@@ -137,7 +137,11 @@ class TrafficCron extends \Froxlor\Cron\FroxlorCron
$mysqlusage_all[$row_database['customerid']] = 0; $mysqlusage_all[$row_database['customerid']] = 0;
} }
// sum up result // sum up result
$mysqlusage_all[$row_database['customerid']] += floatval($mysql_usage_row['customerusage']); if ($mysql_usage_row) {
$mysqlusage_all[$row_database['customerid']] += floatval($mysql_usage_row['customerusage']);
} else {
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_WARNING, "Cannot get usage for database " . $row_database['databasename'] . ".");
}
} else { } else {
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_WARNING, "Seems like the database " . $row_database['databasename'] . " had been removed manually."); \Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_WARNING, "Seems like the database " . $row_database['databasename'] . " had been removed manually.");
} }

View File

@@ -78,36 +78,35 @@ class DbManagerMySQL
public function grantPrivilegesTo($username = null, $password = null, $access_host = null, $p_encrypted = false, $update = false) public function grantPrivilegesTo($username = null, $password = null, $access_host = null, $p_encrypted = false, $update = false)
{ {
if (! $update) { if (! $update) {
// mysql8 compatibility // create user
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) { if ($p_encrypted) {
// create user if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.0', '<')) {
$stmt = Database::prepare("
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY PASSWORD :password
");
} else {
$stmt = Database::prepare("
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password AS :password
");
}
} else {
$stmt = Database::prepare(" $stmt = Database::prepare("
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password
"); ");
Database::pexecute($stmt, array(
"password" => $password
));
// grant privileges
$stmt = Database::prepare("
GRANT ALL ON `" . $username . "`.* TO :username@:host
");
Database::pexecute($stmt, array(
"username" => $username,
"host" => $access_host
));
} else {
// grant privileges
$stmt = Database::prepare("
GRANT ALL PRIVILEGES ON `" . $username . "`.* TO :username@:host IDENTIFIED BY :password
");
Database::pexecute($stmt, array(
"username" => $username,
"host" => $access_host,
"password" => $password
));
} }
Database::pexecute($stmt, array(
"password" => $password
));
// grant privileges
$stmt = Database::prepare("
GRANT ALL ON `" . $username . "`.* TO :username@:host
");
Database::pexecute($stmt, array(
"username" => $username,
"host" => $access_host
));
} else { } else {
// set passoword // set password
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.6', '<')) { if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.6', '<')) {
if ($p_encrypted) { if ($p_encrypted) {
$stmt = Database::prepare("SET PASSWORD FOR :username@:host = :password"); $stmt = Database::prepare("SET PASSWORD FOR :username@:host = :password");
@@ -115,7 +114,11 @@ class DbManagerMySQL
$stmt = Database::prepare("SET PASSWORD FOR :username@:host = PASSWORD(:password)"); $stmt = Database::prepare("SET PASSWORD FOR :username@:host = PASSWORD(:password)");
} }
} else { } else {
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED BY :password"); if ($p_encrypted) {
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED WITH mysql_native_password AS :password");
} else {
$stmt = Database::prepare("ALTER USER :username@:host IDENTIFIED BY :password");
}
} }
Database::pexecute($stmt, array( Database::pexecute($stmt, array(
"username" => $username, "username" => $username,
@@ -158,7 +161,6 @@ class DbManagerMySQL
), false); ), false);
} }
$drop_stmt = Database::prepare("DROP DATABASE IF EXISTS `" . $dbname . "`"); $drop_stmt = Database::prepare("DROP DATABASE IF EXISTS `" . $dbname . "`");
Database::pexecute($drop_stmt); Database::pexecute($drop_stmt);
} }
@@ -247,7 +249,7 @@ class DbManagerMySQL
if ($user_only == false) { if ($user_only == false) {
if (! isset($allsqlusers[$row['User']]) || ! is_array($allsqlusers[$row['User']])) { if (! isset($allsqlusers[$row['User']]) || ! is_array($allsqlusers[$row['User']])) {
$allsqlusers[$row['User']] = array( $allsqlusers[$row['User']] = array(
'password' => $row['Password'], 'password' => $row['Password'] ?? $row['authentication_string'],
'hosts' => array() 'hosts' => array()
); );
} }

View File

@@ -160,7 +160,7 @@ class Dns
// unset special CAA required-entry // unset special CAA required-entry
unset($required_entries[$entry['type']][md5("@CAA@")]); unset($required_entries[$entry['type']][md5("@CAA@")]);
} }
if (Settings::Get('spf.use_spf') == '1' && $entry['type'] == 'TXT' && $entry['record'] == '@' && strtolower(substr($entry['content'], 0, 7)) == '"v=spf1') { if (Settings::Get('spf.use_spf') == '1' && $entry['type'] == 'TXT' && $entry['record'] == '@' && (strtolower(substr($entry['content'], 0, 7)) == '"v=spf1' || strtolower(substr($entry['content'], 0, 6)) == 'v=spf1') ) {
// unset special spf required-entry // unset special spf required-entry
unset($required_entries[$entry['type']][md5("@SPF@")]); unset($required_entries[$entry['type']][md5("@SPF@")]);
} }

View File

@@ -7,10 +7,10 @@ final class Froxlor
{ {
// Main version variable // Main version variable
const VERSION = '0.10.6'; const VERSION = '0.10.15';
// Database version (YYYYMMDDC where C is a daily counter) // Database version (YYYYMMDDC where C is a daily counter)
const DBVERSION = '201911130'; const DBVERSION = '202002290';
// Distribution branding-tag (used for Debian etc.) // Distribution branding-tag (used for Debian etc.)
const BRANDING = ''; const BRANDING = '';

View File

@@ -87,10 +87,13 @@ class FroxlorLogger
self::$ml->pushHandler(new SyslogHandler('froxlor', LOG_USER, Logger::DEBUG)); self::$ml->pushHandler(new SyslogHandler('froxlor', LOG_USER, Logger::DEBUG));
break; break;
case 'file': case 'file':
if (empty(Settings::Get('logger.logfile')) || ! is_writeable(Settings::Get('logger.logfile'))) { $logger_logfile = Settings::Get('logger.logfile');
// is_writable needs an existing file to check if it's actually writable
@touch($logger_logfile);
if (empty($logger_logfile) || ! is_writable($logger_logfile)) {
Settings::Set('logger.logfile', '/tmp/froxlor.log'); Settings::Set('logger.logfile', '/tmp/froxlor.log');
} }
self::$ml->pushHandler(new StreamHandler(Settings::Get('logger.logfile'), Logger::DEBUG)); self::$ml->pushHandler(new StreamHandler($logger_logfile, Logger::DEBUG));
break; break;
case 'mysql': case 'mysql':
self::$ml->pushHandler(new MysqlHandler(Logger::DEBUG)); self::$ml->pushHandler(new MysqlHandler(Logger::DEBUG));

View File

@@ -37,20 +37,31 @@ class Statistics
\Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf'))); \Froxlor\FileDir::safe_exec('mkdir -p ' . escapeshellarg(Settings::Get('system.awstats_conf')));
} }
$logformat = Settings::Get('system.awstats_logformat');
if (! is_numeric($logformat)) {
// if LogFormat is NOT numeric (e.g. 1,2,3,4), we quote it.
// 1-4 are pre-defined formats by awstats which must not be quoted to work properly. So if
// it is not a integer, it is something customized and we simply quote it.
// Only escaping double-quote should be fine, as we only put the whole string under double-quote.
$logformat = '"' . str_replace('"', '\"', Settings::Get('system.awstats_logformat')) . '"';
}
// These are the variables we will replace // These are the variables we will replace
$regex = array( $regex = array(
'/\{LOG_FILE\}/', '/\{LOG_FILE\}/',
'/\{SITE_DOMAIN\}/', '/\{SITE_DOMAIN\}/',
'/\{HOST_ALIASES\}/', '/\{HOST_ALIASES\}/',
'/\{CUSTOMER_DOCROOT\}/', '/\{CUSTOMER_DOCROOT\}/',
'/\{AWSTATS_CONF\}/' '/\{AWSTATS_CONF\}/',
'/\{AWSTATS_LOGFORMAT\}/'
); );
$replace = array( $replace = array(
\Froxlor\FileDir::makeCorrectFile($logFile), \Froxlor\FileDir::makeCorrectFile($logFile),
$siteDomain, $siteDomain,
$hostAliases, $hostAliases,
$awstats_dir, $awstats_dir,
\Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf')) \Froxlor\FileDir::makeCorrectDir(Settings::Get('system.awstats_conf')),
$logformat
); );
// File names // File names

View File

@@ -374,7 +374,7 @@ class PhpHelper
$returnval = array(); $returnval = array();
if (is_array($source)) { if (is_array($source)) {
$source = array_map('trim', $source); $source = array_map('trim', $source);
$source = array_filter($source, function ($value) { $returnval = array_filter($source, function ($value) {
return $value !== ''; return $value !== '';
}); });
} else { } else {

View File

@@ -12,5 +12,4 @@ class FroxlorVhostSettings
$result = Database::pexecute_first($sel_stmt); $result = Database::pexecute_first($sel_stmt);
return $result['vcentries'] > 0 ? true : false; return $result['vcentries'] > 0 ? true : false;
} }
} }

View File

@@ -242,8 +242,8 @@ class Store
$mysql_access_host_array = array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))); $mysql_access_host_array = array_map('trim', explode(',', Settings::Get('system.mysql_access_host')));
$mysql_access_host_array[] = $newfieldvalue; $mysql_access_host_array[] = $newfieldvalue;
$mysql_access_host_array = array_unique(\Froxlor\PhpHelper::arrayTrim($mysql_access_host_array)); $mysql_access_host_array = array_unique(\Froxlor\PhpHelper::arrayTrim($mysql_access_host_array));
$mysql_access_host = implode(',', $mysql_access_host_array);
\Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array); \Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array);
$mysql_access_host = implode(',', $mysql_access_host_array);
Settings::Set('system.mysql_access_host', $mysql_access_host); Settings::Set('system.mysql_access_host', $mysql_access_host);
} }
@@ -293,9 +293,11 @@ class Store
'cleanMySQLAccessHost' 'cleanMySQLAccessHost'
), $mysql_access_host_array); ), $mysql_access_host_array);
$mysql_access_host_array = array_unique($mysql_access_host_array); $mysql_access_host_array = array_unique(\Froxlor\PhpHelper::arrayTrim($mysql_access_host_array));
$newfieldvalue = implode(',', $mysql_access_host_array); $newfieldvalue = implode(',', $mysql_access_host_array);
\Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array); \Froxlor\Database\DbManager::correctMysqlUsers($mysql_access_host_array);
$mysql_access_host = implode(',', $mysql_access_host_array);
Settings::Set('system.mysql_access_host', $mysql_access_host);
} }
return $returnvalue; return $returnvalue;

View File

@@ -82,7 +82,8 @@ class Pagination
// add default ordering by given fields // add default ordering by given fields
if (count($fields) > 0) { if (count($fields) > 0) {
$orderfields = array_keys($fields); $orderfields = array_keys($fields);
$this->addOrderBy($orderfields[0]); $this->sortfield = $orderfields[0];
$this->addOrderBy($orderfields[0], $this->sortorder);
} }
} }
@@ -285,15 +286,22 @@ class Pagination
$stop = $pages; $stop = $pages;
} }
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;'; // check for possible sorting values and keep it
$orderstr = '';
if (!empty($this->sortfield)) {
$fieldname = htmlspecialchars($this->sortfield);
$orderstr .= '&amp;sortfield=' . $fieldname . '&amp;sortorder=' . $this->sortorder;
}
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1' . $orderstr . '">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . $orderstr . '">&lt;</a>&nbsp;';
for ($i = $start; $i <= $stop; $i ++) { for ($i = $start; $i <= $stop; $i ++) {
if ($i != $this->pageno) { if ($i != $this->pageno) {
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;'; $pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . $orderstr . '">' . $i . '</a>&nbsp;';
} else { } else {
$pagingcode .= ' <strong>' . $i . '</strong>&nbsp;'; $pagingcode .= ' <strong>' . $i . '</strong>&nbsp;';
} }
} }
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>'; $pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . $orderstr . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . $orderstr . '">&raquo;</a>';
} else { } else {
$pagingcode = ''; $pagingcode = '';
} }

520
lib/Froxlor/UI/Paging.php Normal file
View File

@@ -0,0 +1,520 @@
<?php
namespace Froxlor\UI;
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
*/
/**
* Class to manage paging system
*
* @package Functions
*/
class Paging
{
/**
* Userinfo
*
* @var array
*/
private $userinfo = array();
/**
* MySQL-Table
*
* @var string
*/
private $table = '';
/**
* Fields with description which should be selectable
*
* @var array
*/
private $fields = array();
/**
* Entries per page
*
* @var int
*/
private $entriesperpage = 0;
/**
* Number of entries of table
*
* @var int
*/
private $entries = 0;
/**
* Sortorder, asc or desc
*
* @var string
*/
public $sortorder = 'asc';
/**
* Sortfield
*
* @var string
*/
public $sortfield = '';
/**
* Searchfield
*
* @var string
*/
private $searchfield = '';
/**
* Searchtext
*
* @var string
*/
private $searchtext = '';
/**
* Pagenumber
*
* @var int
*/
private $pageno = 0;
/**
* Switch natsorting on/off
*
* @var bool
*/
private $natSorting = false;
private $limit = 0;
/**
* Class constructor.
* Loads settings from request or from userdata and saves them to session.
*
* @param
* array userinfo
* @param
* string Name of Table
* @param
* array Fields, in format array( 'fieldname_in_mysql' => 'field_caption' )
* @param
* int *deprecated* entries per page
* @param
* bool *deprecated* Switch natsorting on/off (global, affects all calls of sort)
* @param int $default_field
* default sorting-field-index
* @param string $default_order
* default sorting order 'asc' or 'desc'
*
*/
public function __construct($userinfo, $table, $fields, $entriesperpage = 0, $natSorting = false, $default_field = 0, $default_order = 'asc', $limit = 0)
{
// entries per page and natsorting-flag are not
// passed as parameter anymore, because these are
// from the settings anyway
$entriesperpage = \Froxlor\Settings::Get('panel.paging');
$natSorting = \Froxlor\Settings::Get('panel.natsorting');
$this->userinfo = $userinfo;
if (! is_array($this->userinfo['lastpaging'])) {
$this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true);
}
$this->table = $table;
$this->fields = $fields;
$this->entriesperpage = $entriesperpage;
$this->natSorting = $natSorting;
$checklastpaging = (isset($this->userinfo['lastpaging']['table']) && $this->userinfo['lastpaging']['table'] == $this->table);
$this->userinfo['lastpaging']['table'] = $this->table;
if (isset($_REQUEST['sortorder']) && (strtolower($_REQUEST['sortorder']) == 'desc' || strtolower($_REQUEST['sortorder']) == 'asc')) {
$this->sortorder = strtolower($_REQUEST['sortorder']);
} else {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortorder']) && (strtolower($this->userinfo['lastpaging']['sortorder']) == 'desc' || strtolower($this->userinfo['lastpaging']['sortorder']) == 'asc')) {
$this->sortorder = strtolower($this->userinfo['lastpaging']['sortorder']);
} else {
$this->sortorder = $default_order;
}
}
$this->userinfo['lastpaging']['sortorder'] = $this->sortorder;
if (isset($_REQUEST['sortfield']) && isset($fields[$_REQUEST['sortfield']])) {
$this->sortfield = $_REQUEST['sortfield'];
} else {
if ($checklastpaging && isset($this->userinfo['lastpaging']['sortfield']) && isset($fields[$this->userinfo['lastpaging']['sortfield']])) {
$this->sortfield = $this->userinfo['lastpaging']['sortfield'];
} else {
$fieldnames = array_keys($fields);
$this->sortfield = $fieldnames[$default_field];
}
}
$this->userinfo['lastpaging']['sortfield'] = $this->sortfield;
if (isset($_REQUEST['searchfield']) && isset($fields[$_REQUEST['searchfield']])) {
$this->searchfield = $_REQUEST['searchfield'];
} else {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchfield']) && isset($fields[$this->userinfo['lastpaging']['searchfield']])) {
$this->searchfield = $this->userinfo['lastpaging']['searchfield'];
} else {
$fieldnames = array_keys($fields);
$this->searchfield = $fieldnames[0];
}
}
$this->userinfo['lastpaging']['searchfield'] = $this->searchfield;
if (isset($_REQUEST['searchtext']) && (preg_match('/[-_@\p{L}\p{N}*.]+$/u', $_REQUEST['searchtext']) || $_REQUEST['searchtext'] === '')) {
$this->searchtext = trim($_REQUEST['searchtext']);
} else {
if ($checklastpaging && isset($this->userinfo['lastpaging']['searchtext']) && preg_match('/[-_@\p{L}\p{N}*.]+$/u', $this->userinfo['lastpaging']['searchtext'])) {
$this->searchtext = $this->userinfo['lastpaging']['searchtext'];
} else {
$this->searchtext = '';
}
}
$this->userinfo['lastpaging']['searchtext'] = $this->searchtext;
if (isset($_REQUEST['pageno']) && intval($_REQUEST['pageno']) != 0) {
$this->pageno = intval($_REQUEST['pageno']);
} else {
if ($checklastpaging && isset($this->userinfo['lastpaging']['pageno']) && intval($this->userinfo['lastpaging']['pageno']) != 0) {
$this->pageno = intval($this->userinfo['lastpaging']['pageno']);
} else {
$this->pageno = 1;
}
}
$this->userinfo['lastpaging']['pageno'] = $this->pageno;
$upd_stmt = \Froxlor\Database\Database::prepare("
UPDATE `" . TABLE_PANEL_SESSIONS . "` SET
`lastpaging` = :lastpaging
WHERE `hash` = :hash AND `userid` = :userid
AND `ipaddress` = :ipaddr AND `useragent` = :ua
AND `adminsession` = :adminsession
");
$upd_data = array(
'lastpaging' => json_encode($this->userinfo['lastpaging']),
'hash' => $userinfo['hash'],
'userid' => $userinfo['userid'],
'ipaddr' => $userinfo['ipaddress'],
'ua' => $userinfo['useragent'],
'adminsession' => $userinfo['adminsession']
);
\Froxlor\Database\Database::pexecute($upd_stmt, $upd_data);
$this->limit = $limit;
}
/**
* Sets number of entries and adjusts pageno if the number of entries doesn't correspond to the pageno.
*
* @param
* int entries
*/
public function setEntries($entries)
{
$this->entries = $entries;
if (($this->pageno - 1) * $this->entriesperpage > $this->entries) {
$this->pageno = 1;
}
return true;
}
/**
* Checks if a row should be displayed or not, used in loops
*
* @param
* int number of row
* @return bool to display or not to display, that's the question
*/
public function checkDisplay($count)
{
$begin = (intval($this->pageno) - 1) * intval($this->entriesperpage);
$end = (intval($this->pageno) * intval($this->entriesperpage));
return (($count >= $begin && $count < $end) || $this->entriesperpage == 0);
}
/**
* Returns condition code for sql query
*
* @param
* bool should returned condition code start with WHERE (false) or AND (true)?
* @return string the condition code
*/
public function getSqlWhere($append = false)
{
if ($this->searchtext != '') {
if ($append == true) {
$condition = ' AND ';
} else {
$condition = ' WHERE ';
}
$searchfield = explode('.', $this->searchfield);
foreach ($searchfield as $id => $field) {
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field[0] != '`') {
$field = '`' . $field;
}
$searchfield[$id] = $field;
}
$searchfield = implode('.', $searchfield);
$ops = array(
'<',
'>',
'='
);
// check if we use an operator or not
$useOper = 0;
$oper = "=";
if (in_array(substr($this->searchtext, 0, 1), $ops)) {
$useOper = 1;
$oper = substr($this->searchtext, 0, 1);
}
// check for diskspace and whether searchtext is a number
// in any other case the logical-operators would make no sense
if (strpos($searchfield, 'diskspace') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with diskspace is *1024
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024;
$useOper = 1;
} elseif (strpos($searchfield, 'traffic') > 0 && is_numeric(substr($this->searchtext, $useOper))) {
// anything with traffic is *1024*1024
$searchtext = ((int) substr($this->searchtext, $useOper)) * 1024 * 1024;
$useOper = 1;
} else {
// any other field
$searchtext = substr($this->searchtext, $useOper);
}
if ($useOper == 1 && is_numeric(substr($this->searchtext, $useOper))) {
// now as we use >, < or = we use the given operator and not LIKE
$condition .= $searchfield . " " . $oper . " " . \Froxlor\Database\Database::quote($searchtext);
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any
if (strpos($searchtext, '%') === false)
$searchtext = '%' . $searchtext . '%';
$condition .= $searchfield . " LIKE " . \Froxlor\Database\Database::quote($searchtext);
}
} else {
$condition = '';
}
return $condition;
}
/**
* Returns "order by"-code for sql query
*
* @param
* bool Switch natsorting on/off (local, affects just this call)
* @return string the "order by"-code
*/
public function getSqlOrderBy($natSorting = null)
{
$sortfield = explode('.', $this->sortfield);
foreach ($sortfield as $id => $field) {
if (substr($field, - 1, 1) != '`') {
$field .= '`';
}
if ($field[0] != '`') {
$field = '`' . $field;
}
$sortfield[$id] = $field;
}
$sortfield = implode('.', $sortfield);
$sortorder = strtoupper($this->sortorder);
if ($natSorting == true || ($natSorting === null && $this->natSorting == true)) {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57,
LEFT( " . $sortfield . ", 1 ), 0 ),
IF( ASCII( RIGHT( " . $sortfield . ", 1 ) ) > 57,
LPAD( " . $sortfield . ", 255, '0' ),
LPAD( CONCAT( " . $sortfield . ", '-' ), 255, '0' )
)) " . $sortorder;
} else {
$sortcode = 'ORDER BY ' . $sortfield . ' ' . $sortorder;
}
return $sortcode;
}
/**
* Currently not used
*
* @return string always empty
*/
public function getSqlLimit()
{
if ($this->limit > 0) {
$_offset = ($this->pageno - 1) * $this->limit;
return ' LIMIT ' . $_offset . ',' . $this->limit;
}
/**
* currently not in use
*/
return '';
}
/**
* Returns html code for sorting field
*
* @param
* array Language array
* @return string the html sortcode
*/
public function getHtmlSortCode($lng, $break = false)
{
$sortcode = '';
$fieldoptions = '';
$orderoptions = '';
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions .= HTML::makeoption($fieldcaption, $fieldname, $this->sortfield, true, true);
}
$breakorws = ($break ? '<br />' : '&nbsp;');
foreach (array(
'asc' => $lng['panel']['ascending'],
'desc' => $lng['panel']['descending']
) as $sortordertype => $sortorderdescription) {
$orderoptions .= HTML::makeoption($sortorderdescription, $sortordertype, $this->sortorder, true, true);
}
eval("\$sortcode =\"" . Template::getTemplate("misc/htmlsortcode", '1') . "\";");
return $sortcode;
}
/**
* Returns html code for sorting arrows
*
* @param
* string URL to use as base for links
* @param
* string If set, only this field will be returned
* @return mixed An array or a string (if field is set) of html code of arrows
*/
public function getHtmlArrowCode($baseurl, $field = '')
{
global $theme;
if ($field != '' && isset($this->fields[$field])) {
$baseurl = htmlspecialchars($baseurl);
$fieldname = htmlspecialchars($field);
eval("\$arrowcode =\"" . Template::getTemplate("misc/htmlarrowcode", '1') . "\";");
} else {
$baseurl = htmlspecialchars($baseurl);
$arrowcode = array();
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldname = htmlspecialchars($fieldname);
eval("\$arrowcode[\$fieldname] =\"" . Template::getTemplate("misc/htmlarrowcode", '1') . "\";");
}
}
return $arrowcode;
}
/**
* Returns html code for searching field
*
* @param
* array Language array
* @return string the html searchcode
*/
public function getHtmlSearchCode($lng)
{
$searchcode = '';
$fieldoptions = '';
$searchtext = htmlspecialchars($this->searchtext);
foreach ($this->fields as $fieldname => $fieldcaption) {
$fieldoptions .= HTML::makeoption($fieldcaption, $fieldname, $this->searchfield, true, true);
}
eval("\$searchcode =\"" . Template::getTemplate("misc/htmlsearchcode", '1') . "\";");
return $searchcode;
}
/**
* Returns html code for paging
*
* @param
* string URL to use as base for links
* @return string the html pagingcode
*/
public function getHtmlPagingCode($baseurl)
{
if ($this->entriesperpage == 0) {
return '';
} else {
$pages = intval($this->entries / $this->entriesperpage);
}
if ($this->entries % $this->entriesperpage != 0) {
$pages ++;
}
if ($pages > 1) {
$start = $this->pageno - 4;
if ($start < 1) {
$start = 1;
}
$stop = $this->pageno + 4;
if ($stop > $pages) {
$stop = $pages;
}
$pagingcode = '<a href="' . htmlspecialchars($baseurl) . '&amp;pageno=1">&laquo;</a> <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) - 1) == 0 ? '1' : intval($this->pageno) - 1) . '">&lt;</a>&nbsp;';
for ($i = $start; $i <= $stop; $i ++) {
if ($i != $this->pageno) {
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . $i . '">' . $i . '</a>&nbsp;';
} else {
$pagingcode .= ' <strong>' . $i . '</strong>&nbsp;';
}
}
$pagingcode .= ' <a href="' . htmlspecialchars($baseurl) . '&amp;pageno=' . ((intval($this->pageno) + 1) > $pages ? $pages : intval($this->pageno) + 1) . '">&gt;</a> <a href="' . $baseurl . '&amp;pageno=' . $pages . '">&raquo;</a>';
} else {
$pagingcode = '';
}
return $pagingcode;
}
}

View File

@@ -79,8 +79,8 @@ class User
/** /**
* Function which updates all counters of used ressources in panel_admins and panel_customers * Function which updates all counters of used ressources in panel_admins and panel_customers
* *
* @param * @param bool $returndebuginfo
* bool Set to true to get an array with debug information * Set to true to get an array with debug information
* @return array Contains debug information if parameter 'returndebuginfo' is set to true * @return array Contains debug information if parameter 'returndebuginfo' is set to true
* *
* @author Florian Lippert <flo@syscp.org> (2003-2009) * @author Florian Lippert <flo@syscp.org> (2003-2009)
@@ -100,17 +100,17 @@ class User
// Customers // Customers
$customers_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_CUSTOMERS . '` ORDER BY `customerid`'); $customers_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_CUSTOMERS . '` ORDER BY `customerid`');
Database::pexecute($customers_stmt); Database::pexecute($customers_stmt);
// array to store currently used resources per admin
$admin_resources = array(); $admin_resources = array();
while ($customer = $customers_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($customer = $customers_stmt->fetch(\PDO::FETCH_ASSOC)) {
// set current admin
$cur_adm = $customer['adminid']; $cur_adm = $customer['adminid'];
// initialize admin-resources array for admin $customer['adminid'] // initialize admin-resources array for admin $customer['adminid']
if (! isset($admin_resources[$cur_adm])) { if (! isset($admin_resources[$cur_adm])) {
$admin_resources[$cur_adm] = array(); $admin_resources[$cur_adm] = array();
} }
// fill admin resource usage array with customer data
self::addResourceCountEx($admin_resources[$cur_adm], $customer, 'diskspace_used', 'diskspace'); self::addResourceCountEx($admin_resources[$cur_adm], $customer, 'diskspace_used', 'diskspace');
self::addResourceCountEx($admin_resources[$cur_adm], $customer, 'traffic_used', 'traffic_used'); // !!! yes, USED and USED self::addResourceCountEx($admin_resources[$cur_adm], $customer, 'traffic_used', 'traffic_used'); // !!! yes, USED and USED
@@ -126,6 +126,7 @@ class User
self::addResourceCount($admin_resources[$cur_adm], $customer, $field . '_used', $field); self::addResourceCount($admin_resources[$cur_adm], $customer, $field . '_used', $field);
} }
// calculate real usage
$customer_mysqls_stmt = Database::prepare('SELECT COUNT(*) AS `number_mysqls` FROM `' . TABLE_PANEL_DATABASES . '` $customer_mysqls_stmt = Database::prepare('SELECT COUNT(*) AS `number_mysqls` FROM `' . TABLE_PANEL_DATABASES . '`
WHERE `customerid` = :cid'); WHERE `customerid` = :cid');
$customer_mysqls = Database::pexecute_first($customer_mysqls_stmt, array( $customer_mysqls = Database::pexecute_first($customer_mysqls_stmt, array(
@@ -181,6 +182,7 @@ class User
)); ));
$customer['email_quota_used_new'] = (int) $customer_email_quota['email_quota']; $customer['email_quota_used_new'] = (int) $customer_email_quota['email_quota'];
// update database accordingly
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` $stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
SET `mysqls_used` = :mysqls_used, SET `mysqls_used` = :mysqls_used,
`emails_used` = :emails_used, `emails_used` = :emails_used,
@@ -211,63 +213,56 @@ class User
$admins_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_ADMINS . '` ORDER BY `adminid`'); $admins_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_ADMINS . '` ORDER BY `adminid`');
Database::pexecute($admins_stmt, array()); Database::pexecute($admins_stmt, array());
$resource_fields = array(
'diskspace_used',
'traffic_used',
'mysqls_used',
'ftps_used',
'emails_used',
'email_accounts_used',
'email_forwarders_used',
'email_quota_used',
'subdomains_used'
);
$admin_customers_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `adminid` = :aid');
while ($admin = $admins_stmt->fetch(\PDO::FETCH_ASSOC)) { while ($admin = $admins_stmt->fetch(\PDO::FETCH_ASSOC)) {
$admin_customers_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `adminid` = :aid');
Database::pexecute($admin_customers_stmt, array( Database::pexecute($admin_customers_stmt, array(
"aid" => $admin['adminid'] "aid" => $admin['adminid']
)); ));
$admin_customers = $admin_customers_stmt->fetchAll(\PDO::FETCH_ASSOC); $admin_customers = $admin_customers_stmt->fetchAll(\PDO::FETCH_ASSOC);
$admin['customers_used_new'] = count($admin_customers); $admin['customers_used_new'] = count($admin_customers);
$admin_domains_stmt = Database::prepare('SELECT COUNT(*) AS `number_domains` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `adminid` = :aid'); $admin_domains_stmt = Database::prepare('SELECT COUNT(*) AS `number_domains` FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `adminid` = :aid AND `parentdomainid` = "0"');
$admin_domains = Database::pexecute_first($admin_domains_stmt, array( $admin_domains = Database::pexecute_first($admin_domains_stmt, array(
"aid" => $admin['adminid'] "aid" => $admin['adminid']
)); ));
// substract the amount of domains that are std-subdomains later when we iterated through all customers and now for sure // substract the amount of domains that are std-subdomains later when we iterated through all customers and know for sure
$admin['domains_used_new'] = $admin_domains['number_domains']; $admin['domains_used_new'] = $admin_domains['number_domains'];
// set current admin
$cur_adm = $admin['adminid']; $cur_adm = $admin['adminid'];
// if there's an admin without any customers it might be possible that the id is not yet known in $admin_resources
if (! isset($admin_resources[$cur_adm])) { if (! isset($admin_resources[$cur_adm])) {
$admin_resources[$cur_adm] = array(); $admin_resources[$cur_adm] = array();
} }
// be sure that all fields are set in the array
foreach (array( foreach ($resource_fields as $field) {
'diskspace_used',
'traffic_used',
'mysqls_used',
'ftps_used',
'emails_used',
'email_accounts_used',
'email_forwarders_used',
'email_quota_used',
'subdomains_used'
) as $field) {
self::initArrField($field, $admin_resources[$cur_adm], 0); self::initArrField($field, $admin_resources[$cur_adm], 0);
$admin[$field . '_new'] = $admin_resources[$cur_adm][$field]; // initialize new values
$admin[$field . '_new'] = 0;
} }
// now get the customer resource usage which we have re-calculated previously
foreach ($admin_customers as $acustomer) { foreach ($admin_customers as $acustomer) {
foreach (array( foreach ($resource_fields as $field) {
'diskspace_used',
'traffic_used',
'mysqls_used',
'ftps_used',
'emails_used',
'email_accounts_used',
'email_forwarders_used',
'email_quota_used',
'subdomains_used'
) as $field) {
$admin[$field . '_new'] += $acustomer[$field]; $admin[$field . '_new'] += $acustomer[$field];
} }
// check for std-subdomain // check for std-subdomain
if ($acustomer['standardsubdomain'] > 0) { if ($acustomer['standardsubdomain'] > 0) {
// std-subdomain does not count to assign resource // std-subdomain does not count as assigned resource
$admin['domains_used_new']--; $admin['domains_used_new'] --;
} }
} }
// update database entry accordingly
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_ADMINS . '` $stmt = Database::prepare('UPDATE `' . TABLE_PANEL_ADMINS . '`
SET `customers_used` = :customers_used, SET `customers_used` = :customers_used,
`domains_used` = :domains_used, `domains_used` = :domains_used,

View File

@@ -4625,7 +4625,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command> <command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command> <command><![CDATA[a2dismod php7.2]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->

View File

@@ -4827,7 +4827,7 @@ aliases: files
<command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command> <command><![CDATA[useradd -s /bin/false -g {{settings.system.mod_fcgid_httpgroup}} {{settings.system.mod_fcgid_httpuser}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_configdir}}]]></command>
<command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command> <command><![CDATA[mkdir -p {{settings.system.mod_fcgid_tmpdir}}]]></command>
<command><![CDATA[a2dismod php7.0]]></command> <command><![CDATA[a2dismod php7.3]]></command>
</commands> </commands>
<!-- instead of just restarting apache, we let the cronjob do all the <!-- instead of just restarting apache, we let the cronjob do all the
dirty work --> dirty work -->

View File

@@ -180,6 +180,20 @@ return array(
'image' => 'icons/domain_add.png', 'image' => 'icons/domain_add.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false, 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false,
'fields' => array( 'fields' => array(
'sslenabled' => array(
'visible' => ($ssl_ipsandports != '' ? true : false),
'label' => $lng['admin']['domain_sslenabled'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
),
'no_ssl_available_info' => array( 'no_ssl_available_info' => array(
'visible' => ($ssl_ipsandports == '' ? true : false), 'visible' => ($ssl_ipsandports == '' ? true : false),
'label' => 'SSL', 'label' => 'SSL',
@@ -356,6 +370,32 @@ return array(
) )
), ),
'value' => array() 'value' => array()
),
'honorcipherorder' => array(
'visible' => ($ssl_ipsandports != '' ? true : false),
'label' => $lng['admin']['domain_honorcipherorder'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
),
'sessiontickets' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'),
'label' => $lng['admin']['domain_sessiontickets'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
) )
) )
), ),

View File

@@ -159,7 +159,7 @@ return array(
) )
), ),
'value' => array( 'value' => array(
'1' \Froxlor\Settings::Get('system.apply_specialsettings_default') == 1 ? '1' : ''
) )
), ),
'notryfiles' => array( 'notryfiles' => array(
@@ -212,6 +212,20 @@ return array(
'image' => 'icons/domain_edit.png', 'image' => 'icons/domain_edit.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false, 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? true : false,
'fields' => array( 'fields' => array(
'sslenabled' => array(
'visible' => ($ssl_ipsandports != '' ? true : false),
'label' => $lng['admin']['domain_sslenabled'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['ssl_enabled']
)
),
'no_ssl_available_info' => array( 'no_ssl_available_info' => array(
'visible' => ($ssl_ipsandports == '' ? true : false), 'visible' => ($ssl_ipsandports == '' ? true : false),
'label' => 'SSL', 'label' => 'SSL',
@@ -290,7 +304,7 @@ return array(
'label' => $lng['serversettings']['ssl']['ssl_protocols']['title'], 'label' => $lng['serversettings']['ssl']['ssl_protocols']['title'],
'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'], 'desc' => $lng['serversettings']['ssl']['ssl_protocols']['description'],
'type' => 'checkbox', 'type' => 'checkbox',
'value' => !empty($result['ssl_protocols']) ? explode(",", $result['ssl_protocols']) : explode(",", \Froxlor\Settings::Get('system.ssl_protocols')), 'value' => ! empty($result['ssl_protocols']) ? explode(",", $result['ssl_protocols']) : explode(",", \Froxlor\Settings::Get('system.ssl_protocols')),
'values' => array( 'values' => array(
array( array(
'value' => 'TLSv1', 'value' => 'TLSv1',
@@ -316,14 +330,14 @@ return array(
'label' => $lng['serversettings']['ssl']['ssl_cipher_list']['title'], 'label' => $lng['serversettings']['ssl']['ssl_cipher_list']['title'],
'desc' => $lng['serversettings']['ssl']['ssl_cipher_list']['description'], 'desc' => $lng['serversettings']['ssl']['ssl_cipher_list']['description'],
'type' => 'text', 'type' => 'text',
'value' => !empty($result['ssl_cipher_list']) ? $result['ssl_cipher_list'] : \Froxlor\Settings::Get('system.ssl_cipher_list') 'value' => ! empty($result['ssl_cipher_list']) ? $result['ssl_cipher_list'] : \Froxlor\Settings::Get('system.ssl_cipher_list')
), ),
'tlsv13_cipher_list' => array( 'tlsv13_cipher_list' => array(
'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1 ? true : false), 'visible' => (($ssl_ipsandports != '' ? true : false) && $userinfo['change_serversettings'] == '1' && \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1 ? true : false),
'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['title'], 'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['title'],
'desc' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['description'], 'desc' => $lng['serversettings']['ssl']['tlsv13_cipher_list']['description'],
'type' => 'text', 'type' => 'text',
'value' => !empty($result['tlsv13_cipher_list']) ? $result['tlsv13_cipher_list'] : \Froxlor\Settings::Get('system.tlsv13_cipher_list') 'value' => ! empty($result['tlsv13_cipher_list']) ? $result['tlsv13_cipher_list'] : \Froxlor\Settings::Get('system.tlsv13_cipher_list')
), ),
'ssl_specialsettings' => array( 'ssl_specialsettings' => array(
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false), 'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
@@ -401,6 +415,34 @@ return array(
'value' => array( 'value' => array(
$result['ocsp_stapling'] $result['ocsp_stapling']
) )
),
'honorcipherorder' => array(
'visible' => ($ssl_ipsandports != '' ? true : false),
'label' => $lng['admin']['domain_honorcipherorder'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['ssl_honorcipherorder']
)
),
'sessiontickets' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.sessionticketsenabled' != '1'),
'label' => $lng['admin']['domain_sessiontickets'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['ssl_sessiontickets']
)
) )
) )
), ),
@@ -453,7 +495,7 @@ return array(
) )
), ),
'value' => array( 'value' => array(
'1' \Froxlor\Settings::Get('system.apply_phpconfigs_default') == 1 ? '1' : ''
) )
), ),
'mod_fcgid_starter' => array( 'mod_fcgid_starter' => array(

View File

@@ -32,13 +32,13 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['reload'], 'label' => $lng['serversettings']['phpfpm_settings']['reload'],
'type' => 'text', 'type' => 'text',
'maxlength' => 255, 'maxlength' => 255,
'value' => 'service php7.0-fpm restart' 'value' => 'service php7.3-fpm restart'
), ),
'config_dir' => array( 'config_dir' => array(
'label' => $lng['serversettings']['phpfpm_settings']['configdir'], 'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
'type' => 'text', 'type' => 'text',
'maxlength' => 255, 'maxlength' => 255,
'value' => '/etc/php/7.0/fpm/pool.d/' 'value' => '/etc/php/7.3/fpm/pool.d/'
), ),
'pm' => array( 'pm' => array(
'label' => $lng['serversettings']['phpfpm_settings']['pm'], 'label' => $lng['serversettings']['phpfpm_settings']['pm'],
@@ -49,25 +49,25 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
'type' => 'int', 'type' => 'int',
'value' => 1 'value' => 5
), ),
'start_servers' => array( 'start_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
'type' => 'int', 'type' => 'int',
'value' => 20 'value' => 2
), ),
'min_spare_servers' => array( 'min_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
'type' => 'int', 'type' => 'int',
'value' => 5 'value' => 1
), ),
'max_spare_servers' => array( 'max_spare_servers' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
'type' => 'int', 'type' => 'int',
'value' => 35 'value' => 3
), ),
'max_requests' => array( 'max_requests' => array(
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
@@ -79,13 +79,20 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
'type' => 'int', 'type' => 'int',
'value' => 30 'value' => 10
), ),
'limit_extensions' => array( 'limit_extensions' => array(
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
'type' => 'text', 'type' => 'text',
'value' => '.php' 'value' => '.php'
),
'custom_config' => array(
'label' => $lng['serversettings']['phpfpm_settings']['custom_config']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['custom_config']['description'],
'type' => 'textarea',
'cols' => 50,
'rows' => 7
) )
) )
) )

View File

@@ -87,6 +87,14 @@ return array(
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'], 'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
'type' => 'text', 'type' => 'text',
'value' => $result['limit_extensions'] 'value' => $result['limit_extensions']
),
'custom_config' => array(
'label' => $lng['serversettings']['phpfpm_settings']['custom_config']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['custom_config']['description'],
'type' => 'textarea',
'cols' => 50,
'rows' => 7,
'value' => $result['custom_config']
) )
) )
) )

View File

@@ -163,7 +163,7 @@ return array(
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'], 'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'], 'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] . $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int', 'type' => 'int',
'value' => 30 'value' => 10
), ),
'limit_extensions' => array( 'limit_extensions' => array(
'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false), 'visible' => (\Froxlor\Settings::Get('phpfpm.enabled') == 1 ? true : false),

View File

@@ -83,6 +83,19 @@ return array(
'image' => 'icons/domain_add.png', 'image' => 'icons/domain_add.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false, 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false,
'fields' => array( 'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
),
'ssl_redirect' => array( 'ssl_redirect' => array(
'label' => $lng['domains']['ssl_redirect']['title'], 'label' => $lng['domains']['ssl_redirect']['title'],
'desc' => $lng['domains']['ssl_redirect']['description'], 'desc' => $lng['domains']['ssl_redirect']['description'],

View File

@@ -99,6 +99,19 @@ return array(
'image' => 'icons/domain_edit.png', 'image' => 'icons/domain_edit.png',
'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false, 'visible' => \Froxlor\Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (\Froxlor\Domain\Domain::domainHasSslIpPort($result['id']) ? true : false) : false) : false,
'fields' => array( 'fields' => array(
'sslenabled' => array(
'label' => $lng['admin']['domain_sslenabled'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['ssl_enabled']
)
),
'ssl_redirect' => array( 'ssl_redirect' => array(
'label' => $lng['domains']['ssl_redirect']['title'], 'label' => $lng['domains']['ssl_redirect']['title'],
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''), 'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),

View File

@@ -317,6 +317,7 @@ $lng['admin']['templates']['COMPANY'] = 'Replaces with the customer\'s company n
$lng['admin']['templates']['USERNAME'] = 'Replaced with the customer\'s account username.'; $lng['admin']['templates']['USERNAME'] = 'Replaced with the customer\'s account username.';
$lng['admin']['templates']['PASSWORD'] = 'Replaced with the customer\'s account password.'; $lng['admin']['templates']['PASSWORD'] = 'Replaced with the customer\'s account password.';
$lng['admin']['templates']['EMAIL'] = 'Replaced with the address of the POP3/IMAP account.'; $lng['admin']['templates']['EMAIL'] = 'Replaced with the address of the POP3/IMAP account.';
$lng['admin']['templates']['CUSTOMER_NO'] = 'Replaces with the customer number';
$lng['admin']['webserver'] = 'Webserver'; $lng['admin']['webserver'] = 'Webserver';
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">ATTENTION:</strong> If you use a zonefile you will have to manage all required records for all sub-zones manually as well.'; $lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">ATTENTION:</strong> If you use a zonefile you will have to manage all required records for all sub-zones manually as well.';
@@ -339,7 +340,7 @@ $lng['serversettings']['logfiles_directory']['description'] = 'Where should all
$lng['serversettings']['logfiles_script']['title'] = 'Custom script to pipe log-files to'; $lng['serversettings']['logfiles_script']['title'] = 'Custom script to pipe log-files to';
$lng['serversettings']['logfiles_script']['description'] = 'You can specify a script here and use the placeholders <strong>{LOGFILE}, {DOMAIN} and {CUSTOMER}</strong> if needed. In case you want to use it you will need to activate the <strong>Pipe webserver logfiles</strong> option too. No prefixed pipe-character is needed.'; $lng['serversettings']['logfiles_script']['description'] = 'You can specify a script here and use the placeholders <strong>{LOGFILE}, {DOMAIN} and {CUSTOMER}</strong> if needed. In case you want to use it you will need to activate the <strong>Pipe webserver logfiles</strong> option too. No prefixed pipe-character is needed.';
$lng['serversettings']['logfiles_format']['title'] = 'Access-log format'; $lng['serversettings']['logfiles_format']['title'] = 'Access-log format';
$lng['serversettings']['logfiles_format']['description'] = 'Enter a custom log-format here according to your webservers specifications, leave empty for default'; $lng['serversettings']['logfiles_format']['description'] = 'Enter a custom log-format here according to your webservers specifications, leave empty for default. Depending on your format the string must be quoted.<br/>If used with nginx, it will look like <i>log_format frx_custom {CONFIGURED_VALUE}</i>.<br/>If used with Apache, it will look like <i>LogFormat {CONFIGURED_VALUE} frx_custom</i>.<br/><strong>Attention</strong>: The code won\'t be checked for any errors. If it contains errors, webserver might not start again!';
$lng['serversettings']['logfiles_type']['title'] = 'Access-log type'; $lng['serversettings']['logfiles_type']['title'] = 'Access-log type';
$lng['serversettings']['logfiles_type']['description'] = 'Choose between <strong>combined</strong> or <strong>vhost_combined</strong> here.'; $lng['serversettings']['logfiles_type']['description'] = 'Choose between <strong>combined</strong> or <strong>vhost_combined</strong> here.';
$lng['serversettings']['logfiles_piped']['title'] = 'Pipe webserver logfiles to specified script (see above)'; $lng['serversettings']['logfiles_piped']['title'] = 'Pipe webserver logfiles to specified script (see above)';
@@ -408,6 +409,7 @@ $lng['admin']['ipsandports']['add'] = 'Add IP/Port';
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port'; $lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port'; $lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
$lng['admin']['ipsandports']['ip'] = 'IP'; $lng['admin']['ipsandports']['ip'] = 'IP';
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="red">Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.<br>Only use private ip addresses if you are sure.</div>';
$lng['admin']['ipsandports']['port'] = 'Port'; $lng['admin']['ipsandports']['port'] = 'Port';
// ADDED IN 1.2.13-rc3 // ADDED IN 1.2.13-rc3
@@ -1853,7 +1855,7 @@ $lng['domains']['ssl_redirect_temporarilydisabled'] = "<br>The SSL redirect is t
$lng['serversettings']['caa_entry']['title'] = 'Generate CAA DNS records'; $lng['serversettings']['caa_entry']['title'] = 'Generate CAA DNS records';
$lng['serversettings']['caa_entry']['description'] = 'Automatically generates CAA records for SSL-enabled domains that are using Let\'s Encrypt'; $lng['serversettings']['caa_entry']['description'] = 'Automatically generates CAA records for SSL-enabled domains that are using Let\'s Encrypt';
$lng['serversettings']['caa_entry_custom']['title'] = 'Additional CAA DNS records'; $lng['serversettings']['caa_entry_custom']['title'] = 'Additional CAA DNS records';
$lng['serversettings']['caa_entry_custom']['description'] = 'DNS Certification Authority Authorization (CAA) is an Internet security policy mechanism which allows domain name holders to indicate to certificate authorities<br>whether they are authorized to issue digital certificates for a particular domain name. It does this by means of a new "CAA" Domain Name System (DNS) resource record.<br><br>The content of this field will be included into the DNS zone directly (each line results in a CAA record).<br>If Let\'s Encrypt is enabled for this domain, this entry will always be added automatically and does not need to be added manually:<br><code>0 issue "letsencrypt.org"</code> (If domain is a wildcard domain, issuewild will be used instead).<br>To enable Incident Reporting, you can add an <code>iodef</code> record. An example for sending such report to <code>me@example.com</code> would be:<br><code>0 iodef "mailto:me@example.com"</code><br><br><strong>Attention:</strong> The code won\'t be checked for any errors. If it contains errors, your CAA records might not work!'; $lng['serversettings']['caa_entry_custom']['description'] = 'DNS Certification Authority Authorization (CAA) is an Internet security policy mechanism which allows domain name holders to indicate to certificate authorities<br>whether they are authorized to issue digital certificates for a particular domain name. It does this by means of a new "CAA" Domain Name System (DNS) resource record.<br><br>The content of this field will be included into the DNS zone directly (each line results in a CAA record).<br>If Let\'s Encrypt is enabled for this domain, this entry will always be added automatically and does not need to be added manually:<br><code>0 issue "letsencrypt.org"</code> (If domain is a wildcard domain, issuewild will be used instead).<br>To enable Incident Reporting, you can add an <code>iodef</code> record. An example for sending such report to <code>me@example.com</code> would be:<br><code>0 iodef "mailto:me@example.com"</code><br><br><strong>Attention:</strong> The code won\'t be checked for any errors. If it contains errors, your CAA records might not work!';
// Autoupdate // Autoupdate
$lng['admin']['autoupdate'] = 'Auto-Update'; $lng['admin']['autoupdate'] = 'Auto-Update';
@@ -2079,3 +2081,19 @@ $lng['admin']['ownsslvhostsettings'] = 'Own SSL vHost-settings';
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container'; $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Default SSL vHost-settings for every domain container';
$lng['customer']['total_diskspace'] = 'Total diskspace (MiB)'; $lng['customer']['total_diskspace'] = 'Total diskspace (MiB)';
$lng['admin']['domain_override_tls'] = 'Override system TLS settings'; $lng['admin']['domain_override_tls'] = 'Override system TLS settings';
$lng['domains']['isaliasdomainof'] = 'Is aliasdomain for %s';
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Default value for "' . $lng['admin']['specialsettingsforsubdomains'] . "' setting when editing a domain";
$lng['serversettings']['apply_phpconfigs_default']['title'] = 'Default value for "' . $lng['admin']['phpsettingsforsubdomains'] . "' setting when editing a domain";
$lng['admin']['domain_sslenabled'] = 'Enable usage of SSL';
$lng['admin']['domain_honorcipherorder'] = 'Honor the (server) cipher order, default <strong>no</strong>';
$lng['admin']['domain_sessiontickets'] = 'Enable TLS sessiontickets (RFC 5077), default <strong>yes</strong>';
$lng['admin']['domain_sessionticketsenabled']['title'] = 'Enable usage of TLS sessiontickets globally';
$lng['admin']['domain_sessionticketsenabled']['description'] = 'Default <strong>yes</strong><br>Requires apache-2.4.11+ or nginx-1.5.9+';
$lng['serversettings']['phpfpm_settings']['restart_note'] = 'Attention: The config won\'t be checked for any errors. If it contains errors, PHP-FPM might not start again!';
$lng['serversettings']['phpfpm_settings']['custom_config']['title'] = 'Custom configuration';
$lng['serversettings']['phpfpm_settings']['custom_config']['description'] = 'Add custom configuration to each PHP-FPM version instance, for example <i>pm.status_path = /status</i> for monitoring. Variables below can be used here. ' . ' <strong>' . $lng['serversettings']['phpfpm_settings']['restart_note'] . '</strong>';
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat setting';
$lng['serversettings']['awstats']['logformat']['description'] = 'If you use customized logformat for your webserver, you need change the awstats LogFormat too.<br/>Default is 1. For more information check documentation <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">here</a>.';

View File

@@ -314,6 +314,7 @@ $lng['admin']['templates']['COMPANY'] = 'Wird mit dem Firmennamen des Kunden ers
$lng['admin']['templates']['USERNAME'] = 'Wird mit dem Benutzernamen des neuen Kundenkontos ersetzt.'; $lng['admin']['templates']['USERNAME'] = 'Wird mit dem Benutzernamen des neuen Kundenkontos ersetzt.';
$lng['admin']['templates']['PASSWORD'] = 'Wird mit dem Passwort des neuen Kundenkontos ersetzt.'; $lng['admin']['templates']['PASSWORD'] = 'Wird mit dem Passwort des neuen Kundenkontos ersetzt.';
$lng['admin']['templates']['EMAIL'] = 'Wird mit der Adresse des neuen E-Mail-Kontos ersetzt.'; $lng['admin']['templates']['EMAIL'] = 'Wird mit der Adresse des neuen E-Mail-Kontos ersetzt.';
$lng['admin']['templates']['CUSTOMER_NO'] = 'Wir mit der Kunden-Nummer ersetzt';
$lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">WARNUNG:</strong> Bei der Verwendung einer Zonendatei müssen alle benötigten Records aller Subdomains ebenfalls manuell verwaltet werden.'; $lng['admin']['bindzonewarning'] = $lng['panel']['emptyfordefault'] . '<br /><strong class="red">WARNUNG:</strong> Bei der Verwendung einer Zonendatei müssen alle benötigten Records aller Subdomains ebenfalls manuell verwaltet werden.';
/** /**
@@ -335,7 +336,7 @@ $lng['serversettings']['logfiles_directory']['description'] = 'Wo sollen die Log
$lng['serversettings']['logfiles_script']['title'] = 'Eigenes Script zu dem Log-Files übergeben werden'; $lng['serversettings']['logfiles_script']['title'] = 'Eigenes Script zu dem Log-Files übergeben werden';
$lng['serversettings']['logfiles_script']['description'] = 'Hier kann ein Script an das die Loginhalte übergeben werden hinterlegt und die Platzhalter <strong>{LOGFILE}, {DOMAIN} und {CUSTOMER}</strong> genutzt werden, sofern nötig. Falls ein Script angegeben wird, muss die Option <strong>Webserver Logdateien umleiten</strong> gesetzt werden'; $lng['serversettings']['logfiles_script']['description'] = 'Hier kann ein Script an das die Loginhalte übergeben werden hinterlegt und die Platzhalter <strong>{LOGFILE}, {DOMAIN} und {CUSTOMER}</strong> genutzt werden, sofern nötig. Falls ein Script angegeben wird, muss die Option <strong>Webserver Logdateien umleiten</strong> gesetzt werden';
$lng['serversettings']['logfiles_format']['title'] = 'Access-Log Format'; $lng['serversettings']['logfiles_format']['title'] = 'Access-Log Format';
$lng['serversettings']['logfiles_format']['description'] = 'Hier kann ein angepasstes Log-format entsprechend der Webserver-Dokumentation angegeben werden, leer lassen für Standard'; $lng['serversettings']['logfiles_format']['description'] = 'Hier kann ein angepasstes Log-format entsprechend der Webserver-Dokumentation angegeben werden, leer lassen für Standard. Abhängig vom LogFormat muss die Angabe unter Anführungszeichen stehen.<br/>Wenn verwendet mit nginx, so kann es wie folgt aussehen: <i>log_format frx_custom {EINGESTELLTES_FORMAT}</i>.<br/>Wenn verwendet mit Apache, so kann es wie folgt aussehen: <i>LogFormat {EINGESTELLTES_FORMAT} frx_custom</i>.<br /><strong>ACHTUNG:</strong> Der Code wird nicht auf Fehler geprüft. Etwaige Fehler werden auch übernommen und der Webserver könnte nicht mehr starten!';
$lng['serversettings']['logfiles_type']['title'] = 'Access-Log Typ'; $lng['serversettings']['logfiles_type']['title'] = 'Access-Log Typ';
$lng['serversettings']['logfiles_type']['description'] = 'Wähle zwischen <strong>combined</strong> oder <strong>vhost_combined</strong>.'; $lng['serversettings']['logfiles_type']['description'] = 'Wähle zwischen <strong>combined</strong> oder <strong>vhost_combined</strong>.';
$lng['serversettings']['logfiles_piped']['title'] = 'Webserver Logdateien zu eigenem Script umleiten (siehe oben)'; $lng['serversettings']['logfiles_piped']['title'] = 'Webserver Logdateien zu eigenem Script umleiten (siehe oben)';
@@ -403,6 +404,7 @@ $lng['admin']['ipsandports']['add'] = 'IP-Adresse/Port hinzufügen';
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten'; $lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port'; $lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse'; $lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="red">Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.<br>Verwende private Adressen nur wenn du sicher bist.</div>';
$lng['admin']['ipsandports']['port'] = 'Port'; $lng['admin']['ipsandports']['port'] = 'Port';
// ADDED IN 1.2.13-rc3 // ADDED IN 1.2.13-rc3
@@ -1726,3 +1728,19 @@ $lng['admin']['ownsslvhostsettings'] = 'Eigene SSL vHost-Einstellungen';
$lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container'; $lng['admin']['ipsandports']['ssl_default_vhostconf_domain'] = 'Standard SSL vHost-Einstellungen für jeden Domain-Container';
$lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)'; $lng['customer']['total_diskspace'] = 'Gesamtspeicherplatz (MiB)';
$lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen'; $lng['admin']['domain_override_tls'] = 'Überschreibe System TLS Einstellungen';
$lng['domains']['isaliasdomainof'] = 'Ist Aliasdomain für %s';
$lng['serversettings']['apply_specialsettings_default']['title'] = 'Standardwert für "' . $lng['admin']['specialsettingsforsubdomains'] . "' Einstellung beim Bearbeiten einer Domain";
$lng['serversettings']['apply_phpconfigs_default']['title'] = 'Standardwert für "' . $lng['admin']['phpsettingsforsubdomains'] . "' Einstellung beim Bearbeiten einer Domain";
$lng['admin']['domain_sslenabled'] = 'Aktiviere Nutzung von SSL';
$lng['admin']['domain_honorcipherorder'] = 'Bevorzuge die serverseitige Cipher Reihenfolge, Standardwert <strong>nein</strong>';
$lng['admin']['domain_sessiontickets'] = 'Aktiviere TLS Sessiontickets (RFC 5077), Standardwert <strong>ja</strong>';
$lng['admin']['domain_sessionticketsenabled']['title'] = 'Aktiviere Nutzung von TLS Sessiontickets systemweit';
$lng['admin']['domain_sessionticketsenabled']['description'] = 'Standardwert <strong>yes</strong><br>Erfordert apache-2.4.11+ oder nginx-1.5.9+';
$lng['serversettings']['phpfpm_settings']['restart_note'] = 'Achtung: Der Code wird nicht auf Fehler geprüft. Bei etwaigen Fehlern könnte der PHP-FPM-Prozess nicht mehr starten!';
$lng['serversettings']['phpfpm_settings']['custom_config']['title'] = 'Benutzerdefinierte Konfiguration';
$lng['serversettings']['phpfpm_settings']['custom_config']['description'] = 'Füge eine benutzerdefinierte Einstellungen zur PHP-FPM Instanz hinzu, beispielsweise <i>pm.status_path = /status</i> für Monitoring. Unten ersichtliche Variablen können verwendet werden.' . ' <strong>' . $lng['serversettings']['phpfpm_settings']['restart_note'] . '</strong>';
$lng['serversettings']['awstats']['logformat']['title'] = 'LogFormat Einstellung';
$lng['serversettings']['awstats']['logformat']['description'] = 'Wenn ein benutzerdefiniertes LogFormat beim Webserver verwendet wird, muss LogFormat von awstats ebenso angepasst werden.<br/>Standard ist 1. Für weitere Informationen siehe Dokumentation unter <a target="_blank" href="https://awstats.sourceforge.io/docs/awstats_config.html#LogFormat">hier</a>.';

View File

@@ -30,7 +30,7 @@
<table class="full hl"> <table class="full hl">
<thead> <thead>
<tr> <tr>
<th>{$lng['domains']['domainname']}&nbsp;{$arrowcode['d.domain']}</th> <th>{$lng['domains']['domainname']}&nbsp;{$arrowcode['d.domain_ace']}</th>
<th>{$lng['admin']['ipsandports']['ip']}</th> <th>{$lng['admin']['ipsandports']['ip']}</th>
<th>{$lng['admin']['customer']}&nbsp;{$arrowcode['c.loginname']}</th> <th>{$lng['admin']['customer']}&nbsp;{$arrowcode['c.loginname']}</th>
<th>{$lng['panel']['options']}</th> <th>{$lng['panel']['options']}</th>

View File

@@ -41,8 +41,5 @@
</a> </a>
</if> </if>
</if> </if>
<if isset($row['domainaliasid']) && $row['domainaliasid'] != 0>
&nbsp;<a href="{$linker->getLink(array('section' => 'domains', 'page' => $page, 'searchfield' => 'd.aliasdomain', 'searchtext' => $row['id']))}">{$lng['domains']['hasaliasdomains']}</a>
</if>
</td> </td>
</tr> </tr>

View File

@@ -6,6 +6,7 @@ $header
{$title} {$title}
</h2> </h2>
</header> </header>
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
<section> <section>

View File

@@ -6,6 +6,7 @@ $header
{$title} {$title}
</h2> </h2>
</header> </header>
<script type="text/javascript" src="templates/{$theme}/assets/js/ipsandports.js"></script>
<section> <section>

View File

@@ -21,4 +21,78 @@ $header
</form> </form>
</section> </section>
</article> </article>
<br />
<article>
<header>
<h3>
{$lng['admin']['templates']['template_replace_vars']}
</h3>
</header>
<section>
<table class="full">
<thead>
<tr>
<th>{$lng['panel']['variable']}</th>
<th>{$lng['panel']['description']}</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>{PEAR_DIR}</em></td>
<td>{$lng['admin']['phpconfig']['pear_dir']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR_C}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir_c']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR_GLOBAL}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir_global']}</td>
</tr>
<tr>
<td><em>{TMP_DIR}</em></td>
<td>{$lng['admin']['phpconfig']['tmp_dir']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_EMAIL}</em></td>
<td>{$lng['admin']['phpconfig']['customer_email']}</td>
</tr>
<tr>
<td><em>{ADMIN_EMAIL}</em></td>
<td>{$lng['admin']['phpconfig']['admin_email']}</td>
</tr>
<tr>
<td><em>{DOMAIN}</em></td>
<td>{$lng['admin']['phpconfig']['domain']}</td>
</tr>
<tr>
<td><em>{CUSTOMER}</em></td>
<td>{$lng['admin']['phpconfig']['customer']}</td>
</tr>
<tr>
<td><em>{ADMIN}</em></td>
<td>{$lng['admin']['phpconfig']['admin']}</td>
</tr>
<tr>
<td><em>{DOCUMENT_ROOT}</em></td>
<td>{$lng['admin']['phpconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_HOMEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['homedir']}</td>
</tr>
</tbody>
</table>
</section>
</article>
$footer $footer

View File

@@ -22,4 +22,78 @@ $header
</form> </form>
</section> </section>
</article> </article>
<br />
<article>
<header>
<h3>
{$lng['admin']['templates']['template_replace_vars']}
</h3>
</header>
<section>
<table class="full">
<thead>
<tr>
<th>{$lng['panel']['variable']}</th>
<th>{$lng['panel']['description']}</th>
</tr>
</thead>
<tbody>
<tr>
<td><em>{PEAR_DIR}</em></td>
<td>{$lng['admin']['phpconfig']['pear_dir']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR_C}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir_c']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir']}</td>
</tr>
<tr>
<td><em>{OPEN_BASEDIR_GLOBAL}</em></td>
<td>{$lng['admin']['phpconfig']['open_basedir_global']}</td>
</tr>
<tr>
<td><em>{TMP_DIR}</em></td>
<td>{$lng['admin']['phpconfig']['tmp_dir']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_EMAIL}</em></td>
<td>{$lng['admin']['phpconfig']['customer_email']}</td>
</tr>
<tr>
<td><em>{ADMIN_EMAIL}</em></td>
<td>{$lng['admin']['phpconfig']['admin_email']}</td>
</tr>
<tr>
<td><em>{DOMAIN}</em></td>
<td>{$lng['admin']['phpconfig']['domain']}</td>
</tr>
<tr>
<td><em>{CUSTOMER}</em></td>
<td>{$lng['admin']['phpconfig']['customer']}</td>
</tr>
<tr>
<td><em>{ADMIN}</em></td>
<td>{$lng['admin']['phpconfig']['admin']}</td>
</tr>
<tr>
<td><em>{DOCUMENT_ROOT}</em></td>
<td>{$lng['admin']['phpconfig']['docroot']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_HOMEDIR}</em></td>
<td>{$lng['admin']['phpconfig']['homedir']}</td>
</tr>
</tbody>
</table>
</section>
</article>
$footer $footer

View File

@@ -40,23 +40,27 @@ $header
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td><em>{FIRSTNAME}</em></td>
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
</tr>
<tr>
<td><em>{NAME}</em></td>
<td>{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td><em>{COMPANY}</em></td>
<td>{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_NO}</em></td>
<td>{$lng['admin']['templates']['CUSTOMER_NO']}</td>
</tr>
<if ($template == 'createcustomer')> <if ($template == 'createcustomer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td><em>{FIRSTNAME}</em></td>
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
</tr>
<tr>
<td><em>{NAME}</em></td>
<td>{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td><em>{COMPANY}</em></td>
<td>{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr> <tr>
<td><em>{USERNAME}</em></td> <td><em>{USERNAME}</em></td>
<td>{$lng['admin']['templates']['USERNAME']}</td> <td>{$lng['admin']['templates']['USERNAME']}</td>
@@ -88,10 +92,6 @@ $header
</if> </if>
</if> </if>
<if ($template == 'password_reset')> <if ($template == 'password_reset')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{USERNAME}</em></td> <td><em>{USERNAME}</em></td>
<td>{$lng['admin']['templates']['USERNAME']}</td> <td>{$lng['admin']['templates']['USERNAME']}</td>
@@ -138,10 +138,6 @@ $header
</tr> </tr>
</if> </if>
<if ($template == 'new_database_by_customer')> <if ($template == 'new_database_by_customer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{DB_NAME}</em></td> <td><em>{DB_NAME}</em></td>
<td>{$lng['admin']['templates']['DB_NAME']}</td> <td>{$lng['admin']['templates']['DB_NAME']}</td>
@@ -164,10 +160,6 @@ $header
</tr> </tr>
</if> </if>
<if ($template == 'new_ftpaccount_by_customer')> <if ($template == 'new_ftpaccount_by_customer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{USR_NAME}</em></td> <td><em>{USR_NAME}</em></td>
<td>{$lng['admin']['templates']['USR_NAME']}</td> <td>{$lng['admin']['templates']['USR_NAME']}</td>

View File

@@ -42,23 +42,27 @@ $header
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td><em>{FIRSTNAME}</em></td>
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
</tr>
<tr>
<td><em>{NAME}</em></td>
<td>{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td><em>{COMPANY}</em></td>
<td>{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr>
<td><em>{CUSTOMER_NO}</em></td>
<td>{$lng['admin']['templates']['CUSTOMER_NO']}</td>
</tr>
<if ($template_name == 'createcustomer')> <if ($template_name == 'createcustomer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr>
<td><em>{FIRSTNAME}</em></td>
<td>{$lng['admin']['templates']['FIRSTNAME']}</td>
</tr>
<tr>
<td><em>{NAME}</em></td>
<td>{$lng['admin']['templates']['NAME']}</td>
</tr>
<tr>
<td><em>{COMPANY}</em></td>
<td>{$lng['admin']['templates']['COMPANY']}</td>
</tr>
<tr> <tr>
<td><em>{USERNAME}</em></td> <td><em>{USERNAME}</em></td>
<td>{$lng['admin']['templates']['USERNAME']}</td> <td>{$lng['admin']['templates']['USERNAME']}</td>
@@ -90,10 +94,6 @@ $header
</if> </if>
</if> </if>
<if ($template_name == 'password_reset')> <if ($template_name == 'password_reset')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{USERNAME}</em></td> <td><em>{USERNAME}</em></td>
<td>{$lng['admin']['templates']['USERNAME']}</td> <td>{$lng['admin']['templates']['USERNAME']}</td>
@@ -140,10 +140,6 @@ $header
</tr> </tr>
</if> </if>
<if ($template_name == 'new_database_by_customer')> <if ($template_name == 'new_database_by_customer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{DB_NAME}</em></td> <td><em>{DB_NAME}</em></td>
<td>{$lng['admin']['templates']['DB_NAME']}</td> <td>{$lng['admin']['templates']['DB_NAME']}</td>
@@ -166,10 +162,6 @@ $header
</tr> </tr>
</if> </if>
<if ($template_name == 'new_ftpaccount_by_customer')> <if ($template_name == 'new_ftpaccount_by_customer')>
<tr>
<td><em>{SALUTATION}</em></td>
<td>{$lng['admin']['templates']['SALUTATION']}</td>
</tr>
<tr> <tr>
<td><em>{USR_NAME}</em></td> <td><em>{USR_NAME}</em></td>
<td>{$lng['admin']['templates']['USR_NAME']}</td> <td>{$lng['admin']['templates']['USR_NAME']}</td>
@@ -190,4 +182,3 @@ $header
</article> </article>
$footer $footer

View File

@@ -0,0 +1,46 @@
$(document).ready(function() {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
/**
* check for internal ip and output a notice if private-range ip is given
*/
$('#ip').change(function() {
var ipval = $(this).val();
if (ipval.length > 0) {
var sid = getUrlParameter('s');
$.ajax({
url: "admin_ipsandports.php?s="+sid+"&page=overview&action=jqCheckIP",
type: "POST",
data: {
ip: ipval
},
dataType: "json",
success: function(json) {
if (json != 0) {
$('#ip').parent().append(json);
} else {
$('#ipnote').remove();
}
},
error: function(a, b) {
console.log(a, b);
}
});
}
});
});

View File

@@ -27,7 +27,7 @@
<table class="full hl"> <table class="full hl">
<thead> <thead>
<tr> <tr>
<th>{$lng['domains']['domainname']}&nbsp;{$arrowcode['d.domain']}</th> <th>{$lng['domains']['domainname']}&nbsp;{$arrowcode['d.domain_ace']}</th>
<th>{$lng['panel']['path']}</th> <th>{$lng['panel']['path']}</th>
<th>{$lng['panel']['options']}</th> <th>{$lng['panel']['options']}</th>
</tr> </tr>

View File

@@ -3,7 +3,7 @@ Include "{AWSTATS_CONF}awstats.model.conf"
LogFile="{LOG_FILE}" LogFile="{LOG_FILE}"
LogType=W LogType=W
LogFormat = 1 LogFormat = {AWSTATS_LOGFORMAT}
LogSeparator=" " LogSeparator=" "
SiteDomain="{SITE_DOMAIN}" SiteDomain="{SITE_DOMAIN}"
HostAliases="{HOST_ALIASES}" HostAliases="{HOST_ALIASES}"

View File

@@ -0,0 +1,74 @@
<?php
$phpini = <<<EOINI
allow_url_fopen = Off
allow_url_include = Off
auto_append_file =
auto_globals_jit = On
auto_prepend_file =
bcmath.scale = 0
cli_server.color = On
default_charset = "UTF-8"
default_mimetype = "text/html"
default_socket_timeout = 60
asp_tags = Off
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system
display_errors = Off
display_startup_errors = Off
doc_root =
enable_dl = Off
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
expose_php = Off
file_uploads = On
html_errors = On
ignore_repeated_errors = Off
ignore_repeated_source = Off
include_path = ".:{PEAR_DIR}"
implicit_flush = Off
ldap.max_links = -1
log_errors = On
log_errors_max_len = 1024
mail.add_x_header = Off
max_execution_time = 30
max_file_uploads = 20
max_input_time = 60
memory_limit = 128M
{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"
output_buffering = 4096
post_max_size = 16M
precision = 14
register_argc_argv = Off
report_memleaks = On
request_order = "GP"
sendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"
serialize_precision = -1
session.auto_start = 0
session.cache_expire = 180
session.cache_limiter = nocache
session.cookie_domain =
session.cookie_httponly =
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_samesite =
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.gc_probability = 0
session.name = PHPSESSID
session.referer_check =
session.save_handler = files
session.save_path = "{TMP_DIR}"
session.serialize_handler = php
session.sid_bits_per_character = 5
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.use_cookies = 1
session.use_only_cookies = 1
session.use_strict_mode = 0
session.use_trans_sid = 0
short_open_tag = On
upload_max_filesize = 32M
upload_tmp_dir = "{TMP_DIR}"
variables_order = "GPCS"
opcache.restrict_api = "{DOCUMENT_ROOT}"
EOINI;
define('DEFAULT_PHPINI', $phpini);

View File

@@ -64,7 +64,7 @@ class CertificatesTest extends TestCase
'ssl_key_file' => $certdata['key'] 'ssl_key_file' => $certdata['key']
))->add(); ))->add();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals(5, $result['domainid']); $this->assertEquals(6, $result['domainid']);
} }
public function testAdminCertificatesList() public function testAdminCertificatesList()
@@ -148,7 +148,7 @@ class CertificatesTest extends TestCase
'ssl_key_file' => $certdata['key'] 'ssl_key_file' => $certdata['key']
))->update(); ))->update();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals(5, $result['domainid']); $this->assertEquals(6, $result['domainid']);
$this->assertEquals(str_replace("\n", "", $certdata['cert']), str_replace("\n", "", $result['ssl_cert_file'])); $this->assertEquals(str_replace("\n", "", $certdata['cert']), str_replace("\n", "", $result['ssl_cert_file']));
} }

View File

@@ -61,12 +61,17 @@ class CustomersTest extends TestCase
$this->assertEquals(15, $result['subdomains']); $this->assertEquals(15, $result['subdomains']);
$this->assertEquals('secret', $result['custom_notes']); $this->assertEquals('secret', $result['custom_notes']);
// validate that the std-subdomain has been added $stdsubdomain = $result['standardsubdomain'] ?? false;
$json_result = SubDomains::getLocal($admin_userdata, array( if (! $stdsubdomain) {
'id' => $result['standardsubdomain'] $this->fail('No standardsubdomain where there should be one');
))->get(); } else {
$result = json_decode($json_result, true)['data']; // validate that the std-subdomain has been added
$this->assertEquals('test1.dev.froxlor.org', $result['domain']); $json_result = SubDomains::getLocal($admin_userdata, array(
'id' => $result['standardsubdomain']
))->get();
$result = json_decode($json_result, true)['data'];
$this->assertEquals('test1.dev.froxlor.org', $result['domain']);
}
} }
public function testAdminCustomersAddEmptyMail() public function testAdminCustomersAddEmptyMail()

View File

@@ -26,7 +26,7 @@ class DomainsTest extends TestCase
))->get(); ))->get();
$customer_userdata = json_decode($json_result, true)['data']; $customer_userdata = json_decode($json_result, true)['data'];
$data = [ $data = [
'domain' => 'test.local', 'domain' => 'TEST.local',
'customerid' => $customer_userdata['customerid'], 'customerid' => $customer_userdata['customerid'],
'override_tls' => 1, 'override_tls' => 1,
'ssl_protocols' => array( 'ssl_protocols' => array(
@@ -38,6 +38,7 @@ class DomainsTest extends TestCase
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals($customer_userdata['documentroot'] . 'test.local/', $result['documentroot']); $this->assertEquals($customer_userdata['documentroot'] . 'test.local/', $result['documentroot']);
$this->assertTrue(in_array('TLSv1.3', explode(",", $result['ssl_protocols']))); $this->assertTrue(in_array('TLSv1.3', explode(",", $result['ssl_protocols'])));
$this->assertEquals('0', $result['isemaildomain']);
} }
/** /**
@@ -134,6 +135,28 @@ class DomainsTest extends TestCase
$this->assertEquals(2, $result['subcanemaildomain']); $this->assertEquals(2, $result['subcanemaildomain']);
} }
/**
*
* @depends testAdminDomainsAdd
*/
public function testResellerDomainsUpdate()
{
global $admin_userdata;
// get reseller
$json_result = Admins::getLocal($admin_userdata, array(
'loginname' => 'reseller'
))->get();
$reseller_userdata = json_decode($json_result, true)['data'];
$reseller_userdata['adminsession'] = 1;
$data = [
'domainname' => 'test2.local',
'ssl_protocols' => 'TLSv1'
];
$json_result = Domains::getLocal($reseller_userdata, $data)->update();
$result = json_decode($json_result, true)['data'];
$this->assertEmpty($result['ssl_protocols']);
}
public function testAdminDomainsAddSysHostname() public function testAdminDomainsAddSysHostname()
{ {
global $admin_userdata; global $admin_userdata;
@@ -324,4 +347,27 @@ class DomainsTest extends TestCase
$this->expectExceptionMessage("Not allowed to execute given command."); $this->expectExceptionMessage("Not allowed to execute given command.");
$json_result = Domains::getLocal($customer_userdata)->listingCount(); $json_result = Domains::getLocal($customer_userdata)->listingCount();
} }
public function testAdminIdnDomainsAdd()
{
global $admin_userdata;
// get customer
$json_result = Customers::getLocal($admin_userdata, array(
'loginname' => 'test1'
))->get();
$customer_userdata = json_decode($json_result, true)['data'];
$data = [
'domain' => 'täst.local',
'customerid' => $customer_userdata['customerid']
];
$json_result = Domains::getLocal($admin_userdata, $data)->add();
$result = json_decode($json_result, true)['data'];
$this->assertEquals($customer_userdata['documentroot'] . 'xn--tst-qla.local/', $result['documentroot']);
$this->assertEquals('xn--tst-qla.local', $result['domain']);
$this->assertEquals('täst.local', $result['domain_ace']);
Domains::getLocal($admin_userdata, [
'domainname' => 'täst.local'
])->delete();
}
} }

View File

@@ -246,7 +246,7 @@ class IpsAndPortsTest extends TestCase
'ip' => '123.123.123.123' 'ip' => '123.123.123.123'
]; ];
$this->expectExceptionMessage("You cannot change the last system IP, either create another new IP/Port combination for the system IP or change the system IP."); $this->expectExceptionMessage("You cannot change the last system IP, either create another new IP/Port combination for the system IP or change the system IP.");
$json_result = IpsAndPorts::getLocal($admin_userdata, $data)->update(); IpsAndPorts::getLocal($admin_userdata, $data)->update();
} }
public function testResellerIpsAndPortsEditNoDuplicate() public function testResellerIpsAndPortsEditNoDuplicate()

View File

@@ -1,9 +1,12 @@
<?php <?php
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Froxlor\Settings;
use Froxlor\Api\Commands\Admins; use Froxlor\Api\Commands\Admins;
use Froxlor\Api\Commands\Customers; use Froxlor\Api\Commands\Customers;
use Froxlor\Api\Commands\Mysqls; use Froxlor\Api\Commands\Mysqls;
use Froxlor\Database\Database;
use Froxlor\Settings\Store;
/** /**
* *
@@ -12,6 +15,9 @@ use Froxlor\Api\Commands\Mysqls;
* @covers \Froxlor\Api\Commands\Mysqls * @covers \Froxlor\Api\Commands\Mysqls
* @covers \Froxlor\Api\Commands\Customers * @covers \Froxlor\Api\Commands\Customers
* @covers \Froxlor\Api\Commands\Admins * @covers \Froxlor\Api\Commands\Admins
* @covers \Froxlor\Database\DbManager
* @covers \Froxlor\Database\Manager\DbManagerMySQL
* @covers \Froxlor\Settings\Store
*/ */
class MysqlsTest extends TestCase class MysqlsTest extends TestCase
{ {
@@ -36,7 +42,7 @@ class MysqlsTest extends TestCase
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals('testdb', $result['description']); $this->assertEquals('testdb', $result['description']);
$this->assertEquals(0, $result['dbserver']); $this->assertEquals(0, $result['dbserver']);
// test connection // test connection
try { try {
$test_conn = new \PDO("mysql:host=127.0.0.1", 'test1sql1', $newPwd); $test_conn = new \PDO("mysql:host=127.0.0.1", 'test1sql1', $newPwd);
@@ -110,15 +116,24 @@ class MysqlsTest extends TestCase
{ {
global $admin_userdata; global $admin_userdata;
$newPwd = \Froxlor\System\Crypt::generatePassword();
$data = [ $data = [
'dbname' => 'test1sql1', 'dbname' => 'test1sql1',
'mysql_password' => \Froxlor\System\Crypt::generatePassword(), 'mysql_password' => $newPwd,
'description' => 'testdb-upd', 'description' => 'testdb-upd',
'loginname' => 'test1' 'loginname' => 'test1'
]; ];
$json_result = Mysqls::getLocal($admin_userdata, $data)->update(); $json_result = Mysqls::getLocal($admin_userdata, $data)->update();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals('testdb-upd', $result['description']); $this->assertEquals('testdb-upd', $result['description']);
// test connection
try {
$test_conn = new \PDO("mysql:host=127.0.0.1", 'test1sql1', $newPwd);
unset($test_conn);
} catch (PDOException $e) {
$this->fail($e->getMessage());
}
} }
/** /**
@@ -166,4 +181,57 @@ class MysqlsTest extends TestCase
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals('test1sql1', $result['databasename']); $this->assertEquals('test1sql1', $result['databasename']);
} }
/**
*
* @depends testCustomerMysqlsAdd
*/
public function testStoreSettingIpAddress()
{
// this settings test is here because it directly changes mysql users / privileges
$fielddata = array(
'label' => 'serversettings.ipaddress',
'settinggroup' => 'system',
'varname' => 'ipaddress'
);
Store::storeSettingIpAddress('system_system_ipaddress', $fielddata, '82.149.225.47');
$mysql_access_hosts = Settings::Get('system.mysql_access_host');
$this->assertTrue(strpos($mysql_access_hosts, '82.149.225.47') !== false);
}
/**
*
* @depends testStoreSettingIpAddress
*/
public function testGetAllSqlUsers()
{
\Froxlor\Database\Database::needRoot(true);
$dbm = new \Froxlor\Database\DbManager(\Froxlor\FroxlorLogger::getInstanceOf());
$users = $dbm->getManager()->getAllSqlUsers(false);
foreach ($users as $user => $data) {
$this->assertNotEmpty($data['password'], 'No password for user "' . $user . '"');
}
if (TRAVIS_CI == 0) {
// just to be sure, not required for travis as the vm is fresh every time
Database::needRoot(true);
Database::query("DROP USER IF EXISTS froxlor010@10.0.0.10;");
}
// grant privileges to another host
$testdata = $users['froxlor010'];
$dbm->getManager()->grantPrivilegesTo('froxlor010', $testdata['password'], '10.0.0.10', true);
// select all entries from mysql.user for froxlor010 to compare password-hashes
$sel_stmt = Database::prepare("SELECT * FROM mysql.user WHERE `User` = :usr");
Database::pexecute($sel_stmt, [
'usr' => 'froxlor010'
]);
$results = $sel_stmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($results as $user) {
$passwd = $user['Password'] ?? $user['authentication_string'];
$this->assertEquals($testdata['password'], $passwd);
}
}
} }

View File

@@ -27,7 +27,8 @@ class FpmDaemonsTest extends TestCase
$json_result = FpmDaemons::getLocal($admin_userdata, $data)->add(); $json_result = FpmDaemons::getLocal($admin_userdata, $data)->add();
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$this->assertEquals('/etc/php/7.1/fpm/pool.d/', $result['config_dir']); $this->assertEquals('/etc/php/7.1/fpm/pool.d/', $result['config_dir']);
$this->assertEquals(0, $result['max_children']); $this->assertEquals('dynamic', $result['pm']);
$this->assertEquals(5, $result['max_children']);
$this->assertEquals('.php', $result['limit_extensions']); $this->assertEquals('.php', $result['limit_extensions']);
self::$id = $result['id']; self::$id = $result['id'];
} }

View File

@@ -28,7 +28,7 @@ class SubDomainsTest extends TestCase
$customer_userdata = json_decode($json_result, true)['data']; $customer_userdata = json_decode($json_result, true)['data'];
$data = [ $data = [
'subdomain' => 'mysub', 'subdomain' => 'mySub',
'domain' => 'test2.local' 'domain' => 'test2.local'
]; ];
$json_result = SubDomains::getLocal($customer_userdata, $data)->add(); $json_result = SubDomains::getLocal($customer_userdata, $data)->add();
@@ -47,7 +47,7 @@ class SubDomainsTest extends TestCase
$reseller_userdata['adminsession'] = 1; $reseller_userdata['adminsession'] = 1;
$data = [ $data = [
'subdomain' => 'mysub2', 'subdomain' => 'mySub2',
'domain' => 'test2.local', 'domain' => 'test2.local',
'customerid' => 1 'customerid' => 1
]; ];