Compare commits
223 Commits
0.9.38-rc1
...
0.9.39
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa707ebc9 | ||
|
|
f38a0fd8b6 | ||
|
|
a6b2daa77d | ||
|
|
7ae31496ac | ||
|
|
c62dd2ecf4 | ||
|
|
840b5ea229 | ||
|
|
d8a3015303 | ||
|
|
194b7863b8 | ||
|
|
f034695290 | ||
|
|
f896fe11a0 | ||
|
|
2603a9c869 | ||
|
|
fcd0dddfd5 | ||
|
|
3fb92259a8 | ||
|
|
54d7b01ac5 | ||
|
|
ca0ab1f97a | ||
|
|
f3733ca249 | ||
|
|
7442bf7347 | ||
|
|
6ac3cb2014 | ||
|
|
ca76e572a2 | ||
|
|
c3fb6f6a1c | ||
|
|
1796a8ff17 | ||
|
|
52c7839b9b | ||
|
|
d16a7b2089 | ||
|
|
9a00a67f71 | ||
|
|
6e651200ca | ||
|
|
29968e6026 | ||
|
|
8c61773280 | ||
|
|
29433ce963 | ||
|
|
eed3a91385 | ||
|
|
62006d584e | ||
|
|
bba872618a | ||
|
|
941dd14c72 | ||
|
|
f2a79d4d96 | ||
|
|
281b131c62 | ||
|
|
4bcdfc0786 | ||
|
|
9312e4967e | ||
|
|
6b44dfe9b2 | ||
|
|
ba58991d11 | ||
|
|
84abb33e54 | ||
|
|
07a4f045f1 | ||
|
|
f49cb81e49 | ||
|
|
b2b9d4e31a | ||
|
|
d40d1f30b6 | ||
|
|
9aaadb1f8b | ||
|
|
3969ef63c5 | ||
|
|
d8abe30c44 | ||
|
|
eaa10ce6a5 | ||
|
|
c434249616 | ||
|
|
b849a5f29a | ||
|
|
3dc6a64252 | ||
|
|
ebd636494a | ||
|
|
07caf55f79 | ||
|
|
73868b7947 | ||
|
|
af55fe5b82 | ||
|
|
de408347fc | ||
|
|
ea96039128 | ||
|
|
c49539258e | ||
|
|
64653a2bb1 | ||
|
|
732c6e3a78 | ||
|
|
66a4309fe5 | ||
|
|
57277eb1e3 | ||
|
|
148b2fc1be | ||
|
|
cf4f15a83c | ||
|
|
a5251824ae | ||
|
|
cb31c5258d | ||
|
|
5540b02e35 | ||
|
|
e725b48c4c | ||
|
|
45c0915b59 | ||
|
|
1e03946df7 | ||
|
|
dd3e5e9c6b | ||
|
|
421c29c491 | ||
|
|
15b62aae04 | ||
|
|
181848290f | ||
|
|
b263b211a5 | ||
|
|
1753d2895b | ||
|
|
64ebb0ca38 | ||
|
|
bab982a0e6 | ||
|
|
c2c5178831 | ||
|
|
56e8e32965 | ||
|
|
47cd30a45e | ||
|
|
bd8f659272 | ||
|
|
82c719d786 | ||
|
|
dc22ff6aa3 | ||
|
|
c68682b084 | ||
|
|
aa8a7ee0a9 | ||
|
|
e95a917812 | ||
|
|
332e627007 | ||
|
|
a3201481f6 | ||
|
|
dae233dd05 | ||
|
|
9aa2cc269b | ||
|
|
434f202832 | ||
|
|
552d58848c | ||
|
|
bea1677d5d | ||
|
|
a2e0de23e1 | ||
|
|
ebb33c9cee | ||
|
|
22414096ad | ||
|
|
9db7434876 | ||
|
|
9fabfd539d | ||
|
|
54f6c3e019 | ||
|
|
5930ab1c9d | ||
|
|
3870cc1002 | ||
|
|
f880e1c9f1 | ||
|
|
9285a169dd | ||
|
|
95b7b57fc6 | ||
|
|
872928fb38 | ||
|
|
cb2f094e3d | ||
|
|
b11b423217 | ||
|
|
567827e2cb | ||
|
|
ec1bd6e19a | ||
|
|
d4cd827284 | ||
|
|
50f85fb6d0 | ||
|
|
9cc69e5b3d | ||
|
|
d9e8f43298 | ||
|
|
ad7cf52f21 | ||
|
|
398d45deae | ||
|
|
541ab1fe6e | ||
|
|
c0fddbce81 | ||
|
|
2284706e0c | ||
|
|
a4f72cbb40 | ||
|
|
d1c776b706 | ||
|
|
8ef315014c | ||
|
|
2d59e569df | ||
|
|
202eb0931f | ||
|
|
4cd1a8d656 | ||
|
|
01a363456e | ||
|
|
8f4da0638e | ||
|
|
3e6c3d725b | ||
|
|
95a18be5c5 | ||
|
|
8030aae37a | ||
|
|
0eaa81b503 | ||
|
|
c2b864a20f | ||
|
|
e00cb8926d | ||
|
|
afb2bce16d | ||
|
|
1033f502b1 | ||
|
|
ab18d94053 | ||
|
|
9afbe7fb71 | ||
|
|
5e0270e6a8 | ||
|
|
c6962b0992 | ||
|
|
9fdcd09089 | ||
|
|
338cf161d2 | ||
|
|
044ce6662a | ||
|
|
d574233f49 | ||
|
|
02c6545c94 | ||
|
|
c795cd3320 | ||
|
|
1ebde2e6a4 | ||
|
|
78ee141b26 | ||
|
|
d11ddd910f | ||
|
|
437446c49d | ||
|
|
7a603596c5 | ||
|
|
c2a91ed623 | ||
|
|
3dcd2b9a3e | ||
|
|
75622d4737 | ||
|
|
7a617d0aa4 | ||
|
|
ccca077df7 | ||
|
|
5c008adf16 | ||
|
|
4502f7ddf5 | ||
|
|
f9101f880b | ||
|
|
5ed0c3f2f3 | ||
|
|
9907775c0d | ||
|
|
ed9d4a5744 | ||
|
|
c1aea2795e | ||
|
|
3a8996aee2 | ||
|
|
e67aefe48b | ||
|
|
602c38dbeb | ||
|
|
f1c232cef9 | ||
|
|
3d4b56b233 | ||
|
|
d8994ca65b | ||
|
|
18514f0180 | ||
|
|
001786dd97 | ||
|
|
225539d2e7 | ||
|
|
1b18ec45be | ||
|
|
7b6bbcec48 | ||
|
|
56276a19d1 | ||
|
|
c00abc3b92 | ||
|
|
301dadaa02 | ||
|
|
559bd6d892 | ||
|
|
18b45c749d | ||
|
|
2c00f982d8 | ||
|
|
54200427ab | ||
|
|
f8996ad767 | ||
|
|
9838ff4da5 | ||
|
|
192e00c717 | ||
|
|
43ca4a28e4 | ||
|
|
16e9fd6bd9 | ||
|
|
16f547bce0 | ||
|
|
60a482dce6 | ||
|
|
9540cb158c | ||
|
|
1984aced9d | ||
|
|
ca2949da71 | ||
|
|
eb8449fd79 | ||
|
|
547140bafb | ||
|
|
d245bca445 | ||
|
|
5f899a5510 | ||
|
|
432645431c | ||
|
|
30087548b0 | ||
|
|
d93cfff172 | ||
|
|
e5053bad15 | ||
|
|
1519db1637 | ||
|
|
b0326c640c | ||
|
|
7e4164da26 | ||
|
|
fad607c6e8 | ||
|
|
d6b56262ce | ||
|
|
c409d8a6ba | ||
|
|
4274b8a737 | ||
|
|
60c1babd93 | ||
|
|
ec6ddd054d | ||
|
|
76c200a56c | ||
|
|
a44be363a6 | ||
|
|
304926260f | ||
|
|
462fca7328 | ||
|
|
884b2ed913 | ||
|
|
af77453bfe | ||
|
|
fa45de6586 | ||
|
|
b4e8458076 | ||
|
|
979b1b0ad8 | ||
|
|
2bee58166b | ||
|
|
3597a89da3 | ||
|
|
f406962dfd | ||
|
|
ce31a0b3fd | ||
|
|
fc2ae594cb | ||
|
|
3ff85e167c | ||
|
|
dc428b7de2 | ||
|
|
06a55ef91e |
58
.github/CONTRIBUTING.md
vendored
Normal file
58
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Contributing
|
||||
|
||||
Before you start working on a PR, contact us via IRC in #froxlor on Freenode or
|
||||
the forum at https://forum.froxlor.org to get a clue whether someone else isn't
|
||||
already working on it or if we don't want to invest the effort in favour of
|
||||
working on Froxlor 2.0.
|
||||
Of course, bug fixes are always welcome.
|
||||
However, at this stage of the 0.9.x branch, we are not looking for new
|
||||
features or refactoring, especially not the kind which requires changes to a
|
||||
lot of files.
|
||||
Currently, we are working on a complete re-write, which, at this point in
|
||||
time, is not yet public to keep delays due to discussions about internal
|
||||
details to a minimum.
|
||||
|
||||
|
||||
|
||||
|
||||
## Checklist
|
||||
|
||||
General rules for PRs are:
|
||||
* Please save us all some trouble and unnecessary round-trips by _testing_ your
|
||||
changes.
|
||||
|
||||
* Re-write your commit history to provide a CLEAN history!
|
||||
|
||||
* i.e. do not provide PRs which contain a commit that changes something,
|
||||
the next changes it back, a third one changes it again, only a little
|
||||
differently...
|
||||
|
||||
|
||||
Thanks!
|
||||
|
||||
|
||||
|
||||
|
||||
### Webserver changes
|
||||
If you make changes to the functionality of webserver configuration, please
|
||||
make sure your implementation covers both apache **and** nginx.
|
||||
|
||||
|
||||
|
||||
|
||||
### l10n
|
||||
|
||||
If you add new language strings, please make sure you add the english fallback
|
||||
strings in
|
||||
|
||||
* `lng/english.lng.php`
|
||||
* `install/lng/english.lng.php` (if applicable)
|
||||
|
||||
|
||||
|
||||
|
||||
### New settings
|
||||
If you add new settings, please make sure you add the default values to
|
||||
|
||||
* `install/froxlor.sql`
|
||||
* handle the update (see `install/updates/froxlor/0.9/update_0.9.inc.php`)
|
||||
64
.github/ISSUE_TEMPLATE.md
vendored
Normal file
64
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# Bug report vs. support request
|
||||
If you're unsure of whether your problem is a bug or a configuration error
|
||||
* contact us via IRC in #froxlor on freenode
|
||||
* or post a thread in our forum at https://forum.froxlor.org
|
||||
|
||||
As a rule of thumb: before reporting an issue
|
||||
* see if it hasn't been [reported](https://github.com/Froxlor/froxlor/issues) (and possibly already been [fixed](https://github.com/Froxlor/froxlor/issues?utf8=✓&q=is:issue%20is:closed)) first
|
||||
* try with the git master
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Summary
|
||||
|
||||
Please provide a concise summary of the problem you're experiencing...
|
||||
|
||||
|
||||
|
||||
|
||||
# System information
|
||||
* Froxlor version: $version/$gitSHA1
|
||||
* Web server: apache2/nginx/lighttpd
|
||||
* DNS server: Bind/PowerDNS (standalone)/PowerDNS (Bind-backend)
|
||||
* POP/IMAP server: Courier/Dovecot
|
||||
* SMTP server: postfix/exim
|
||||
* FTP server: proftpd/pureftpd
|
||||
* OS/Version: ...
|
||||
|
||||
|
||||
|
||||
|
||||
# Steps to reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
|
||||
|
||||
|
||||
# Expected behavior
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
|
||||
|
||||
|
||||
# Actual behavior
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
|
||||
|
||||
|
||||
# Log files/log entries
|
||||
syslog:
|
||||
<pre>
|
||||
example
|
||||
</pre>
|
||||
32
README.md
32
README.md
@@ -11,13 +11,13 @@ Developed by experienced server administrators, this panel simplifies the effort
|
||||
3. Point your browser to http://[ip-of-webserver]/froxlor
|
||||
4. Follow the installer
|
||||
5. Login as administrator
|
||||
6. Adjust "Server > Settings" according to your needs
|
||||
7. Choose your distribution under "Server > Configuration"
|
||||
6. Adjust "System > Settings" according to your needs
|
||||
7. Choose your distribution under "System > Configuration"
|
||||
8. Follow the steps for your services
|
||||
9. Have fun!
|
||||
|
||||
### Detailed installation
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki/Installationtarball
|
||||
https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-from-tarball
|
||||
|
||||
## Help
|
||||
|
||||
@@ -30,12 +30,12 @@ irc://chat.freenode.net/froxlor
|
||||
|
||||
### Forum
|
||||
|
||||
The community is located on http://forum.froxlor.org
|
||||
The community is located on https://forum.froxlor.org/
|
||||
|
||||
### Wiki
|
||||
|
||||
More documentation may be found in the froxlor - wiki:
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki
|
||||
https://github.com/Froxlor/Froxlor/wiki
|
||||
|
||||
## License
|
||||
|
||||
@@ -44,31 +44,21 @@ May be found in COPYING
|
||||
## Downloads
|
||||
|
||||
### Tarball
|
||||
http://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](http://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](http://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](https://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
|
||||
### Debian repository
|
||||
|
||||
[HowTo](http://redmine.froxlor.org/projects/froxlor/wiki/Installationdebian)
|
||||
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian)
|
||||
|
||||
/etc/apt/sources.list.d/froxlor.list
|
||||
> deb http://debian.froxlor.org {wheezy|jessie} main
|
||||
|
||||
### Gentoo repository
|
||||
|
||||
[HowTo](http://redmine.froxlor.org/projects/froxlor/wiki/Installationgentoo)
|
||||
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-gentoo)
|
||||
|
||||
http://files.froxlor.org/gentoo/repositories.xml
|
||||
https://files.froxlor.org/gentoo/repositories.xml
|
||||
|
||||
## Let's Encrypt support
|
||||
|
||||
This version of Froxlor contains a test implementation of support for [Let's Encrypt](https://letsencrypt.org). This is (as Let's Encrypt is in itself)
|
||||
still a beta version and may break your system. The way it currently works is by creating a (sub-)domain with the default system - certificate,
|
||||
after which the Let's Encrypt cronjob orders the certificate for this (sub-)domain and inserts the certificates in the database. With the next run
|
||||
of the default cronjob, the certificates will be updated on the disk and the webserver reloaded.
|
||||
|
||||
This has 2 known side-effects at the moment:
|
||||
* The basic ip/port combinations don't work with the Froxlor - integration of Let's Encrypt, since it needs a certificate for the very first creation
|
||||
* After creating a domain, it will have the default certificate for a short time (by default 5 minutes until the cronjob runs the next time)
|
||||
|
||||
It may be possible to fix these issues, but they are not a priority at the moment
|
||||
## Contributing
|
||||
|
||||
[see here](.github/CONTRIBUTING.md)
|
||||
|
||||
@@ -234,6 +234,7 @@ return array(
|
||||
'type' => 'option',
|
||||
'default' => '',
|
||||
'option_mode' => 'multiple',
|
||||
'option_emptyallowed' => true,
|
||||
'option_options' => array(
|
||||
'email' => $lng['menue']['email']['email'],
|
||||
'mysql' => $lng['menue']['mysql']['mysql'],
|
||||
|
||||
@@ -94,6 +94,14 @@ return array(
|
||||
'plausibility_check_method' => 'checkMysqlAccessHost',
|
||||
'save_method' => 'storeSettingMysqlAccessHost',
|
||||
),
|
||||
'system_nssextrausers' => array(
|
||||
'label' => $lng['serversettings']['nssextrausers'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nssextrausers',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_index_file_extension' => array(
|
||||
'label' => $lng['serversettings']['index_file_extension'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -39,7 +39,7 @@ return array(
|
||||
'varname' => 'le_froxlor_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingClearCertificates',
|
||||
'visible' => Settings::Get('system.leenabled')
|
||||
),
|
||||
'system_le_froxlor_redirect' => array(
|
||||
@@ -49,7 +49,49 @@ return array(
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.leenabled')
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
),
|
||||
'system_hsts_maxage' => array(
|
||||
'label' => $lng['admin']['domain_hsts_maxage'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_maxage',
|
||||
'type' => 'int',
|
||||
'int_min' => 0,
|
||||
'int_max' => 94608000, // 3-years
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
),
|
||||
'system_hsts_incsub' => array(
|
||||
'label' => $lng['admin']['domain_hsts_incsub'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_incsub',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
),
|
||||
'system_hsts_preload' => array(
|
||||
'label' => $lng['admin']['domain_hsts_preload'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_preload',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
),
|
||||
'system_http2_support' => array(
|
||||
'label' => $lng['serversettings']['http2_support'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'http2_support',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array(
|
||||
'apache2',
|
||||
'nginx'
|
||||
),
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
),
|
||||
/**
|
||||
* FCGID
|
||||
|
||||
@@ -260,11 +260,7 @@ return array(
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array(
|
||||
'apache2',
|
||||
'lighttpd'
|
||||
)
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'customredirect_default' => array(
|
||||
'label' => $lng['serversettings']['customredirect_default'],
|
||||
@@ -274,11 +270,7 @@ return array(
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getRedirectCodes',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array(
|
||||
'apache2',
|
||||
'lighttpd'
|
||||
)
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -30,6 +30,20 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_ssl_protocols' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_protocols'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_protocols',
|
||||
'type' => 'option',
|
||||
'default' => 'TLSv1,TLSv1.2',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array(
|
||||
'TLSv1' => 'TLSv1',
|
||||
'TLSv1.1' => 'TLSv1.1',
|
||||
'TLSv1.2' => 'TLSv1.2'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_ssl_cipher_list' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cipher_list'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -79,6 +93,17 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_apache24_ocsp_cache_path' => array(
|
||||
'label' => $lng['serversettings']['ssl']['apache24_ocsp_cache_path'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apache24_ocsp_cache_path',
|
||||
'type' => 'string',
|
||||
'string_type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)',
|
||||
'visible' => Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_leenabled' => array(
|
||||
'label' => $lng['serversettings']['leenabled'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -95,7 +120,20 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/apache2/conf-enabled/acme.conf',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_leapiversion' => array(
|
||||
'label' => $lng['serversettings']['leapiversion'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'leapiversion',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'1' => 'ACME v1',
|
||||
'2' => 'ACME v2'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_letsencryptca' => array(
|
||||
'label' => $lng['serversettings']['letsencryptca'],
|
||||
@@ -105,8 +143,8 @@ return array(
|
||||
'default' => 'testing',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'testing' => 'https://acme-staging.api.letsencrypt.org (Test)',
|
||||
'production' => 'https://acme-v01.api.letsencrypt.org (Live)'
|
||||
'testing' => 'https://acme-staging' . (Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)',
|
||||
'production' => 'https://acme-v0' . Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
@@ -154,32 +192,14 @@ return array(
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_hsts_maxage' => array(
|
||||
'label' => $lng['admin']['domain_hsts_maxage'],
|
||||
'system_disable_le_selfcheck' => array(
|
||||
'label' => $lng['serversettings']['disable_le_selfcheck'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_maxage',
|
||||
'type' => 'int',
|
||||
'int_min' => 0,
|
||||
'int_max' => 94608000, // 3-years
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_hsts_incsub' => array(
|
||||
'label' => $lng['admin']['domain_hsts_incsub'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_incsub',
|
||||
'varname' => 'disable_le_selfcheck',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_hsts_preload' => array(
|
||||
'label' => $lng['admin']['domain_hsts_preload'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_preload',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -104,7 +104,7 @@ return array(
|
||||
'type' => 'int',
|
||||
'default' => 30,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -40,15 +40,6 @@ return array(
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_configdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'configdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_aliasconfigdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -73,9 +64,22 @@ return array(
|
||||
'varname' => 'peardir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_delimiter' => ':',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_envpath' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['envpath'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'envpath',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_delimiter' => ':',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/usr/local/bin:/usr/bin:/bin',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_fastcgi_ipcdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -85,72 +89,6 @@ return array(
|
||||
'default' => '/var/lib/apache2/fastcgi/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_reload' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'reload',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/php-fpm restart',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'pm',
|
||||
'type' => 'option',
|
||||
'default' => 'static',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand'),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_children',
|
||||
'type' => 'int',
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'start_servers',
|
||||
'type' => 'int',
|
||||
'default' => 20,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'min_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 35,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_requests',
|
||||
'type' => 'int',
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'idle_timeout',
|
||||
'type' => 'int',
|
||||
'default' => 30,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_use_mod_proxy' => array(
|
||||
'label' => $lng['phpfpm']['use_mod_proxy'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -160,6 +98,38 @@ return array(
|
||||
'visible' => Settings::Get('system.apache24'),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_ini_flags' => array(
|
||||
'label' => $lng['phpfpm']['ini_flags'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_flags',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_ini_values' => array(
|
||||
'label' => $lng['phpfpm']['ini_values'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_values',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_ini_admin_flags' => array(
|
||||
'label' => $lng['phpfpm']['ini_admin_flags'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_admin_flags',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_ini_admin_values' => array(
|
||||
'label' => $lng['phpfpm']['ini_admin_values'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_admin_values',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -440,7 +440,7 @@ if ($page == 'admins'
|
||||
} else {
|
||||
|
||||
$language_options = '';
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
||||
}
|
||||
|
||||
@@ -840,13 +840,13 @@ if ($page == 'admins'
|
||||
}
|
||||
|
||||
$language_options = '';
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options.= makeoption($language_name, $language_file, $result['def_language'], true);
|
||||
}
|
||||
|
||||
$ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']);
|
||||
$ipsandports_stmt = Database::query("
|
||||
SELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `ip` ORDER BY `ip`, `port` ASC
|
||||
SELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `id`, `ip` ORDER BY `ip`, `port` ASC
|
||||
");
|
||||
|
||||
while ($row = $ipsandports_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
@@ -30,15 +30,30 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
$customer_tmpdir = Settings::Get('phpfpm.tmpdir');
|
||||
}
|
||||
|
||||
// try to convert namserver hosts to ip's
|
||||
$ns_ips = "";
|
||||
if (Settings::Get('system.nameservers') != '') {
|
||||
$nameservers = explode(',', Settings::Get('system.nameservers'));
|
||||
foreach ($nameservers as $nameserver) {
|
||||
$nameserver = trim($nameserver);
|
||||
$nameserver_ips = gethostbynamel($nameserver);
|
||||
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) {
|
||||
$ns_ips .= implode(",", $nameserver_ips);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$replace_arr = Array(
|
||||
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'FROXLOR_MYSQL_PASSWORD',
|
||||
'<SQL_DB>' => $sql['db'],
|
||||
'<SQL_HOST>' => $sql['host'],
|
||||
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
||||
'<SERVERNAME>' => Settings::Get('system.hostname'),
|
||||
'<SERVERIP>' => Settings::Get('system.ipaddress'),
|
||||
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
|
||||
'<NAMESERVERS_IP>' => $ns_ips,
|
||||
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
|
||||
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
|
||||
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
|
||||
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),
|
||||
@@ -67,6 +82,12 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
$config_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . '/lib/configfiles/');
|
||||
|
||||
if ($distribution != "") {
|
||||
|
||||
if (!file_exists($config_dir . '/' . $distribution . ".xml")) {
|
||||
trigger_error("Unknown distribution, are you playing around with the URL?");
|
||||
exit;
|
||||
}
|
||||
|
||||
// create configparser object
|
||||
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");
|
||||
|
||||
@@ -78,6 +99,11 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
if ($service != "") {
|
||||
|
||||
if (!isset($services[$service])) {
|
||||
trigger_error("Unknown service, are you playing around with the URL?");
|
||||
exit;
|
||||
}
|
||||
|
||||
$daemons = $services[$service]->getDaemons();
|
||||
|
||||
if ($daemon == "") {
|
||||
@@ -121,6 +147,11 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
if ($distribution != "" && $service != "" && $daemon != "") {
|
||||
|
||||
if (!isset($daemons[$daemon])) {
|
||||
trigger_error("Unknown daemon, are you playing around with the URL?");
|
||||
exit;
|
||||
}
|
||||
|
||||
$confarr = $daemons[$daemon]->getConfig();
|
||||
|
||||
$configpage = '';
|
||||
|
||||
@@ -532,6 +532,14 @@ if ($page == 'customers'
|
||||
$phpenabled = intval($_POST['phpenabled']);
|
||||
}
|
||||
|
||||
$allowed_phpconfigs = array();
|
||||
if (isset($_POST['allowed_phpconfigs']) && is_array($_POST['allowed_phpconfigs'])) {
|
||||
foreach ($_POST['allowed_phpconfigs'] as $allowed_phpconfig) {
|
||||
$allowed_phpconfig = intval($allowed_phpconfig);
|
||||
$allowed_phpconfigs[] = $allowed_phpconfig;
|
||||
}
|
||||
}
|
||||
|
||||
$perlenabled = 0;
|
||||
if (isset($_POST['perlenabled'])) {
|
||||
$perlenabled = intval($_POST['perlenabled']);
|
||||
@@ -693,6 +701,7 @@ if ($page == 'customers'
|
||||
'tickets' => $tickets,
|
||||
'mysqls' => $mysqls,
|
||||
'phpenabled' => $phpenabled,
|
||||
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||
'imap' => $email_imap,
|
||||
'pop3' => $email_pop3,
|
||||
'perlenabled' => $perlenabled,
|
||||
@@ -733,6 +742,7 @@ if ($page == 'customers'
|
||||
`mysqls` = :mysqls,
|
||||
`standardsubdomain` = '0',
|
||||
`phpenabled` = :phpenabled,
|
||||
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||
`imap` = :imap,
|
||||
`pop3` = :pop3,
|
||||
`perlenabled` = :perlenabled,
|
||||
@@ -910,7 +920,8 @@ if ($page == 'customers'
|
||||
'customerid' => $customerid,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'docroot' => $documentroot,
|
||||
'adddate' => date('Y-m-d')
|
||||
'adddate' => time(),
|
||||
'phpenabled' => $phpenabled
|
||||
);
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
@@ -928,6 +939,7 @@ if ($page == 'customers'
|
||||
`dkim_id` = '0',
|
||||
`dkim_privkey` = '',
|
||||
`dkim_pubkey` = '',
|
||||
`phpenabled` = :phpenabled,
|
||||
`add_date` = :adddate"
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
@@ -1022,7 +1034,7 @@ if ($page == 'customers'
|
||||
} else {
|
||||
$language_options = '';
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options.= makeoption($language_name, $language_file, Settings::Get('panel.standardlanguage'), true);
|
||||
}
|
||||
|
||||
@@ -1041,6 +1053,26 @@ if ($page == 'customers'
|
||||
$gender_options .= makeoption($lng['gender']['male'], 1, null, true, true);
|
||||
$gender_options .= makeoption($lng['gender']['female'], 2, null, true, true);
|
||||
|
||||
$phpconfigs = array();
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description'] . " [".$row['interpreter']."]<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
} else {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description']."<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$customer_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_add.php';
|
||||
$customer_add_form = htmlform::genHTMLForm($customer_add_data);
|
||||
|
||||
@@ -1203,6 +1235,14 @@ if ($page == 'customers'
|
||||
$phpenabled = intval($_POST['phpenabled']);
|
||||
}
|
||||
|
||||
$allowed_phpconfigs = array();
|
||||
if (isset($_POST['allowed_phpconfigs']) && is_array($_POST['allowed_phpconfigs'])) {
|
||||
foreach ($_POST['allowed_phpconfigs'] as $allowed_phpconfig) {
|
||||
$allowed_phpconfig = intval($allowed_phpconfig);
|
||||
$allowed_phpconfigs[] = $allowed_phpconfig;
|
||||
}
|
||||
}
|
||||
|
||||
$perlenabled = 0;
|
||||
if (isset($_POST['perlenabled'])) {
|
||||
$perlenabled = intval($_POST['perlenabled']);
|
||||
@@ -1281,7 +1321,7 @@ if ($page == 'customers'
|
||||
'customerid' => $result['customerid'],
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'docroot' => $result['documentroot'],
|
||||
'adddate' => date('Y-m-d')
|
||||
'adddate' => time()
|
||||
);
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
@@ -1455,6 +1495,7 @@ if ($page == 'customers'
|
||||
'mysqls' => $mysqls,
|
||||
'deactivated' => $deactivated,
|
||||
'phpenabled' => $phpenabled,
|
||||
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||
'imap' => $email_imap,
|
||||
'pop3' => $email_pop3,
|
||||
'perlenabled' => $perlenabled,
|
||||
@@ -1488,6 +1529,7 @@ if ($page == 'customers'
|
||||
`mysqls` = :mysqls,
|
||||
`deactivated` = :deactivated,
|
||||
`phpenabled` = :phpenabled,
|
||||
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||
`email_quota` = :email_quota,
|
||||
`imap` = :imap,
|
||||
`pop3` = :pop3,
|
||||
@@ -1628,7 +1670,7 @@ if ($page == 'customers'
|
||||
} else {
|
||||
$language_options = '';
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options.= makeoption($language_name, $language_file, $result['def_language'], true);
|
||||
}
|
||||
|
||||
@@ -1693,6 +1735,26 @@ if ($page == 'customers'
|
||||
$gender_options .= makeoption($lng['gender']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
|
||||
$gender_options .= makeoption($lng['gender']['female'], 2, ($result['gender'] == '2' ? true : false), true, true);
|
||||
|
||||
$phpconfigs = array();
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description'] . " [".$row['interpreter']."]<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
} else {
|
||||
$phpconfigs[] = array(
|
||||
'label' => $row['description']."<br />",
|
||||
'value' => $row['id']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$customer_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_edit.php';
|
||||
$customer_edit_form = htmlform::genHTMLForm($customer_edit_data);
|
||||
|
||||
|
||||
@@ -210,6 +210,8 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
$deleted_domains = $del_stmt->rowCount();
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||
`subdomains_used` = `subdomains_used` - :domaincount
|
||||
@@ -304,7 +306,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
standard_error('admin_domain_emailsystemhostname');
|
||||
}
|
||||
|
||||
if (strpos($_POST['domain'], '--') !== false) {
|
||||
if (substr($_POST['domain'], 0, 4) == 'xn--') {
|
||||
standard_error('domain_nopunycode');
|
||||
}
|
||||
|
||||
@@ -453,6 +455,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1') {
|
||||
|
||||
$phpenabled = isset($_POST['phpenabled']) ? intval($_POST['phpenabled']) : 0;
|
||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 0;
|
||||
|
||||
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
@@ -493,7 +496,9 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
} else {
|
||||
|
||||
$phpenabled = '1';
|
||||
$openbasedir = '1';
|
||||
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpsettingid = Settings::Get('phpfpm.defaultini');
|
||||
} else {
|
||||
@@ -585,14 +590,20 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
}
|
||||
|
||||
$http2 = isset($_POST['http2']) && (int)$_POST['http2'] == 1 ? 1 : 0;
|
||||
|
||||
// HSTS
|
||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
||||
$hsts_sub = isset($_POST['hsts_sub']) && (int)$_POST['hsts_sub'] == 1 ? 1 : 0;
|
||||
$hsts_preload = isset($_POST['hsts_preload']) && (int)$_POST['hsts_preload'] == 1 ? 1 : 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = isset($_POST['ocsp_stapling']) && (int)$_POST['ocsp_stapling'] == 1 ? 1 : 0;
|
||||
|
||||
} else {
|
||||
$ssl_redirect = 0;
|
||||
$letsencrypt = 0;
|
||||
$http2 = 0;
|
||||
// we need this for the serialize
|
||||
// if ssl is disabled or no ssl-ip/port exists
|
||||
$ssl_ipandports[] = - 1;
|
||||
@@ -601,10 +612,14 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$hsts_maxage = 0;
|
||||
$hsts_sub = 0;
|
||||
$hsts_preload = 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = 0;
|
||||
}
|
||||
} else {
|
||||
$ssl_redirect = 0;
|
||||
$letsencrypt = 0;
|
||||
$http2 = 0;
|
||||
// we need this for the serialize
|
||||
// if ssl is disabled or no ssl-ip/port exists
|
||||
$ssl_ipandports[] = - 1;
|
||||
@@ -613,12 +628,20 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$hsts_maxage = 0;
|
||||
$hsts_sub = 0;
|
||||
$hsts_preload = 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = 0;
|
||||
}
|
||||
|
||||
// We can't enable let's encrypt for wildcard - domains
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1') {
|
||||
// We can't enable let's encrypt for wildcard - domains if using acme-v1
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||
standard_error('nowildcardwithletsencrypt');
|
||||
}
|
||||
// if using acme-v2 we cannot issue wildcard-certificates
|
||||
// because they currently only support the dns-01 challenge
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '2') {
|
||||
standard_error('nowildcardwithletsencryptv2');
|
||||
}
|
||||
|
||||
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||
if ($ssl_redirect > 0 && $letsencrypt == 1) {
|
||||
@@ -689,6 +712,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
standard_error('noipportgiven');
|
||||
}
|
||||
|
||||
if ($phpenabled != '1') {
|
||||
$phpenabled = '0';
|
||||
}
|
||||
|
||||
if ($openbasedir != '1') {
|
||||
$openbasedir = '0';
|
||||
}
|
||||
@@ -768,6 +795,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'ipandport' => serialize($ipandports),
|
||||
'ssl_redirect' => $ssl_redirect,
|
||||
'ssl_ipandport' => serialize($ssl_ipandports),
|
||||
'phpenabled' => $phpenabled,
|
||||
'openbasedir' => $openbasedir,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
@@ -777,9 +805,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'termination_date' => $termination_date,
|
||||
'issubof' => $issubof,
|
||||
'letsencrypt' => $letsencrypt,
|
||||
'hsts' => $hsts_maxage,
|
||||
'http2' => $http2,
|
||||
'hsts_maxage' => $hsts_maxage,
|
||||
'hsts_sub' => $hsts_sub,
|
||||
'hsts_preload' => $hsts_preload
|
||||
'hsts_preload' => $hsts_preload,
|
||||
'ocsp_stapling' => $ocsp_stapling
|
||||
);
|
||||
|
||||
$security_questions = array(
|
||||
@@ -816,6 +846,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'email_only' => $email_only,
|
||||
'subcanemaildomain' => $subcanemaildomain,
|
||||
'caneditdomain' => $caneditdomain,
|
||||
'phpenabled' => $phpenabled,
|
||||
'openbasedir' => $openbasedir,
|
||||
'speciallogfile' => $speciallogfile,
|
||||
'specialsettings' => $specialsettings,
|
||||
@@ -828,9 +859,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
'ismainbutsubto' => $issubof,
|
||||
'letsencrypt' => $letsencrypt,
|
||||
'http2' => $http2,
|
||||
'hsts' => $hsts_maxage,
|
||||
'hsts_sub' => $hsts_sub,
|
||||
'hsts_preload' => $hsts_preload
|
||||
'hsts_preload' => $hsts_preload,
|
||||
'ocsp_stapling' => $ocsp_stapling
|
||||
);
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
@@ -852,6 +885,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
`email_only` = :email_only,
|
||||
`subcanemaildomain` = :subcanemaildomain,
|
||||
`caneditdomain` = :caneditdomain,
|
||||
`phpenabled` = :phpenabled,
|
||||
`openbasedir` = :openbasedir,
|
||||
`speciallogfile` = :speciallogfile,
|
||||
`specialsettings` = :specialsettings,
|
||||
@@ -864,9 +898,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
|
||||
`ismainbutsubto` = :ismainbutsubto,
|
||||
`letsencrypt` = :letsencrypt,
|
||||
`http2` = :http2,
|
||||
`hsts` = :hsts,
|
||||
`hsts_sub` = :hsts_sub,
|
||||
`hsts_preload` = :hsts_preload
|
||||
`hsts_preload` = :hsts_preload,
|
||||
`ocsp_stapling` = :ocsp_stapling
|
||||
");
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
$domainid = Database::lastInsertId();
|
||||
@@ -1046,11 +1082,15 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
|
||||
$phpconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs .= makeoption($row['description'], $row['id'], Settings::Get('phpfpm.defaultini'), true, true);
|
||||
$phpconfigs .= makeoption($row['description'] . " [".$row['interpreter']."]", $row['id'], Settings::Get('phpfpm.defaultini'), true, true);
|
||||
} else {
|
||||
$phpconfigs .= makeoption($row['description'], $row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true);
|
||||
}
|
||||
@@ -1081,8 +1121,12 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `d`.*, `c`.`customerid` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||
WHERE `d`.`parentdomainid` = '0' AND `d`.`id` = :id" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid"));
|
||||
SELECT `d`.*, `c`.`customerid`
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||
WHERE `d`.`parentdomainid` = '0'
|
||||
AND `d`.`id` = :id" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid")
|
||||
);
|
||||
$params = array(
|
||||
'id' => $id
|
||||
);
|
||||
@@ -1227,7 +1271,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$adminid = $result['adminid'];
|
||||
}
|
||||
|
||||
$aliasdomain = intval($_POST['alias']);
|
||||
$aliasdomain = isset($_POST['alias']) ? intval($_POST['alias']) : 0;
|
||||
$issubof = intval($_POST['issubof']);
|
||||
$subcanemaildomain = intval($_POST['subcanemaildomain']);
|
||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||
@@ -1322,7 +1366,9 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1') {
|
||||
|
||||
$phpenabled = isset($_POST['phpenabled']) ? intval($_POST['phpenabled']) : 0;
|
||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 0;
|
||||
$phpfs = (isset($_POST['phpsettingsforsubdomains']) && intval($_POST['phpsettingsforsubdomains']) == 1) ? 1 : 0;
|
||||
|
||||
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpsettingid = (int) $_POST['phpsettingid'];
|
||||
@@ -1352,12 +1398,15 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
} else {
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
$phpfs = 1;
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
}
|
||||
} else {
|
||||
$phpenabled = $result['phpenabled'];
|
||||
$openbasedir = $result['openbasedir'];
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
$phpfs = 1;
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
}
|
||||
@@ -1398,6 +1447,16 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$letsencrypt = (int) $_POST['letsencrypt'];
|
||||
}
|
||||
|
||||
$http2 = isset($_POST['http2']) && (int)$_POST['http2'] == 1 ? 1 : 0;
|
||||
|
||||
// HSTS
|
||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
||||
$hsts_sub = isset($_POST['hsts_sub']) && (int)$_POST['hsts_sub'] == 1 ? 1 : 0;
|
||||
$hsts_preload = isset($_POST['hsts_preload']) && (int)$_POST['hsts_preload'] == 1 ? 1 : 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = isset($_POST['ocsp_stapling']) && (int)$_POST['ocsp_stapling'] == 1 ? 1 : 0;
|
||||
|
||||
$ssl_ipandports = array();
|
||||
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
|
||||
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
|
||||
@@ -1424,14 +1483,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
}
|
||||
|
||||
// HSTS
|
||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
||||
$hsts_sub = isset($_POST['hsts_sub']) && (int)$_POST['hsts_sub'] == 1 ? 1 : 0;
|
||||
$hsts_preload = isset($_POST['hsts_preload']) && (int)$_POST['hsts_preload'] == 1 ? 1 : 0;
|
||||
|
||||
} else {
|
||||
$ssl_redirect = 0;
|
||||
$letsencrypt = 0;
|
||||
$http2 = 0;
|
||||
// we need this for the serialize
|
||||
// if ssl is disabled or no ssl-ip/port exists
|
||||
$ssl_ipandports[] = - 1;
|
||||
@@ -1440,10 +1495,14 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$hsts_maxage = 0;
|
||||
$hsts_sub = 0;
|
||||
$hsts_preload = 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = 0;
|
||||
}
|
||||
} else {
|
||||
$ssl_redirect = 0;
|
||||
$letsencrypt = 0;
|
||||
$http2 = 0;
|
||||
// we need this for the serialize
|
||||
// if ssl is disabled or no ssl-ip/port exists
|
||||
$ssl_ipandports[] = - 1;
|
||||
@@ -1452,12 +1511,20 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$hsts_maxage = 0;
|
||||
$hsts_sub = 0;
|
||||
$hsts_preload = 0;
|
||||
|
||||
// OCSP stapling
|
||||
$ocsp_stapling = 0;
|
||||
}
|
||||
|
||||
// We can't enable let's encrypt for wildcard domains
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1') {
|
||||
// We can't enable let's encrypt for wildcard domains when using acme-v1
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||
standard_error('nowildcardwithletsencrypt');
|
||||
}
|
||||
// if using acme-v2 we cannot issue wildcard-certificates
|
||||
// because they currently only support the dns-01 challenge
|
||||
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '2') {
|
||||
standard_error('nowildcardwithletsencryptv2');
|
||||
}
|
||||
|
||||
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
||||
@@ -1468,6 +1535,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$documentroot = makeCorrectDir($documentroot);
|
||||
}
|
||||
|
||||
if ($phpenabled != '1') {
|
||||
$phpenabled = '0';
|
||||
}
|
||||
|
||||
if ($openbasedir != '1') {
|
||||
$openbasedir = '0';
|
||||
}
|
||||
@@ -1576,8 +1647,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'dkim' => $dkim,
|
||||
'selectserveralias' => $serveraliasoption,
|
||||
'ssl_redirect' => $ssl_redirect,
|
||||
'phpenabled' => $phpenabled,
|
||||
'openbasedir' => $openbasedir,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'phpsettingsforsubdomains' => $phpfs,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
'specialsettings' => $specialsettings,
|
||||
@@ -1590,9 +1663,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'ipandport' => serialize($ipandports),
|
||||
'ssl_ipandport' => serialize($ssl_ipandports),
|
||||
'letsencrypt' => $letsencrypt,
|
||||
'hsts' => $hsts_maxage,
|
||||
'http2' => $http2,
|
||||
'hsts_maxage' => $hsts_maxage,
|
||||
'hsts_sub' => $hsts_sub,
|
||||
'hsts_preload' => $hsts_preload
|
||||
'hsts_preload' => $hsts_preload,
|
||||
'ocsp_stapling' => $ocsp_stapling
|
||||
);
|
||||
|
||||
$security_questions = array(
|
||||
@@ -1611,7 +1686,28 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
|
||||
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
|
||||
|
||||
if ($documentroot != $result['documentroot'] || $ssl_redirect != $result['ssl_redirect'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] || $aliasdomain != $result['aliasdomain'] || $issubof != $result['ismainbutsubto'] || $email_only != $result['email_only'] || ($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') || $letsencrypt != $result['letsencrypt']) {
|
||||
if (
|
||||
$documentroot != $result['documentroot'] ||
|
||||
$ssl_redirect != $result['ssl_redirect'] ||
|
||||
$wwwserveralias != $result['wwwserveralias'] ||
|
||||
$iswildcarddomain != $result['iswildcarddomain'] ||
|
||||
$phpenabled != $result['phpenabled'] ||
|
||||
$openbasedir != $result['openbasedir'] ||
|
||||
$phpsettingid != $result['phpsettingid'] ||
|
||||
$mod_fcgid_starter != $result['mod_fcgid_starter'] ||
|
||||
$mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] ||
|
||||
$specialsettings != $result['specialsettings'] ||
|
||||
$aliasdomain != $result['aliasdomain'] ||
|
||||
$issubof != $result['ismainbutsubto'] ||
|
||||
$email_only != $result['email_only'] ||
|
||||
($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') ||
|
||||
$letsencrypt != $result['letsencrypt'] ||
|
||||
$http2 != $result['http2'] ||
|
||||
$hsts_maxage != $result['hsts'] ||
|
||||
$hsts_sub != $result['hsts_sub'] ||
|
||||
$hsts_preload != $result['hsts_preload'] ||
|
||||
$ocsp_stapling != $result['ocsp_stapling']
|
||||
) {
|
||||
inserttask('1');
|
||||
}
|
||||
|
||||
@@ -1640,6 +1736,16 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain #" . $id . " from mail-tables");
|
||||
}
|
||||
|
||||
// check whether LE has been disabled, so we remove the certificate
|
||||
if ($letsencrypt == '0' && $result['letsencrypt'] == '1') {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :id
|
||||
");
|
||||
Database::pexecute($del_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
}
|
||||
|
||||
$updatechildren = '';
|
||||
|
||||
if ($subcanemaildomain == '0' && $result['subcanemaildomain'] != '0') {
|
||||
@@ -1742,6 +1848,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$update_data['zonefile'] = $zonefile;
|
||||
$update_data['wwwserveralias'] = $wwwserveralias;
|
||||
$update_data['iswildcarddomain'] = $iswildcarddomain;
|
||||
$update_data['phpenabled'] = $phpenabled;
|
||||
$update_data['openbasedir'] = $openbasedir;
|
||||
$update_data['speciallogfile'] = $speciallogfile;
|
||||
$update_data['phpsettingid'] = $phpsettingid;
|
||||
@@ -1752,9 +1859,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$update_data['termination_date'] = $termination_date;
|
||||
$update_data['ismainbutsubto'] = $issubof;
|
||||
$update_data['letsencrypt'] = $letsencrypt;
|
||||
$update_data['http2'] = $http2;
|
||||
$update_data['hsts'] = $hsts_maxage;
|
||||
$update_data['hsts_sub'] = $hsts_sub;
|
||||
$update_data['hsts_preload'] = $hsts_preload;
|
||||
$update_data['ocsp_stapling'] = $ocsp_stapling;
|
||||
$update_data['id'] = $id;
|
||||
|
||||
$update_stmt = Database::prepare("
|
||||
@@ -1773,6 +1882,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
`zonefile` = :zonefile,
|
||||
`wwwserveralias` = :wwwserveralias,
|
||||
`iswildcarddomain` = :iswildcarddomain,
|
||||
`phpenabled` = :phpenabled,
|
||||
`openbasedir` = :openbasedir,
|
||||
`speciallogfile` = :speciallogfile,
|
||||
`phpsettingid` = :phpsettingid,
|
||||
@@ -1783,21 +1893,31 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
`termination_date` = :termination_date,
|
||||
`ismainbutsubto` = :ismainbutsubto,
|
||||
`letsencrypt` = :letsencrypt,
|
||||
`http2` = :http2,
|
||||
`hsts` = :hsts,
|
||||
`hsts_sub` = :hsts_sub,
|
||||
`hsts_preload` = :hsts_preload
|
||||
`hsts_preload` = :hsts_preload,
|
||||
`ocsp_stapling` = :ocsp_stapling
|
||||
WHERE `id` = :id
|
||||
");
|
||||
Database::pexecute($update_stmt, $update_data);
|
||||
|
||||
$_update_data['customerid'] = $customerid;
|
||||
$_update_data['adminid'] = $adminid;
|
||||
$_update_data['phpenabled'] = $phpenabled;
|
||||
$_update_data['openbasedir'] = $openbasedir;
|
||||
$_update_data['phpsettingid'] = $phpsettingid;
|
||||
$_update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
|
||||
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
|
||||
$_update_data['parentdomainid'] = $id;
|
||||
|
||||
// if php config is to be set for all subdomains, check here
|
||||
$update_phpconfig = '';
|
||||
$phpfs = isset($_POST['phpsettingsforsubdomains']) ? 1 : 0;
|
||||
if ($phpfs == 1) {
|
||||
$_update_data['phpsettingid'] = $phpsettingid;
|
||||
$update_phpconfig = ", `phpsettingid` = :phpsettingid";
|
||||
}
|
||||
|
||||
// if we have no more ssl-ip's for this domain,
|
||||
// all its subdomains must have "ssl-redirect = 0"
|
||||
// and disable let's encrypt
|
||||
@@ -1810,11 +1930,11 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`customerid` = :customerid,
|
||||
`adminid` = :adminid,
|
||||
`phpenabled` = :phpenabled,
|
||||
`openbasedir` = :openbasedir,
|
||||
`phpsettingid` = :phpsettingid,
|
||||
`mod_fcgid_starter` = :mod_fcgid_starter,
|
||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests
|
||||
" . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
||||
" . $update_phpconfig . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
||||
WHERE `parentdomainid` = :parentdomainid
|
||||
");
|
||||
Database::pexecute($_update_stmt, $_update_data);
|
||||
@@ -2084,10 +2204,18 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$result['add_date'] = date('Y-m-d', $result['add_date']);
|
||||
|
||||
$phpconfigs = '';
|
||||
$phpconfigs_result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
$phpconfigs_result_stmt = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
|
||||
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
} else {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
}
|
||||
}
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
@@ -2127,6 +2255,8 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
// update customer/admin counters
|
||||
updateCounters(false);
|
||||
inserttask('1');
|
||||
inserttask('4');
|
||||
|
||||
$result_str = $result['imported'] . ' / ' . $result['all'];
|
||||
standard_success('domain_import_successfully', $result_str, array(
|
||||
|
||||
@@ -280,7 +280,7 @@ if ($page == 'overview') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ if ($page == 'log'
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
||||
$result_stmt = Database::query('
|
||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
||||
);
|
||||
$logs_count = Database::num_rows();
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy();
|
||||
$result_stmt = Database::query($query . ' ' . $paging->getSqlLimit());
|
||||
$result_cnt_stmt = Database::query($query);
|
||||
$logs_count = $result_cnt_stmt->rowCount();
|
||||
$paging->setEntries($logs_count);
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
@@ -67,7 +67,7 @@ if ($page == 'log'
|
||||
foreach ($clog as $action => $logrows) {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
// if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
@@ -105,7 +105,7 @@ if ($page == 'log'
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
}
|
||||
// }
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* @package Panel
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
@@ -27,104 +26,111 @@ if (isset($_POST['id'])) {
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
$result = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
|
||||
$result = Database::query("
|
||||
SELECT c.*, fd.description as fpmdesc
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fd ON fd.id = c.fpmsettingid
|
||||
ORDER BY c.description ASC
|
||||
");
|
||||
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
|
||||
$domainresult = false;
|
||||
$query_params = array('id' => $row['id']);
|
||||
|
||||
$query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."`
|
||||
$query_params = array(
|
||||
'id' => $row['id']
|
||||
);
|
||||
|
||||
$query = "SELECT * FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `phpsettingid` = :id
|
||||
AND `parentdomainid` = '0'";
|
||||
|
||||
if ((int)$userinfo['domains_see_all'] == 0) {
|
||||
|
||||
if ((int) $userinfo['domains_see_all'] == 0) {
|
||||
$query .= " AND `adminid` = :adminid";
|
||||
$query_params['adminid'] = $userinfo['adminid'];
|
||||
}
|
||||
|
||||
if ((int)Settings::Get('panel.phpconfigs_hidestdsubdomain') == 1) {
|
||||
|
||||
if ((int) Settings::Get('panel.phpconfigs_hidestdsubdomain') == 1) {
|
||||
$ssdids_res = Database::query("
|
||||
SELECT DISTINCT `standardsubdomain` FROM `".TABLE_PANEL_CUSTOMERS."`
|
||||
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;"
|
||||
);
|
||||
SELECT DISTINCT `standardsubdomain` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;");
|
||||
$ssdids = array();
|
||||
while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) {
|
||||
$ssdids[] = $ssd['standardsubdomain'];
|
||||
}
|
||||
if (count($ssdids) > 0) {
|
||||
$query .= " AND `id` NOT IN (".implode(', ', $ssdids).")";
|
||||
$query .= " AND `id` NOT IN (" . implode(', ', $ssdids) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$domainresult_stmt = Database::prepare($query);
|
||||
Database::pexecute($domainresult_stmt, $query_params);
|
||||
|
||||
|
||||
$domains = '';
|
||||
if (Database::num_rows() > 0) {
|
||||
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains.= $row2['domain'] . '<br/>';
|
||||
$domains .= $row2['domain'] . '<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check whether we use that config as froxor-vhost config
|
||||
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id']
|
||||
|| Settings::Get('phpfpm.vhost_defaultini') == $row['id']
|
||||
) {
|
||||
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id'] || Settings::Get('phpfpm.vhost_defaultini') == $row['id']) {
|
||||
$domains .= Settings::Get('system.hostname');
|
||||
}
|
||||
|
||||
|
||||
if ($domains == '') {
|
||||
$domains = $lng['admin']['phpsettings']['notused'];
|
||||
}
|
||||
|
||||
|
||||
// check whether this is our default config
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini') == $row['id'])
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.defaultini') == $row['id'])
|
||||
) {
|
||||
$row['description'] = '<b>'.$row['description'].'</b>';
|
||||
if ((Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_defaultini') == $row['id']) || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.defaultini') == $row['id'])) {
|
||||
$row['description'] = '<b>' . $row['description'] . '</b>';
|
||||
}
|
||||
|
||||
|
||||
$count ++;
|
||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
||||
}
|
||||
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
||||
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'add') {
|
||||
|
||||
if ((int)$userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
if ((int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
|
||||
|
||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array(
|
||||
'-1',
|
||||
''
|
||||
));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array(
|
||||
'-1',
|
||||
''
|
||||
));
|
||||
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||
// disable fpm stuff
|
||||
$fpm_config_id = 1;
|
||||
$fpm_enableslowlog = 0;
|
||||
$fpm_reqtermtimeout = 0;
|
||||
$fpm_reqslowtimeout = 0;
|
||||
}
|
||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_pass_authorizationheader = 0;
|
||||
} elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_config_id = intval($_POST['fpmconfig']);
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int) $_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_pass_authorizationheader = isset($_POST['phpfpm_pass_authorizationheader']) ? (int) $_POST['phpfpm_pass_authorizationheader'] : 0;
|
||||
// disable fcgid stuff
|
||||
$binary = '/usr/bin/php-cgi';
|
||||
$file_extensions = 'php';
|
||||
@@ -132,13 +138,11 @@ if ($page == 'overview') {
|
||||
$mod_fcgid_maxrequests = 0;
|
||||
$mod_fcgid_umask = "022";
|
||||
}
|
||||
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
|
||||
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||
`description` = :desc,
|
||||
@@ -150,8 +154,9 @@ if ($page == 'overview') {
|
||||
`fpm_slowlog` = :fpmslow,
|
||||
`fpm_reqterm` = :fpmreqterm,
|
||||
`fpm_reqslow` = :fpmreqslow,
|
||||
`phpsettings` = :phpsettings"
|
||||
);
|
||||
`phpsettings` = :phpsettings,
|
||||
`fpmsettingid` = :fpmsettingid,
|
||||
`pass_authorizationheader` = :fpmpassauth");
|
||||
$ins_data = array(
|
||||
'desc' => $description,
|
||||
'binary' => $binary,
|
||||
@@ -162,123 +167,133 @@ if ($page == 'overview') {
|
||||
'fpmslow' => $fpm_enableslowlog,
|
||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||
'phpsettings' => $phpsettings
|
||||
'phpsettings' => $phpsettings,
|
||||
'fpmsettingid' => $fpm_config_id,
|
||||
'fpmpassauth' => $fpm_pass_authorizationheader
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
|
||||
$fpmconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
$fpmconfigs .= makeoption($row['description'], $row['id'], 1, true, true);
|
||||
}
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
$phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data);
|
||||
|
||||
|
||||
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
||||
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'delete') {
|
||||
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $id)
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.vhost_defaultini') == $id)
|
||||
) {
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||
$result = Database::pexecute_first($result_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $id) || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.vhost_defaultini') == $id)) {
|
||||
standard_error('cannotdeletehostnamephpconfig');
|
||||
}
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini') == $id)
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.defaultini') == $id)
|
||||
) {
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_defaultini') == $id) || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.defaultini') == $id)) {
|
||||
standard_error('cannotdeletedefaultphpconfig');
|
||||
}
|
||||
|
||||
if ($result['id'] != 0
|
||||
&& $result['id'] == $id
|
||||
&& (int)$userinfo['change_serversettings'] == 1
|
||||
&& $id != 1 // cannot delete the default php.config
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
||||
{
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// set php-config to default for all domains using the
|
||||
// config that is to be deleted
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id"
|
||||
);
|
||||
Database::pexecute($upd_stmt, array('id' => $id));
|
||||
|
||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($del_stmt, array('id' => $id));
|
||||
|
||||
DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||
Database::pexecute($del_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int) $id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
ask_yesno('phpsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']);
|
||||
ask_yesno('phpsetting_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $result['description']);
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if ($result['id'] != 0
|
||||
&& $result['id'] == $id
|
||||
&& (int)$userinfo['change_serversettings'] == 1
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||
$result = Database::pexecute_first($result_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
|
||||
|
||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array(
|
||||
'-1',
|
||||
''
|
||||
));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array(
|
||||
'-1',
|
||||
''
|
||||
));
|
||||
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||
// disable fpm stuff
|
||||
$fpm_config_id = 1;
|
||||
$fpm_enableslowlog = 0;
|
||||
$fpm_reqtermtimeout = 0;
|
||||
$fpm_reqslowtimeout = 0;
|
||||
}
|
||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_pass_authorizationheader = 0;
|
||||
} elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_config_id = intval($_POST['fpmconfig']);
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int) $_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_pass_authorizationheader = isset($_POST['phpfpm_pass_authorizationheader']) ? (int) $_POST['phpfpm_pass_authorizationheader'] : 0;
|
||||
// disable fcgid stuff
|
||||
$binary = '/usr/bin/php-cgi';
|
||||
$file_extensions = 'php';
|
||||
@@ -286,13 +301,11 @@ if ($page == 'overview') {
|
||||
$mod_fcgid_maxrequests = 0;
|
||||
$mod_fcgid_umask = "022";
|
||||
}
|
||||
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
|
||||
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||
`description` = :desc,
|
||||
@@ -304,39 +317,292 @@ if ($page == 'overview') {
|
||||
`fpm_slowlog` = :fpmslow,
|
||||
`fpm_reqterm` = :fpmreqterm,
|
||||
`fpm_reqslow` = :fpmreqslow,
|
||||
`phpsettings` = :phpsettings
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
`phpsettings` = :phpsettings,
|
||||
`fpmsettingid` = :fpmsettingid,
|
||||
`pass_authorizationheader` = :fpmpassauth
|
||||
WHERE `id` = :id");
|
||||
$upd_data = array(
|
||||
'desc' => $description,
|
||||
'binary' => $binary,
|
||||
'fext' => $file_extensions,
|
||||
'starter' => $mod_fcgid_starter,
|
||||
'mreq' => $mod_fcgid_maxrequests,
|
||||
'umask' => $mod_fcgid_umask,
|
||||
'fpmslow' => $fpm_enableslowlog,
|
||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||
'phpsettings' => $phpsettings,
|
||||
'id' => $id
|
||||
'desc' => $description,
|
||||
'binary' => $binary,
|
||||
'fext' => $file_extensions,
|
||||
'starter' => $mod_fcgid_starter,
|
||||
'mreq' => $mod_fcgid_maxrequests,
|
||||
'umask' => $mod_fcgid_umask,
|
||||
'fpmslow' => $fpm_enableslowlog,
|
||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||
'phpsettings' => $phpsettings,
|
||||
'fpmsettingid' => $fpm_config_id,
|
||||
'fpmpassauth' => $fpm_pass_authorizationheader,
|
||||
'id' => $id
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data);
|
||||
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
$fpmconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
$fpmconfigs .= makeoption($row['description'], $row['id'], $id, true, true);
|
||||
}
|
||||
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);
|
||||
|
||||
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
||||
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
||||
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
} elseif ($page == 'fpmdaemons') {
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
$result = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$query_params = array(
|
||||
'id' => $row['id']
|
||||
);
|
||||
|
||||
$query = "SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `fpmsettingid` = :id";
|
||||
|
||||
$configresult_stmt = Database::prepare($query);
|
||||
Database::pexecute($configresult_stmt, $query_params);
|
||||
|
||||
$configs = '';
|
||||
if (Database::num_rows() > 0) {
|
||||
while ($row2 = $configresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$configs .= $row2['description'] . '<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($configs == '') {
|
||||
$configs = $lng['admin']['phpsettings']['notused'];
|
||||
}
|
||||
|
||||
$count ++;
|
||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/fpmdaemons_overview") . "\";");
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "fpm daemons setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
||||
eval("echo \"" . getTemplate("phpconfig/fpmdaemons") . "\";");
|
||||
}
|
||||
|
||||
if ($action == 'add') {
|
||||
|
||||
if ((int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$reload_cmd = validate($_POST['reload_cmd'], 'reload_cmd');
|
||||
$config_dir = validate($_POST['config_dir'], 'config_dir');
|
||||
$pm = $_POST['pm'];
|
||||
$max_children = isset($_POST['max_children']) ? (int) $_POST['max_children'] : 0;
|
||||
$start_servers = isset($_POST['start_servers']) ? (int) $_POST['start_servers'] : 0;
|
||||
$min_spare_servers = isset($_POST['min_spare_servers']) ? (int) $_POST['min_spare_servers'] : 0;
|
||||
$max_spare_servers = isset($_POST['max_spare_servers']) ? (int) $_POST['max_spare_servers'] : 0;
|
||||
$max_requests = isset($_POST['max_requests']) ? (int) $_POST['max_requests'] : 0;
|
||||
$idle_timeout = isset($_POST['idle_timeout']) ? (int) $_POST['idle_timeout'] : 0;
|
||||
$limit_extensions = validate($_POST['limit_extensions'], 'limit_extensions', '/^(\.[a-z]([a-z0-9]+)\ ?)+$/');
|
||||
|
||||
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_FPMDAEMONS . "` SET
|
||||
`description` = :desc,
|
||||
`reload_cmd` = :reload_cmd,
|
||||
`config_dir` = :config_dir,
|
||||
`pm` = :pm,
|
||||
`max_children` = :max_children,
|
||||
`start_servers` = :start_servers,
|
||||
`min_spare_servers` = :min_spare_servers,
|
||||
`max_spare_servers` = :max_spare_servers,
|
||||
`max_requests` = :max_requests,
|
||||
`idle_timeout` = :idle_timeout,
|
||||
`limit_extensions` = :limit_extensions
|
||||
");
|
||||
$ins_data = array(
|
||||
'desc' => $description,
|
||||
'reload_cmd' => $reload_cmd,
|
||||
'config_dir' => makeCorrectDir($config_dir),
|
||||
'pm' => $pm,
|
||||
'max_children' => $max_children,
|
||||
'start_servers' => $start_servers,
|
||||
'min_spare_servers' => $min_spare_servers,
|
||||
'max_spare_servers' => $max_spare_servers,
|
||||
'max_requests' => $max_requests,
|
||||
'idle_timeout' => $idle_timeout,
|
||||
'limit_extensions' => $limit_extensions
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "fpm-daemon setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
$pm_select = makeoption('static', 'static', 'static', true, true);
|
||||
$pm_select.= makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select.= makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
|
||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||
$fpmconfig_add_form = htmlform::genHTMLForm($fpmconfig_add_data);
|
||||
|
||||
$title = $fpmconfig_add_data['fpmconfig_add']['title'];
|
||||
$image = $fpmconfig_add_data['fpmconfig_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/fpmconfig_add") . "\";");
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
|
||||
$result = Database::pexecute_first($result_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
if ($id == 1) {
|
||||
standard_error('cannotdeletedefaultphpconfig');
|
||||
}
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
||||
{
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// set default fpm daemon config for all php-config that use this config that is to be deleted
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
|
||||
Database::pexecute($del_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "fpm-daemon setting with id #" . (int) $id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
ask_yesno('fpmsetting_reallydelete', $filename, array(
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $result['description']);
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'edit') {
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
|
||||
$result = Database::pexecute_first($result_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$reload_cmd = validate($_POST['reload_cmd'], 'reload_cmd');
|
||||
$config_dir = validate($_POST['config_dir'], 'config_dir');
|
||||
$pm = $_POST['pm'];
|
||||
$max_children = isset($_POST['max_children']) ? (int) $_POST['max_children'] : $result['max_children'];
|
||||
$start_servers = isset($_POST['start_servers']) ? (int) $_POST['start_servers'] : $result['start_servers'];
|
||||
$min_spare_servers = isset($_POST['min_spare_servers']) ? (int) $_POST['min_spare_servers'] : $result['min_spare_servers'];
|
||||
$max_spare_servers = isset($_POST['max_spare_servers']) ? (int) $_POST['max_spare_servers'] : $result['max_spare_servers'];
|
||||
$max_requests = isset($_POST['max_requests']) ? (int) $_POST['max_requests'] : $result['max_requests'];
|
||||
$idle_timeout = isset($_POST['idle_timeout']) ? (int) $_POST['idle_timeout'] : $result['idle_timeout'];
|
||||
$limit_extensions = validate($_POST['limit_extensions'], 'limit_extensions', '/^(\.[a-z]([a-z0-9]+)\ ?)+$/');
|
||||
|
||||
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_FPMDAEMONS . "` SET
|
||||
`description` = :desc,
|
||||
`reload_cmd` = :reload_cmd,
|
||||
`config_dir` = :config_dir,
|
||||
`pm` = :pm,
|
||||
`max_children` = :max_children,
|
||||
`start_servers` = :start_servers,
|
||||
`min_spare_servers` = :min_spare_servers,
|
||||
`max_spare_servers` = :max_spare_servers,
|
||||
`max_requests` = :max_requests,
|
||||
`idle_timeout` = :idle_timeout,
|
||||
`limit_extensions` = :limit_extensions
|
||||
WHERE `id` = :id
|
||||
");
|
||||
$upd_data = array(
|
||||
'desc' => $description,
|
||||
'reload_cmd' => $reload_cmd,
|
||||
'config_dir' => makeCorrectDir($config_dir),
|
||||
'pm' => $pm,
|
||||
'max_children' => $max_children,
|
||||
'start_servers' => $start_servers,
|
||||
'min_spare_servers' => $min_spare_servers,
|
||||
'max_spare_servers' => $max_spare_servers,
|
||||
'max_requests' => $max_requests,
|
||||
'idle_timeout' => $idle_timeout,
|
||||
'limit_extensions' => $limit_extensions,
|
||||
'id' => $id
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data);
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "fpm-daemon setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
} else {
|
||||
|
||||
$pm_select = makeoption('static', 'static', $result['pm'], true, true);
|
||||
$pm_select.= makeoption('dynamic', 'dynamic', $result['pm'], true, true);
|
||||
$pm_select.= makeoption('ondemand', 'ondemand', $result['pm'], true, true);
|
||||
|
||||
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
||||
$fpmconfig_edit_form = htmlform::genHTMLForm($fpmconfig_edit_data);
|
||||
|
||||
$title = $fpmconfig_edit_data['fpmconfig_edit']['title'];
|
||||
$image = $fpmconfig_edit_data['fpmconfig_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/fpmconfig_edit") . "\";");
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
|
||||
@@ -290,3 +290,107 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/integritycheck") . "\";");
|
||||
}
|
||||
elseif ($page == 'importexport' && $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
// check for json-stuff
|
||||
if (! extension_loaded('json')) {
|
||||
standard_error('jsonextensionnotfound');
|
||||
}
|
||||
|
||||
if (isset($_GET['action']) && $_GET['action'] == "export") {
|
||||
// export
|
||||
try {
|
||||
$json_export = SImExporter::export();
|
||||
} catch(Exception $e) {
|
||||
dynamic_error($e->getMessage());
|
||||
}
|
||||
header('Content-disposition: attachment; filename=Froxlor_settings-'.$version.'-'.$dbversion.'_'.date('d.m.Y').'.json');
|
||||
header('Content-type: application/json');
|
||||
echo $json_export;
|
||||
exit;
|
||||
} elseif (isset($_GET['action']) && $_GET['action'] == "import") {
|
||||
// import
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// get uploaded file
|
||||
if (isset($_FILES["import_file"]["tmp_name"])) {
|
||||
$imp_content = file_get_contents($_FILES["import_file"]["tmp_name"]);
|
||||
try {
|
||||
SImExporter::import($imp_content);
|
||||
} catch(Exception $e) {
|
||||
dynamic_error($e->getMessage());
|
||||
}
|
||||
standard_success('settingsimported', '', array('filename' => 'admin_settings.php'));
|
||||
}
|
||||
dynamic_error("Upload failed");
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate("settings/importexport/index") . "\";");
|
||||
}
|
||||
}
|
||||
elseif ($page == 'testmail')
|
||||
{
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send')
|
||||
{
|
||||
$test_addr = isset($_POST['test_addr']) ? $_POST['test_addr'] : null;
|
||||
|
||||
/**
|
||||
* Initialize the mailingsystem
|
||||
*/
|
||||
$testmail = new PHPMailer(true);
|
||||
$testmail->CharSet = "UTF-8";
|
||||
|
||||
if (Settings::Get('system.mail_use_smtp')) {
|
||||
$testmail->isSMTP();
|
||||
$testmail->Host = Settings::Get('system.mail_smtp_host');
|
||||
$testmail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1' ? true : false;
|
||||
$testmail->Username = Settings::Get('system.mail_smtp_user');
|
||||
$testmail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$testmail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$testmail->SMTPAutoTLS = false;
|
||||
}
|
||||
$testmail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
$_mailerror = false;
|
||||
if (PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||
// set return-to address and custom sender-name, see #76
|
||||
$testmail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
if (Settings::Get('panel.adminmail_return') != '') {
|
||||
$testmail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
|
||||
}
|
||||
|
||||
try {
|
||||
$testmail->Subject = "Froxlor Test-Mail";
|
||||
$mail_body = "Yay, this worked :)";
|
||||
$testmail->AltBody = $mail_body;
|
||||
$testmail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$testmail->AddAddress($test_addr);
|
||||
$testmail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if (!$_mailerror) {
|
||||
// success
|
||||
$mail->ClearAddresses();
|
||||
standard_success('testmailsent', '', array('filename' => 'admin_settings.php', 'page' => 'testmail'));
|
||||
}
|
||||
} else {
|
||||
// invalid sender e-mail
|
||||
$mailerr_msg = "Invalid sender e-mail address: ".Settings::Get('panel.adminmail');
|
||||
$_mailerror = true;
|
||||
}
|
||||
}
|
||||
|
||||
$mail_smtp_user = Settings::Get('system.mail_smtp_user');
|
||||
$mail_smtp_host = Settings::Get('system.mail_smtp_host');
|
||||
$mail_smtp_port = Settings::Get('system.mail_smtp_port');
|
||||
|
||||
eval("echo \"" . getTemplate("settings/testmail") . "\";");
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ if ($action == '') {
|
||||
}
|
||||
|
||||
$add = false;
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
|
||||
$templates_done = array();
|
||||
$result_stmt = Database::prepare("
|
||||
@@ -328,7 +328,7 @@ if ($action == '') {
|
||||
$language_options = '';
|
||||
$template_options = '';
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$templates = array();
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
|
||||
@@ -260,7 +260,7 @@ if ($page == 'overview') {
|
||||
if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
|
||||
if (strpos($_POST['subdomain'], '--') !== false) {
|
||||
if (substr($_POST['subdomain'], 0, 4) == 'xn--') {
|
||||
standard_error('domain_nopunycode');
|
||||
}
|
||||
|
||||
@@ -327,6 +327,9 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
||||
if (strstr($path, ":") !== FALSE) {
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
}
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||
@@ -334,9 +337,6 @@ if ($page == 'overview') {
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
}
|
||||
if (strstr($path, ":") !== FALSE) {
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
}
|
||||
} else {
|
||||
$_doredirect = true;
|
||||
}
|
||||
@@ -405,6 +405,10 @@ if ($page == 'overview') {
|
||||
// assign default config
|
||||
$phpsid_result['phpsettingid'] = 1;
|
||||
}
|
||||
// check whether the customer has chosen its own php-config
|
||||
if (isset($_POST['phpsettingid']) && intval($_POST['phpsettingid']) != $phpsid_result['phpsettingid']) {
|
||||
$phpsid_result['phpsettingid'] = intval($_POST['phpsettingid']);
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`customerid` = :customerid,
|
||||
@@ -415,6 +419,7 @@ if ($page == 'overview') {
|
||||
`wwwserveralias` = :wwwserveralias,
|
||||
`isemaildomain` = :isemaildomain,
|
||||
`iswildcarddomain` = :iswildcarddomain,
|
||||
`phpenabled` = :phpenabled,
|
||||
`openbasedir` = :openbasedir,
|
||||
`openbasedir_path` = :openbasedir_path,
|
||||
`speciallogfile` = :speciallogfile,
|
||||
@@ -437,6 +442,7 @@ if ($page == 'overview') {
|
||||
"isemaildomain" => $domain_check['subcanemaildomain'] == '3' ? '1' : '0',
|
||||
"openbasedir" => $domain_check['openbasedir'],
|
||||
"openbasedir_path" => $openbasedir_path,
|
||||
"phpenabled" => $domain_check['phpenabled'],
|
||||
"speciallogfile" => $domain_check['speciallogfile'],
|
||||
"specialsettings" => $domain_check['specialsettings'],
|
||||
"ssl_redirect" => $ssl_redirect,
|
||||
@@ -517,7 +523,12 @@ if ($page == 'overview') {
|
||||
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$ssl_ip_stmt = Database::prepare("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
$ssl_ip_stmt = Database::prepare("
|
||||
SELECT COUNT(*) as countSSL
|
||||
FROM `".TABLE_PANEL_IPSANDPORTS."` pip
|
||||
LEFT JOIN `".TABLE_DOMAINTOIP."` dti ON dti.id_ipandports = pip.id
|
||||
WHERE pip.`ssl`='1'
|
||||
");
|
||||
Database::pexecute($ssl_ip_stmt);
|
||||
$resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
@@ -527,6 +538,27 @@ if ($page == 'overview') {
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
|
||||
$phpconfigs = '';
|
||||
$has_phpconfigs = false;
|
||||
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs']))
|
||||
{
|
||||
$has_phpconfigs = true;
|
||||
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
|
||||
$phpconfigs_result_stmt = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
WHERE c.id IN (".implode(", ", $allowed_cfg).")
|
||||
");
|
||||
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], Settings::Get('phpfpm.defaultini'), true, true);
|
||||
} else {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$subdomain_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domains_add.php';
|
||||
$subdomain_add_form = htmlform::genHTMLForm($subdomain_add_data);
|
||||
|
||||
@@ -564,6 +596,9 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
||||
if (strstr($path, ":") !== FALSE) {
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
}
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||
@@ -571,14 +606,11 @@ if ($page == 'overview') {
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
}
|
||||
if (strstr($path, ":") !== FALSE) {
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
}
|
||||
} else {
|
||||
$_doredirect = true;
|
||||
}
|
||||
|
||||
$aliasdomain = intval($_POST['alias']);
|
||||
$aliasdomain = isset($_POST['alias']) ? intval($_POST['alias']) : 0;
|
||||
|
||||
if (isset($_POST['selectserveralias'])) {
|
||||
$iswildcarddomain = ($_POST['selectserveralias'] == '0') ? '1' : '0';
|
||||
@@ -617,6 +649,13 @@ if ($page == 'overview') {
|
||||
$openbasedir_path = '0';
|
||||
}
|
||||
|
||||
// check whether the customer has chosen its own php-config
|
||||
if (isset($_POST['phpsettingid'])) {
|
||||
$phpsettingid = intval($_POST['phpsettingid']);
|
||||
} else {
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
}
|
||||
|
||||
if (isset($_POST['ssl_redirect']) && $_POST['ssl_redirect'] == '1') {
|
||||
// a ssl-redirect only works if there actually is a
|
||||
// ssl ip/port assigned to the domain
|
||||
@@ -642,10 +681,15 @@ if ($page == 'overview') {
|
||||
$letsencrypt = '0';
|
||||
}
|
||||
|
||||
// We can't enable let's encrypt for wildcard - domains
|
||||
if ($iswildcarddomain == '1' && $letsencrypt == '1') {
|
||||
// We can't enable let's encrypt for wildcard - domains when using acme-v1
|
||||
if ($iswildcarddomain == '1' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||
standard_error('nowildcardwithletsencrypt');
|
||||
}
|
||||
// if using acme-v2 we cannot issue wildcard-certificates
|
||||
// because they currently only support the dns-01 challenge
|
||||
if ($iswildcarddomain == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '2') {
|
||||
standard_error('nowildcardwithletsencryptv2');
|
||||
}
|
||||
|
||||
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
||||
@@ -681,7 +725,12 @@ if ($page == 'overview') {
|
||||
|| $aliasdomain != $result['aliasdomain']
|
||||
|| $openbasedir_path != $result['openbasedir_path']
|
||||
|| $ssl_redirect != $result['ssl_redirect']
|
||||
|| $letsencrypt != $result['letsencrypt']) {
|
||||
|| $letsencrypt != $result['letsencrypt']
|
||||
|| $hsts_maxage != $result['hsts']
|
||||
|| $hsts_sub != $result['hsts_sub']
|
||||
|| $hsts_preload != $result['hsts_preload']
|
||||
|| $phpsettingid != $result['phpsettingid']
|
||||
) {
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
@@ -695,7 +744,8 @@ if ($page == 'overview') {
|
||||
`letsencrypt`= :letsencrypt,
|
||||
`hsts` = :hsts,
|
||||
`hsts_sub` = :hsts_sub,
|
||||
`hsts_preload` = :hsts_preload
|
||||
`hsts_preload` = :hsts_preload,
|
||||
`phpsettingid` = :phpsettingid
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id"
|
||||
);
|
||||
@@ -711,6 +761,7 @@ if ($page == 'overview') {
|
||||
"hsts" => $hsts_maxage,
|
||||
"hsts_sub" => $hsts_sub,
|
||||
"hsts_preload" => $hsts_preload,
|
||||
"phpsettingid" => $phpsettingid,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
);
|
||||
@@ -720,11 +771,20 @@ if ($page == 'overview') {
|
||||
// trigger when domain id for alias destination has changed: both for old and new destination
|
||||
triggerLetsEncryptCSRForAliasDestinationDomain($result['aliasdomain'], $log);
|
||||
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
||||
} else
|
||||
if ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
|
||||
// or when wwwserveralias or letsencrypt was changed
|
||||
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
||||
}
|
||||
} elseif ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
|
||||
// or when wwwserveralias or letsencrypt was changed
|
||||
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
||||
}
|
||||
|
||||
// check whether LE has been disabled, so we remove the certificate
|
||||
if ($letsencrypt == '0' && $result['letsencrypt'] == '1') {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :id
|
||||
");
|
||||
Database::pexecute($del_stmt, array(
|
||||
'id' => $id
|
||||
));
|
||||
}
|
||||
|
||||
inserttask('1');
|
||||
|
||||
@@ -784,8 +844,13 @@ if ($page == 'overview') {
|
||||
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$ssl_ip_stmt = Database::prepare("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
Database::pexecute($ssl_ip_stmt);
|
||||
$ssl_ip_stmt = Database::prepare("
|
||||
SELECT COUNT(*) as countSSL
|
||||
FROM `".TABLE_PANEL_IPSANDPORTS."` pip
|
||||
LEFT JOIN `".TABLE_DOMAINTOIP."` dti ON dti.id_ipandports = pip.id
|
||||
WHERE `dti`.`id_domain` = :id_domain AND pip.`ssl`='1'
|
||||
");
|
||||
Database::pexecute($ssl_ip_stmt, array("id_domain" => $result['id']));
|
||||
$resultX = $ssl_ip_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
$ssl_ipsandports = 'notempty';
|
||||
@@ -821,6 +886,27 @@ if ($page == 'overview') {
|
||||
$result_ipandport['ip'] .= $rowip['ip'] . "<br />";
|
||||
}
|
||||
|
||||
$phpconfigs = '';
|
||||
$has_phpconfigs = false;
|
||||
if (isset($userinfo['allowed_phpconfigs']) && !empty($userinfo['allowed_phpconfigs']))
|
||||
{
|
||||
$has_phpconfigs = true;
|
||||
$allowed_cfg = json_decode($userinfo['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY);
|
||||
$phpconfigs_result_stmt = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
WHERE c.id IN (".implode(", ", $allowed_cfg).")
|
||||
");
|
||||
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'] . " [".$phpconfigs_row['interpreter']."]", $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
} else {
|
||||
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$domainip = $result_ipandport['ip'];
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
|
||||
@@ -96,7 +96,8 @@ if ($page == 'overview') {
|
||||
$row['destination'] = explode(' ', $row['destination']);
|
||||
uasort($row['destination'], 'strcasecmp');
|
||||
|
||||
while (list($dest_id, $destination) = each($row['destination'])) {
|
||||
$dest_list = $row['destination'];
|
||||
foreach ($dest_list as $dest_id => $destination) {
|
||||
$row['destination'][$dest_id] = $idna_convert->decode($row['destination'][$dest_id]);
|
||||
|
||||
if ($row['destination'][$dest_id] == $row['email_full']) {
|
||||
@@ -164,7 +165,7 @@ if ($page == 'overview') {
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $result['popaccountid']));
|
||||
$update_users_query_addon .= " , `email_accounts_used` = `email_accounts_used` - 1 ";
|
||||
$number_forwarders-= 1;
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "deleted forwarder for email address '" . $result['email'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted forwarder for email address '" . $result['email'] . "'");
|
||||
}
|
||||
} else {
|
||||
$number_forwarders = 0;
|
||||
@@ -323,7 +324,7 @@ if ($page == 'overview') {
|
||||
$forwarders = '';
|
||||
$forwarders_count = 0;
|
||||
|
||||
while (list($dest_id, $destination) = each($result['destination'])) {
|
||||
foreach ($result['destination'] as $dest_id => $destination) {
|
||||
$destination = $idna_convert->decode($destination);
|
||||
|
||||
if ($destination != $result['email_full'] && $destination != '') {
|
||||
@@ -652,7 +653,7 @@ if ($page == 'overview') {
|
||||
|
||||
$password = validatePassword($password);
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "changed email password for '" . $result['email_full'] . "'");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
||||
SET " . (Settings::Get('system.mailpwcleartext') == '1' ? "`password` = :password, " : '') . "
|
||||
@@ -699,7 +700,7 @@ if ($page == 'overview') {
|
||||
if ($userinfo['email_quota'] != '-1' && ($quota == 0 || ($quota + $userinfo['email_quota_used'] - $result['quota']) > $userinfo['email_quota'])) {
|
||||
standard_error('allocatetoomuchquota', $quota);
|
||||
} else {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "updated quota for email address '" . $result['email'] . "' to " . $quota . " MB");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated quota for email address '" . $result['email'] . "' to " . $quota . " MB");
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
||||
SET `quota` = :quota
|
||||
WHERE `id` = :id
|
||||
@@ -834,7 +835,7 @@ if ($page == 'overview') {
|
||||
);
|
||||
Database::pexecute($stmt, array("cid" => $userinfo['customerid']));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "added email forwarder for '" . $result['email_full'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added email forwarder for '" . $result['email_full'] . "'");
|
||||
redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
@@ -895,7 +896,7 @@ if ($page == 'overview') {
|
||||
);
|
||||
Database::pexecute($stmt, array("cid" => $userinfo['customerid']));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "deleted email forwarder for '" . $result['email_full'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted email forwarder for '" . $result['email_full'] . "'");
|
||||
redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
} else {
|
||||
ask_yesno('email_reallydelete_forwarder', $filename, array('id' => $id, 'forwarderid' => $forwarderid, 'page' => $page, 'action' => $action), $idna_convert->decode($result['email_full']) . ' -> ' . $idna_convert->decode($forwarder));
|
||||
|
||||
@@ -134,6 +134,12 @@ if ($page == 'overview') {
|
||||
// refs #293
|
||||
if (isset($_POST['delete_userfiles']) && (int)$_POST['delete_userfiles'] == 1) {
|
||||
inserttask('8', $userinfo['loginname'], $result['homedir']);
|
||||
} else {
|
||||
if (Settings::Get('system.nssextrausers') == 1)
|
||||
{
|
||||
// this is used so that the libnss-extrausers cron is fired
|
||||
inserttask(5);
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
@@ -431,6 +437,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'");
|
||||
inserttask(5);
|
||||
$description = validate($_POST['ftp_description'], 'description');
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `description` = :desc, `shell` = :shell
|
||||
|
||||
@@ -204,7 +204,7 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$language_options = '';
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options .= makeoption($language_name, $language_file, $default_lang, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,15 @@
|
||||
* @package Panel
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options','extras.logger')) {
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras.logger')) {
|
||||
redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($page == 'log'
|
||||
) {
|
||||
if ($page == 'log') {
|
||||
if ($action == '') {
|
||||
$fields = array(
|
||||
'date' => $lng['logger']['date'],
|
||||
@@ -34,37 +32,39 @@ if ($page == 'log'
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
||||
$result_stmt = Database::prepare('
|
||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
||||
);
|
||||
Database::pexecute($result_stmt, array("loginname" => $userinfo['loginname']));
|
||||
$logs_count = Database::num_rows();
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy();
|
||||
$result_stmt = Database::prepare($query . ' ' . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"loginname" => $userinfo['loginname']
|
||||
));
|
||||
$result_cnt_stmt = Database::prepare($query);
|
||||
Database::pexecute($result_cnt_stmt, array(
|
||||
"loginname" => $userinfo['loginname']
|
||||
));
|
||||
$res_cnt = $result_cnt_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$logs_count = $result_cnt_stmt->rowCount();
|
||||
$paging->setEntries($logs_count);
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (!isset($clog[$row['action']])
|
||||
|| !is_array($clog[$row['action']])
|
||||
) {
|
||||
|
||||
if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
|
||||
$clog[$row['action']] = array();
|
||||
}
|
||||
$clog[$row['action']][$row['logid']] = $row;
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'date'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
|
||||
if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
|
||||
krsort($clog);
|
||||
} else {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
@@ -72,51 +72,50 @@ if ($page == 'log'
|
||||
foreach ($clog as $action => $logrows) {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
switch ($action) {
|
||||
case USR_ACTION:
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
case RES_ACTION:
|
||||
$_action = $lng['logger']['reseller'];
|
||||
break;
|
||||
case ADM_ACTION:
|
||||
$_action = $lng['logger']['admin'];
|
||||
break;
|
||||
case CRON_ACTION:
|
||||
$_action = $lng['logger']['cron'];
|
||||
break;
|
||||
case LOGIN_ACTION:
|
||||
$_action = $lng['logger']['login'];
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
$_action = $lng['logger']['intern'];
|
||||
break;
|
||||
default:
|
||||
$_action = $lng['logger']['unknown'];
|
||||
break;
|
||||
}
|
||||
|
||||
$row['action'] = $_action;
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||
// if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
switch ($action) {
|
||||
case USR_ACTION:
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
case RES_ACTION:
|
||||
$_action = $lng['logger']['reseller'];
|
||||
break;
|
||||
case ADM_ACTION:
|
||||
$_action = $lng['logger']['admin'];
|
||||
break;
|
||||
case CRON_ACTION:
|
||||
$_action = $lng['logger']['cron'];
|
||||
break;
|
||||
case LOGIN_ACTION:
|
||||
$_action = $lng['logger']['login'];
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
$_action = $lng['logger']['intern'];
|
||||
break;
|
||||
default:
|
||||
$_action = $lng['logger']['unknown'];
|
||||
break;
|
||||
}
|
||||
|
||||
$log_count++;
|
||||
$row['type'] = getLogLevelDesc($row['type']);
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
|
||||
$row['action'] = $_action;
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||
}
|
||||
$i++;
|
||||
|
||||
$log_count ++;
|
||||
$row['type'] = getLogLevelDesc($row['type']);
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count ++;
|
||||
$_action = $action;
|
||||
// }
|
||||
$i ++;
|
||||
}
|
||||
$i++;
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
eval("echo \"" . getTemplate('logger/logger') . "\";");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options','domains')) {
|
||||
redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
|
||||
|
||||
@@ -56,13 +56,29 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
||||
if (strpos($record, '--') !== false) {
|
||||
$errors[] = $lng['error']['domain_nopunycode'];
|
||||
} else {
|
||||
// check for wildcard-record
|
||||
$add_wildcard_again = false;
|
||||
if (substr($record, 0, 2) == '*.') {
|
||||
$record = substr($record, 2);
|
||||
$add_wildcard_again = true;
|
||||
}
|
||||
// convert entry
|
||||
$record = $idna_convert->encode($record);
|
||||
|
||||
if ($add_wildcard_again) {
|
||||
$record = '*.'.$record;
|
||||
}
|
||||
|
||||
/*
|
||||
* see https://redmine.froxlor.org/issues/1697
|
||||
*
|
||||
if ($type != 'SRV' && $type != 'TXT') {
|
||||
$check_dom = $record . '.example.com';
|
||||
if (! validateDomain($check_dom)) {
|
||||
$errors[] = sprintf($lng['error']['subdomainiswrong'], $idna_convert->decode($record));
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (strlen($record) > 63) {
|
||||
$errors[] = $lng['error']['dns_record_toolong'];
|
||||
}
|
||||
@@ -112,6 +128,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
||||
if (substr($content, - 1) == '.') {
|
||||
// remove it for checks
|
||||
$content = substr($content, 0, - 1);
|
||||
} else {
|
||||
// add domain name
|
||||
$content .= '.' . $domain;
|
||||
}
|
||||
if (! validateDomain($content)) {
|
||||
$errors[] = $lng['error']['dns_cname_invaliddom'];
|
||||
@@ -171,8 +190,8 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// append trailing dot (again)
|
||||
if ($target != '.') {
|
||||
// append trailing dot if there's none
|
||||
if (substr($content, - 1) != '.') {
|
||||
$content .= '.';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ if ($action == 'login') {
|
||||
$language_options = '';
|
||||
$language_options .= makeoption($lng['login']['profile_lng'], 'profile', 'profile', true, true);
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$language_options .= makeoption($language_name, $language_file, 'profile', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ CREATE TABLE `mail_virtual` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`email_full` varchar(255) NOT NULL default '',
|
||||
`destination` text NOT NULL default '',
|
||||
`destination` text,
|
||||
`domainid` int(11) NOT NULL default '0',
|
||||
`customerid` int(11) NOT NULL default '0',
|
||||
`popaccountid` int(11) NOT NULL default '0',
|
||||
@@ -195,8 +195,10 @@ CREATE TABLE `panel_customers` (
|
||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||
`custom_notes` text,
|
||||
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||
`lepublickey` mediumtext DEFAULT NULL,
|
||||
`leprivatekey` mediumtext DEFAULT NULL,
|
||||
`lepublickey` mediumtext default NULL,
|
||||
`leprivatekey` mediumtext default NULL,
|
||||
`leregistered` tinyint(1) NOT NULL default '0',
|
||||
`allowed_phpconfigs` varchar(500) NOT NULL default '',
|
||||
PRIMARY KEY (`customerid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -237,6 +239,7 @@ CREATE TABLE `panel_domains` (
|
||||
`dkim_pubkey` text,
|
||||
`wwwserveralias` tinyint(1) NOT NULL default '1',
|
||||
`parentdomainid` int(11) NOT NULL default '0',
|
||||
`phpenabled` tinyint(1) NOT NULL default '0',
|
||||
`openbasedir` tinyint(1) NOT NULL default '0',
|
||||
`openbasedir_path` tinyint(1) NOT NULL default '0',
|
||||
`speciallogfile` tinyint(1) NOT NULL default '0',
|
||||
@@ -255,6 +258,8 @@ CREATE TABLE `panel_domains` (
|
||||
`hsts` varchar(10) NOT NULL default '0',
|
||||
`hsts_sub` tinyint(1) NOT NULL default '0',
|
||||
`hsts_preload` tinyint(1) NOT NULL default '0',
|
||||
`ocsp_stapling` tinyint(1) DEFAULT '0',
|
||||
`http2` tinyint(1) DEFAULT '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`),
|
||||
KEY `parentdomain` (`parentdomainid`),
|
||||
@@ -280,7 +285,8 @@ CREATE TABLE `panel_ipsandports` (
|
||||
`default_vhostconf_domain` text,
|
||||
`ssl_cert_chainfile` varchar(255) NOT NULL,
|
||||
`docroot` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ip_port` (`ip`,`port`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
@@ -408,6 +414,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('phpfpm', 'max_requests', '0'),
|
||||
('phpfpm', 'tmpdir', '/var/customers/tmp/'),
|
||||
('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'),
|
||||
('phpfpm', 'envpath', '/usr/local/bin:/usr/bin:/bin'),
|
||||
('phpfpm', 'enabled_ownvhost', '0'),
|
||||
('phpfpm', 'vhost_httpuser', 'froxlorlocal'),
|
||||
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
|
||||
@@ -417,6 +424,102 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('phpfpm', 'vhost_defaultini', '2'),
|
||||
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
||||
('phpfpm', 'use_mod_proxy', '0'),
|
||||
('phpfpm', 'ini_flags', 'asp_tags
|
||||
display_errors
|
||||
display_startup_errors
|
||||
html_errors
|
||||
log_errors
|
||||
magic_quotes_gpc
|
||||
magic_quotes_runtime
|
||||
magic_quotes_sybase
|
||||
mail.add_x_header
|
||||
session.cookie_secure
|
||||
session.use_cookies
|
||||
short_open_tag
|
||||
track_errors
|
||||
xmlrpc_errors
|
||||
suhosin.simulation
|
||||
suhosin.session.encrypt
|
||||
suhosin.session.cryptua
|
||||
suhosin.session.cryptdocroot
|
||||
suhosin.cookie.encrypt
|
||||
suhosin.cookie.cryptua
|
||||
suhosin.cookie.cryptdocroot
|
||||
suhosin.executor.disable_eval
|
||||
mbstring.func_overload'),
|
||||
('phpfpm', 'ini_values', 'auto_append_file
|
||||
auto_prepend_file
|
||||
date.timezone
|
||||
default_charset
|
||||
error_reporting
|
||||
include_path
|
||||
log_errors_max_len
|
||||
mail.log
|
||||
max_execution_time
|
||||
session.cookie_domain
|
||||
session.cookie_lifetime
|
||||
session.cookie_path
|
||||
session.name
|
||||
session.serialize_handler
|
||||
upload_max_filesize
|
||||
xmlrpc_error_number
|
||||
session.auto_start
|
||||
always_populate_raw_post_data
|
||||
suhosin.session.cryptkey
|
||||
suhosin.session.cryptraddr
|
||||
suhosin.session.checkraddr
|
||||
suhosin.cookie.cryptkey
|
||||
suhosin.cookie.plainlist
|
||||
suhosin.cookie.cryptraddr
|
||||
suhosin.cookie.checkraddr
|
||||
suhosin.executor.func.blacklist
|
||||
suhosin.executor.eval.whitelist'),
|
||||
('phpfpm', 'ini_admin_flags', 'allow_call_time_pass_reference
|
||||
allow_url_fopen
|
||||
allow_url_include
|
||||
auto_detect_line_endings
|
||||
cgi.fix_pathinfo
|
||||
cgi.force_redirect
|
||||
enable_dl
|
||||
expose_php
|
||||
file_uploads
|
||||
ignore_repeated_errors
|
||||
ignore_repeated_source
|
||||
log_errors
|
||||
register_argc_argv
|
||||
report_memleaks
|
||||
opcache.enable
|
||||
opcache.consistency_checks
|
||||
opcache.dups_fix
|
||||
opcache.load_comments
|
||||
opcache.revalidate_path
|
||||
opcache.save_comments
|
||||
opcache.use_cwd
|
||||
opcache.validate_timestamps
|
||||
opcache.fast_shutdown'),
|
||||
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
|
||||
date.timezone
|
||||
disable_classes
|
||||
disable_functions
|
||||
error_log
|
||||
gpc_order
|
||||
max_input_time
|
||||
max_input_vars
|
||||
memory_limit
|
||||
open_basedir
|
||||
output_buffering
|
||||
post_max_size
|
||||
precision
|
||||
sendmail_path
|
||||
session.gc_divisor
|
||||
session.gc_probability
|
||||
variables_order
|
||||
opcache.log_verbosity_level
|
||||
opcache.restrict_api
|
||||
opcache.revalidate_freq
|
||||
opcache.max_accelerated_files
|
||||
opcache.memory_consumption
|
||||
opcache.interned_strings_buffer'),
|
||||
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||
('system', 'lastaccountnumber', '0'),
|
||||
('system', 'lastguid', '9999'),
|
||||
@@ -496,9 +599,11 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'ssl_cert_chainfile', ''),
|
||||
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
||||
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
||||
('system', 'http2_support', '0'),
|
||||
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
||||
('system', 'phpreload_command', ''),
|
||||
('system', 'apache24', '0'),
|
||||
('system', 'apache24', '1'),
|
||||
('system', 'apache24_ocsp_cache_path', 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)'),
|
||||
('system', 'documentroot_use_default_value', '0'),
|
||||
('system', 'passwordcryptfunc', '3'),
|
||||
('system', 'axfrservers', ''),
|
||||
@@ -526,6 +631,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'letsencryptkeysize', '4096'),
|
||||
('system', 'letsencryptreuseold', 0),
|
||||
('system', 'leenabled', '0'),
|
||||
('system', 'leapiversion', '1'),
|
||||
('system', 'backupenabled', '0'),
|
||||
('system', 'dnsenabled', '0'),
|
||||
('system', 'dns_server', 'bind'),
|
||||
@@ -543,8 +649,12 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'mail_smtp_user', ''),
|
||||
('system', 'mail_smtp_passwd', ''),
|
||||
('system', 'hsts_maxage', '0'),
|
||||
('system', 'hsts_sub', '0'),
|
||||
('system', 'hsts_incsub', '0'),
|
||||
('system', 'hsts_preload', '0'),
|
||||
('system', 'leregistered', '0'),
|
||||
('system', 'nssextrausers', '0'),
|
||||
('system', 'disable_le_selfcheck', '0'),
|
||||
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
@@ -575,8 +685,9 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('panel', 'password_numeric', '0'),
|
||||
('panel', 'password_special_char_required', '0'),
|
||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||
('panel', 'version', '0.9.38-rc1'),
|
||||
('panel', 'db_version', '201610070');
|
||||
('panel', 'customer_hide_options', ''),
|
||||
('panel', 'version', '0.9.39'),
|
||||
('panel', 'db_version', '201801260');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
@@ -742,6 +853,33 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_fpmdaemons`;
|
||||
CREATE TABLE `panel_fpmdaemons` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`description` varchar(50) NOT NULL,
|
||||
`reload_cmd` varchar(255) NOT NULL,
|
||||
`config_dir` varchar(255) NOT NULL,
|
||||
`pm` varchar(15) NOT NULL DEFAULT 'static',
|
||||
`max_children` int(4) NOT NULL DEFAULT '1',
|
||||
`start_servers` int(4) NOT NULL DEFAULT '20',
|
||||
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
|
||||
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
|
||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
||||
`limit_extensions` varchar(255) NOT NULL default '.php',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `reload` (`reload_cmd`),
|
||||
UNIQUE KEY `config` (`config_dir`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
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/');
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_phpconfigs`;
|
||||
CREATE TABLE `panel_phpconfigs` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
@@ -755,14 +893,17 @@ CREATE TABLE `panel_phpconfigs` (
|
||||
`fpm_reqterm` varchar(15) NOT NULL default '60s',
|
||||
`fpm_reqslow` varchar(15) NOT NULL default '5s',
|
||||
`phpsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
`fpmsettingid` int(11) NOT NULL DEFAULT '1',
|
||||
`pass_authorizationheader` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fpmsettingid` (`fpmsettingid`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
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'),
|
||||
(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,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\nnoutput_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_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = 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 = 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');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
*
|
||||
*
|
||||
*/
|
||||
class FroxlorInstall
|
||||
{
|
||||
@@ -74,10 +74,17 @@ class FroxlorInstall
|
||||
/**
|
||||
* currently used language
|
||||
*
|
||||
* @var unknown
|
||||
* @var string
|
||||
*/
|
||||
private $_activelng = 'english';
|
||||
|
||||
/**
|
||||
* check whether to abort due to errors
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $_abort = false;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*/
|
||||
@@ -154,7 +161,7 @@ class FroxlorInstall
|
||||
$this->_guessServerName();
|
||||
$this->_guessServerIP();
|
||||
$this->_guessWebserver();
|
||||
|
||||
|
||||
$this->_getPostField('mysql_host', '127.0.0.1');
|
||||
$this->_getPostField('mysql_database', 'froxlor');
|
||||
$this->_getPostField('mysql_unpriv_user', 'froxlor');
|
||||
@@ -169,18 +176,22 @@ class FroxlorInstall
|
||||
$this->_getPostField('httpuser', $posixusername['name']);
|
||||
$posixgroup = posix_getgrgid(posix_getgid());
|
||||
$this->_getPostField('httpgroup', $posixgroup['name']);
|
||||
|
||||
|
||||
if ($this->_data['mysql_host'] == 'localhost' || $this->_data['mysql_host'] == '127.0.0.1') {
|
||||
$this->_data['mysql_access_host'] = $this->_data['mysql_host'];
|
||||
} else {
|
||||
$this->_data['mysql_access_host'] = $this->_data['serverip'];
|
||||
}
|
||||
|
||||
|
||||
// check system-hostname to be a FQDN
|
||||
if ($this->_validate_ip($this->_data['servername'], true) !== false) {
|
||||
if ($this->_validate_ip($this->_data['servername']) !== false) {
|
||||
$this->_data['servername'] = '';
|
||||
}
|
||||
|
||||
|
||||
if (empty($this->_data['serverip']) || $this->_validate_ip($this->_data['serverip']) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['installstep']) && $_POST['installstep'] == '1' && $this->_data['admin_pass1'] == $this->_data['admin_pass2'] && $this->_data['admin_pass1'] != '' && $this->_data['admin_pass2'] != '' && $this->_data['mysql_unpriv_pass'] != '' && $this->_data['mysql_root_pass'] != '' && $this->_data['servername'] != '' && $this->_data['serverip'] != '' && $this->_data['httpuser'] != '' && $this->_data['httpgroup'] != '' && $this->_data['mysql_unpriv_user'] != $this->_data['mysql_root_user']) {
|
||||
return true;
|
||||
}
|
||||
@@ -195,12 +206,12 @@ class FroxlorInstall
|
||||
private function _doInstall()
|
||||
{
|
||||
$content = "<table class=\"noborder\">";
|
||||
|
||||
|
||||
// check for mysql-root-connection
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
|
||||
|
||||
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8'
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
|
||||
);
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";";
|
||||
$fatal_fail = false;
|
||||
@@ -223,9 +234,9 @@ class FroxlorInstall
|
||||
$fatal_fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $fatal_fail) {
|
||||
|
||||
|
||||
// ok, if we are here, the database connection is up and running
|
||||
$content .= $this->_status_message('green', "OK");
|
||||
// check for existing db and create backup if so
|
||||
@@ -234,36 +245,37 @@ class FroxlorInstall
|
||||
$content .= $this->_createDatabaseAndUser($db_root);
|
||||
// importing data to new database
|
||||
$content .= $this->_importDatabaseData();
|
||||
// create DB object for new database
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8'
|
||||
);
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||
$another_fail = false;
|
||||
try {
|
||||
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
||||
} catch (PDOException $e) {
|
||||
// dafuq? this should have happened in _importDatabaseData()
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$another_fail = true;
|
||||
}
|
||||
;
|
||||
if (! $this->_abort) {
|
||||
// create DB object for new database
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
|
||||
);
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||
$another_fail = false;
|
||||
try {
|
||||
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
||||
} catch (PDOException $e) {
|
||||
// dafuq? this should have happened in _importDatabaseData()
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$another_fail = true;
|
||||
}
|
||||
|
||||
if (! $another_fail) {
|
||||
// change settings accordingly
|
||||
$content .= $this->_doSettings($db);
|
||||
// create entries
|
||||
$content .= $this->_doDataEntries($db);
|
||||
$db = null;
|
||||
// create config-file
|
||||
$content .= $this->_createUserdataConf();
|
||||
if (! $another_fail) {
|
||||
// change settings accordingly
|
||||
$content .= $this->_doSettings($db);
|
||||
// create entries
|
||||
$content .= $this->_doDataEntries($db);
|
||||
$db = null;
|
||||
// create config-file
|
||||
$content .= $this->_createUserdataConf();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$content .= "</table>";
|
||||
|
||||
|
||||
// check if we have unrecoverable errors
|
||||
if ($fatal_fail || $another_fail) {
|
||||
if ($fatal_fail || $another_fail || $this->_abort) {
|
||||
// D'oh
|
||||
$navigation = '';
|
||||
$msgcolor = 'red';
|
||||
@@ -278,9 +290,9 @@ class FroxlorInstall
|
||||
$link = '../index.php';
|
||||
$linktext = $this->_lng['click_here_to_login'];
|
||||
}
|
||||
|
||||
|
||||
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
||||
|
||||
|
||||
return array(
|
||||
'pagecontent' => $content,
|
||||
'pagenavigation' => $navigation
|
||||
@@ -293,7 +305,7 @@ class FroxlorInstall
|
||||
private function _createUserdataConf()
|
||||
{
|
||||
$content = "";
|
||||
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['creating_configfile']);
|
||||
$userdata = "<?php\n";
|
||||
$userdata .= "// automatically generated userdata.inc.php for Froxlor\n";
|
||||
@@ -308,7 +320,7 @@ class FroxlorInstall
|
||||
$userdata .= "// enable debugging to browser in case of SQL errors\n";
|
||||
$userdata .= "\$sql['debug'] = false;\n";
|
||||
$userdata .= "?>";
|
||||
|
||||
|
||||
// test if we can store the userdata.inc.php in ../lib
|
||||
if ($fp = @fopen(dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php', 'w')) {
|
||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
||||
@@ -325,7 +337,7 @@ class FroxlorInstall
|
||||
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
||||
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
||||
}
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -339,9 +351,9 @@ class FroxlorInstall
|
||||
private function _doDataEntries(&$db)
|
||||
{
|
||||
$content = "";
|
||||
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']);
|
||||
|
||||
|
||||
// and lets insert the default ip and port
|
||||
$stmt = $db->prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "` SET
|
||||
@@ -355,7 +367,7 @@ class FroxlorInstall
|
||||
'serverip' => $this->_data['serverip']
|
||||
));
|
||||
$defaultip = $db->lastInsertId();
|
||||
|
||||
|
||||
// insert the defaultip
|
||||
$upd_stmt = $db->prepare("
|
||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||
@@ -365,9 +377,9 @@ class FroxlorInstall
|
||||
$upd_stmt->execute(array(
|
||||
'defaultip' => $defaultip
|
||||
));
|
||||
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
// last but not least create the main admin
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
|
||||
$ins_data = array(
|
||||
@@ -402,11 +414,11 @@ class FroxlorInstall
|
||||
`subdomains` = -1,
|
||||
`traffic` = -1048576
|
||||
");
|
||||
|
||||
|
||||
$ins_stmt->execute($ins_data);
|
||||
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -437,14 +449,14 @@ class FroxlorInstall
|
||||
private function _doSettings(&$db)
|
||||
{
|
||||
$content = "";
|
||||
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['changing_data']);
|
||||
$upd_stmt = $db->prepare("
|
||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||
`value` = :value
|
||||
WHERE `settinggroup` = :group AND `varname` = :varname
|
||||
");
|
||||
|
||||
|
||||
$this->_updateSetting($upd_stmt, 'admin@' . $this->_data['servername'], 'panel', 'adminmail');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['serverip'], 'system', 'ipaddress');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname');
|
||||
@@ -453,7 +465,7 @@ class FroxlorInstall
|
||||
$this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup');
|
||||
|
||||
|
||||
// necessary changes for webservers != apache2
|
||||
if ($this->_data['webserver'] == "apache24") {
|
||||
$this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
||||
@@ -473,25 +485,25 @@ class FroxlorInstall
|
||||
$this->_updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file');
|
||||
$this->_updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
|
||||
}
|
||||
|
||||
|
||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||
|
||||
|
||||
// insert the lastcronrun to be the installation date
|
||||
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
||||
|
||||
|
||||
// set specific times for some crons (traffic only at night, etc.)
|
||||
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic.php';");
|
||||
$ts = mktime(1, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||
|
||||
|
||||
// insert task 99 to generate a correct cron.d-file automatically
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '99';");
|
||||
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -507,22 +519,28 @@ class FroxlorInstall
|
||||
$content = "";
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8'
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
|
||||
);
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||
$fatal_fail = false;
|
||||
try {
|
||||
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
||||
$attributes = array(
|
||||
'ATTR_ERRMODE' => 'ERRMODE_EXCEPTION'
|
||||
);
|
||||
// set attributes
|
||||
foreach ($attributes as $k => $v) {
|
||||
$db->setAttribute(constant("PDO::" . $k), constant("PDO::" . $v));
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$fatal_fail = true;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
if (! $fatal_fail) {
|
||||
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['importing_data']);
|
||||
$db_schema = dirname(dirname(__FILE__)) . '/froxlor.sql';
|
||||
$sql_query = @file_get_contents($db_schema);
|
||||
@@ -530,14 +548,23 @@ class FroxlorInstall
|
||||
$sql_query = $this->_split_sql_file($sql_query, ';');
|
||||
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
||||
if (trim($sql_query[$i]) != '') {
|
||||
$result = $db->query($sql_query[$i]);
|
||||
try {
|
||||
$result = $db->query($sql_query[$i]);
|
||||
} catch (\PDOException $e) {
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$fatal_fail = true;
|
||||
$this->_abort = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $fatal_fail) {
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
}
|
||||
$db = null;
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
}
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -551,56 +578,56 @@ class FroxlorInstall
|
||||
private function _createDatabaseAndUser(&$db_root)
|
||||
{
|
||||
$content = "";
|
||||
|
||||
|
||||
// so first we have to delete the database and
|
||||
// the user given for the unpriv-user if they exit
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['prepare_db']);
|
||||
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`user` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array(
|
||||
'user' => $this->_data['mysql_unpriv_user'],
|
||||
'accesshost' => $this->_data['mysql_access_host']
|
||||
));
|
||||
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array(
|
||||
'user' => $this->_data['mysql_unpriv_user'],
|
||||
'accesshost' => $this->_data['mysql_access_host']
|
||||
));
|
||||
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost");
|
||||
$del_stmt->execute(array(
|
||||
'user' => $this->_data['mysql_unpriv_user'],
|
||||
'accesshost' => $this->_data['mysql_access_host']
|
||||
));
|
||||
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array(
|
||||
'user' => $this->_data['mysql_unpriv_user'],
|
||||
'accesshost' => $this->_data['mysql_access_host']
|
||||
));
|
||||
|
||||
|
||||
$del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `" . str_replace('`', '', $this->_data['mysql_database']) . "`;");
|
||||
$del_stmt->execute();
|
||||
|
||||
|
||||
$db_root->query("FLUSH PRIVILEGES;");
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
// we have to create a new user and database for the froxlor unprivileged mysql access
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']);
|
||||
$ins_stmt = $db_root->prepare("CREATE DATABASE `" . str_replace('`', '', $this->_data['mysql_database']) . "` CHARACTER SET=utf8 COLLATE=utf8_general_ci");
|
||||
$ins_stmt->execute();
|
||||
|
||||
|
||||
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
|
||||
|
||||
|
||||
if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) {
|
||||
$mysql_access_host_array[] = 'localhost';
|
||||
}
|
||||
|
||||
|
||||
if (! in_array('127.0.0.1', $mysql_access_host_array) && in_array('localhost', $mysql_access_host_array)) {
|
||||
$mysql_access_host_array[] = '127.0.0.1';
|
||||
}
|
||||
|
||||
|
||||
$mysql_access_host_array[] = $this->_data['serverip'];
|
||||
foreach ($mysql_access_host_array as $mysql_access_host) {
|
||||
$_db = str_replace('`', '', $this->_data['mysql_database']);
|
||||
@@ -619,11 +646,11 @@ class FroxlorInstall
|
||||
"password" => $this->_data['mysql_unpriv_pass']
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$db_root->query("FLUSH PRIVILEGES;");
|
||||
$this->_data['mysql_access_host'] = implode(',', $mysql_access_host_array);
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -637,7 +664,7 @@ class FroxlorInstall
|
||||
private function _backupExistingDatabase(&$db_root)
|
||||
{
|
||||
$content = "";
|
||||
|
||||
|
||||
// check for existing of former database
|
||||
$tables_exist = false;
|
||||
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database";
|
||||
@@ -646,19 +673,19 @@ class FroxlorInstall
|
||||
'database' => $this->_data['mysql_database']
|
||||
));
|
||||
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
|
||||
|
||||
|
||||
// check result
|
||||
if ($result_stmt !== false && $rows > 0) {
|
||||
$tables_exist = true;
|
||||
}
|
||||
|
||||
|
||||
if ($tables_exist) {
|
||||
// tell whats going on
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
|
||||
|
||||
|
||||
// create temporary backup-filename
|
||||
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
||||
|
||||
|
||||
// look for mysqldump
|
||||
$do_backup = false;
|
||||
if (file_exists("/usr/bin/mysqldump")) {
|
||||
@@ -668,7 +695,7 @@ class FroxlorInstall
|
||||
$do_backup = true;
|
||||
$mysql_dump = '/usr/local/bin/mysqldump';
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
$output = exec($command);
|
||||
@@ -681,7 +708,7 @@ class FroxlorInstall
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
@@ -698,12 +725,12 @@ class FroxlorInstall
|
||||
}
|
||||
// language selection
|
||||
$language_options = '';
|
||||
while (list ($language_file, $language_name) = each($this->_languages)) {
|
||||
foreach ($this->_languages as $language_name => $language_file) {
|
||||
$language_options .= makeoption($language_name, $language_file, $this->_activelng, true, true);
|
||||
}
|
||||
// get language-form-template
|
||||
eval("\$content .= \"" . $this->_getTemplate("lngform") . "\";");
|
||||
|
||||
|
||||
// form-data
|
||||
$formdata = "";
|
||||
/**
|
||||
@@ -743,7 +770,7 @@ class FroxlorInstall
|
||||
$style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
||||
|
||||
|
||||
/**
|
||||
* admin data
|
||||
*/
|
||||
@@ -767,7 +794,7 @@ class FroxlorInstall
|
||||
$formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password');
|
||||
// activate newsfeed?
|
||||
$formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true);
|
||||
|
||||
|
||||
/**
|
||||
* Server data
|
||||
*/
|
||||
@@ -781,7 +808,7 @@ class FroxlorInstall
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('servername', true, $style);
|
||||
// serverip
|
||||
if (! empty($_POST['installstep']) && $this->_data['serverip'] == '') {
|
||||
if (! empty($_POST['installstep']) && ($this->_data['serverip'] == '' || $this->_validate_ip($this->_data['serverip']) == false)) {
|
||||
$style = 'color:red;';
|
||||
} else {
|
||||
$style = '';
|
||||
@@ -814,11 +841,11 @@ class FroxlorInstall
|
||||
$style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('httpgroup', true, $style);
|
||||
|
||||
|
||||
// get data-form-template
|
||||
$language = htmlspecialchars($this->_activelng);
|
||||
eval("\$content .= \"" . $this->_getTemplate("dataform2") . "\";");
|
||||
|
||||
|
||||
$navigation = '';
|
||||
return array(
|
||||
'pagecontent' => $content,
|
||||
@@ -835,7 +862,7 @@ class FroxlorInstall
|
||||
* optional css
|
||||
* @param string $type
|
||||
* optional type of input-box (default: text)
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getSectionItemString($fieldname = null, $required = false, $style = "", $type = 'text')
|
||||
@@ -895,26 +922,26 @@ class FroxlorInstall
|
||||
*/
|
||||
private function _requirementCheck()
|
||||
{
|
||||
|
||||
|
||||
// indicator whether we need to abort or not
|
||||
$_die = false;
|
||||
|
||||
|
||||
$content = "<table class=\"noborder\">";
|
||||
|
||||
|
||||
// check for correct php version
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
||||
|
||||
|
||||
if (version_compare("5.3.0", PHP_VERSION, ">=")) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
||||
$_die = true;
|
||||
} else {
|
||||
if (version_compare("5.6.0", PHP_VERSION, ">=")) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['newerphpprefered'] . ' (' .PHP_VERSION . ')');
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['newerphpprefered'] . ' (' . PHP_VERSION . ')');
|
||||
} else {
|
||||
$content .= $this->_status_message('green', PHP_VERSION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if magic_quotes_runtime is active | get_magic_quotes_runtime() is always FALSE since 5.4
|
||||
if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
||||
@@ -926,85 +953,94 @@ class FroxlorInstall
|
||||
$content .= $this->_status_message('green', 'off');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check for php_pdo and pdo_mysql
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
||||
|
||||
|
||||
if (! extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for xml-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpxml']);
|
||||
|
||||
|
||||
if (! extension_loaded('xml')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for filter-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpfilter']);
|
||||
|
||||
|
||||
if (! extension_loaded('filter')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for posix-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpposix']);
|
||||
|
||||
|
||||
if (! extension_loaded('posix')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for bstring-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
|
||||
|
||||
|
||||
if (! extension_loaded('mbstring')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for curl extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpcurl']);
|
||||
|
||||
|
||||
if (! extension_loaded('curl')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for bcmath extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
|
||||
|
||||
|
||||
if (! extension_loaded('bcmath')) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['bcmathdescription']);
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
|
||||
// check for zip extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpzip']);
|
||||
|
||||
|
||||
if (! extension_loaded('zip')) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['zipdescription']);
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for json extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpjson']);
|
||||
|
||||
if (! extension_loaded('json')) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['jsondescription']);
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for open_basedir
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
|
||||
$php_ob = @ini_get("open_basedir");
|
||||
@@ -1014,7 +1050,7 @@ class FroxlorInstall
|
||||
$content .= $this->_status_message('green', 'off');
|
||||
}
|
||||
$content .= "</table>";
|
||||
|
||||
|
||||
// check if we have unrecoverable errors
|
||||
$navigation = '';
|
||||
if ($_die) {
|
||||
@@ -1029,7 +1065,7 @@ class FroxlorInstall
|
||||
$linktext = $this->_lng['click_here_to_continue'];
|
||||
}
|
||||
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
||||
|
||||
|
||||
return array(
|
||||
'pagecontent' => $content,
|
||||
'pagenavigation' => $navigation
|
||||
@@ -1046,7 +1082,7 @@ class FroxlorInstall
|
||||
header("Pragma: no-cache");
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
|
||||
|
||||
|
||||
// ensure that default timezone is set
|
||||
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
|
||||
@date_default_timezone_set(@date_default_timezone_get());
|
||||
@@ -1064,7 +1100,7 @@ class FroxlorInstall
|
||||
// includes the usersettings (MySQL-Username/Passwort)
|
||||
// to test if Froxlor is already installed
|
||||
require $this->_basepath . '/lib/userdata.inc.php';
|
||||
|
||||
|
||||
if (isset($sql) && is_array($sql)) {
|
||||
// use sparkle theme for the notice
|
||||
$installed_hint = file_get_contents($this->_basepath . '/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
||||
@@ -1081,7 +1117,7 @@ class FroxlorInstall
|
||||
{
|
||||
// set default
|
||||
$standardlanguage = 'english';
|
||||
|
||||
|
||||
// check either _GET or _POST
|
||||
if (isset($_GET['language']) && isset($this->_languages[$_GET['language']])) {
|
||||
$this->_activelng = $_GET['language'];
|
||||
@@ -1102,7 +1138,7 @@ class FroxlorInstall
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
|
||||
if (file_exists($lngfile)) {
|
||||
// includes file /lng/$language.lng.php if it exists
|
||||
@@ -1116,7 +1152,7 @@ class FroxlorInstall
|
||||
*
|
||||
* @param string $template
|
||||
* name of the template including subdirectory
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getTemplate($template = null)
|
||||
@@ -1133,7 +1169,7 @@ class FroxlorInstall
|
||||
} else {
|
||||
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
|
||||
}
|
||||
|
||||
|
||||
return $templatefile;
|
||||
}
|
||||
|
||||
@@ -1164,14 +1200,13 @@ class FroxlorInstall
|
||||
$this->_data['servername'] = $_POST['servername'];
|
||||
return;
|
||||
// from $_SERVER
|
||||
} else
|
||||
if (! empty($_SERVER['SERVER_NAME'])) {
|
||||
// no ips
|
||||
if ($this->_validate_ip($_SERVER['SERVER_NAME']) == false) {
|
||||
$this->_data['servername'] = $_SERVER['SERVER_NAME'];
|
||||
return;
|
||||
}
|
||||
} else if (! empty($_SERVER['SERVER_NAME'])) {
|
||||
// no ips
|
||||
if ($this->_validate_ip($_SERVER['SERVER_NAME']) == false) {
|
||||
$this->_data['servername'] = $_SERVER['SERVER_NAME'];
|
||||
return;
|
||||
}
|
||||
}
|
||||
// empty
|
||||
$this->_data['servername'] = '';
|
||||
}
|
||||
@@ -1204,7 +1239,7 @@ class FroxlorInstall
|
||||
$this->_data['webserver'] = $_POST['webserver'];
|
||||
} else {
|
||||
if (strtoupper(@php_sapi_name()) == "APACHE2HANDLER" || stristr($_SERVER['SERVER_SOFTWARE'], "apache/2")) {
|
||||
$this->_data['webserver'] = 'apache2';
|
||||
$this->_data['webserver'] = 'apache24';
|
||||
} elseif (substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD" || stristr($_SERVER['SERVER_SOFTWARE'], "lighttpd")) {
|
||||
$this->_data['webserver'] = 'lighttpd';
|
||||
} elseif (substr(strtoupper(@php_sapi_name()), 0, 8) == "NGINX" || stristr($_SERVER['SERVER_SOFTWARE'], "nginx")) {
|
||||
@@ -1290,17 +1325,17 @@ class FroxlorInstall
|
||||
*/
|
||||
private function _split_sql_file($sql, $delimiter)
|
||||
{
|
||||
|
||||
|
||||
// Split up our string into "possible" SQL statements.
|
||||
$tokens = explode($delimiter, $sql);
|
||||
|
||||
|
||||
// try to save mem.
|
||||
$sql = "";
|
||||
$output = array();
|
||||
|
||||
|
||||
// we don't actually care about the matches preg gives us.
|
||||
$matches = array();
|
||||
|
||||
|
||||
// this is faster than calling count($tokens) every time through the loop.
|
||||
$token_count = count($tokens);
|
||||
for ($i = 0; $i < $token_count; $i ++) {
|
||||
@@ -1308,12 +1343,12 @@ class FroxlorInstall
|
||||
if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0))) {
|
||||
// This is the total number of single quotes in the token.
|
||||
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
|
||||
|
||||
|
||||
// Counts single quotes that are preceded by an odd number of backslashes,
|
||||
// which means they're escaped quotes.
|
||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
|
||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||
|
||||
|
||||
// If the number of unescaped quotes is even, then the delimiter
|
||||
// did NOT occur inside a string literal.
|
||||
if (($unescaped_quotes % 2) == 0) {
|
||||
@@ -1336,7 +1371,7 @@ class FroxlorInstall
|
||||
// which means they're escaped quotes.
|
||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
|
||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||
|
||||
|
||||
if (($unescaped_quotes % 2) == 1) {
|
||||
// odd number of unescaped quotes. In combination with the previous incomplete
|
||||
// statement(s), we now have a complete statement. (2 odds always make an even)
|
||||
|
||||
@@ -35,8 +35,10 @@ $lng['requirements']['phpbcmath'] = 'PHP bcmath-extension...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-extension...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
|
||||
$lng['requirements']['phpzip'] = 'PHP zip-extension...';
|
||||
$lng['requirements']['phpjson'] = 'PHP json-extension...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
||||
$lng['requirements']['zipdescription'] = 'The auto-update feature requires the zip extension.';
|
||||
$lng['requirements']['jsondescription'] = 'The settings import/export feature requires the json extension.';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the coresponding php.ini';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Try to fix them and retry.';
|
||||
@@ -63,7 +65,7 @@ $lng['install']['serversettings'] = 'Server settings';
|
||||
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
|
||||
$lng['install']['serverip'] = 'Server IP';
|
||||
$lng['install']['webserver'] = 'Webserver';
|
||||
$lng['install']['apache2'] = 'Apache 2';
|
||||
$lng['install']['apache2'] = 'Apache 2.2';
|
||||
$lng['install']['apache24'] = 'Apache 2.4';
|
||||
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||
$lng['install']['nginx'] = 'NGINX';
|
||||
@@ -83,8 +85,8 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
|
||||
$lng['install']['creating_entries'] = 'Inserting new values...';
|
||||
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
||||
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to lib/.';
|
||||
$lng['install']['creating_configfile_failed'] = 'Could not create lib/userdata.inc.php, please create it manually with the following content:';
|
||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to '.dirname(dirname(__DIR__)).'/lib/.';
|
||||
$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['click_here_to_refresh'] = 'Click here to check again';
|
||||
|
||||
@@ -79,8 +79,8 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
|
||||
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||
$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 lib/.';
|
||||
$lng['install']['creating_configfile_failed'] = 'Impossible de créer lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||
$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_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['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';
|
||||
|
||||
@@ -35,8 +35,10 @@ $lng['requirements']['phpbcmath'] = 'PHP bcmath-Erweiterung...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-Erweiterung...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
|
||||
$lng['requirements']['phpzip'] = 'PHP zip-Erweiterung...';
|
||||
$lng['requirements']['phpjson'] = 'PHP json-Erweiterung...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
|
||||
$lng['requirements']['zipdescription'] = 'Die Auto-Update Funktion benötigt die zip Erweiterung.';
|
||||
$lng['requirements']['jsondescription'] = 'Die Einstellungen Import/Export Funktion benötigt die json Erweiterung.';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir genutzt wird...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor in der entsprechenden php.ini';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Beheben Sie die angezeigten Probleme und versuchen Sie es erneut.';
|
||||
@@ -83,8 +85,8 @@ $lng['install']['changing_data'] = 'Einstellungen anpassen...';
|
||||
$lng['install']['creating_entries'] = 'Trage neue Werte ein...';
|
||||
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
||||
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach lib/ verschieben.';
|
||||
$lng['install']['creating_configfile_failed'] = 'Konnte lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach '.dirname(dirname(__DIR__)).'/lib/ verschieben.';
|
||||
$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['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}<span>
|
||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}</span>
|
||||
</p>
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
* @package Install
|
||||
*
|
||||
*/
|
||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||
header('Location: ../../../../index.php');
|
||||
exit();
|
||||
if (!defined('_CRON_UPDATE')) {
|
||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||
header('Location: ../../../../index.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9-r0')) {
|
||||
@@ -3507,3 +3509,374 @@ if (isFroxlorVersion('0.9.37')) {
|
||||
showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false);
|
||||
updateToVersion('0.9.38-rc1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38-rc1')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38-rc1 to 0.9.38-rc2", false);
|
||||
updateToVersion('0.9.38-rc2');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38-rc2')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38-rc2 to 0.9.38 final", false);
|
||||
updateToVersion('0.9.38');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201610070')) {
|
||||
|
||||
showUpdateStep("Add Nginx http2 setting");
|
||||
Settings::AddNew("system.nginx_http2_support", 0);
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201611180');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38 to 0.9.38.1", false);
|
||||
updateToVersion('0.9.38.1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.1')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.1 to 0.9.38.2", false);
|
||||
updateToVersion('0.9.38.2');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.2')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.2 to 0.9.38.3", false);
|
||||
updateToVersion('0.9.38.3');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.3')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.3 to 0.9.38.4", false);
|
||||
updateToVersion('0.9.38.4');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201611180')) {
|
||||
|
||||
showUpdateStep("Updating database table definition for panel_domains");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `phpenabled` tinyint(1) NOT NULL default '1' AFTER `parentdomainid`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding field for let's-encrypt registration status");
|
||||
Database::query("ALTER TABLE `".TABLE_PANEL_CUSTOMERS."` add `leregistered` TINYINT(1) NOT NULL DEFAULT 0;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding system setting for let's-encrypt registration status");
|
||||
Settings::AddNew('system.leregistered', '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding unique key to ipsandports table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD UNIQUE KEY `ip_port` (`ip`,`port`)");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201612110');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.4')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.4 to 0.9.38.5", false);
|
||||
updateToVersion('0.9.38.5');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.5')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.5 to 0.9.38.6", false);
|
||||
updateToVersion('0.9.38.6');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.6')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.6 to 0.9.38.7", false);
|
||||
updateToVersion('0.9.38.7');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201612110')) {
|
||||
|
||||
showUpdateStep("Adding field for OCSP stapling");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS .
|
||||
"` ADD `ocsp_stapling` TINYINT(1) NOT NULL DEFAULT '0';");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding default setting for Apache 2.4 OCSP cache path");
|
||||
Settings::AddNew('system.apache24_ocsp_cache_path', 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201704100');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201704100')) {
|
||||
|
||||
showUpdateStep("Adding new setting for libnss-extrausers");
|
||||
$system_nssextrausers= isset($_POST['system_nssextrausers']) ? (int) $_POST['system_nssextrausers'] : 0;
|
||||
Settings::AddNew('system.nssextrausers', $system_nssextrausers);
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201705050');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201705050')) {
|
||||
|
||||
showUpdateStep("Updating HTTP2 setting");
|
||||
if (Settings::Get('system.nginx_http2_support') != null) {
|
||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'http2_support' WHERE `varname` = 'nginx_http2_support';");
|
||||
} else {
|
||||
Settings::AddNew('system.http2_support', 0);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
showUpdateStep("Adding domain field for HTTP2 stapling");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `http2` TINYINT(1) NOT NULL DEFAULT '0';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201708240');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201708240')) {
|
||||
|
||||
showUpdateStep("Adding new 'disable LE self-check' setting");
|
||||
$system_disable_le_selfcheck = isset($_POST['system_disable_le_selfcheck']) ? (int) $_POST['system_disable_le_selfcheck'] : 0;
|
||||
Settings::AddNew('system.disable_le_selfcheck', $system_disable_le_selfcheck);
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201712310');
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.7 to 0.9.38.8", false);
|
||||
updateToVersion('0.9.38.8');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201712310')) {
|
||||
|
||||
showUpdateStep("Adding field for fpm-daemon configs");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `fpmsettingid` int(11) NOT NULL DEFAULT '1';");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fpm-daemons table");
|
||||
Database::query("DROP TABLE IF EXISTS `panel_fpmdaemons`;");
|
||||
$sql = "CREATE TABLE `panel_fpmdaemons` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`description` varchar(50) NOT NULL,
|
||||
`reload_cmd` varchar(255) NOT NULL,
|
||||
`config_dir` varchar(255) NOT NULL,
|
||||
`pm` varchar(15) NOT NULL DEFAULT 'static',
|
||||
`max_children` int(4) NOT NULL DEFAULT '1',
|
||||
`start_servers` int(4) NOT NULL DEFAULT '20',
|
||||
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
|
||||
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
|
||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `reload` (`reload_cmd`),
|
||||
UNIQUE KEY `config` (`config_dir`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;";
|
||||
Database::query($sql);
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Converting php-fpm settings to new layout");
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `panel_fpmdaemons` SET
|
||||
`id` = 1,
|
||||
`description` = 'System default',
|
||||
`reload_cmd` = :reloadcmd,
|
||||
`config_dir` = :confdir,
|
||||
`pm` = :pm,
|
||||
`max_children` = :maxc,
|
||||
`start_servers` = :starts,
|
||||
`min_spare_servers` = :minss,
|
||||
`max_spare_servers` = :maxss,
|
||||
`max_requests` = :maxr,
|
||||
`idle_timeout` = :it
|
||||
");
|
||||
Database::pexecute($ins_stmt, array(
|
||||
'reloadcmd' => Settings::Get('phpfpm.reload'),
|
||||
'confdir' => Settings::Get('phpfpm.configdir'),
|
||||
'pm' => Settings::Get('phpfpm.pm'),
|
||||
'maxc' => Settings::Get('phpfpm.max_children'),
|
||||
'starts' => Settings::Get('phpfpm.start_servers'),
|
||||
'minss' => Settings::Get('phpfpm.min_spare_servers'),
|
||||
'maxss' => Settings::Get('phpfpm.max_spare_servers'),
|
||||
'maxr' => Settings::Get('phpfpm.max_requests'),
|
||||
'it' => Settings::Get('phpfpm.idle_timeout')
|
||||
));
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Deleting unneeded settings");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'reload'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'configdir'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'pm'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'max_children'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'start_servers'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'min_spare_servers'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'max_spare_servers'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'max_requests'");
|
||||
Database::query("DELETE FROM `".TABLE_PANEL_SETTINGS."` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'idle_timeout'");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801070');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801070')) {
|
||||
|
||||
showUpdateStep("Adding field allowed_phpconfigs for customers");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `allowed_phpconfigs` varchar(500) NOT NULL default '';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801080');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801080')) {
|
||||
|
||||
showUpdateStep("Adding new setting for Let's Encrypt ACME version");
|
||||
Settings::AddNew('system.leapiversion', '1');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801090');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801090')) {
|
||||
|
||||
showUpdateStep("Adding field pass_authorizationheader for php-configs");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `pass_authorizationheader` tinyint(1) NOT NULL default '0';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801091');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801091')) {
|
||||
|
||||
showUpdateStep("Adding new setting for SSL protocols");
|
||||
Settings::AddNew('system.ssl_protocols', 'TLSv1,TLSv1.2');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801100');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801100')) {
|
||||
|
||||
showUpdateStep("Adding field for security.limit_extensions fpm-setting");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_FPMDAEMONS . "` ADD `limit_extensions` varchar(255) NOT NULL default '.php';");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801101');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801101')) {
|
||||
|
||||
showUpdateStep("Adding dynamic php-fpm php.ini settings");
|
||||
Settings::AddNew('phpfpm.ini_flags', 'asp_tags
|
||||
display_errors
|
||||
display_startup_errors
|
||||
html_errors
|
||||
log_errors
|
||||
magic_quotes_gpc
|
||||
magic_quotes_runtime
|
||||
magic_quotes_sybase
|
||||
mail.add_x_header
|
||||
session.cookie_secure
|
||||
session.use_cookies
|
||||
short_open_tag
|
||||
track_errors
|
||||
xmlrpc_errors
|
||||
suhosin.simulation
|
||||
suhosin.session.encrypt
|
||||
suhosin.session.cryptua
|
||||
suhosin.session.cryptdocroot
|
||||
suhosin.cookie.encrypt
|
||||
suhosin.cookie.cryptua
|
||||
suhosin.cookie.cryptdocroot
|
||||
suhosin.executor.disable_eval
|
||||
mbstring.func_overload');
|
||||
Settings::AddNew('phpfpm.ini_values', 'auto_append_file
|
||||
auto_prepend_file
|
||||
date.timezone
|
||||
default_charset
|
||||
error_reporting
|
||||
include_path
|
||||
log_errors_max_len
|
||||
mail.log
|
||||
max_execution_time
|
||||
session.cookie_domain
|
||||
session.cookie_lifetime
|
||||
session.cookie_path
|
||||
session.name
|
||||
session.serialize_handler
|
||||
upload_max_filesize
|
||||
xmlrpc_error_number
|
||||
session.auto_start
|
||||
always_populate_raw_post_data
|
||||
suhosin.session.cryptkey
|
||||
suhosin.session.cryptraddr
|
||||
suhosin.session.checkraddr
|
||||
suhosin.cookie.cryptkey
|
||||
suhosin.cookie.plainlist
|
||||
suhosin.cookie.cryptraddr
|
||||
suhosin.cookie.checkraddr
|
||||
suhosin.executor.func.blacklist
|
||||
suhosin.executor.eval.whitelist');
|
||||
Settings::AddNew('phpfpm.ini_admin_flags', 'allow_call_time_pass_reference
|
||||
allow_url_fopen
|
||||
allow_url_include
|
||||
auto_detect_line_endings
|
||||
cgi.fix_pathinfo
|
||||
cgi.force_redirect
|
||||
enable_dl
|
||||
expose_php
|
||||
file_uploads
|
||||
ignore_repeated_errors
|
||||
ignore_repeated_source
|
||||
log_errors
|
||||
register_argc_argv
|
||||
report_memleaks
|
||||
opcache.enable
|
||||
opcache.consistency_checks
|
||||
opcache.dups_fix
|
||||
opcache.load_comments
|
||||
opcache.revalidate_path
|
||||
opcache.save_comments
|
||||
opcache.use_cwd
|
||||
opcache.validate_timestamps
|
||||
opcache.fast_shutdown');
|
||||
Settings::AddNew('phpfpm.ini_admin_values', 'cgi.redirect_status_env
|
||||
date.timezone
|
||||
disable_classes
|
||||
disable_functions
|
||||
error_log
|
||||
gpc_order
|
||||
max_input_time
|
||||
max_input_vars
|
||||
memory_limit
|
||||
open_basedir
|
||||
output_buffering
|
||||
post_max_size
|
||||
precision
|
||||
sendmail_path
|
||||
session.gc_divisor
|
||||
session.gc_probability
|
||||
variables_order
|
||||
opcache.log_verbosity_level
|
||||
opcache.restrict_api
|
||||
opcache.revalidate_freq
|
||||
opcache.max_accelerated_files
|
||||
opcache.memory_consumption
|
||||
opcache.interned_strings_buffer');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801110');
|
||||
}
|
||||
|
||||
if (isDatabaseVersion('201801110')) {
|
||||
|
||||
showUpdateStep("Adding php-fpm php PATH setting for envrironment");
|
||||
Settings::AddNew("phpfpm.envpath", '/usr/local/bin:/usr/bin:/bin');
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToDbVersion('201801260');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.38.8')) {
|
||||
|
||||
showUpdateStep("Updating from 0.9.38.8 to 0.9.39 final", false);
|
||||
updateToVersion('0.9.39');
|
||||
}
|
||||
|
||||
@@ -709,4 +709,22 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
|
||||
$question .= '<input type="password" class="text" name="smtp_passwd" value="" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201705050')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'DEBIAN/UBUNTU ONLY: Enable usage of libnss-extrausers as alternative to libnss-mysql (NOTE: if enabled, go through the configuration steps right after the update!!!)<br /><br />';
|
||||
$question = '<strong>Enable usage of libnss-extrausers?</strong><br />';
|
||||
$question .= makeyesno('system_nssextrausers', '1', '0', '0') . '<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201712310')) {
|
||||
if (Settings::Get('system.leenabled') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Chose whether you want to disable the Let\'s Encrypt selfcheck as it causes false positives for some configurations.<br /><br />';
|
||||
$question = '<strong>Disable Let\'s Encrypt self-check?</strong><br />';
|
||||
$question .= makeyesno('system_disable_le_selfcheck', '1', '0', '0') . '<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('AREA')
|
||||
|| (defined('AREA') && AREA != 'admin')
|
||||
|| !isset($userinfo['loginname'])
|
||||
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||
) {
|
||||
header('Location: ../index.php');
|
||||
exit;
|
||||
if (!defined('_CRON_UPDATE')) {
|
||||
if (!defined('AREA')
|
||||
|| (defined('AREA') && AREA != 'admin')
|
||||
|| !isset($userinfo['loginname'])
|
||||
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||
) {
|
||||
header('Location: ../index.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||
|
||||
@@ -93,6 +93,13 @@ class DomainBulkAction
|
||||
/* 16 */ 'use_ssl',
|
||||
/* 17 */ 'registration_date',
|
||||
/* 18 */ 'ips',
|
||||
/* 19 */ 'letsencrypt',
|
||||
/* 20 */ 'hsts',
|
||||
/* 21 */ 'hsts_sub',
|
||||
/* 22 */ 'hsts_preload',
|
||||
/* 23 */ 'ocsp_stapling',
|
||||
/* 24 */ 'phpenabled',
|
||||
/* 25 */ 'http2',
|
||||
/* automatically added */
|
||||
'adminid',
|
||||
'customerid',
|
||||
@@ -180,13 +187,14 @@ class DomainBulkAction
|
||||
}
|
||||
|
||||
// preapre insert statement as it is used a few times
|
||||
// leave out aliasdomain for now, cause empty = NULL value which cannot be
|
||||
// added this easily using prepared statements
|
||||
$this->_ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`domain` = :domain,
|
||||
`adminid` = :adminid,
|
||||
`customerid` = :customerid,
|
||||
`documentroot` = :documentroot,
|
||||
`aliasdomain` = :aliasdomain,
|
||||
`isbinddomain` = :isbinddomain,
|
||||
`isemaildomain` = :isemaildomain,
|
||||
`email_only` = :email_only,
|
||||
@@ -200,7 +208,14 @@ class DomainBulkAction
|
||||
`specialsettings` = :specialsettings,
|
||||
`ssl_redirect` = :ssl_redirect,
|
||||
`registration_date` = :registration_date,
|
||||
`add_date` = :add_date
|
||||
`add_date` = :add_date,
|
||||
`letsencrypt` = :letsencrypt,
|
||||
`hsts` = :hsts,
|
||||
`hsts_sub` = :hsts_sub,
|
||||
`hsts_preload` = :hsts_preload,
|
||||
`ocsp_stapling` = :ocsp_stapling,
|
||||
`phpenabled` = :phpenabled,
|
||||
`http2` = :http2
|
||||
");
|
||||
|
||||
// prepare insert statement for ip/port <> domain
|
||||
@@ -293,6 +308,7 @@ class DomainBulkAction
|
||||
}
|
||||
|
||||
// check for alias-domain
|
||||
$hasAlias = false;
|
||||
if (! empty($domain_data['aliasdomain'])) {
|
||||
// format
|
||||
$domain_data['aliasdomain'] = $idna_convert->encode(preg_replace(array(
|
||||
@@ -311,6 +327,7 @@ class DomainBulkAction
|
||||
// - we'd better skip
|
||||
return false;
|
||||
}
|
||||
$hasAlias = $domain_data['aliasdomain'];
|
||||
}
|
||||
|
||||
// check for use_ssl and ssl_redirect
|
||||
@@ -335,6 +352,38 @@ class DomainBulkAction
|
||||
$domain_data['ssl_redirect'] = 0;
|
||||
}
|
||||
|
||||
// only check for letsencrypt, hsts and oscp-stapling if ssl is enabled
|
||||
if ($domain_data['use_ssl'] == 1) {
|
||||
//lets encrypt
|
||||
if ($domain_data['letsencrypt'] != 1 || $domain_data['iswildcarddomain'] == 1) {
|
||||
$domain_data['letsencrypt'] = 0;
|
||||
}
|
||||
} else {
|
||||
$domain_data['letsencrypt'] = 0;
|
||||
}
|
||||
|
||||
// hsts
|
||||
if ($domain_data['hsts'] != 1) {
|
||||
$domain_data['hsts'] = 0;
|
||||
}
|
||||
if ($domain_data['hsts_sub'] != 1) {
|
||||
$domain_data['hsts_sub'] = 0;
|
||||
}
|
||||
if ($domain_data['hsts_preload'] != 1) {
|
||||
$domain_data['hsts_preload'] = 0;
|
||||
}
|
||||
if ($domain_data['ocsp_stapling'] != 1) {
|
||||
$domain_data['ocsp_stapling'] = 0;
|
||||
}
|
||||
|
||||
if ($domain_data['phpenabled'] != 1) {
|
||||
$domain_data['phpenabled'] = 0;
|
||||
}
|
||||
|
||||
if ($domain_data['http2'] != 1) {
|
||||
$domain_data['http2'] = 0;
|
||||
}
|
||||
|
||||
// add to known domains
|
||||
$this->_knownDomains[] = $domain_data['domain'];
|
||||
|
||||
@@ -416,13 +465,21 @@ class DomainBulkAction
|
||||
$use_ssl = (bool)$domain_data['use_ssl'];
|
||||
// don't need that for the domain-insert-statement
|
||||
unset($domain_data['use_ssl']);
|
||||
|
||||
// don't need alias
|
||||
unset($domain_data['aliasdomain']);
|
||||
|
||||
// finally ADD the domain to panel_domains
|
||||
Database::pexecute($this->_ins_stmt, $domain_data);
|
||||
|
||||
// get the newly inserted domain-id
|
||||
$domain_id = Database::lastInsertId();
|
||||
|
||||
// add alias if any
|
||||
if ($hasAlias != false) {
|
||||
$alias_stmt = Database::prepare("UPDATE `".TABLE_PANEL_DOMAINS."` SET `aliasdomain` = :aliasdomain WHERE `id` = :did");
|
||||
Database::pexecute($alias_stmt, array('aliasdomain' => $hasAlias, 'did' => $domain_id));
|
||||
}
|
||||
|
||||
// insert domain <-> ip/port reference
|
||||
if (empty($iplist)) {
|
||||
$iplist = Settings::Get('system.ipaddress');
|
||||
|
||||
@@ -262,7 +262,7 @@ class Database {
|
||||
// build up connection string
|
||||
$driver = 'mysql';
|
||||
$dsn = $driver.":";
|
||||
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8');
|
||||
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"');
|
||||
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
||||
|
||||
$dbconf["dsn"] = array(
|
||||
|
||||
@@ -134,7 +134,7 @@ class DbManagerMySQL {
|
||||
* @param string $host (unused in mysql)
|
||||
*/
|
||||
public function disableUser($username = null, $host = null) {
|
||||
$stmt = Database::prepare("REVOKE ALL PRIVILEGES, GRANT OPTION FROM `".$row_database['databasename']."`");
|
||||
$stmt = Database::prepare('REVOKE ALL PRIVILEGES, GRANT OPTION FROM `' . $username . '`@`' . $host . '`');
|
||||
Database::pexecute($stmt, array(), false);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,31 @@ class DnsEntry
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$result = $this->record . "\t" . $this->ttl . "\t" . $this->class . "\t" . $this->type . "\t" . (($this->priority >= 0 && ($this->type == 'MX' || $this->type == 'SRV')) ? $this->priority . "\t" : "") . $this->content . PHP_EOL;
|
||||
$_content = $this->content;
|
||||
// check content length for txt records for bind9 (multiline)
|
||||
if (Settings::Get('system.dns_server') != 'pdns' && $this->type == 'TXT' && strlen($_content) >= 64) {
|
||||
// split string
|
||||
$_contentlines = str_split($_content, 63);
|
||||
// first line
|
||||
$_l = array_shift($_contentlines);
|
||||
// check for starting quote
|
||||
if (substr($_l, 0, 1) == '"') {
|
||||
$_l = substr($_l, 1);
|
||||
}
|
||||
$_content = '("' . $_l . '"' . PHP_EOL;
|
||||
$_l = array_pop($_contentlines);
|
||||
// check for ending quote
|
||||
if (substr($_l, - 1) == '"') {
|
||||
$_l = substr($_l, 0, - 1);
|
||||
}
|
||||
foreach ($_contentlines as $_cl) {
|
||||
// lines in between
|
||||
$_content .= "\t\t\t\t" . '"' . $_cl . '"' . PHP_EOL;
|
||||
}
|
||||
// last line
|
||||
$_content .= "\t\t\t\t" . '"' . $_l . '")';
|
||||
}
|
||||
$result = $this->record . "\t" . $this->ttl . "\t" . $this->class . "\t" . $this->type . "\t" . (($this->priority >= 0 && ($this->type == 'MX' || $this->type == 'SRV')) ? $this->priority . "\t" : "") . $_content . PHP_EOL;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,11 +85,10 @@ class IntegrityCheck {
|
||||
// fix database
|
||||
Database::query('ALTER DATABASE `' . Database::getDbName() . '` CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||
// fix all tables
|
||||
$handle = Database::query('SHOW TABLES');
|
||||
while ($row = $handle->fetch(PDO::FETCH_ASSOC)) {
|
||||
foreach ($row as $table) {
|
||||
Database::query('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
||||
}
|
||||
$handle = Database::query('SHOW FULL TABLES WHERE Table_type != "VIEW"');
|
||||
while ($row = $handle->fetch(PDO::FETCH_BOTH)) {
|
||||
$table = $row[0];
|
||||
Database::query('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
||||
}
|
||||
$this->_log->logAction(ADM_ACTION, LOG_WARNING, "database charset was different from UTF-8, integrity-check fixed that");
|
||||
} else {
|
||||
|
||||
@@ -88,6 +88,8 @@ class paging {
|
||||
* @var bool
|
||||
*/
|
||||
private $natSorting = false;
|
||||
|
||||
private $_limit = 0;
|
||||
|
||||
/**
|
||||
* Class constructor. Loads settings from request or from userdata and saves them to session.
|
||||
@@ -101,7 +103,7 @@ class paging {
|
||||
* @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') {
|
||||
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
|
||||
@@ -230,6 +232,8 @@ class paging {
|
||||
'adminsession' => $userinfo['adminsession']
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data);
|
||||
|
||||
$this->_limit = $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,6 +382,11 @@ class paging {
|
||||
* @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
|
||||
*/
|
||||
|
||||
@@ -91,6 +91,12 @@ class phpinterface {
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
$this->_php_configs_cache[$php_config_id] = Database::pexecute_first($stmt, array('id' => $php_config_id));
|
||||
if ((int)Settings::Get('phpfpm.enabled') == 1) {
|
||||
$stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id"
|
||||
);
|
||||
$this->_php_configs_cache[$php_config_id]['fpm_settings'] = Database::pexecute_first($stmt, array('id' => $this->_php_configs_cache[$php_config_id]['fpmsettingid']));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_php_configs_cache[$php_config_id];
|
||||
|
||||
@@ -135,15 +135,6 @@ class phpinterface_fcgid {
|
||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach ($openbasedir as $number => $path) {
|
||||
if (trim($path) != '/') {
|
||||
$clean_openbasedir[] = makeCorrectDir($path);
|
||||
}
|
||||
}
|
||||
$openbasedir = implode(':', $clean_openbasedir);
|
||||
|
||||
} else {
|
||||
$openbasedir = 'none';
|
||||
$openbasedirc = ';';
|
||||
|
||||
@@ -18,19 +18,28 @@
|
||||
* @since 0.9.16
|
||||
*
|
||||
*/
|
||||
|
||||
class phpinterface_fpm {
|
||||
class phpinterface_fpm
|
||||
{
|
||||
|
||||
/**
|
||||
* Domain-Data array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
*/
|
||||
private $_domain = array();
|
||||
|
||||
/**
|
||||
* Admin-Date cache array
|
||||
* fpm config
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
*/
|
||||
private $_fpm_cfg = array();
|
||||
|
||||
/**
|
||||
* Admin-Date cache array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_admin_cache = array();
|
||||
|
||||
/**
|
||||
@@ -38,119 +47,38 @@ class phpinterface_fpm {
|
||||
* Mostly taken from http://php.net/manual/en/ini.list.php
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_ini = array(
|
||||
'php_value' => array(
|
||||
'auto_append_file',
|
||||
'auto_prepend_file',
|
||||
'date.timezone',
|
||||
'default_charset',
|
||||
'error_reporting',
|
||||
'include_path',
|
||||
'log_errors_max_len',
|
||||
'mail.log',
|
||||
'max_execution_time',
|
||||
'session.cookie_domain',
|
||||
'session.cookie_lifetime',
|
||||
'session.cookie_path',
|
||||
'session.name',
|
||||
'session.serialize_handler',
|
||||
'upload_max_filesize',
|
||||
'xmlrpc_error_number',
|
||||
'session.auto_start',
|
||||
'always_populate_raw_post_data',
|
||||
'suhosin.session.cryptkey',
|
||||
'suhosin.session.cryptraddr',
|
||||
'suhosin.session.checkraddr',
|
||||
'suhosin.cookie.cryptkey',
|
||||
'suhosin.cookie.plainlist',
|
||||
'suhosin.cookie.cryptraddr',
|
||||
'suhosin.cookie.checkraddr',
|
||||
'suhosin.executor.func.blacklist',
|
||||
'suhosin.executor.eval.whitelist'
|
||||
),
|
||||
'php_flag' => array(
|
||||
'asp_tags',
|
||||
'display_errors',
|
||||
'display_startup_errors',
|
||||
'html_errors',
|
||||
'log_errors',
|
||||
'magic_quotes_gpc',
|
||||
'magic_quotes_runtime',
|
||||
'magic_quotes_sybase',
|
||||
'mail.add_x_header',
|
||||
'session.cookie_secure',
|
||||
'session.use_cookies',
|
||||
'short_open_tag',
|
||||
'track_errors',
|
||||
'xmlrpc_errors',
|
||||
'suhosin.simulation',
|
||||
'suhosin.session.encrypt',
|
||||
'suhosin.session.cryptua',
|
||||
'suhosin.session.cryptdocroot',
|
||||
'suhosin.cookie.encrypt',
|
||||
'suhosin.cookie.cryptua',
|
||||
'suhosin.cookie.cryptdocroot',
|
||||
'suhosin.executor.disable_eval',
|
||||
'mbstring.func_overload'
|
||||
),
|
||||
'php_admin_value' => array(
|
||||
'cgi.redirect_status_env',
|
||||
'date.timezone',
|
||||
'disable_classes',
|
||||
'disable_functions',
|
||||
'error_log',
|
||||
'gpc_order',
|
||||
'max_input_time',
|
||||
'max_input_vars',
|
||||
'memory_limit',
|
||||
'open_basedir',
|
||||
'output_buffering',
|
||||
'post_max_size',
|
||||
'precision',
|
||||
'sendmail_path',
|
||||
'session.gc_divisor',
|
||||
'session.gc_probability',
|
||||
'variables_order',
|
||||
'opcache.log_verbosity_level',
|
||||
'opcache.restrict_api',
|
||||
'opcache.revalidate_freq',
|
||||
'opcache.max_accelerated_files',
|
||||
'opcache.memory_consumption',
|
||||
'opcache.interned_strings_buffer'
|
||||
),
|
||||
'php_admin_flag' => array(
|
||||
'allow_call_time_pass_reference',
|
||||
'allow_url_fopen',
|
||||
'allow_url_include',
|
||||
'auto_detect_line_endings',
|
||||
'cgi.fix_pathinfo',
|
||||
'cgi.force_redirect',
|
||||
'enable_dl',
|
||||
'expose_php',
|
||||
'file_uploads',
|
||||
'ignore_repeated_errors',
|
||||
'ignore_repeated_source',
|
||||
'log_errors',
|
||||
'register_argc_argv',
|
||||
'report_memleaks',
|
||||
'opcache.enable',
|
||||
'opcache.consistency_checks',
|
||||
'opcache.dups_fix',
|
||||
'opcache.load_comments',
|
||||
'opcache.revalidate_path',
|
||||
'opcache.save_comments',
|
||||
'opcache.use_cwd',
|
||||
'opcache.validate_timestamps',
|
||||
'opcache.fast_shutdown'
|
||||
)
|
||||
);
|
||||
*/
|
||||
private $_ini = array();
|
||||
|
||||
/**
|
||||
* main constructor
|
||||
*/
|
||||
public function __construct($domain) {
|
||||
*/
|
||||
public function __construct($domain)
|
||||
{
|
||||
if (!isset($domain['fpm_config_id']) || empty($domain['fpm_config_id'])) {
|
||||
$domain['fpm_config_id'] = 1;
|
||||
}
|
||||
$this->_domain = $domain;
|
||||
$this->_readFpmConfig($domain['fpm_config_id']);
|
||||
$this->_buildIniMapping();
|
||||
}
|
||||
|
||||
private function _buildIniMapping()
|
||||
{
|
||||
$this->_ini = array(
|
||||
'php_flag' => explode("\n", Settings::Get('phpfpm.ini_flags')),
|
||||
'php_value' => explode("\n", Settings::Get('phpfpm.ini_values')),
|
||||
'php_admin_flag' => explode("\n", Settings::Get('phpfpm.ini_admin_flags')),
|
||||
'php_admin_value' => explode("\n", Settings::Get('phpfpm.ini_admin_values'))
|
||||
);
|
||||
}
|
||||
|
||||
private function _readFpmConfig($fpm_config_id)
|
||||
{
|
||||
$stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
|
||||
$this->_fpm_cfg = Database::pexecute_first($stmt, array(
|
||||
'id' => $fpm_config_id
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,47 +86,48 @@ class phpinterface_fpm {
|
||||
*
|
||||
* @param array $phpconfig
|
||||
*/
|
||||
public function createConfig($phpconfig) {
|
||||
|
||||
public function createConfig($phpconfig)
|
||||
{
|
||||
$fh = @fopen($this->getConfigFile(), 'w');
|
||||
|
||||
|
||||
if ($fh) {
|
||||
$fpm_pm = Settings::Get('phpfpm.pm');
|
||||
$fpm_children = (int)Settings::Get('phpfpm.max_children');
|
||||
$fpm_start_servers = (int)Settings::Get('phpfpm.start_servers');
|
||||
$fpm_min_spare_servers = (int)Settings::Get('phpfpm.min_spare_servers');
|
||||
$fpm_max_spare_servers = (int)Settings::Get('phpfpm.max_spare_servers');
|
||||
$fpm_requests = (int)Settings::Get('phpfpm.max_requests');
|
||||
$fpm_process_idle_timeout = (int)Settings::Get('phpfpm.idle_timeout');
|
||||
|
||||
$fpm_pm = $this->_fpm_cfg['pm'];
|
||||
$fpm_children = (int) $this->_fpm_cfg['max_children'];
|
||||
$fpm_start_servers = (int) $this->_fpm_cfg['start_servers'];
|
||||
$fpm_min_spare_servers = (int) $this->_fpm_cfg['min_spare_servers'];
|
||||
$fpm_max_spare_servers = (int) $this->_fpm_cfg['max_spare_servers'];
|
||||
$fpm_requests = (int) $this->_fpm_cfg['max_requests'];
|
||||
$fpm_process_idle_timeout = (int) $this->_fpm_cfg['idle_timeout'];
|
||||
$fpm_limit_extensions = $this->_fpm_cfg['limit_extensions'];
|
||||
|
||||
if ($fpm_children == 0) {
|
||||
$fpm_children = 1;
|
||||
}
|
||||
|
||||
$fpm_config = ';PHP-FPM configuration for "'.$this->_domain['domain'].'" created on ' . date("Y.m.d H:i:s") . "\n";
|
||||
$fpm_config.= '['.$this->_domain['domain'].']'."\n";
|
||||
$fpm_config.= 'listen = '.$this->getSocketFile()."\n";
|
||||
|
||||
$fpm_config = ';PHP-FPM configuration for "' . $this->_domain['domain'] . '" created on ' . date("Y.m.d H:i:s") . "\n";
|
||||
$fpm_config .= '[' . $this->_domain['domain'] . ']' . "\n";
|
||||
$fpm_config .= 'listen = ' . $this->getSocketFile() . "\n";
|
||||
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
||||
$fpm_config.= 'listen.owner = '.$this->_domain['guid']."\n";
|
||||
$fpm_config.= 'listen.group = '.$this->_domain['guid']."\n";
|
||||
$fpm_config .= 'listen.owner = ' . $this->_domain['guid'] . "\n";
|
||||
$fpm_config .= 'listen.group = ' . $this->_domain['guid'] . "\n";
|
||||
} else {
|
||||
$fpm_config.= 'listen.owner = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config.= 'listen.group = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config .= 'listen.owner = ' . $this->_domain['loginname'] . "\n";
|
||||
$fpm_config .= 'listen.group = ' . $this->_domain['loginname'] . "\n";
|
||||
}
|
||||
// see #1418 why this is 0660
|
||||
$fpm_config.= 'listen.mode = 0660'."\n";
|
||||
|
||||
$fpm_config .= 'listen.mode = 0660' . "\n";
|
||||
|
||||
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
||||
$fpm_config.= 'user = '.$this->_domain['guid']."\n";
|
||||
$fpm_config.= 'group = '.$this->_domain['guid']."\n";
|
||||
$fpm_config .= 'user = ' . $this->_domain['guid'] . "\n";
|
||||
$fpm_config .= 'group = ' . $this->_domain['guid'] . "\n";
|
||||
} else {
|
||||
$fpm_config.= 'user = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config.= 'group = '.$this->_domain['loginname']."\n";
|
||||
$fpm_config .= 'user = ' . $this->_domain['loginname'] . "\n";
|
||||
$fpm_config .= 'group = ' . $this->_domain['loginname'] . "\n";
|
||||
}
|
||||
|
||||
$fpm_config.= 'pm = '.$fpm_pm."\n";
|
||||
$fpm_config.= 'pm.max_children = '.$fpm_children."\n";
|
||||
|
||||
|
||||
$fpm_config .= 'pm = ' . $fpm_pm . "\n";
|
||||
$fpm_config .= 'pm.max_children = ' . $fpm_children . "\n";
|
||||
|
||||
if ($fpm_pm == 'dynamic') {
|
||||
// honor max_children
|
||||
if ($fpm_children < $fpm_min_spare_servers) {
|
||||
@@ -214,35 +143,40 @@ class phpinterface_fpm {
|
||||
if ($fpm_start_servers > $fpm_max_spare_servers) {
|
||||
$fpm_start_servers = $fpm_max_spare_servers;
|
||||
}
|
||||
$fpm_config.= 'pm.start_servers = '.$fpm_start_servers."\n";
|
||||
$fpm_config.= 'pm.min_spare_servers = '.$fpm_min_spare_servers."\n";
|
||||
$fpm_config.= 'pm.max_spare_servers = '.$fpm_max_spare_servers."\n";
|
||||
$fpm_config .= 'pm.start_servers = ' . $fpm_start_servers . "\n";
|
||||
$fpm_config .= 'pm.min_spare_servers = ' . $fpm_min_spare_servers . "\n";
|
||||
$fpm_config .= 'pm.max_spare_servers = ' . $fpm_max_spare_servers . "\n";
|
||||
} elseif ($fpm_pm == 'ondemand') {
|
||||
$fpm_config.= 'pm.process_idle_timeout = '.$fpm_process_idle_timeout."\n";
|
||||
$fpm_config .= 'pm.process_idle_timeout = ' . $fpm_process_idle_timeout . "\n";
|
||||
}
|
||||
|
||||
$fpm_config.= 'pm.max_requests = '.$fpm_requests."\n";
|
||||
|
||||
|
||||
$fpm_config .= 'pm.max_requests = ' . $fpm_requests . "\n";
|
||||
|
||||
// possible slowlog configs
|
||||
if ($phpconfig['fpm_slowlog'] == '1') {
|
||||
$fpm_config.= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
||||
$fpm_config.= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
||||
$fpm_config .= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
||||
$fpm_config .= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
||||
$slowlog = makeCorrectFile(Settings::Get('system.logfiles_directory') . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
||||
$fpm_config.= 'slowlog = ' . $slowlog . "\n";
|
||||
$fpm_config.= 'catch_workers_output = yes' . "\n";
|
||||
$fpm_config .= 'slowlog = ' . $slowlog . "\n";
|
||||
$fpm_config .= 'catch_workers_output = yes' . "\n";
|
||||
}
|
||||
|
||||
$fpm_config.= ';chroot = '.makeCorrectDir($this->_domain['documentroot'])."\n";
|
||||
|
||||
|
||||
$fpm_config .= ';chroot = ' . makeCorrectDir($this->_domain['documentroot']) . "\n";
|
||||
$fpm_config .= 'security.limit_extensions = '.$fpm_limit_extensions . "\n";
|
||||
|
||||
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
if (!is_dir($tmpdir)) {
|
||||
if (! is_dir($tmpdir)) {
|
||||
$this->getTempDir();
|
||||
}
|
||||
|
||||
$fpm_config.= 'env[TMP] = '.$tmpdir."\n";
|
||||
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
|
||||
$fpm_config.= 'env[TEMP] = '.$tmpdir."\n";
|
||||
|
||||
|
||||
$env_path = Settings::Get('phpfpm.envpath');
|
||||
if (!empty($env_path)) {
|
||||
$fpm_config .= 'env[PATH] = ' . $env_path . "\n";
|
||||
}
|
||||
$fpm_config .= 'env[TMP] = ' . $tmpdir . "\n";
|
||||
$fpm_config .= 'env[TMPDIR] = ' . $tmpdir . "\n";
|
||||
$fpm_config .= 'env[TEMP] = ' . $tmpdir . "\n";
|
||||
|
||||
$openbasedir = '';
|
||||
if ($this->_domain['loginname'] != 'froxlor.panel') {
|
||||
if ($this->_domain['openbasedir'] == '1') {
|
||||
@@ -251,56 +185,45 @@ class phpinterface_fpm {
|
||||
foreach ($_custom_openbasedir as $cobd) {
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
|
||||
$_custom_openbasedir = explode(':', Settings::Get('system.phpappendopenbasedir'));
|
||||
foreach ($_custom_openbasedir as $cobd) {
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
if ($this->_domain['openbasedir_path'] == '0'
|
||||
&& strstr($this->_domain['documentroot'], ":") === false
|
||||
) {
|
||||
|
||||
if ($this->_domain['openbasedir_path'] == '0' && strstr($this->_domain['documentroot'], ":") === false) {
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['documentroot'], true);
|
||||
} else {
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['customerroot'], true);
|
||||
}
|
||||
|
||||
|
||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach ($openbasedir as $number => $path) {
|
||||
if (trim($path) != '/') {
|
||||
$clean_openbasedir[] = makeCorrectDir($path);
|
||||
}
|
||||
}
|
||||
$openbasedir = implode(':', $clean_openbasedir);
|
||||
}
|
||||
}
|
||||
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config.= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
|
||||
$fpm_config .= 'php_admin_value[session.save_path] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config .= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
|
||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
||||
'PEAR_DIR' => Settings::Get('phpfpm.peardir'),
|
||||
'TMP_DIR' => $this->getTempDir(),
|
||||
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $this->_domain['domain'],
|
||||
'CUSTOMER' => $this->_domain['loginname'],
|
||||
'ADMIN' => $admin['loginname'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => '',
|
||||
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
||||
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
|
||||
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
||||
'PEAR_DIR' => Settings::Get('phpfpm.peardir'),
|
||||
'TMP_DIR' => $this->getTempDir(),
|
||||
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $this->_domain['domain'],
|
||||
'CUSTOMER' => $this->_domain['loginname'],
|
||||
'ADMIN' => $admin['loginname'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => '',
|
||||
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
||||
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
|
||||
);
|
||||
|
||||
|
||||
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_array = explode("\n", $phpini);
|
||||
|
||||
$fpm_config.= "\n\n";
|
||||
|
||||
$fpm_config .= "\n\n";
|
||||
foreach ($phpini_array as $inisection) {
|
||||
$is = explode("=", $inisection);
|
||||
foreach ($this->_ini as $sec => $possibles) {
|
||||
@@ -309,17 +232,17 @@ class phpinterface_fpm {
|
||||
if (trim($is[0]) == 'open_basedir' && $openbasedir == '') {
|
||||
continue;
|
||||
}
|
||||
$fpm_config.= $sec.'['.trim($is[0]).'] = ' . trim($is[1]) . "\n";
|
||||
$fpm_config .= $sec . '[' . trim($is[0]) . '] = ' . trim($is[1]) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// now check if 'sendmail_path' has not beed set in the custom-php.ini
|
||||
// if not we use our fallback-default as usual
|
||||
if (strpos($fpm_config, 'php_admin_value[sendmail_path]') === false) {
|
||||
$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";
|
||||
}
|
||||
|
||||
|
||||
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||
fclose($fh);
|
||||
}
|
||||
@@ -331,108 +254,138 @@ class phpinterface_fpm {
|
||||
*
|
||||
* @param string $phpconfig
|
||||
*/
|
||||
public function createIniFile($phpconfig) {
|
||||
public function createIniFile($phpconfig)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpm-config file
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @param boolean $createifnotexists
|
||||
* create the directory if it does not exist
|
||||
*
|
||||
* @return string the full path to the file
|
||||
*/
|
||||
public function getConfigFile($createifnotexists = true) {
|
||||
|
||||
$configdir = makeCorrectDir(Settings::Get('phpfpm.configdir'));
|
||||
$config = makeCorrectFile($configdir.'/'.$this->_domain['domain'].'.conf');
|
||||
|
||||
if (!is_dir($configdir) && $createifnotexists) {
|
||||
public function getConfigFile($createifnotexists = true)
|
||||
{
|
||||
$configdir = $this->_fpm_cfg['config_dir'];
|
||||
$config = makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
||||
|
||||
if (! is_dir($configdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* return path of fpm-socket file
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @param boolean $createifnotexists
|
||||
* create the directory if it does not exist
|
||||
*
|
||||
* @return string the full path to the socket
|
||||
*/
|
||||
public function getSocketFile($createifnotexists = true) {
|
||||
|
||||
public function getSocketFile($createifnotexists = true)
|
||||
{
|
||||
$socketdir = makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir'));
|
||||
$socket = strtolower(makeCorrectFile($socketdir.'/'.$this->_domain['loginname'].'-'.$this->_domain['domain'].'-php-fpm.socket'));
|
||||
|
||||
if (!is_dir($socketdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p '.escapeshellarg($socketdir));
|
||||
safe_exec('chown -R '.Settings::Get('system.httpuser').':'.Settings::Get('system.httpgroup').' '.escapeshellarg($socketdir));
|
||||
// add fpm-config-id to filename so it's unique for the fpm-daemon and doesn't interfere with running configs when reuilding
|
||||
$socket = strtolower(makeCorrectFile($socketdir . '/' . $this->_domain['fpm_config_id'] . '-' . $this->_domain['loginname'] . '-' . $this->_domain['domain'] . '-php-fpm.socket'));
|
||||
|
||||
if (! is_dir($socketdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
||||
safe_exec('chown -R ' . Settings::Get('system.httpuser') . ':' . Settings::Get('system.httpgroup') . ' ' . escapeshellarg($socketdir));
|
||||
}
|
||||
|
||||
|
||||
return $socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* fpm-temp directory
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @param boolean $createifnotexists
|
||||
* create the directory if it does not exist
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getTempDir($createifnotexists = true) {
|
||||
|
||||
public function getTempDir($createifnotexists = true)
|
||||
{
|
||||
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||
|
||||
if (!is_dir($tmpdir) && $createifnotexists) {
|
||||
|
||||
if (! is_dir($tmpdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* fastcgi-fakedirectory directory
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @param boolean $createifnotexists
|
||||
* create the directory if it does not exist
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getAliasConfigDir($createifnotexists = true) {
|
||||
|
||||
public function getAliasConfigDir($createifnotexists = true)
|
||||
{
|
||||
|
||||
// ensure default...
|
||||
if (Settings::Get('phpfpm.aliasconfigdir') == null) {
|
||||
Settings::Set('phpfpm.aliasconfigdir', '/var/www/php-fpm');
|
||||
}
|
||||
|
||||
|
||||
$configdir = makeCorrectDir(Settings::Get('phpfpm.aliasconfigdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||
if (!is_dir($configdir) && $createifnotexists) {
|
||||
if (! is_dir($configdir) && $createifnotexists) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
|
||||
return $configdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* create a dummy fpm pool config with minimal configuration
|
||||
* (this is used whenever a config directory is empty but needs at least one pool to startup/restart)
|
||||
*
|
||||
* @param string $configdir
|
||||
*/
|
||||
public static function createDummyPool($configdir)
|
||||
{
|
||||
if (! is_dir($configdir)) {
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
}
|
||||
$config = makeCorrectFile($configdir . '/dummy.conf');
|
||||
$dummy = "[dummy]
|
||||
user = ".Settings::Get('system.httpuser')."
|
||||
listen = /run/" . base64_encode($configdir) . "-fpm.sock
|
||||
pm = static
|
||||
pm.max_children = 1
|
||||
";
|
||||
file_put_contents($config, $dummy);
|
||||
}
|
||||
|
||||
/**
|
||||
* return the admin-data of a specific admin
|
||||
*
|
||||
* @param int $adminid id of the admin-user
|
||||
*
|
||||
* @param int $adminid
|
||||
* id of the admin-user
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _getAdminData($adminid) {
|
||||
|
||||
private function _getAdminData($adminid)
|
||||
{
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if (!isset($this->_admin_cache[$adminid])) {
|
||||
|
||||
if (! isset($this->_admin_cache[$adminid])) {
|
||||
$stmt = Database::prepare("
|
||||
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id"
|
||||
);
|
||||
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array('id' => $adminid));
|
||||
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id");
|
||||
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array(
|
||||
'id' => $adminid
|
||||
));
|
||||
}
|
||||
return $this->_admin_cache[$adminid];
|
||||
}
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer SPL autoloader.
|
||||
* PHP Version 5
|
||||
* @package PHPMailer
|
||||
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||
* @author Brent R. Matzelle (original founder)
|
||||
* @copyright 2012 - 2014 Marcus Bointon
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
* PHP Version 5
|
||||
* @package PHPMailer
|
||||
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||
* @author Brent R. Matzelle (original founder)
|
||||
* @copyright 2012 - 2014 Marcus Bointon
|
||||
* @copyright 2010 - 2012 Jim Jagielski
|
||||
* @copyright 2004 - 2009 Andy Prevost
|
||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPMailer SPL autoloader.
|
||||
* @param string $classname The name of the class to load
|
||||
*/
|
||||
* @param string $classname The name of the class to load
|
||||
*/
|
||||
function PHPMailerAutoload($classname)
|
||||
{
|
||||
//Can't use __DIR__ as it's only in PHP 5.3+
|
||||
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
|
||||
if (is_readable($filename)) {
|
||||
require $filename;
|
||||
}
|
||||
//Can't use __DIR__ as it's only in PHP 5.3+
|
||||
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
|
||||
if (is_readable($filename)) {
|
||||
require $filename;
|
||||
}
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
|
||||
//SPL autoloading was introduced in PHP 5.1.2
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
spl_autoload_register('PHPMailerAutoload', true, true);
|
||||
} else {
|
||||
spl_autoload_register('PHPMailerAutoload');
|
||||
}
|
||||
//SPL autoloading was introduced in PHP 5.1.2
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
spl_autoload_register('PHPMailerAutoload', true, true);
|
||||
} else {
|
||||
spl_autoload_register('PHPMailerAutoload');
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* Fall back to traditional autoload for old PHP versions
|
||||
* @param string $classname The name of the class to load
|
||||
*/
|
||||
function __autoload($classname)
|
||||
{
|
||||
PHPMailerAutoload($classname);
|
||||
}
|
||||
/**
|
||||
* Fall back to traditional autoload for old PHP versions
|
||||
* @param string $classname The name of the class to load
|
||||
*/
|
||||
function __autoload($classname)
|
||||
{
|
||||
PHPMailerAutoload($classname);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
114
lib/classes/settings/class.SImExporter.php
Normal file
114
lib/classes/settings/class.SImExporter.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2018 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 Michael Kaufmann <d00p@froxlor.org>
|
||||
* @author Froxlor team <team@froxlor.org> (2018-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Classes
|
||||
*
|
||||
* @since 0.9.39
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class SImExporter
|
||||
*
|
||||
* Import/Export settings to JSON
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <d00p@froxlor.org>
|
||||
* @author Froxlor team <team@froxlor.org> (2018-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Classes
|
||||
*/
|
||||
class SImExporter
|
||||
{
|
||||
|
||||
/**
|
||||
* settings which are not being exported
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_no_export = [
|
||||
'panel.adminmail',
|
||||
'admin.show_news_feed',
|
||||
'system.lastaccountnumber',
|
||||
'system.lastguid',
|
||||
'system.ipaddress',
|
||||
'system.last_traffic_run',
|
||||
'system.hostname',
|
||||
'system.mysql_access_host',
|
||||
'system.lastcronrun',
|
||||
'system.defaultip',
|
||||
'system.last_tasks_run',
|
||||
'system.last_archive_run',
|
||||
'system.leprivatekey',
|
||||
'system.lepublickey'
|
||||
];
|
||||
|
||||
public static function export()
|
||||
{
|
||||
$result_stmt = Database::query("
|
||||
SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` ORDER BY `settingid` ASC
|
||||
");
|
||||
$_data = array();
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$index = $row['settinggroup'] . "." . $row['varname'];
|
||||
if (! in_array($index, self::$_no_export)) {
|
||||
$_data[$index] = $row['value'];
|
||||
}
|
||||
}
|
||||
// add checksum for validation
|
||||
$_data['_sha'] = sha1(var_export($_data, true));
|
||||
$_export = json_encode($_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||
if (! $_export) {
|
||||
throw new Exception("Error exporting settings: " . json_last_error_msg());
|
||||
}
|
||||
return $_export;
|
||||
}
|
||||
|
||||
public static function import($json_str = null)
|
||||
{
|
||||
// decode data
|
||||
$_data = json_decode($json_str, true);
|
||||
if ($_data) {
|
||||
// get validity check data
|
||||
$_sha = isset($_data['_sha']) ? $_data['_sha'] : false;
|
||||
$_version = isset($_data['panel.version']) ? $_data['panel.version'] : false;
|
||||
$_dbversion = isset($_data['panel.db_version']) ? $_data['panel.db_version'] : false;
|
||||
// check if we have everything we need
|
||||
if (! $_sha || ! $_version || ! $_dbversion) {
|
||||
throw new Exception("Invalid froxlor settings data. Unable to import.");
|
||||
}
|
||||
// validate import file
|
||||
unset($_data['_sha']);
|
||||
// compare
|
||||
if ($_sha != sha1(var_export($_data, true))) {
|
||||
throw new Exception("SHA check of import data failed. Unable to import.");
|
||||
}
|
||||
// do not import version info - but we need that to possibily update settings
|
||||
// when there were changes in the variable-name or similar
|
||||
unset($_data['panel.version']);
|
||||
unset($_data['panel.db_version']);
|
||||
/*
|
||||
// store new data
|
||||
foreach ($_data as $index => $value) {
|
||||
Settings::Set($index, $value);
|
||||
}
|
||||
// save to DB
|
||||
Settings::Flush();
|
||||
*/
|
||||
// all good
|
||||
return true;
|
||||
}
|
||||
throw new Exception("Invalid JSON data: " . json_last_error_msg());
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@ class Settings {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
self::$_data[$row['settinggroup']][$row['varname']] = $row['value'];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,10 +162,16 @@ class Settings {
|
||||
if ($instant_save) {
|
||||
$this->_storeSetting($sstr[0], $sstr[1], $value);
|
||||
} else {
|
||||
if (!is_array(self::$_data[$sstr[0]])) {
|
||||
// set temporary data for usage
|
||||
if (!isset(self::$_data[$sstr[0]]) || !is_array(self::$_data[$sstr[0]])) {
|
||||
self::$_data[$sstr[0]] = array();
|
||||
}
|
||||
self::$_data[$sstr[0]][$sstr[1]] = $value;
|
||||
// set update-data when invoking Flush()
|
||||
if (!isset(self::$_updatedata[$sstr[0]]) || !is_array(self::$_updatedata[$sstr[0]])) {
|
||||
self::$_updatedata[$sstr[0]] = array();
|
||||
}
|
||||
self::$_updatedata[$sstr[0]][$sstr[1]] = $value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -223,8 +230,9 @@ class Settings {
|
||||
// now empty the array
|
||||
self::$_updatedata = array();
|
||||
// re-read in all settings
|
||||
$this->_readSettings();
|
||||
return $this->_readSettings();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,6 @@ class lescript
|
||||
{
|
||||
|
||||
// https://letsencrypt.org/repository/
|
||||
public $license;
|
||||
|
||||
private $logger;
|
||||
|
||||
@@ -38,6 +37,12 @@ class lescript
|
||||
|
||||
private $accountKey;
|
||||
|
||||
private $customerid;
|
||||
|
||||
private $isFroxlorVhost;
|
||||
|
||||
private $isLeProduction;
|
||||
|
||||
private $version;
|
||||
|
||||
public function __construct($logger, $version = '1')
|
||||
@@ -57,44 +62,59 @@ class lescript
|
||||
{
|
||||
// Let's see if we have the private accountkey
|
||||
$this->accountKey = $certrow['leprivatekey'];
|
||||
if (! $this->accountKey || $this->accountKey == 'unset' || Settings::Get('system.letsencryptca') != 'production') {
|
||||
$this->customerId = (!$isFroxlorVhost ? $certrow['customerid'] : null);
|
||||
$this->isFroxlorVhost = $isFroxlorVhost;
|
||||
$this->isLeProduction = (Settings::Get('system.letsencryptca') == 'production');
|
||||
|
||||
$leregistered=$certrow['leregistered'];
|
||||
|
||||
if (! $this->accountKey || $this->accountKey == 'unset' || !$this->isLeProduction) {
|
||||
|
||||
// generate and save new private key for account
|
||||
// ---------------------------------------------
|
||||
|
||||
$this->log('Starting new account registration');
|
||||
$this->log('Creating new account key');
|
||||
$keys = $this->generateKey();
|
||||
// Only store the accountkey in production, in staging always generate a new key
|
||||
if (Settings::Get('system.letsencryptca') == 'production') {
|
||||
if ($this->isLeProduction) {
|
||||
if ($isFroxlorVhost) {
|
||||
Settings::Set('system.lepublickey', $keys['public']);
|
||||
Settings::Set('system.leprivatekey', $keys['private']);
|
||||
Settings::Set('system.leregistered', 0); // key is not registered
|
||||
} else {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `lepublickey` = :public, `leprivatekey` = :private " . "WHERE `customerid` = :customerid;");
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `lepublickey` = :public, `leprivatekey` = :private, `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'public' => $keys['public'],
|
||||
'private' => $keys['private'],
|
||||
'customerid' => $certrow['customerid']
|
||||
'registered' => 0,
|
||||
'customerid' => $this->customerId
|
||||
));
|
||||
}
|
||||
}
|
||||
$leregistered=0;
|
||||
$this->accountKey = $keys['private'];
|
||||
} else {
|
||||
$this->log('Using existing account key');
|
||||
}
|
||||
|
||||
if ($leregistered==0) { // Account not registered
|
||||
|
||||
$this->log('Starting new account registration');
|
||||
$response = $this->postNewReg();
|
||||
if ($this->client->getLastCode() != 201) {
|
||||
if ($this->client->getLastCode() == 409) {
|
||||
$this->log('The key was already registered. Using existing account.');
|
||||
} else if ($this->client->getLastCode() == 201) {
|
||||
$this->log('New account registered.');
|
||||
} else {
|
||||
throw new \RuntimeException("Account not initialized, probably due to rate limiting. Whole response: " . json_encode($response));
|
||||
}
|
||||
$this->license = $this->client->getAgreementURL();
|
||||
$accountUrl=$this->client->getLastLocation();
|
||||
|
||||
// Terms of Servce are optional according to ACME specs; if no ToS are presented, no need to update registration
|
||||
if (!empty($this->license)) {
|
||||
$this->postRegAgreement(parse_url($this->client->getLastLocation(), PHP_URL_PATH));
|
||||
}
|
||||
$this->log('New account certificate registered');
|
||||
} else {
|
||||
|
||||
$this->log('Account already registered. Continuing.');
|
||||
$leregistered = 1;
|
||||
$this->setLeRegisteredState($leregistered); // Account registered
|
||||
$this->log('Lets encrypt Terms of Service accepted');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,11 +156,17 @@ class lescript
|
||||
)
|
||||
));
|
||||
|
||||
if ($this->client->getLastCode() == 403) {
|
||||
$this->log("Got status 403 - setting LE status to unregistered.");
|
||||
$this->setLeRegisteredState(0);
|
||||
throw new RuntimeException("Got 'unauthorized' response - we need to re-register at next run. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
// if response is not an array but a string, it's most likely a server-error, e.g.
|
||||
// <HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>An error occurred while processing your request.
|
||||
// <p>Reference #179.d8be1402.1458059103.3613c4db</BODY></HTML>
|
||||
if (! is_array($response)) {
|
||||
throw new RuntimeException("Invalid response from LE for domain $domain. Whole response: " . $response);
|
||||
throw new RuntimeException("Invalid response from LE for domain $domain. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
if (! array_key_exists('challenges', $response)) {
|
||||
@@ -188,17 +214,19 @@ class lescript
|
||||
$this->log("Token for $domain saved at $tokenPath and should be available at $uri");
|
||||
|
||||
// simple self check
|
||||
$selfcheckContextOptions = array('http' => array('header' => "User Agent: Froxlor/".$this->version));
|
||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
||||
$errmsg = json_encode(error_get_last());
|
||||
if ($errmsg != "null") {
|
||||
$errmsg = "; PHP error: " . $errmsg;
|
||||
} else {
|
||||
$errmsg = "";
|
||||
if (Settings::Get('system.disable_le_selfcheck') == '0')
|
||||
{
|
||||
$selfcheckContextOptions = array('http' => array('header' => "User-Agent: Froxlor/".$this->version));
|
||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
||||
$errmsg = json_encode(error_get_last());
|
||||
if ($errmsg != "null") {
|
||||
$errmsg = "; PHP error: " . $errmsg;
|
||||
} else {
|
||||
$errmsg = "";
|
||||
}
|
||||
$this->logger->logAction(CRON_ACTION, LOG_WARNING, "[Lets Encrypt self-check] Please check $uri - token seems to be not available. This is just a simple self-check, it might be wrong but consider using this information when Let's Encrypt fails to issue a certificate" . $errmsg);
|
||||
}
|
||||
@unlink($tokenPath);
|
||||
$this->logger->logAction(CRON_ACTION, LOG_ERR, "letsencrypt Please check $uri - token not available" . $errmsg);
|
||||
}
|
||||
|
||||
$this->log("Sending request to challenge");
|
||||
@@ -309,6 +337,21 @@ class lescript
|
||||
);
|
||||
}
|
||||
|
||||
private function setLeRegisteredState($state)
|
||||
{
|
||||
if ($this->isLeProduction) {
|
||||
if ($this->isFroxlorVhost) {
|
||||
Settings::Set('system.leregistered', $state);
|
||||
} else {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'registered' => $state,
|
||||
'customerid' => $this->customerId
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function parsePemFromBody($body)
|
||||
{
|
||||
$pem = chunk_split(base64_encode($body), 64, "\n");
|
||||
@@ -317,21 +360,16 @@ class lescript
|
||||
|
||||
private function postNewReg()
|
||||
{
|
||||
$this->log('Getting last terms of service URL');
|
||||
$directory = $this->client->get('/directory');
|
||||
if (!isset($directory['meta']) || !isset($directory['meta']['terms-of-service'])) {
|
||||
throw new \RuntimeException("No terms of service link available!");
|
||||
}
|
||||
$this->log('Sending registration to letsencrypt server');
|
||||
|
||||
return $this->signedRequest('/acme/new-reg', array(
|
||||
'resource' => 'new-reg',
|
||||
'agreement' => $this->license
|
||||
));
|
||||
}
|
||||
|
||||
private function postRegAgreement($uri)
|
||||
{
|
||||
$this->log('Accepting agreement at URL: ' . $this->license);
|
||||
|
||||
return $this->signedRequest($uri, array(
|
||||
'resource' => 'reg',
|
||||
'agreement' => $this->license
|
||||
'agreement' => $directory['meta']['terms-of-service']
|
||||
));
|
||||
}
|
||||
|
||||
@@ -536,13 +574,6 @@ class Client
|
||||
preg_match_all('~Link: <(.+)>;rel="up"~', $this->lastHeader, $matches);
|
||||
return $matches[1];
|
||||
}
|
||||
|
||||
public function getAgreementURL()
|
||||
{
|
||||
preg_match_all('~Link: <(.+)>;rel="terms-of-service"~', $this->lastHeader, $matches);
|
||||
return $matches[1][0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Base64UrlSafeEncoder
|
||||
|
||||
599
lib/classes/ssl/class.lescript_v2.php
Normal file
599
lib/classes/ssl/class.lescript_v2.php
Normal file
@@ -0,0 +1,599 @@
|
||||
<?php
|
||||
|
||||
// Copyright (c) 2015, Stanislav Humplik <sh@analogic.cz>
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// * Neither the name of the <organization> nor the
|
||||
// names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// This file is copied from https://github.com/analogic/lescript
|
||||
// and modified to work without files and integrate in Froxlor
|
||||
class lescript_v2
|
||||
{
|
||||
|
||||
// https://letsencrypt.org/repository/
|
||||
private $logger;
|
||||
|
||||
private $client;
|
||||
|
||||
private $accountKey;
|
||||
|
||||
private $customerid;
|
||||
|
||||
private $isFroxlorVhost;
|
||||
|
||||
private $isLeProduction;
|
||||
|
||||
private $version;
|
||||
|
||||
private $_req_uris = array();
|
||||
|
||||
private $_acc_location = null;
|
||||
|
||||
public function __construct($logger, $version = '2')
|
||||
{
|
||||
$this->logger = $logger;
|
||||
$this->version = $version;
|
||||
if (Settings::Get('system.letsencryptca') == 'production') {
|
||||
$ca = 'https://acme-v02.api.letsencrypt.org';
|
||||
} else {
|
||||
$ca = 'https://acme-staging-v02.api.letsencrypt.org';
|
||||
}
|
||||
$this->client = new Client($ca);
|
||||
$this->log("Using '$ca' to generate certificate");
|
||||
|
||||
// get request-uris from /directory
|
||||
$response = $this->client->get('/directory');
|
||||
$this->_req_uris['newAccount'] = $response['newAccount'];
|
||||
$this->_req_uris['newOrder'] = $response['newOrder'];
|
||||
$this->_req_uris['newNonce'] = $response['newNonce'];
|
||||
$this->_req_uris['revokeCert'] = $response['revokeCert'];
|
||||
}
|
||||
|
||||
public function initAccount($certrow, $isFroxlorVhost = false)
|
||||
{
|
||||
// Let's see if we have the private accountkey
|
||||
$this->accountKey = $certrow['leprivatekey'];
|
||||
$this->customerId = (! $isFroxlorVhost ? $certrow['customerid'] : null);
|
||||
$this->isFroxlorVhost = $isFroxlorVhost;
|
||||
$this->isLeProduction = (Settings::Get('system.letsencryptca') == 'production');
|
||||
|
||||
$leregistered = $certrow['leregistered'];
|
||||
|
||||
if (! $this->accountKey || $this->accountKey == 'unset' || ! $this->isLeProduction) {
|
||||
|
||||
// generate and save new private key for account
|
||||
// ---------------------------------------------
|
||||
|
||||
$this->log('Creating new account key');
|
||||
$keys = $this->generateKey();
|
||||
// Only store the accountkey in production, in staging always generate a new key
|
||||
if ($this->isLeProduction) {
|
||||
if ($isFroxlorVhost) {
|
||||
Settings::Set('system.lepublickey', $keys['public']);
|
||||
Settings::Set('system.leprivatekey', $keys['private']);
|
||||
Settings::Set('system.leregistered', 0); // key is not registered
|
||||
} else {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `lepublickey` = :public, `leprivatekey` = :private, `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'public' => $keys['public'],
|
||||
'private' => $keys['private'],
|
||||
'registered' => 0,
|
||||
'customerid' => $this->customerId
|
||||
));
|
||||
}
|
||||
}
|
||||
$leregistered = 0;
|
||||
$this->accountKey = $keys['private'];
|
||||
} else {
|
||||
$this->log('Using existing account key');
|
||||
}
|
||||
|
||||
if ($leregistered == 0) { // Account not registered
|
||||
|
||||
$this->log('Starting new account registration');
|
||||
$response = $this->postNewReg();
|
||||
if ($this->client->getLastCode() == 409) {
|
||||
$this->log('The key was already registered. Using existing account.');
|
||||
} else if ($this->client->getLastCode() == 201) {
|
||||
$this->log('New account registered.');
|
||||
} else {
|
||||
throw new \RuntimeException("Account not initialized, probably due to rate limiting. Whole response: " . json_encode($response));
|
||||
}
|
||||
$this->_acc_location = $this->client->getLastLocation();
|
||||
|
||||
$leregistered = 1;
|
||||
$this->setLeRegisteredState($leregistered);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $domains
|
||||
* @param string $domainkey
|
||||
* @param string $csr
|
||||
* optional, same behavior as $reuseCsr from the original class, but we're passing the content of the csr already
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
* @return string[]
|
||||
*/
|
||||
public function signDomains(array $domains, $domainkey = null, $csr = null)
|
||||
{
|
||||
if (! $this->accountKey) {
|
||||
throw new \RuntimeException("Account not initialized");
|
||||
}
|
||||
|
||||
$this->log('Starting certificate generation process for domains');
|
||||
|
||||
$privateAccountKey = openssl_pkey_get_private($this->accountKey);
|
||||
$accountKeyDetails = openssl_pkey_get_details($privateAccountKey);
|
||||
|
||||
// start domains authentication
|
||||
// ----------------------------
|
||||
|
||||
foreach ($domains as $domain) {
|
||||
|
||||
// 1. getting available authentication options
|
||||
// -------------------------------------------
|
||||
|
||||
$this->log("Requesting challenge for $domain");
|
||||
|
||||
$response = $this->signedRequest($this->_req_uris['newOrder'], array(
|
||||
"identifiers" => array(
|
||||
array(
|
||||
"type" => "dns",
|
||||
"value" => $domain
|
||||
)
|
||||
)
|
||||
), false);
|
||||
|
||||
if ($this->client->getLastCode() == 403) {
|
||||
$this->log("Got status 403 - setting LE status to unregistered.");
|
||||
$this->setLeRegisteredState(0);
|
||||
throw new RuntimeException("Got 'unauthorized' response - we need to re-register at next run. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
// if response is not an array but a string, it's most likely a server-error, e.g.
|
||||
// <HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>An error occurred while processing your request.
|
||||
// <p>Reference #179.d8be1402.1458059103.3613c4db</BODY></HTML>
|
||||
if (! is_array($response)) {
|
||||
throw new RuntimeException("Invalid response from LE for domain $domain. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
if (! array_key_exists('authorizations', $response)) {
|
||||
throw new RuntimeException("No authorizations received for $domain. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
// get authorization
|
||||
$auth_response = $this->client->get($response['authorizations'][0]);
|
||||
|
||||
if (! array_key_exists('challenges', $auth_response)) {
|
||||
throw new RuntimeException("No challenges received for $domain. Whole response: " . json_encode($auth_response));
|
||||
}
|
||||
|
||||
// choose http-01 challenge only
|
||||
$challenge = array_reduce($auth_response['challenges'], function ($v, $w) {
|
||||
return $v ? $v : ($w['type'] == 'http-01' ? $w : false);
|
||||
});
|
||||
|
||||
if (! $challenge) {
|
||||
throw new RuntimeException("HTTP Challenge for $domain is not available. Whole response: " . json_encode($response));
|
||||
}
|
||||
|
||||
$this->log("Got challenge token for $domain");
|
||||
$location = $challenge['url'];
|
||||
$finalizeLink = $response['finalize'];
|
||||
|
||||
// 2. saving authentication token for web verification
|
||||
// ---------------------------------------------------
|
||||
|
||||
$directory = Settings::Get('system.letsencryptchallengepath') . '/.well-known/acme-challenge';
|
||||
$tokenPath = $directory . '/' . $challenge['token'];
|
||||
|
||||
if (! file_exists($directory) && ! @mkdir($directory, 0755, true)) {
|
||||
throw new \RuntimeException("Couldn't create directory to expose challenge: ${tokenPath}");
|
||||
}
|
||||
|
||||
$header = array(
|
||||
// need to be in precise order!
|
||||
"e" => Base64UrlSafeEncoder::encode($accountKeyDetails["rsa"]["e"]),
|
||||
"kty" => "RSA",
|
||||
"n" => Base64UrlSafeEncoder::encode($accountKeyDetails["rsa"]["n"])
|
||||
);
|
||||
$payload = $challenge['token'] . '.' . Base64UrlSafeEncoder::encode(hash('sha256', json_encode($header), true));
|
||||
|
||||
file_put_contents($tokenPath, $payload);
|
||||
chmod($tokenPath, 0644);
|
||||
|
||||
// 3. verification process itself
|
||||
// -------------------------------
|
||||
|
||||
$uri = "http://${domain}/.well-known/acme-challenge/${challenge['token']}";
|
||||
|
||||
$this->log("Token for $domain saved at $tokenPath and should be available at $uri");
|
||||
|
||||
// simple self check
|
||||
if (Settings::Get('system.disable_le_selfcheck') == '0') {
|
||||
$selfcheckContextOptions = array(
|
||||
'http' => array(
|
||||
'header' => "User-Agent: Froxlor/" . $this->version
|
||||
)
|
||||
);
|
||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
||||
$errmsg = json_encode(error_get_last());
|
||||
if ($errmsg != "null") {
|
||||
$errmsg = "; PHP error: " . $errmsg;
|
||||
} else {
|
||||
$errmsg = "";
|
||||
}
|
||||
$this->logger->logAction(CRON_ACTION, LOG_WARNING, "[Lets Encrypt self-check] Please check $uri - token seems to be not available. This is just a simple self-check, it might be wrong but consider using this information when Let's Encrypt fails to issue a certificate" . $errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
$this->log("Sending request to challenge");
|
||||
|
||||
// send request to challenge
|
||||
$result = $this->signedRequest($challenge['url'], array(
|
||||
"type" => "http-01",
|
||||
"keyAuthorization" => $payload,
|
||||
"token" => $challenge['token']
|
||||
), false);
|
||||
|
||||
// waiting loop
|
||||
// we wait for a maximum of 30 seconds to avoid endless loops
|
||||
$count = 0;
|
||||
do {
|
||||
if (empty($result['status']) || $result['status'] == "invalid") {
|
||||
@unlink($tokenPath);
|
||||
throw new \RuntimeException("Verification ended with error: " . json_encode($result));
|
||||
}
|
||||
$ended = ! ($result['status'] === "pending" || $result['status'] === "processing");
|
||||
|
||||
if (! $ended) {
|
||||
$this->log("Verification " . $result['status'] . ", sleeping 1s");
|
||||
sleep(1);
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$result = $this->client->get($location);
|
||||
} while (! $ended && $count < 30);
|
||||
|
||||
$this->log("Verification ended with status: ${result['status']}");
|
||||
@unlink($tokenPath);
|
||||
}
|
||||
|
||||
// requesting certificate
|
||||
// ----------------------
|
||||
|
||||
// generate private key for domain if not exist
|
||||
if (empty($domainkey) || Settings::Get('system.letsencryptreuseold') == 0) {
|
||||
$keys = $this->generateKey();
|
||||
$domainkey = $keys['private'];
|
||||
}
|
||||
|
||||
// load domain key
|
||||
$privateDomainKey = openssl_pkey_get_private($domainkey);
|
||||
|
||||
if (empty($csr)) {
|
||||
$csr = $this->generateCSR($privateDomainKey, $domains);
|
||||
}
|
||||
|
||||
// request certificates creation
|
||||
$result = $this->signedRequest($finalizeLink, array(
|
||||
'csr' => $csr
|
||||
), false);
|
||||
if ($this->client->getLastCode() !== 200) {
|
||||
throw new \RuntimeException("Invalid response code: " . $this->client->getLastCode() . ", " . json_encode($result));
|
||||
}
|
||||
if (! isset($result['certificate'])) {
|
||||
throw new \RuntimeException("No certificate URL specified in result");
|
||||
}
|
||||
|
||||
$certificates = array();
|
||||
$certdata = $this->client->get($result['certificate']);
|
||||
$this->log("Got certificate! YAY!");
|
||||
$certificates[] = $certdata;
|
||||
foreach ($this->client->getLastLinks() as $link) {
|
||||
$this->log("Requesting chained cert at $link");
|
||||
$result = $this->client->get($link);
|
||||
$certificates[] = $result;
|
||||
}
|
||||
|
||||
if (empty($certificates))
|
||||
throw new \RuntimeException('No certificates generated');
|
||||
|
||||
$fullchain = implode("\n", $certificates);
|
||||
$crt = array_shift($certificates);
|
||||
$chain = implode("\n", $certificates);
|
||||
|
||||
$this->log("Done, returning new certificates and key");
|
||||
return array(
|
||||
'fullchain' => $fullchain,
|
||||
'crt' => $crt,
|
||||
'chain' => $chain,
|
||||
'key' => $domainkey,
|
||||
'csr' => $csr
|
||||
);
|
||||
}
|
||||
|
||||
private function setLeRegisteredState($state)
|
||||
{
|
||||
if ($this->isLeProduction) {
|
||||
if ($this->isFroxlorVhost) {
|
||||
Settings::Set('system.leregistered', $state);
|
||||
} else {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'registered' => $state,
|
||||
'customerid' => $this->customerId
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function parsePemFromBody($body)
|
||||
{
|
||||
$pem = chunk_split(base64_encode($body), 64, "\n");
|
||||
return "-----BEGIN CERTIFICATE-----\n" . $pem . "-----END CERTIFICATE-----\n";
|
||||
}
|
||||
|
||||
private function postNewReg()
|
||||
{
|
||||
$this->log('Getting last terms of service URL');
|
||||
$directory = $this->client->get('/directory');
|
||||
if (! isset($directory['meta']) || ! isset($directory['meta']['termsOfService'])) {
|
||||
throw new \RuntimeException("No terms of service link available!");
|
||||
}
|
||||
$this->log('Sending registration to letsencrypt server');
|
||||
|
||||
return $this->signedRequest($this->_req_uris['newAccount'], array(
|
||||
'termsOfServiceAgreed' => true
|
||||
));
|
||||
}
|
||||
|
||||
private function generateCSR($privateKey, array $domains)
|
||||
{
|
||||
$domain = reset($domains);
|
||||
$san = implode(",", array_map(function ($dns) {
|
||||
return "DNS:" . $dns;
|
||||
}, $domains));
|
||||
$tmpConf = tmpfile();
|
||||
$tmpConfMeta = stream_get_meta_data($tmpConf);
|
||||
$tmpConfPath = $tmpConfMeta["uri"];
|
||||
|
||||
// workaround to get SAN working
|
||||
fwrite($tmpConf, 'HOME = .
|
||||
RANDFILE = $ENV::HOME/.rnd
|
||||
[ req ]
|
||||
default_bits = ' . Settings::Get('system.letsencryptkeysize') . '
|
||||
default_keyfile = privkey.pem
|
||||
distinguished_name = req_distinguished_name
|
||||
req_extensions = v3_req
|
||||
[ req_distinguished_name ]
|
||||
countryName = Country Name (2 letter code)
|
||||
[ v3_req ]
|
||||
basicConstraints = CA:FALSE
|
||||
subjectAltName = ' . $san . '
|
||||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment');
|
||||
|
||||
$csr = openssl_csr_new(array(
|
||||
"CN" => $domain,
|
||||
"ST" => Settings::Get('system.letsencryptstate'),
|
||||
"C" => Settings::Get('system.letsencryptcountrycode'),
|
||||
"O" => "Unknown"
|
||||
), $privateKey, array(
|
||||
"config" => $tmpConfPath,
|
||||
"digest_alg" => "sha256"
|
||||
));
|
||||
|
||||
if (! $csr)
|
||||
throw new \RuntimeException("CSR couldn't be generated! " . openssl_error_string());
|
||||
|
||||
openssl_csr_export($csr, $csr);
|
||||
fclose($tmpConf);
|
||||
|
||||
preg_match('~REQUEST-----(.*)-----END~s', $csr, $matches);
|
||||
|
||||
return trim(Base64UrlSafeEncoder::encode(base64_decode($matches[1])));
|
||||
}
|
||||
|
||||
private function generateKey()
|
||||
{
|
||||
$res = openssl_pkey_new(array(
|
||||
"private_key_type" => OPENSSL_KEYTYPE_RSA,
|
||||
"private_key_bits" => (int) Settings::Get('system.letsencryptkeysize')
|
||||
));
|
||||
|
||||
if (! openssl_pkey_export($res, $privateKey)) {
|
||||
throw new \RuntimeException("Key export failed!");
|
||||
}
|
||||
|
||||
$details = openssl_pkey_get_details($res);
|
||||
|
||||
return array(
|
||||
'private' => $privateKey,
|
||||
'public' => $details['key']
|
||||
);
|
||||
}
|
||||
|
||||
private function signedRequest($uri, array $payload, $needs_jwk = true)
|
||||
{
|
||||
$privateKey = openssl_pkey_get_private($this->accountKey);
|
||||
$details = openssl_pkey_get_details($privateKey);
|
||||
|
||||
$header = array(
|
||||
"alg" => "RS256"
|
||||
);
|
||||
|
||||
if ($needs_jwk) {
|
||||
$header["jwk"] = array(
|
||||
"kty" => "RSA",
|
||||
"n" => Base64UrlSafeEncoder::encode($details["rsa"]["n"]),
|
||||
"e" => Base64UrlSafeEncoder::encode($details["rsa"]["e"])
|
||||
);
|
||||
} else {
|
||||
// need account-url
|
||||
$header["kid"] = $this->_acc_location;
|
||||
}
|
||||
|
||||
$protected = $header;
|
||||
$protected["nonce"] = $this->client->getLastNonce();
|
||||
$protected["url"] = $uri;
|
||||
|
||||
$payload64 = Base64UrlSafeEncoder::encode(json_encode($payload, JSON_UNESCAPED_SLASHES));
|
||||
$protected64 = Base64UrlSafeEncoder::encode(json_encode($protected));
|
||||
|
||||
openssl_sign($protected64 . '.' . $payload64, $signed, $privateKey, "SHA256");
|
||||
|
||||
$signed64 = Base64UrlSafeEncoder::encode($signed);
|
||||
|
||||
$data = array(
|
||||
'protected' => $protected64,
|
||||
'payload' => $payload64,
|
||||
'signature' => $signed64
|
||||
);
|
||||
|
||||
$this->log("Sending signed request to $uri");
|
||||
return $this->client->post($uri, json_encode($data));
|
||||
}
|
||||
|
||||
protected function log($message)
|
||||
{
|
||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, "letsencrypt-v2 " . $message);
|
||||
}
|
||||
}
|
||||
|
||||
class Client
|
||||
{
|
||||
|
||||
private $lastCode;
|
||||
|
||||
public $lastHeader;
|
||||
|
||||
private $base;
|
||||
|
||||
public function __construct($base)
|
||||
{
|
||||
$this->base = $base;
|
||||
}
|
||||
|
||||
private function curl($method, $url, $data = null)
|
||||
{
|
||||
$headers = array(
|
||||
'Accept: application/json',
|
||||
'Content-Type: application/json'
|
||||
);
|
||||
$handle = curl_init();
|
||||
curl_setopt($handle, CURLOPT_URL, preg_match('~^http~', $url) ? $url : $this->base . $url);
|
||||
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($handle, CURLOPT_HEADER, true);
|
||||
|
||||
// DO NOT DO THAT!
|
||||
// curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
|
||||
// curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
switch ($method) {
|
||||
case 'GET':
|
||||
break;
|
||||
case 'POST':
|
||||
curl_setopt($handle, CURLOPT_POST, true);
|
||||
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
|
||||
break;
|
||||
}
|
||||
$response = curl_exec($handle);
|
||||
|
||||
if (curl_errno($handle)) {
|
||||
throw new \RuntimeException('Curl: ' . curl_error($handle));
|
||||
}
|
||||
|
||||
$header_size = curl_getinfo($handle, CURLINFO_HEADER_SIZE);
|
||||
|
||||
$header = substr($response, 0, $header_size);
|
||||
$body = substr($response, $header_size);
|
||||
|
||||
$this->lastHeader = $header;
|
||||
$this->lastCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
|
||||
|
||||
$data = json_decode($body, true);
|
||||
return $data === null ? $body : $data;
|
||||
}
|
||||
|
||||
public function post($url, $data)
|
||||
{
|
||||
return $this->curl('POST', $url, $data);
|
||||
}
|
||||
|
||||
public function get($url)
|
||||
{
|
||||
return $this->curl('GET', $url);
|
||||
}
|
||||
|
||||
public function getLastNonce()
|
||||
{
|
||||
if (preg_match('~Replay\-Nonce: (.+)~i', $this->lastHeader, $matches)) {
|
||||
return trim($matches[1]);
|
||||
}
|
||||
|
||||
$this->curl('GET', '/directory');
|
||||
return $this->getLastNonce();
|
||||
}
|
||||
|
||||
public function getLastLocation()
|
||||
{
|
||||
if (preg_match('~Location: (.+)~i', $this->lastHeader, $matches)) {
|
||||
return trim($matches[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getLastCode()
|
||||
{
|
||||
return $this->lastCode;
|
||||
}
|
||||
|
||||
public function getLastLinks()
|
||||
{
|
||||
preg_match_all('~Link: <(.+)>;rel="up"~', $this->lastHeader, $matches);
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
class Base64UrlSafeEncoder
|
||||
{
|
||||
|
||||
public static function encode($input)
|
||||
{
|
||||
return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
|
||||
}
|
||||
|
||||
public static function decode($input)
|
||||
{
|
||||
$remainder = strlen($input) % 4;
|
||||
if ($remainder) {
|
||||
$padlen = 4 - $remainder;
|
||||
$input .= str_repeat('=', $padlen);
|
||||
}
|
||||
return base64_decode(strtr($input, '-_', '+/'));
|
||||
}
|
||||
}
|
||||
@@ -17,13 +17,14 @@
|
||||
* @since 0.9.29
|
||||
*
|
||||
*/
|
||||
|
||||
class ConfigIO {
|
||||
class ConfigIO
|
||||
{
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
public function __construct() {}
|
||||
public function __construct()
|
||||
{}
|
||||
|
||||
/**
|
||||
* clean up former created configs, including (if enabled)
|
||||
@@ -32,39 +33,40 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function cleanUp() {
|
||||
|
||||
public function cleanUp()
|
||||
{
|
||||
|
||||
// old error logs
|
||||
$this->_cleanErrLogs();
|
||||
|
||||
|
||||
// awstats files
|
||||
$this->_cleanAwstatsFiles();
|
||||
|
||||
|
||||
// fcgid files
|
||||
$this->_cleanFcgidFiles();
|
||||
|
||||
|
||||
// php-fpm files
|
||||
$this->_cleanFpmFiles();
|
||||
|
||||
|
||||
// clean webserver-configs
|
||||
$this->_cleanWebserverConfigs();
|
||||
|
||||
|
||||
// old htpasswd files
|
||||
$this->_cleanHtpasswdFiles();
|
||||
|
||||
|
||||
// customer-specified ssl-certificates
|
||||
$this->_cleanCustomerSslCerts();
|
||||
}
|
||||
|
||||
private function _cleanErrLogs() {
|
||||
|
||||
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
|
||||
if (@is_dir($err_dir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /*.log so we don't delete the directory)
|
||||
$err_dir.='/*.log';
|
||||
safe_exec('rm -rf '. makeCorrectFile($err_dir));
|
||||
}
|
||||
private function _cleanErrLogs()
|
||||
{
|
||||
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . "/logs/");
|
||||
if (@is_dir($err_dir)) {
|
||||
// now get rid of old stuff
|
||||
// (but append /*.log so we don't delete the directory)
|
||||
$err_dir .= '/*.log';
|
||||
safe_exec('rm -f ' . makeCorrectFile($err_dir));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,8 +75,9 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanCustomerSslCerts() {
|
||||
|
||||
private function _cleanCustomerSslCerts()
|
||||
{
|
||||
|
||||
/*
|
||||
* only clean up if we're actually using SSL
|
||||
*/
|
||||
@@ -82,14 +85,14 @@ class ConfigIO {
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'customer_ssl_path');
|
||||
if ($configdir !== false) {
|
||||
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
// (but append /* so we don't delete the directory)
|
||||
$configdir .= '/*';
|
||||
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,39 +103,38 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanWebserverConfigs() {
|
||||
|
||||
private function _cleanWebserverConfigs()
|
||||
{
|
||||
|
||||
// get directories
|
||||
$configdirs = array();
|
||||
$dir = $this->_getFile('system', 'apacheconf_vhost');
|
||||
if ($dir !== false)
|
||||
$configdirs[] = makeCorrectDir($dir);
|
||||
|
||||
|
||||
$dir = $this->_getFile('system', 'apacheconf_diroptions');
|
||||
if ($dir !== false)
|
||||
$configdirs[] = makeCorrectDir($dir);
|
||||
|
||||
|
||||
// file pattern
|
||||
$pattern = "/^([0-9]){2}_(froxlor|syscp)_(.+)\.conf$/";
|
||||
|
||||
|
||||
// check ALL the folders
|
||||
foreach ($configdirs as $config_dir) {
|
||||
|
||||
|
||||
// check directory
|
||||
if (@is_dir($config_dir)) {
|
||||
|
||||
|
||||
// create directory iterator
|
||||
$its = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($config_dir)
|
||||
);
|
||||
|
||||
$its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config_dir));
|
||||
|
||||
// iterate through all subdirs,
|
||||
// look for vhost/diroption files
|
||||
// and delete them
|
||||
foreach ($its as $fullFileName => $it ) {
|
||||
foreach ($its as $fullFileName => $it) {
|
||||
if ($it->isFile() && preg_match($pattern, $it->getFilename())) {
|
||||
// remove file
|
||||
safe_exec('rm -f '. escapeshellarg(makeCorrectFile($its->getPathname())));
|
||||
safe_exec('rm -f ' . escapeshellarg(makeCorrectFile($its->getPathname())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,19 +146,20 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanHtpasswdFiles() {
|
||||
|
||||
private function _cleanHtpasswdFiles()
|
||||
{
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'apacheconf_htpasswddir');
|
||||
|
||||
|
||||
if ($configdir !== false) {
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
// (but append /* so we don't delete the directory)
|
||||
$configdir .= '/*';
|
||||
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,37 +169,36 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanAwstatsFiles() {
|
||||
|
||||
private function _cleanAwstatsFiles()
|
||||
{
|
||||
if (Settings::Get('system.awstats_enabled') == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
//dhr: cleanout froxlor-generated awstats configs prior to re-creation
|
||||
|
||||
// dhr: cleanout froxlor-generated awstats configs prior to re-creation
|
||||
$awstatsclean['header'] = "## GENERATED BY FROXLOR\n";
|
||||
$awstatsclean['headerold'] = "## GENERATED BY SYSCP\n";
|
||||
$awstatsclean['path'] = $this->_getFile('system', 'awstats_conf');
|
||||
|
||||
|
||||
/**
|
||||
* don't do anything if the directory does not exist
|
||||
* (e.g. awstats not installed yet or whatever)
|
||||
* (e.g.
|
||||
* awstats not installed yet or whatever)
|
||||
* fixes #45
|
||||
*/
|
||||
*/
|
||||
if ($awstatsclean['path'] !== false && is_dir($awstatsclean['path'])) {
|
||||
$awstatsclean['dir'] = dir($awstatsclean['path']);
|
||||
while ($awstatsclean['entry'] = $awstatsclean['dir']->read()) {
|
||||
$awstatsclean['fullentry'] = makeCorrectFile($awstatsclean['path'].'/'.$awstatsclean['entry']);
|
||||
$awstatsclean['fullentry'] = makeCorrectFile($awstatsclean['path'] . '/' . $awstatsclean['entry']);
|
||||
/**
|
||||
* don't do anything if the file does not exist
|
||||
*/
|
||||
*/
|
||||
if (@file_exists($awstatsclean['fullentry'])) {
|
||||
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
|
||||
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1);
|
||||
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header']) + 1);
|
||||
fclose($awstatsclean['fh']);
|
||||
|
||||
if ($awstatsclean['headerRead'] == $awstatsclean['header']
|
||||
|| $awstatsclean['headerRead'] == $awstatsclean['headerold']
|
||||
) {
|
||||
|
||||
if ($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] == $awstatsclean['headerold']) {
|
||||
$awstats_conf_file = makeCorrectFile($awstatsclean['fullentry']);
|
||||
@unlink($awstats_conf_file);
|
||||
}
|
||||
@@ -204,7 +206,7 @@ class ConfigIO {
|
||||
}
|
||||
}
|
||||
unset($awstatsclean);
|
||||
//end dhr
|
||||
// end dhr
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,39 +214,37 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanFcgidFiles() {
|
||||
|
||||
private function _cleanFcgidFiles()
|
||||
{
|
||||
if (Settings::Get('system.mod_fcgid') == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'mod_fcgid_configdir');
|
||||
if ($configdir !== false) {
|
||||
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// create directory iterator
|
||||
$its = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($configdir)
|
||||
);
|
||||
|
||||
$its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($configdir));
|
||||
|
||||
// iterate through all subdirs,
|
||||
// look for php-fcgi-starter files
|
||||
// and take immutable-flag away from them
|
||||
// so we can delete them :)
|
||||
foreach ($its as $fullFileName => $it ) {
|
||||
foreach ($its as $fullFileName => $it) {
|
||||
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter') {
|
||||
// set chattr -i
|
||||
removeImmutable($its->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
// (but append /* so we don't delete the directory)
|
||||
$configdir .= '/*';
|
||||
safe_exec('rm -rf ' . makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,33 +254,36 @@ class ConfigIO {
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanFpmFiles() {
|
||||
|
||||
private function _cleanFpmFiles()
|
||||
{
|
||||
if (Settings::Get('phpfpm.enabled') == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('phpfpm', 'configdir');
|
||||
if ($configdir !== false) {
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
|
||||
// get all fpm config paths
|
||||
$fpmconf_sel = Database::prepare("SELECT config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
|
||||
Database::pexecute($fpmconf_sel);
|
||||
$fpmconf_paths = $fpmconf_sel->fetchAll(PDO::FETCH_ASSOC);
|
||||
// clean all php-fpm config-dirs
|
||||
foreach ($fpmconf_paths as $configdir) {
|
||||
$configdir = makeCorrectDir($configdir['config_dir']);
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
// (but append /*.conf so we don't delete the directory)
|
||||
$configdir .= '/*.conf';
|
||||
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||
} else {
|
||||
safe_exec('mkdir -p ' . $configdir);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// also remove aliasconfigdir #1273
|
||||
$aliasconfigdir = $this->_getFile('phpfpm', 'aliasconfigdir');
|
||||
if ($aliasconfigdir !== false) {
|
||||
$aliasconfigdir = makeCorrectDir($aliasconfigdir);
|
||||
if (@is_dir($aliasconfigdir)) {
|
||||
$aliasconfigdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($aliasconfigdir));
|
||||
$aliasconfigdir .= '/*';
|
||||
safe_exec('rm -rf ' . makeCorrectFile($aliasconfigdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,17 +291,21 @@ class ConfigIO {
|
||||
/**
|
||||
* returns a file/direcotry from the settings and checks whether it exists
|
||||
*
|
||||
* @param string $group settings-group
|
||||
* @param string $varname var-name
|
||||
* @param boolean $check_exists check if the file exists
|
||||
*
|
||||
* @param string $group
|
||||
* settings-group
|
||||
* @param string $varname
|
||||
* var-name
|
||||
* @param boolean $check_exists
|
||||
* check if the file exists
|
||||
*
|
||||
* @return string|boolean complete path including filename if any or false on error
|
||||
*/
|
||||
private function _getFile($group, $varname, $check_exists = true) {
|
||||
|
||||
private function _getFile($group, $varname, $check_exists = true)
|
||||
{
|
||||
|
||||
// read from settings
|
||||
$file = Settings::Get($group.'.'.$varname);
|
||||
|
||||
$file = Settings::Get($group . '.' . $varname);
|
||||
|
||||
// check whether it exists
|
||||
if ($check_exists && @file_exists($file) == false) {
|
||||
return false;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
* @since 0.9.31
|
||||
*
|
||||
*/
|
||||
|
||||
class WebserverBase {
|
||||
class WebserverBase
|
||||
{
|
||||
|
||||
/**
|
||||
* returns an array with all entries required for all
|
||||
@@ -26,27 +26,45 @@ class WebserverBase {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getVhostsToCreate() {
|
||||
|
||||
public static function getVhostsToCreate()
|
||||
{
|
||||
$query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`,
|
||||
`d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`,
|
||||
`c`.`documentroot` AS `customerroot`, `c`.`deactivated`,
|
||||
`c`.`phpenabled` AS `phpenabled`, `d`.`mod_fcgid_starter`,
|
||||
`d`.`mod_fcgid_maxrequests`
|
||||
FROM `".TABLE_PANEL_DOMAINS."` `d`
|
||||
`c`.`phpenabled` AS `phpenabled_customer`,
|
||||
`d`.`phpenabled` AS `phpenabled_vhost`,
|
||||
`d`.`mod_fcgid_starter`,`d`.`mod_fcgid_maxrequests`,
|
||||
`d`.`ocsp_stapling`
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
|
||||
LEFT JOIN `".TABLE_PANEL_CUSTOMERS."` `c` USING(`customerid`)
|
||||
LEFT JOIN `".TABLE_PANEL_DOMAINS."` `pd` ON (`pd`.`id` = `d`.`parentdomainid`)
|
||||
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`)
|
||||
|
||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
||||
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;
|
||||
";
|
||||
|
||||
|
||||
$result_domains_stmt = Database::query($query);
|
||||
|
||||
|
||||
// prepare IP statement
|
||||
$ip_stmt = Database::prepare("
|
||||
SELECT `di`.`id_domain` , `p`.`ssl`, `p`.`ssl_cert_file`, `p`.`ssl_key_file`, `p`.`ssl_ca_file`, `p`.`ssl_cert_chainfile`
|
||||
FROM `" . TABLE_DOMAINTOIP . "` `di`, `" . TABLE_PANEL_IPSANDPORTS . "` `p`
|
||||
WHERE `p`.`id` = `di`.`id_ipandports`
|
||||
AND `di`.`id_domain` = :domainid
|
||||
AND `p`.`ssl` = '1'
|
||||
");
|
||||
|
||||
// prepare fpm-config select query
|
||||
$fpm_sel_stmt = Database::prepare("
|
||||
SELECT f.id FROM `" . TABLE_PANEL_FPMDAEMONS . "` f
|
||||
LEFT JOIN `" . TABLE_PANEL_PHPCONFIGS . "` p ON p.fpmsettingid = f.id
|
||||
WHERE p.id = :phpconfigid
|
||||
");
|
||||
|
||||
$domains = array();
|
||||
while ($domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
|
||||
// set whole domain
|
||||
$domains[$domain['domain']] = $domain;
|
||||
// set empty-defaults for non-ssl
|
||||
@@ -55,31 +73,38 @@ class WebserverBase {
|
||||
$domains[$domain['domain']]['ssl_key_file'] = '';
|
||||
$domains[$domain['domain']]['ssl_ca_file'] = '';
|
||||
$domains[$domain['domain']]['ssl_cert_chainfile'] = '';
|
||||
|
||||
|
||||
// now, if the domain has an ssl ip/port assigned, get
|
||||
// the corresponding information from the db
|
||||
if (domainHasSslIpPort($domain['id'])) {
|
||||
|
||||
$ip_stmt = Database::prepare("
|
||||
SELECT `di`.`id_domain` , `p`.`ssl`, `p`.`ssl_cert_file`, `p`.`ssl_key_file`, `p`.`ssl_ca_file`, `p`.`ssl_cert_chainfile`
|
||||
FROM `".TABLE_DOMAINTOIP."` `di`, `".TABLE_PANEL_IPSANDPORTS."` `p`
|
||||
WHERE `p`.`id` = `di`.`id_ipandports`
|
||||
AND `di`.`id_domain` = :domainid
|
||||
AND `p`.`ssl` = '1'
|
||||
");
|
||||
$ssl_ip = Database::pexecute_first($ip_stmt, array('domainid' => $domain['id']));
|
||||
|
||||
$ssl_ip = Database::pexecute_first($ip_stmt, array(
|
||||
'domainid' => $domain['id']
|
||||
));
|
||||
|
||||
// set ssl info for domain
|
||||
$domains[$domain['domain']]['ssl'] = '1';
|
||||
$domains[$domain['domain']]['ssl_cert_file'] = $ssl_ip['ssl_cert_file'];
|
||||
$domains[$domain['domain']]['ssl_key_file'] = $ssl_ip['ssl_key_file'];
|
||||
$domains[$domain['domain']]['ssl_ca_file'] = $ssl_ip['ssl_ca_file'];
|
||||
$domains[$domain['domain']]['ssl_cert_chainfile'] = $ssl_ip['ssl_cert_chainfile'];
|
||||
}
|
||||
|
||||
// read fpm-config-id if using fpm
|
||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||
|
||||
$fpm_config = Database::pexecute_first($fpm_sel_stmt, array(
|
||||
'phpconfigid' => $domain['phpsettingid']
|
||||
));
|
||||
if ($fpm_config) {
|
||||
$domains[$domain['domain']]['fpm_config_id'] = $fpm_config['id'];
|
||||
} else {
|
||||
// fallback
|
||||
$domains[$domain['domain']]['fpm_config_id'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $domains;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -396,7 +396,8 @@ mail IN A <SERVERIP>
|
||||
#################################
|
||||
# allow-axfr-ips Allow zonetransfers only to these subnets
|
||||
#
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
|
||||
@@ -938,7 +939,8 @@ gmysql-password=
|
||||
#################################
|
||||
# allow-axfr-ips Allow zonetransfers only to these subnets
|
||||
#
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
|
||||
|
||||
@@ -380,7 +380,8 @@ exit "$RETVAL"
|
||||
#################################
|
||||
# allow-axfr-ips Allow zonetransfers only to these subnets
|
||||
#
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
|
||||
@@ -921,7 +922,8 @@ gmysql-password=
|
||||
#################################
|
||||
# allow-axfr-ips Allow zonetransfers only to these subnets
|
||||
#
|
||||
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
# allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-dnsupdate-from A global setting to allow DNS updates from these IP ranges.
|
||||
@@ -4467,9 +4469,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
<!-- libnss-mysql -->
|
||||
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
|
||||
<install><![CDATA[apt-get install nscd
|
||||
wget http://ftp.us.debian.org/debian/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-4_`dpkg --print-architecture`.deb
|
||||
dpkg -i libnss-mysql-bg_1.5-4_`dpkg --print-architecture`.deb
|
||||
rm libnss-mysql-bg_1.5-4_`dpkg --print-architecture`.deb
|
||||
wget http://debian.froxlor.org/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-3+frx1_amd64.deb
|
||||
dpkg -i libnss-mysql-bg_1.5-3+frx1_amd64.deb
|
||||
rm libnss-mysql-bg_1.5-3+frx1_amd64.deb
|
||||
]]></install>
|
||||
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
|
||||
backup="true">
|
||||
@@ -4632,6 +4634,42 @@ aliases: files
|
||||
</content>
|
||||
</file>
|
||||
</daemon>
|
||||
<!-- libnss-extrausers -->
|
||||
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
|
||||
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
|
||||
<commands index="1">
|
||||
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
|
||||
<command><![CDATA[touch /var/lib/extrausers/{passwd,group,shadow}]]></command>
|
||||
</commands>
|
||||
<file name="/etc/nsswitch.conf" backup="true">
|
||||
<content><![CDATA[
|
||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
||||
#
|
||||
passwd: compat extrausers
|
||||
group: compat extrausers
|
||||
shadow: compat extrausers
|
||||
|
||||
hosts: files dns
|
||||
networks: files dns
|
||||
|
||||
services: db files
|
||||
protocols: db files
|
||||
rpc: db files
|
||||
ethers: db files
|
||||
netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
<command><![CDATA[/etc/init.d/nscd restart]]></command>
|
||||
<!-- clear group chache -->
|
||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||
</daemon>
|
||||
<!-- Logrotate -->
|
||||
<daemon name="logrotate" title="Logrotate">
|
||||
<install><![CDATA[apt-get install logrotate]]></install>
|
||||
|
||||
@@ -346,7 +346,8 @@ exit "$RETVAL"
|
||||
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
|
||||
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
|
||||
<content><![CDATA[
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
allow-recursion=127.0.0.1
|
||||
config-dir=/etc/powerdns
|
||||
daemon=yes
|
||||
@@ -407,7 +408,8 @@ include-dir=/etc/powerdns/froxlor/
|
||||
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
|
||||
chmod="600">
|
||||
<content><![CDATA[
|
||||
allow-axfr-ips=<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
#local-ipv6=YOUR_IPv6_(if_any)
|
||||
bind-config=<BIND_CONFIG_PATH>named.conf
|
||||
bind-check-interval=180
|
||||
@@ -1622,6 +1624,42 @@ netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
<command><![CDATA[/etc/init.d/nscd restart]]></command>
|
||||
<!-- clear group chache -->
|
||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||
</daemon>
|
||||
<!-- libnss-extrausers -->
|
||||
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
|
||||
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
|
||||
<commands index="1">
|
||||
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
|
||||
<command><![CDATA[touch /var/lib/extrausers/{passwd,group,shadow}]]></command>
|
||||
</commands>
|
||||
<file name="/etc/nsswitch.conf" backup="true">
|
||||
<content><![CDATA[
|
||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
||||
#
|
||||
passwd: compat extrausers
|
||||
group: compat extrausers
|
||||
shadow: compat extrausers
|
||||
|
||||
hosts: files dns
|
||||
networks: files dns
|
||||
|
||||
services: db files
|
||||
protocols: db files
|
||||
rpc: db files
|
||||
ethers: db files
|
||||
netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
|
||||
@@ -2089,7 +2089,7 @@ LoadModule mod_ctrls_admin.c
|
||||
# (http://www.castaglia.org/proftpd/modules/mod_vroot.html)
|
||||
# Using this module rather than the kernel's chroot() system call works
|
||||
# around issues with PAM and chroot (http://bugzilla.redhat.com/506735)
|
||||
LoadModule mod_vroot.c
|
||||
# LoadModule mod_vroot.c
|
||||
#
|
||||
# Provide a flexible way of specifying that certain configuration directives
|
||||
# only apply to certain sessions, based on credentials such as connection
|
||||
|
||||
4650
lib/configfiles/stretch.xml
Normal file
4650
lib/configfiles/stretch.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -379,7 +379,8 @@ exit "$RETVAL"
|
||||
<install><![CDATA[apt-get install pdns-server pdns-backend-mysql]]></install>
|
||||
<file name="/etc/powerdns/pdns.conf" backup="true" chmod="600">
|
||||
<content><![CDATA[
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
allow-recursion=127.0.0.1
|
||||
config-dir=/etc/powerdns
|
||||
daemon=yes
|
||||
@@ -417,7 +418,8 @@ gmysql-password=
|
||||
<install><![CDATA[apt-get install pdns-server]]></install>
|
||||
<file name="/etc/powerdns/pdns.conf" backup="true">
|
||||
<content><![CDATA[
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
allow-recursion=127.0.0.1
|
||||
config-dir=/etc/powerdns
|
||||
daemon=yes
|
||||
@@ -441,7 +443,8 @@ include-dir=/etc/powerdns/froxlor/
|
||||
<file name="/etc/powerdns/froxlor/pdns_froxlor.conf" chown="root:root"
|
||||
chmod="600">
|
||||
<content><![CDATA[
|
||||
allow-axfr-ips=<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
#local-ipv6=YOUR_IPv6_(if_any)
|
||||
bind-config=<BIND_CONFIG_PATH>named.conf
|
||||
bind-check-interval=180
|
||||
@@ -1639,6 +1642,42 @@ aliases: files
|
||||
<!-- clear group chache -->
|
||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||
</daemon>
|
||||
<!-- libnss-extrausers -->
|
||||
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
|
||||
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
|
||||
<commands index="1">
|
||||
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
|
||||
<command><![CDATA[touch /var/lib/extrausers/{passwd,group,shadow}]]></command>
|
||||
</commands>
|
||||
<file name="/etc/nsswitch.conf" backup="true">
|
||||
<content><![CDATA[
|
||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
||||
#
|
||||
passwd: compat extrausers
|
||||
group: compat extrausers
|
||||
shadow: compat extrausers
|
||||
|
||||
hosts: files dns
|
||||
networks: files dns
|
||||
|
||||
services: db files
|
||||
protocols: db files
|
||||
rpc: db files
|
||||
ethers: db files
|
||||
netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
<command><![CDATA[/etc/init.d/nscd restart]]></command>
|
||||
<!-- clear group chache -->
|
||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||
</daemon>
|
||||
<!-- Logrotate -->
|
||||
<daemon name="logrotate" title="Logrotate">
|
||||
<install><![CDATA[apt-get install logrotate]]></install>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<froxlor>
|
||||
<distribution name="Debian" codename="Wheezy" version="7.x" defaulteditor="/usr/bin/nano">
|
||||
<distribution name="Debian" codename="Wheezy" version="7.x" defaulteditor="/usr/bin/nano" deprecated="true">
|
||||
<services>
|
||||
<!-- HTTP -->
|
||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||
@@ -424,7 +424,8 @@ exit "$RETVAL"
|
||||
# allow-axfr-ips If enabled, restrict zonetransfers to originate from these
|
||||
# IP addresses
|
||||
#
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-recursion List of netmasks that are allowed to recurse
|
||||
@@ -763,7 +764,8 @@ gmysql-password=
|
||||
# allow-axfr-ips If enabled, restrict zonetransfers to originate from these
|
||||
# IP addresses
|
||||
#
|
||||
allow-axfr-ips=<NAMESERVERS>
|
||||
allow-axfr-ips=127.0.0.0/8,::1,<NAMESERVERS_IP>
|
||||
# add these entries to the list if any speficied: <AXFRSERVERS>
|
||||
|
||||
#################################
|
||||
# allow-recursion List of netmasks that are allowed to recurse
|
||||
@@ -5431,6 +5433,42 @@ netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
</content>
|
||||
</file>
|
||||
<command><![CDATA[/etc/init.d/nscd restart]]></command>
|
||||
<!-- clear group chache -->
|
||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||
</daemon>
|
||||
<!-- libnss-extrausers -->
|
||||
<daemon name="libnssextrausers" title="libnss-extrausers (alternative to libnss-mysql, required for FCGID/php-fpm/mpm-itk)">
|
||||
<install><![CDATA[apt-get install nscd libnss-extrausers]]></install>
|
||||
<commands index="1">
|
||||
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
|
||||
<command><![CDATA[touch /var/lib/extrausers/{passwd,group,shadow}]]></command>
|
||||
</commands>
|
||||
<file name="/etc/nsswitch.conf" backup="true">
|
||||
<content><![CDATA[
|
||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
||||
#
|
||||
passwd: compat extrausers
|
||||
group: compat extrausers
|
||||
shadow: compat extrausers
|
||||
|
||||
hosts: files dns
|
||||
networks: files dns
|
||||
|
||||
services: db files
|
||||
protocols: db files
|
||||
rpc: db files
|
||||
ethers: db files
|
||||
netmasks: files
|
||||
netgroup: files
|
||||
bootparams: files
|
||||
|
||||
automount: files
|
||||
aliases: files
|
||||
]]>
|
||||
|
||||
@@ -205,6 +205,7 @@ if (hasUpdates($version) || hasDbUpdates($dbversion)
|
||||
fwrite($debugHandler, '*** WARNING *** - all new settings etc. will be stored with the default value, that might not always be right for your system!' . "\n");
|
||||
fwrite($debugHandler, "*** WARNING *** - If you don't want this to happen in the future consider removing the --allow-autoupdate flag from the cronjob\n");
|
||||
// including update procedures
|
||||
define('_CRON_UPDATE', 1);
|
||||
include_once FROXLOR_INSTALL_DIR.'/install/updatesql.php';
|
||||
// pew - everything went better than expected
|
||||
$cronlog->logAction(CRON_ACTION, LOG_WARNING, 'Automatic update done - you should check your settings to be sure everything is fine');
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'customer_add' => array(
|
||||
'title' => $lng['admin']['customer_add'],
|
||||
@@ -29,20 +28,30 @@ return array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'createstdsubdomain' => array(
|
||||
'label' => $lng['admin']['stdsubdomain_add'].'?',
|
||||
'label' => $lng['admin']['stdsubdomain_add'] . '?',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'store_defaultindex' => array(
|
||||
'label' => $lng['admin']['store_defaultindex'].'?',
|
||||
'label' => $lng['admin']['store_defaultindex'] . '?',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'new_customer_password' => array(
|
||||
'label' => $lng['login']['password'],
|
||||
@@ -53,15 +62,20 @@ return array(
|
||||
'label' => $lng['customer']['generated_pwd'],
|
||||
'type' => 'text',
|
||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||
'value' => generatePassword(),
|
||||
'value' => generatePassword()
|
||||
),
|
||||
'sendpassword' => array(
|
||||
'label' => $lng['admin']['sendpassword'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'def_language' => array(
|
||||
'label' => $lng['login']['language'],
|
||||
@@ -135,7 +149,10 @@ return array(
|
||||
'label' => $lng['usersettings']['custom_notes']['show'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
)
|
||||
@@ -206,18 +223,28 @@ return array(
|
||||
'label' => $lng['customer']['email_imap'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1'),
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
),
|
||||
'mandatory' => true
|
||||
),
|
||||
'email_pop3' => array(
|
||||
'label' => $lng['customer']['email_pop3'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1'),
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
),
|
||||
'mandatory' => true
|
||||
),
|
||||
'ftps' => array(
|
||||
@@ -244,28 +271,51 @@ return array(
|
||||
'ul_field' => $mysqls_ul
|
||||
),
|
||||
'phpenabled' => array(
|
||||
'label' => $lng['admin']['phpenabled'].'?',
|
||||
'label' => $lng['admin']['phpenabled'] . '?',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'allowed_phpconfigs' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'checkbox',
|
||||
'values' => $phpconfigs,
|
||||
'value' => ((int) Settings::Get('system.mod_fcgid') == 1 ? array(
|
||||
Settings::Get('system.mod_fcgid_defaultini')
|
||||
) : (int) Settings::Get('phpfpm.enabled') == 1) ? array(
|
||||
Settings::Get('phpfpm.defaultini')
|
||||
) : array(),
|
||||
'is_array' => 1
|
||||
),
|
||||
'perlenabled' => array(
|
||||
'label' => $lng['admin']['perlenabled'].'?',
|
||||
'label' => $lng['admin']['perlenabled'] . '?',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
)
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
)
|
||||
),
|
||||
'dnsenabled' => array(
|
||||
'label' => $lng['admin']['dnsenabled'].'?',
|
||||
'label' => $lng['admin']['dnsenabled'] . '?',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'visible' => (Settings::Get('system.dnsenabled') == '1' ? true : false)
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -260,6 +260,14 @@ return array(
|
||||
),
|
||||
'value' => array($result['phpenabled'])
|
||||
),
|
||||
'allowed_phpconfigs' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'checkbox',
|
||||
'values' => $phpconfigs,
|
||||
'value' => isset($result['allowed_phpconfigs']) && !empty($result['allowed_phpconfigs']) ? json_decode($result['allowed_phpconfigs'], JSON_OBJECT_AS_ARRAY) : array(),
|
||||
'is_array' => 1
|
||||
),
|
||||
'perlenabled' => array(
|
||||
'label' => $lng['admin']['perlenabled'].'?',
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'domain_add' => array(
|
||||
'title' => $lng['admin']['domain_add'],
|
||||
@@ -27,20 +26,20 @@ return array(
|
||||
'domain' => array(
|
||||
'label' => 'Domain',
|
||||
'type' => 'text',
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'customerid' => array(
|
||||
'label' => $lng['admin']['customer'],
|
||||
'type' => 'select',
|
||||
'select_var' => $customers,
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'adminid' => array(
|
||||
'visible' => ($userinfo['customers_see_all'] == '1' ? true : false),
|
||||
'label' => $lng['admin']['admin'],
|
||||
'type' => 'select',
|
||||
'select_var' => $admins,
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'alias' => array(
|
||||
'label' => $lng['domains']['aliasdomain'],
|
||||
@@ -58,9 +57,14 @@ return array(
|
||||
'desc' => $lng['admin']['domain_editable']['desc'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'add_date' => array(
|
||||
'label' => $lng['domains']['add_date'],
|
||||
@@ -112,7 +116,10 @@ return array(
|
||||
'desc' => $lng['admin']['speciallogfile']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
@@ -146,7 +153,10 @@ return array(
|
||||
'desc' => $lng['domains']['ssl_redirect']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
@@ -156,7 +166,23 @@ return array(
|
||||
'desc' => $lng['admin']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'label' => $lng['admin']['domain_http2']['title'],
|
||||
'desc' => $lng['admin']['domain_http2']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array (
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
@@ -175,13 +201,16 @@ return array(
|
||||
'int_max' => 94608000, // 3-years
|
||||
'value' => 0
|
||||
),
|
||||
'hsts_incsub' => array(
|
||||
'hsts_sub' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
@@ -191,11 +220,31 @@ return array(
|
||||
'desc' => $lng['admin']['domain_hsts_preload']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
),
|
||||
'ocsp_stapling' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) &&
|
||||
Settings::Get('system.webserver') != 'lighttpd',
|
||||
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
|
||||
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
|
||||
(Settings::Get('system.webserver') == 'nginx' ?
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
|
||||
""),
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array (
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
)
|
||||
),
|
||||
'section_c' => array(
|
||||
'title' => $lng['admin']['phpserversettings'],
|
||||
@@ -206,23 +255,41 @@ return array(
|
||||
'label' => 'OpenBasedir',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'phpenabled' => array(
|
||||
'label' => $lng['admin']['phpenabled'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text'
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text'
|
||||
)
|
||||
@@ -237,9 +304,14 @@ return array(
|
||||
'label' => 'Nameserver',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'zonefile' => array(
|
||||
'label' => 'Zonefile',
|
||||
@@ -256,15 +328,23 @@ return array(
|
||||
'label' => $lng['admin']['emaildomain'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'email_only' => array(
|
||||
'label' => $lng['admin']['email_only'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
@@ -278,9 +358,14 @@ return array(
|
||||
'label' => 'DomainKeys',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'domain_edit' => array(
|
||||
'title' => $lng['admin']['domain_edit'],
|
||||
@@ -28,14 +27,14 @@ return array(
|
||||
'label' => 'Domain',
|
||||
'type' => 'label',
|
||||
'value' => $result['domain'],
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'customerid' => array(
|
||||
'label' => $lng['admin']['customer'],
|
||||
'type' => (Settings::Get('panel.allow_domain_change_customer') == '1' ? 'select' : 'label'),
|
||||
'select_var' => (isset($customers) ? $customers : null),
|
||||
'value' => (isset($result['customername']) ? $result['customername'] : null),
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'adminid' => array(
|
||||
'visible' => ($userinfo['customers_see_all'] == '1' ? true : false),
|
||||
@@ -43,7 +42,7 @@ return array(
|
||||
'type' => (Settings::Get('panel.allow_domain_change_admin') == '1' ? 'select' : 'label'),
|
||||
'select_var' => (isset($admins) ? $admins : null),
|
||||
'value' => (isset($result['adminname']) ? $result['adminname'] : null),
|
||||
'mandatory' => true,
|
||||
'mandatory' => true
|
||||
),
|
||||
'alias' => array(
|
||||
'visible' => ($alias_check == '0' ? true : false),
|
||||
@@ -60,16 +59,21 @@ return array(
|
||||
'associated_info' => array(
|
||||
'label' => $lng['domains']['associated_with_domain'],
|
||||
'type' => 'label',
|
||||
'value' => $subdomains.' '.$lng['customer']['subdomains'].', '.$alias_check.' '.$lng['domains']['aliasdomains'].', '.$emails.' '.$lng['customer']['emails'].', '.$email_accounts.' '.$lng['customer']['accounts'].', '.$email_forwarders.' '.$lng['customer']['forwarders']
|
||||
'value' => $subdomains . ' ' . $lng['customer']['subdomains'] . ', ' . $alias_check . ' ' . $lng['domains']['aliasdomains'] . ', ' . $emails . ' ' . $lng['customer']['emails'] . ', ' . $email_accounts . ' ' . $lng['customer']['accounts'] . ', ' . $email_forwarders . ' ' . $lng['customer']['forwarders']
|
||||
),
|
||||
'caneditdomain' => array(
|
||||
'label' => $lng['admin']['domain_editable']['title'],
|
||||
'desc' => $lng['admin']['domain_editable']['desc'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['caneditdomain'])
|
||||
'value' => array(
|
||||
$result['caneditdomain']
|
||||
)
|
||||
),
|
||||
'add_date' => array(
|
||||
'label' => $lng['domains']['add_date'],
|
||||
@@ -124,9 +128,14 @@ return array(
|
||||
'desc' => $lng['admin']['speciallogfile']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['speciallogfile'])
|
||||
'value' => array(
|
||||
$result['speciallogfile']
|
||||
)
|
||||
),
|
||||
'specialsettings' => array(
|
||||
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
|
||||
@@ -144,9 +153,14 @@ return array(
|
||||
'desc' => $lng['serversettings']['specialsettingsforsubdomains']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array('1')
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -169,9 +183,14 @@ return array(
|
||||
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['ssl_redirect'])
|
||||
'value' => array(
|
||||
$result['ssl_redirect']
|
||||
)
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
@@ -179,9 +198,29 @@ return array(
|
||||
'desc' => $lng['admin']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['letsencrypt'])
|
||||
'value' => array(
|
||||
$result['letsencrypt']
|
||||
)
|
||||
),
|
||||
'http2' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) && Settings::Get('system.webserver') != 'lighttpd' && Settings::Get('system.http2_support') == '1',
|
||||
'label' => $lng['admin']['domain_http2']['title'],
|
||||
'desc' => $lng['admin']['domain_http2']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array (
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
$result['http2']
|
||||
)
|
||||
),
|
||||
'no_ssl_available_info' => array(
|
||||
'visible' => ($ssl_ipsandports == '' ? true : false),
|
||||
@@ -198,15 +237,20 @@ return array(
|
||||
'int_max' => 94608000, // 3-years
|
||||
'value' => $result['hsts']
|
||||
),
|
||||
'hsts_incsub' => array(
|
||||
'hsts_sub' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['hsts_sub'])
|
||||
'value' => array(
|
||||
$result['hsts_sub']
|
||||
)
|
||||
),
|
||||
'hsts_preload' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
@@ -214,9 +258,33 @@ return array(
|
||||
'desc' => $lng['admin']['domain_hsts_preload']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['hsts_preload'])
|
||||
'value' => array(
|
||||
$result['hsts_preload']
|
||||
)
|
||||
),
|
||||
'ocsp_stapling' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false) &&
|
||||
Settings::Get('system.webserver') != 'lighttpd',
|
||||
'label' => $lng['admin']['domain_ocsp_stapling']['title'],
|
||||
'desc' => $lng['admin']['domain_ocsp_stapling']['description'] .
|
||||
(Settings::Get('system.webserver') == 'nginx' ?
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] :
|
||||
""),
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array (
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
$result['ocsp_stapling']
|
||||
)
|
||||
),
|
||||
)
|
||||
),
|
||||
@@ -229,27 +297,60 @@ return array(
|
||||
'label' => 'OpenBasedir',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['openbasedir'])
|
||||
'value' => array(
|
||||
$result['openbasedir']
|
||||
)
|
||||
),
|
||||
'phpenabled' => array(
|
||||
'label' => $lng['admin']['phpenabled'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
$result['phpenabled']
|
||||
)
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
),
|
||||
'phpsettingsforsubdomains' => array(
|
||||
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'label' => $lng['admin']['phpsettingsforsubdomains'],
|
||||
'desc' => $lng['serversettings']['phpsettingsforsubdomains']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array(
|
||||
'1'
|
||||
)
|
||||
),
|
||||
'mod_fcgid_starter' => array(
|
||||
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||
'type' => 'text',
|
||||
'value' => ((int)$result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
|
||||
'value' => ((int) $result['mod_fcgid_starter'] != - 1 ? $result['mod_fcgid_starter'] : '')
|
||||
),
|
||||
'mod_fcgid_maxrequests' => array(
|
||||
'visible' => ((int)Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'visible' => ((int) Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['mod_fcgid_maxrequests']['title'],
|
||||
'type' => 'text',
|
||||
'value' => ((int)$result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
|
||||
'value' => ((int) $result['mod_fcgid_maxrequests'] != - 1 ? $result['mod_fcgid_maxrequests'] : '')
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -262,9 +363,14 @@ return array(
|
||||
'label' => 'Nameserver',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['isbinddomain'])
|
||||
'value' => array(
|
||||
$result['isbinddomain']
|
||||
)
|
||||
),
|
||||
'zonefile' => array(
|
||||
'label' => 'Zonefile',
|
||||
@@ -282,17 +388,27 @@ return array(
|
||||
'label' => $lng['admin']['emaildomain'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['isemaildomain'])
|
||||
'value' => array(
|
||||
$result['isemaildomain']
|
||||
)
|
||||
),
|
||||
'email_only' => array(
|
||||
'label' => $lng['admin']['email_only'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['email_only'])
|
||||
'value' => array(
|
||||
$result['email_only']
|
||||
)
|
||||
),
|
||||
'subcanemaildomain' => array(
|
||||
'label' => $lng['admin']['subdomainforemail'],
|
||||
@@ -304,9 +420,14 @@ return array(
|
||||
'label' => 'DomainKeys',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
array(
|
||||
'label' => $lng['panel']['yes'],
|
||||
'value' => '1'
|
||||
)
|
||||
),
|
||||
'value' => array($result['dkim'])
|
||||
'value' => array(
|
||||
$result['dkim']
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
95
lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php
Normal file
95
lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* 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 Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'fpmconfig_add' => array(
|
||||
'title' => $lng['admin']['phpsettings']['addsettings'],
|
||||
'image' => 'icons/phpsettings_add.png',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => $lng['admin']['phpsettings']['addsettings'],
|
||||
'image' => 'icons/phpsettings_add.png',
|
||||
'fields' => array(
|
||||
'description' => array(
|
||||
'label' => $lng['admin']['phpsettings']['description'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 50
|
||||
),
|
||||
'reload_cmd' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => 'service php7.0-fpm restart'
|
||||
),
|
||||
'config_dir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => '/etc/php/7.0/fpm/pool.d/'
|
||||
),
|
||||
'pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'type' => 'select',
|
||||
'select_var' => $pm_select
|
||||
),
|
||||
'max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 1
|
||||
),
|
||||
'start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 20
|
||||
),
|
||||
'min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 5
|
||||
),
|
||||
'max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 35
|
||||
),
|
||||
'max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 0
|
||||
),
|
||||
'idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
|
||||
'type' => 'int',
|
||||
'value' => 30
|
||||
),
|
||||
'limit_extensions' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
|
||||
'type' => 'text',
|
||||
'value' => '.php'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
96
lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php
Normal file
96
lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* 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 Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'fpmconfig_edit' => array(
|
||||
'title' => $lng['admin']['phpsettings']['editsettings'],
|
||||
'image' => 'icons/phpsettings_edit.png',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => $lng['admin']['phpsettings']['editsettings'],
|
||||
'image' => 'icons/phpsettings_edit.png',
|
||||
'fields' => array(
|
||||
'description' => array(
|
||||
'label' => $lng['admin']['phpsettings']['description'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 50,
|
||||
'value' => $result['description']
|
||||
),
|
||||
'reload_cmd' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => $result['reload_cmd']
|
||||
),
|
||||
'config_dir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 255,
|
||||
'value' => $result['config_dir']
|
||||
),
|
||||
'pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'type' => 'select',
|
||||
'select_var' => $pm_select
|
||||
),
|
||||
'max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_children']
|
||||
),
|
||||
'start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['start_servers']
|
||||
),
|
||||
'min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['min_spare_servers']
|
||||
),
|
||||
'max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_spare_servers']
|
||||
),
|
||||
'max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['max_requests']
|
||||
),
|
||||
'idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'],
|
||||
'type' => 'int',
|
||||
'value' => $result['idle_timeout']
|
||||
),
|
||||
'limit_extensions' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
|
||||
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'],
|
||||
'type' => 'text',
|
||||
'value' => $result['limit_extensions']
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -36,6 +36,12 @@ return array(
|
||||
'maxlength' => 255,
|
||||
'value' => '/usr/bin/php-cgi'
|
||||
),
|
||||
'fpmconfig' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||
'type' => 'select',
|
||||
'select_var' => $fpmconfigs
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
@@ -84,6 +90,15 @@ return array(
|
||||
'maxlength' => 10,
|
||||
'value' => '5s'
|
||||
),
|
||||
'phpfpm_pass_authorizationheader' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
'phpsettings' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||
|
||||
@@ -37,6 +37,12 @@ return array(
|
||||
'maxlength' => 255,
|
||||
'value' => $result['binary']
|
||||
),
|
||||
'fpmconfig' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['fpmdesc'],
|
||||
'type' => 'select',
|
||||
'select_var' => $fpmconfigs
|
||||
),
|
||||
'file_extensions' => array(
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||
@@ -87,6 +93,15 @@ return array(
|
||||
'maxlength' => 10,
|
||||
'value' => $result['fpm_reqslow']
|
||||
),
|
||||
'phpfpm_pass_authorizationheader' => array(
|
||||
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['pass_authorizationheader'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['pass_authorizationheader'])
|
||||
),
|
||||
'phpsettings' => array(
|
||||
'style' => 'align-top',
|
||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||
|
||||
@@ -54,7 +54,7 @@ return array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => ((Settings::Get('system.webserver') == 'apache2' && Settings::Get('customredirect.enabled') == '1') ? true : false),
|
||||
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -70,16 +70,21 @@ return array(
|
||||
'label' => $lng['domain']['openbasedirpath'],
|
||||
'type' => 'select',
|
||||
'select_var' => $openbasedir
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? true : false) : false,
|
||||
'fields' => array(
|
||||
'ssl_redirect' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['domains']['ssl_redirect']['title'],
|
||||
'desc' => $lng['domains']['ssl_redirect']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -89,7 +94,7 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'visible' => (Settings::Get('system.leenabled') == '1' ? true : false),
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -99,7 +104,6 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'hsts_maxage' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_maxage']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_maxage']['description'],
|
||||
'type' => 'int',
|
||||
@@ -107,8 +111,7 @@ return array(
|
||||
'int_max' => 94608000, // 3-years
|
||||
'value' => 0
|
||||
),
|
||||
'hsts_incsub' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'hsts_sub' => array(
|
||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -118,7 +121,6 @@ return array(
|
||||
'value' => array()
|
||||
),
|
||||
'hsts_preload' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_preload']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_preload']['description'],
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -54,7 +54,7 @@ return array(
|
||||
'value' => $urlvalue
|
||||
),
|
||||
'redirectcode' => array(
|
||||
'visible' => ((Settings::Get('system.webserver') == 'apache2' && Settings::Get('customredirect.enabled') == '1') ? true : false),
|
||||
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||
'label' => $lng['domains']['redirectifpathisurl'],
|
||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||
'type' => 'select',
|
||||
@@ -81,16 +81,21 @@ return array(
|
||||
'label' => $lng['domain']['openbasedirpath'],
|
||||
'type' => 'select',
|
||||
'select_var' => $openbasedir
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => (((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) && $has_phpconfigs ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
)
|
||||
)
|
||||
),
|
||||
'section_bssl' => array(
|
||||
'title' => $lng['admin']['webserversettings_ssl'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? true : false,
|
||||
'visible' => Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (domainHasSslIpPort($result['id']) ? true : false) : false) : false,
|
||||
'fields' => array(
|
||||
'ssl_redirect' => array(
|
||||
'visible' => (Settings::Get('system.use_ssl') == '1' ? ($ssl_ipsandports != '' ? (domainHasSslIpPort($result['id']) ? true : false) : false) : false),
|
||||
'label' => $lng['domains']['ssl_redirect']['title'],
|
||||
'desc' => $lng['domains']['ssl_redirect']['description'] . ($result['temporary_ssl_redirect'] > 1 ? $lng['domains']['ssl_redirect_temporarilydisabled'] : ''),
|
||||
'type' => 'checkbox',
|
||||
@@ -100,7 +105,7 @@ return array(
|
||||
'value' => array($result['ssl_redirect'])
|
||||
),
|
||||
'letsencrypt' => array(
|
||||
'visible' => (Settings::Get('system.use_ssl') == '1' ? (Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? (domainHasSslIpPort($result['id']) ? true : false) : false) : false) : false),
|
||||
'visible' => Settings::Get('system.leenabled') == '1' ? true : false,
|
||||
'label' => $lng['customer']['letsencrypt']['title'],
|
||||
'desc' => $lng['customer']['letsencrypt']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -110,7 +115,6 @@ return array(
|
||||
'value' => array($result['letsencrypt'])
|
||||
),
|
||||
'hsts_maxage' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_maxage']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_maxage']['description'],
|
||||
'type' => 'int',
|
||||
@@ -118,8 +122,7 @@ return array(
|
||||
'int_max' => 94608000, // 3-years
|
||||
'value' => $result['hsts']
|
||||
),
|
||||
'hsts_incsub' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'hsts_sub' => array(
|
||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||
'type' => 'checkbox',
|
||||
@@ -129,7 +132,6 @@ return array(
|
||||
'value' => array($result['hsts_sub'])
|
||||
),
|
||||
'hsts_preload' => array(
|
||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||
'label' => $lng['admin']['domain_hsts_preload']['title'],
|
||||
'desc' => $lng['admin']['domain_hsts_preload']['description'],
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -275,13 +275,11 @@ function createDomainZone($domain_id, $froxlorhostname = false, $isMainButSubTo
|
||||
Database::pexecute($upd_stmt, array('serial' => $domain['bindserial'], 'id' => $domain['id']));
|
||||
}
|
||||
|
||||
$soa_content = $primary_ns . " " . escapeSoaAdminMail(Settings::Get('panel.adminmail')) . " (" . PHP_EOL;
|
||||
$soa_content .= $domain['bindserial'] . "\t; serial" . PHP_EOL;
|
||||
// PowerDNS does not like multi-line-format
|
||||
$soa_content = $primary_ns . " " . escapeSoaAdminMail(Settings::Get('panel.adminmail')) . " ";
|
||||
$soa_content .= $domain['bindserial'] . " ";
|
||||
// TODO for now, dummy time-periods
|
||||
$soa_content .= "1800\t; refresh (30 mins)" . PHP_EOL;
|
||||
$soa_content .= "900\t; retry (15 mins)" . PHP_EOL;
|
||||
$soa_content .= "604800\t; expire (7 days)" . PHP_EOL;
|
||||
$soa_content .= "1200\t)\t; minimum (20 mins)";
|
||||
$soa_content .= "3600 900 604800 1200";
|
||||
|
||||
$soa_record = new DnsEntry('@', 'SOA', $soa_content);
|
||||
array_unshift($zonerecords, $soa_record);
|
||||
|
||||
@@ -54,20 +54,8 @@ function generateDkimEntries($domain)
|
||||
// end-part
|
||||
$dkim_txt .= 't=s';
|
||||
|
||||
if (Settings::Get('system.dns_server') == 'pdns') {
|
||||
// PowerDNS does not need/want splitted content
|
||||
$txt_record_split = $dkim_txt;
|
||||
} else {
|
||||
// split if necessary
|
||||
$txt_record_split = '';
|
||||
$lbr = 50;
|
||||
for ($pos = 0; $pos <= strlen($dkim_txt) - 1; $pos += $lbr) {
|
||||
$txt_record_split .= (($pos == 0) ? '("' : "\t\t\t\t\t \"") . substr($dkim_txt, $pos, $lbr) . (($pos >= strlen($dkim_txt) - $lbr) ? '")' : '"') . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// dkim-entry
|
||||
$zone_dkim[] = $txt_record_split;
|
||||
$zone_dkim[] = $dkim_txt;
|
||||
|
||||
// adsp-entry
|
||||
if (Settings::Get('dkim.dkim_add_adsp') == "1") {
|
||||
|
||||
@@ -17,27 +17,57 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of found directories
|
||||
*
|
||||
* This function checks every found directory if they match either $uid or $gid, if they do
|
||||
* the found directory is valid. It uses recursive-iterators to find subdirectories.
|
||||
*
|
||||
* @param string $path the path to start searching in
|
||||
* @param int $uid the uid which must match the found directories
|
||||
* @param int $gid the gid which must match the found direcotries
|
||||
* @param string $path
|
||||
* the path to start searching in
|
||||
* @param int $uid
|
||||
* the uid which must match the found directories
|
||||
* @param int $gid
|
||||
* the gid which must match the found direcotries
|
||||
*
|
||||
* @return array Array of found valid paths
|
||||
*/
|
||||
function findDirs($path, $uid, $gid) {
|
||||
|
||||
$_fileList = array ();
|
||||
function findDirs($path, $uid, $gid)
|
||||
{
|
||||
$_fileList = array();
|
||||
$path = makeCorrectDir($path);
|
||||
|
||||
// valid directory?
|
||||
if (is_dir($path)) {
|
||||
|
||||
// Will exclude everything under these directories
|
||||
$exclude = array(
|
||||
'awstats',
|
||||
'webalizer'
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param SplFileInfo $file
|
||||
* @param mixed $key
|
||||
* @param RecursiveCallbackFilterIterator $iterator
|
||||
* @return bool True if you need to recurse or if the item is acceptable
|
||||
*/
|
||||
$filter = function ($file, $key, $iterator) use ($exclude) {
|
||||
if (in_array($file->getFilename(), $exclude)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// create RecursiveIteratorIterator
|
||||
$its = new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($path));
|
||||
$its = new RecursiveIteratorIterator(
|
||||
new RecursiveCallbackFilterIterator(
|
||||
new IgnorantRecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
$filter
|
||||
)
|
||||
);
|
||||
// we can limit the recursion-depth, but will it be helpful or
|
||||
// will people start asking "why do I only see 2 subdirectories, i want to use /a/b/c"
|
||||
// let's keep this in mind and see whether it will be useful
|
||||
@@ -50,24 +80,27 @@ function findDirs($path, $uid, $gid) {
|
||||
$_fileList[] = makeCorrectDir(dirname($fullFileName));
|
||||
}
|
||||
}
|
||||
$_fileList[] = $path;
|
||||
}
|
||||
|
||||
return array_unique($_fileList);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* If you use RecursiveDirectoryIterator with RecursiveIteratorIterator and run
|
||||
* into UnexpectedValueException you may use this little hack to ignore those
|
||||
* directories, such as lost+found on linux.
|
||||
* (User "antennen" @ http://php.net/manual/en/class.recursivedirectoryiterator.php#101654)
|
||||
**/
|
||||
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
||||
function getChildren() {
|
||||
try {
|
||||
return new IgnorantRecursiveDirectoryIterator($this->getPathname());
|
||||
} catch(UnexpectedValueException $e) {
|
||||
return new RecursiveArrayIterator(array());
|
||||
}
|
||||
}
|
||||
* If you use RecursiveDirectoryIterator with RecursiveIteratorIterator and run
|
||||
* into UnexpectedValueException you may use this little hack to ignore those
|
||||
* directories, such as lost+found on linux.
|
||||
* (User "antennen" @ http://php.net/manual/en/class.recursivedirectoryiterator.php#101654)
|
||||
*/
|
||||
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator
|
||||
{
|
||||
|
||||
function getChildren()
|
||||
{
|
||||
try {
|
||||
return new IgnorantRecursiveDirectoryIterator($this->getPathname());
|
||||
} catch (UnexpectedValueException $e) {
|
||||
return new RecursiveArrayIterator(array());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@
|
||||
*/
|
||||
function makeCorrectDir($dir) {
|
||||
|
||||
assert('is_string($dir) && strlen($dir) > 0 /* $dir does not look like an actual folder name */');
|
||||
if (version_compare("5.4.6", PHP_VERSION, ">")) {
|
||||
assert('is_string($dir) && strlen($dir) > 0 /* $dir does not look like an actual folder name */');
|
||||
} else {
|
||||
assert('is_string($dir) && strlen($dir) > 0', 'Value "' . $dir .'" does not look like an actual folder name');
|
||||
}
|
||||
|
||||
$dir = trim($dir);
|
||||
|
||||
|
||||
@@ -64,7 +64,12 @@ function makePathfield($path, $uid, $gid, $value = '', $dom = false) {
|
||||
$_field = '';
|
||||
foreach ($dirList as $key => $dir) {
|
||||
if (strpos($dir, $path) === 0) {
|
||||
$dir = makeCorrectDir(substr($dir, strlen($path)));
|
||||
$dir = substr($dir, strlen($path));
|
||||
// docroot cut off of current directory == empty -> directory is the docroot
|
||||
if (empty($dir)) {
|
||||
$dir = '/';
|
||||
}
|
||||
$dir = makeCorrectDir($dir);
|
||||
}
|
||||
$_field.= makeoption($dir, $dir, $value);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
$returnvalue = true;
|
||||
|
||||
|
||||
if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple')
|
||||
{
|
||||
$options = explode(',', $newfieldvalue);
|
||||
@@ -33,13 +33,16 @@ function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
$returnvalue = isset($fielddata['option_options'][$newfieldvalue]);
|
||||
}
|
||||
|
||||
|
||||
if($returnvalue === true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($fielddata['option_emptyallowed']) && $fielddata['option_emptyallowed']) {
|
||||
return true;
|
||||
}
|
||||
return 'not in option';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
|
||||
$newfieldvalue = '';
|
||||
$returnvalue = 'stringmustntbeempty';
|
||||
} else {
|
||||
$newfieldvalue = validate_ip2($newfieldvalue, true, true, true);
|
||||
$newfieldvalue = validate_ip2($newfieldvalue, true, 'invalidip', true, true, true);
|
||||
$returnvalue = ($newfieldvalue !== false ? true : 'invalidip');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) {
|
||||
if (empty($theme)) {
|
||||
$theme = "Sparkle";
|
||||
}
|
||||
// prevent possible file-path-disclosure
|
||||
$errfile = str_replace(FROXLOR_INSTALL_DIR, "", $errfile);
|
||||
// if we're not on the shell, output a nicer error-message
|
||||
$err_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$theme.'/misc/phperrornice.tpl');
|
||||
// replace values
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
/**
|
||||
* return an array of all enabled redirect-codes
|
||||
*
|
||||
*
|
||||
* @return array array of enabled redirect-codes
|
||||
*/
|
||||
function getRedirectCodesArray() {
|
||||
|
||||
|
||||
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
||||
$result_stmt = Database::query($sql);
|
||||
|
||||
@@ -35,13 +35,13 @@ function getRedirectCodesArray() {
|
||||
/**
|
||||
* return an array of all enabled redirect-codes
|
||||
* for the settings form
|
||||
*
|
||||
*
|
||||
* @return array array of enabled redirect-codes
|
||||
*/
|
||||
function getRedirectCodes() {
|
||||
|
||||
global $lng;
|
||||
|
||||
|
||||
$sql = "SELECT * FROM `".TABLE_PANEL_REDIRECTCODES."` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
||||
$result_stmt = Database::query($sql);
|
||||
|
||||
@@ -54,16 +54,17 @@ function getRedirectCodes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the redirect-code for a given
|
||||
* returns the redirect-code for a given
|
||||
* domain-id
|
||||
*
|
||||
*
|
||||
* @param integer $domainid id of the domain
|
||||
*
|
||||
* @param string $default
|
||||
*
|
||||
* @return string redirect-code
|
||||
*/
|
||||
function getDomainRedirectCode($domainid = 0) {
|
||||
function getDomainRedirectCode($domainid = 0, $default = '') {
|
||||
|
||||
$code = '';
|
||||
$code = $default;
|
||||
if ($domainid > 0) {
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
@@ -76,18 +77,18 @@ function getDomainRedirectCode($domainid = 0) {
|
||||
if (is_array($result)
|
||||
&& isset($result['redirect'])
|
||||
) {
|
||||
$code = ($result['redirect'] == '---') ? '' : $result['redirect'];
|
||||
$code = ($result['redirect'] == '---') ? $default : $result['redirect'];
|
||||
}
|
||||
}
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the redirect-id for a given
|
||||
* returns the redirect-id for a given
|
||||
* domain-id
|
||||
*
|
||||
*
|
||||
* @param integer $domainid id of the domain
|
||||
*
|
||||
*
|
||||
* @return integer redirect-code-id
|
||||
*/
|
||||
function getDomainRedirectId($domainid = 0) {
|
||||
@@ -112,10 +113,10 @@ function getDomainRedirectId($domainid = 0) {
|
||||
|
||||
/**
|
||||
* adds a redirectcode for a domain
|
||||
*
|
||||
*
|
||||
* @param integer $domainid id of the domain to add the code for
|
||||
* @param integer $redirect selected redirect-id
|
||||
*
|
||||
* @param integer $redirect selected redirect-id
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function addRedirectToDomain($domainid = 0, $redirect = 1) {
|
||||
@@ -130,10 +131,10 @@ function addRedirectToDomain($domainid = 0, $redirect = 1) {
|
||||
/**
|
||||
* updates the redirectcode of a domain
|
||||
* if redirect-code is false, nothing happens
|
||||
*
|
||||
*
|
||||
* @param integer $domainid id of the domain to update
|
||||
* @param integer $redirect selected redirect-id or false
|
||||
*
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function updateRedirectOfDomain($domainid = 0, $redirect = false) {
|
||||
|
||||
@@ -42,6 +42,8 @@ function dieWithMail($message, $subject = "[froxlor] Cronjob error") {
|
||||
$_mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$_mail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$mail->SMTPAutoTLS = false;
|
||||
}
|
||||
$_mail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
@@ -63,3 +63,15 @@ function standard_error($errors = '', $replacer = '') {
|
||||
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
||||
exit;
|
||||
}
|
||||
|
||||
function dynamic_error($message) {
|
||||
global $userinfo, $s, $header, $footer, $lng, $theme;
|
||||
$_SESSION['requestData'] = $_POST;
|
||||
$link = '';
|
||||
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) {
|
||||
$link = '<a href="'.htmlentities($_SERVER['HTTP_REFERER']).'">'.$lng['panel']['back'].'</a>';
|
||||
}
|
||||
$error = $message;
|
||||
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -20,27 +20,22 @@
|
||||
/**
|
||||
* Returns Array, whose elements have been checked whether thay are empty or not
|
||||
*
|
||||
* @param array The array to trim
|
||||
* @param array $source
|
||||
* The array to trim
|
||||
* @return array The trim'med array
|
||||
* @author Florian Lippert <flo@syscp.org>
|
||||
*/
|
||||
|
||||
function array_trim($source)
|
||||
{
|
||||
$returnval = array();
|
||||
|
||||
if(is_array($source))
|
||||
{
|
||||
while(list($var, $val) = each($source))
|
||||
{
|
||||
if($val != ' '
|
||||
&& $val != '')$returnval[$var] = $val;
|
||||
if (is_array($source)) {
|
||||
foreach ($source as $var => $val) {
|
||||
if ($val != ' ' && $val != '') {
|
||||
$returnval[$var] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$returnval = $source;
|
||||
}
|
||||
|
||||
return $returnval;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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 Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingClearCertificates($fieldname, $fielddata, $newfieldvalue) {
|
||||
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if ($returnvalue !== false
|
||||
&& is_array($fielddata)
|
||||
&& isset($fielddata['settinggroup'])
|
||||
&& $fielddata['settinggroup'] == 'system'
|
||||
&& isset($fielddata['varname'])
|
||||
&& $fielddata['varname'] == 'le_froxlor_enabled'
|
||||
&& $newfieldvalue == '0'
|
||||
) {
|
||||
Database::query("
|
||||
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
||||
");
|
||||
}
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
@@ -16,33 +16,36 @@
|
||||
* @package Functions
|
||||
*
|
||||
*/
|
||||
|
||||
function storeSettingMysqlAccessHost($fieldname, $fielddata, $newfieldvalue)
|
||||
{
|
||||
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||
|
||||
if($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'mysql_access_host')
|
||||
{
|
||||
if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'system' && isset($fielddata['varname']) && $fielddata['varname'] == 'mysql_access_host') {
|
||||
$mysql_access_host_array = array_map('trim', explode(',', $newfieldvalue));
|
||||
|
||||
if(in_array('127.0.0.1', $mysql_access_host_array)
|
||||
&& !in_array('localhost', $mysql_access_host_array))
|
||||
{
|
||||
if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) {
|
||||
$mysql_access_host_array[] = 'localhost';
|
||||
}
|
||||
|
||||
if(!in_array('127.0.0.1', $mysql_access_host_array)
|
||||
&& in_array('localhost', $mysql_access_host_array))
|
||||
{
|
||||
if (! in_array('127.0.0.1', $mysql_access_host_array) && in_array('localhost', $mysql_access_host_array)) {
|
||||
$mysql_access_host_array[] = '127.0.0.1';
|
||||
}
|
||||
|
||||
// be aware that ipv6 addresses are enclosed in [ ] when passed here
|
||||
$mysql_access_host_array = array_map('cleanMySQLAccessHost', $mysql_access_host_array);
|
||||
|
||||
$mysql_access_host_array = array_unique(array_trim($mysql_access_host_array));
|
||||
$newfieldvalue = implode(',', $mysql_access_host_array);
|
||||
correctMysqlUsers($mysql_access_host_array);
|
||||
}
|
||||
|
||||
|
||||
return $returnvalue;
|
||||
}
|
||||
|
||||
?>
|
||||
function cleanMySQLAccessHost($value)
|
||||
{
|
||||
if (substr($value, 0, 1) == '[' && substr($value, - 1) == ']') {
|
||||
return substr($value, 1, - 1);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
@@ -21,40 +21,43 @@
|
||||
* to a line for a open_basedir directive
|
||||
*
|
||||
* @param string $path
|
||||
* the path to check and append
|
||||
* the path to check and append
|
||||
* @param boolean $first
|
||||
* if true, no ':' will be prefixed to the path
|
||||
*
|
||||
* if true, no ':' will be prefixed to the path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function appendOpenBasedirPath($path = '', $first = false)
|
||||
{
|
||||
if ($path != '' && $path != '/'
|
||||
&& (! preg_match("#^/dev#i", $path) || preg_match("#^/dev/urandom#i", $path))
|
||||
&& ! preg_match("#^/proc#i", $path)
|
||||
&& ! preg_match("#^/etc#i", $path)
|
||||
&& ! preg_match("#^/sys#i", $path)
|
||||
&& ! preg_match("#:#", $path)
|
||||
) {
|
||||
|
||||
$path = makeCorrectDir($path);
|
||||
|
||||
// check for php-version that requires the trailing
|
||||
// slash to be removed as it does not allow the usage
|
||||
// of the subfolders within the given folder, fixes #797
|
||||
if ((PHP_MINOR_VERSION == 2 && PHP_VERSION_ID >= 50216) || PHP_VERSION_ID >= 50304) {
|
||||
// check trailing slash
|
||||
if (substr($path, - 1, 1) == '/') {
|
||||
// remove it
|
||||
$path = substr($path, 0, - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($first) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
return ':' . $path;
|
||||
}
|
||||
return '';
|
||||
if ($path != '' && $path != '/' &&
|
||||
(! preg_match("#^/dev#i", $path) || preg_match("#^/dev/urandom#i", $path))
|
||||
&& ! preg_match("#^/proc#i", $path)
|
||||
&& ! preg_match("#^/etc#i", $path)
|
||||
&& ! preg_match("#^/sys#i", $path)
|
||||
&& ! preg_match("#:#", $path)) {
|
||||
|
||||
if (preg_match("#^/dev/urandom#i", $path)) {
|
||||
$path = makeCorrectFile($path);
|
||||
} else {
|
||||
$path = makeCorrectDir($path);
|
||||
}
|
||||
|
||||
// check for php-version that requires the trailing
|
||||
// slash to be removed as it does not allow the usage
|
||||
// of the subfolders within the given folder, fixes #797
|
||||
if ((PHP_MINOR_VERSION == 2 && PHP_VERSION_ID >= 50216) || PHP_VERSION_ID >= 50304) {
|
||||
// check trailing slash
|
||||
if (substr($path, - 1, 1) == '/') {
|
||||
// remove it
|
||||
$path = substr($path, 0, - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($first) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
return ':' . $path;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -37,7 +37,11 @@ function validateUrl($url) {
|
||||
}
|
||||
|
||||
// needs converting
|
||||
$url = $idna_convert->encode($url);
|
||||
try {
|
||||
$url = $idna_convert->encode($url);
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$pattern = "/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(\:[0-9]+)?\/?(.+)?$/i";
|
||||
if (preg_match($pattern, $url)) {
|
||||
|
||||
@@ -49,23 +49,43 @@ function validate_ip($ip, $return_bool = false, $lng = 'invalidip') {
|
||||
* @param string $lng index for error-message (if $return_bool is false)
|
||||
* @param bool $allow_localhost whether to allow 127.0.0.1
|
||||
* @param bool $allow_priv whether to allow private network addresses
|
||||
* @param bool $allow_cidr whether to allow CIDR values e.g. 10.10.10.10/16
|
||||
*
|
||||
* @return string|bool ip address on success, false on failure
|
||||
*/
|
||||
function validate_ip2($ip, $return_bool = false, $lng = 'invalidip', $allow_localhost = false, $allow_priv = false) {
|
||||
function validate_ip2($ip, $return_bool = false, $lng = 'invalidip', $allow_localhost = false, $allow_priv = false, $allow_cidr = false) {
|
||||
|
||||
$filter_lan = $allow_priv ? FILTER_FLAG_NO_RES_RANGE : (FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE);
|
||||
$cidr = "";
|
||||
if ($allow_cidr) {
|
||||
$org_ip = $ip;
|
||||
$ip_cidr = explode("/", $ip);
|
||||
if (count($ip_cidr) == 2) {
|
||||
$ip = $ip_cidr[0];
|
||||
$cidr = "/".$ip_cidr[1];
|
||||
} else {
|
||||
$ip = $org_ip;
|
||||
}
|
||||
} elseif (strpos($ip, "/") !== false) {
|
||||
if ($return_bool) {
|
||||
return false;
|
||||
} else {
|
||||
standard_error($lng, $ip);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
$filter_lan = $allow_priv ? FILTER_FLAG_NO_RES_RANGE : (FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE);
|
||||
|
||||
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_lan)
|
||||
) {
|
||||
return $ip;
|
||||
return $ip.$cidr;
|
||||
}
|
||||
|
||||
// special case where localhost ip is allowed (mysql-access-hosts for example)
|
||||
if ($allow_localhost && $ip == '127.0.0.1') {
|
||||
return $ip;
|
||||
return $ip.$cidr;
|
||||
}
|
||||
|
||||
if ($return_bool) {
|
||||
|
||||
@@ -156,7 +156,8 @@ if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$in = array(&$_GET, &$_POST, &$_COOKIE);
|
||||
|
||||
while (list($k, $v) = each($in)) {
|
||||
$_in = $in;
|
||||
foreach ($_in as $k => $v) {
|
||||
foreach ($v as $key => $val) {
|
||||
if (!is_array($val)) {
|
||||
$in[$k][$key] = stripslashes($val);
|
||||
@@ -563,6 +564,8 @@ if (Settings::Get('system.mail_use_smtp')) {
|
||||
$mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$mail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$mail->SMTPAutoTLS = false;
|
||||
}
|
||||
$mail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
@@ -279,6 +279,12 @@ return array(
|
||||
'label' => $lng['menue']['phpsettings']['maintitle'],
|
||||
'show_element' => (Settings::Get('system.mod_fcgid') == true || Settings::Get('phpfpm.enabled') == true)
|
||||
),
|
||||
array(
|
||||
'url' => 'admin_phpsettings.php?page=fpmdaemons',
|
||||
'label' => $lng['menue']['phpsettings']['fpmdaemons'],
|
||||
'required_resources' => 'change_serversettings',
|
||||
'show_element' => Settings::Get('phpfpm.enabled') == true
|
||||
),
|
||||
array(
|
||||
'url' => 'admin_settings.php?page=phpinfo',
|
||||
'label' => $lng['admin']['phpinfo'],
|
||||
@@ -313,6 +319,10 @@ return array(
|
||||
array(
|
||||
'url' => 'admin_message.php?page=message',
|
||||
'label' => $lng['admin']['message']
|
||||
),
|
||||
array(
|
||||
'url' => 'admin_settings.php?page=testmail',
|
||||
'label' => $lng['admin']['testmail']
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -51,5 +51,6 @@ define('TABLE_PANEL_DOMAINREDIRECTS', 'domain_redirect_codes');
|
||||
define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
|
||||
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
|
||||
define('TABLE_DOMAIN_DNS', 'domain_dns_entries');
|
||||
define('TABLE_PANEL_FPMDAEMONS', 'panel_fpmdaemons');
|
||||
|
||||
require dirname(__FILE__).'/version.inc.php';
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
*/
|
||||
|
||||
// Main version variable
|
||||
$version = '0.9.38-rc1';
|
||||
$version = '0.9.39';
|
||||
|
||||
// Database version (YYYYMMDDC where C is a daily counter)
|
||||
$dbversion = '201610070';
|
||||
$dbversion = '201801260';
|
||||
|
||||
// Distribution branding-tag (used for Debian etc.)
|
||||
$branding = '';
|
||||
|
||||
@@ -1031,7 +1031,7 @@ $lng['dkim']['dkim_notes']['description'] = 'Notities die van belang kunnen zijn
|
||||
$lng['dkim']['dkim_add_adsp']['title'] = 'DKIM ADSP toevoegen';
|
||||
$lng['dkim']['dkim_add_adsp']['description'] = 'Indien u niet weet wat dit is, laat het op "actief" staan.';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['title'] = 'ADSP beleid';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Voor meer informatie inzake deze instelling zie <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/En-dkim-adsp-policies">DKIM ADSP policies</a>';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Voor meer informatie inzake deze instelling zie <a target="blank" href="https://en.wikipedia.org/wiki/Author_Domain_Signing_Practices">DKIM ADSP policies</a>';
|
||||
|
||||
$lng['admin']['cron']['cronsettings'] = 'Instellingen cron-taken';
|
||||
$lng['cron']['cronname'] = 'naam cron-taak';
|
||||
@@ -1146,7 +1146,7 @@ $lng['serversettings']['perl_path']['description'] = 'Alleen relevant voor light
|
||||
// ADDED IN FROXLOR 0.9.12-svn1
|
||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'FCGID inschakelen voor de VHost voor Froxlor';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Indien ingeschakeld wordt Froxlor ook uitgevoerd onder een lokale gebruiker<br /><strong>Let op:</strong>Dit vereist handmatige configuratie, zie <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_fcgid">FCGID - handbook</a>';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Indien ingeschakeld wordt Froxlor ook uitgevoerd onder een lokale gebruiker<br /><strong>Let op:</strong>Dit vereist handmatige configuratie, zie <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-fcgid">FCGID - handbook</a>';
|
||||
$lng['admin']['mod_fcgid_user'] = 'Lokale gebruiker voor FCGID (Froxlor vhost)';
|
||||
$lng['admin']['mod_fcgid_group'] = 'Lokale groep voor FCGID (Froxlor vhost)';
|
||||
|
||||
|
||||
@@ -534,7 +534,7 @@ $lng['panel']['back'] = 'Back';
|
||||
// ADDED IN 1.2.16-svn12
|
||||
|
||||
$lng['serversettings']['mod_fcgid']['title'] = 'Enable FCGID';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'Use this to run PHP with the corresponding useraccount.<br /><br /><b>This needs a special webserver configuration for Apache, see <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_fcgid">FCGID - handbook</a></b>';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'Use this to run PHP with the corresponding useraccount.<br /><br /><b>This needs a special webserver configuration for Apache, see <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-fcgid">FCGID - handbook</a></b>';
|
||||
$lng['serversettings']['sendalternativemail']['title'] = 'Use alternative email-address';
|
||||
$lng['serversettings']['sendalternativemail']['description'] = 'Send the password-email to a different address during email-account-creation';
|
||||
$lng['emails']['alternative_emailaddress'] = 'Alternative e-mail-address';
|
||||
@@ -940,6 +940,7 @@ $lng['admin']['phpsettings']['phpinisettings'] = 'php.ini settings';
|
||||
$lng['error']['nopermissionsorinvalidid'] = 'You don\'t have enough permissions to change these settings or an invalid id was given.';
|
||||
$lng['panel']['view'] = 'view';
|
||||
$lng['question']['phpsetting_reallydelete'] = 'Do you really want to delete these settings? All domains which use these settings currently will be changed to the default config.';
|
||||
$lng['question']['fpmsetting_reallydelete'] = 'Do you really want to delete these php-fpm settings? All php configurations which use these settings currently will be changed to the default config.';
|
||||
$lng['admin']['phpsettings']['addnew'] = 'Create new settings';
|
||||
$lng['error']['phpsettingidwrong'] = 'A PHP Configuration with this id doesn\'t exist';
|
||||
$lng['error']['descriptioninvalid'] = 'The description is too short, too long or contains illegal characters.';
|
||||
@@ -1001,6 +1002,7 @@ $lng['error']['ipportdoesntexist'] = 'The ip/port combination you have chosen do
|
||||
|
||||
$lng['admin']['phpserversettings'] = 'PHP Settings';
|
||||
$lng['admin']['phpsettings']['binary'] = 'PHP Binary';
|
||||
$lng['admin']['phpsettings']['fpmdesc'] = 'PHP-FPM config';
|
||||
$lng['admin']['phpsettings']['file_extensions'] = 'File extensions';
|
||||
$lng['admin']['phpsettings']['file_extensions_note'] = '(without dot, separated by spaces)';
|
||||
$lng['admin']['mod_fcgid_maxrequests']['title'] = 'Maximum php requests for this domain (empty for default value)';
|
||||
@@ -1102,7 +1104,7 @@ $lng['dkim']['dkim_notes']['description'] = 'Notes that might be of interest to
|
||||
$lng['dkim']['dkim_add_adsp']['title'] = 'Add DKIM ADSP entry';
|
||||
$lng['dkim']['dkim_add_adsp']['description'] = 'If you don\'t know what this is, leave it "enabled"';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['title'] = 'ADSP policy';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'For more information about this setting see <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/En-dkim-adsp-policies">DKIM ADSP policies</a>';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'For more information about this setting see <a target="blank" href="https://en.wikipedia.org/wiki/Author_Domain_Signing_Practices">DKIM ADSP policies</a>';
|
||||
|
||||
$lng['admin']['cron']['cronsettings'] = 'Cronjob settings';
|
||||
$lng['cron']['cronname'] = 'cronjob-name';
|
||||
@@ -1293,7 +1295,7 @@ $lng['error']['intvaluetoolow'] = 'The given number is too low (field %s)';
|
||||
$lng['error']['intvaluetoohigh'] = 'The given number is too high (field %s)';
|
||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||
$lng['serversettings']['phpfpm']['title'] = 'Enable php-fpm';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>This needs a special webserver configuration see FPM-handbook for <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_phpfpm">Apache2</a> or <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookNginx_phpfpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>This needs a special webserver configuration see FPM-handbook for <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-php-fpm">Apache2</a> or <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/nginx-with-php-fpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm_settings']['configdir'] = 'Configuration directory of php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configuration Alias-directory of php-fpm';
|
||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'php-fpm restart command';
|
||||
@@ -1656,7 +1658,7 @@ $lng['traffic']['mail'] = 'Mail (MiB)';
|
||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle Timeout';
|
||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['description'] = 'Timeout setting for Mod FastCGI.';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['title'] = 'Idle Timeout';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] = 'Timeout setting for PHP5 FPM FastCGI.';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] = 'Timeout setting for PHP FPM FastCGI.';
|
||||
|
||||
// ADDED IN 0.9.27-svn2
|
||||
$lng['panel']['cancel'] = 'Cancel';
|
||||
@@ -1826,7 +1828,7 @@ $lng['serversettings']['panel_password_special_char_required']['description'] =
|
||||
$lng['serversettings']['panel_password_special_char']['title'] = 'Special characters list';
|
||||
$lng['serversettings']['panel_password_special_char']['description'] = 'One of these characters is required if the above option is set.';
|
||||
$lng['phpfpm']['use_mod_proxy']['title'] = 'Use mod_proxy / mod_proxy_fcgi';
|
||||
$lng['phpfpm']['use_mod_proxy']['description'] = 'Activate to use php-fpm via mod_proxy_fcgi. Requires at least apache-2.4.9';
|
||||
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Must be enabled when using Debian 9.x (Stretch)</strong>. Activate to use php-fpm via mod_proxy_fcgi. Requires at least apache-2.4.9';
|
||||
$lng['error']['no_phpinfo'] = 'Sorry, unable to read phpinfo()';
|
||||
|
||||
$lng['admin']['movetoadmin'] = 'Move customer';
|
||||
@@ -1840,16 +1842,16 @@ $lng['domains']['import_file'] = 'CSV-File';
|
||||
$lng['success']['domain_import_successfully'] = 'Successfully imported %s domains.';
|
||||
$lng['error']['domain_import_error'] = 'Following error occurred while importing domains: %s';
|
||||
$lng['admin']['note'] = 'Note';
|
||||
$lng['domains']['import_description'] = 'Detailed information about the structure of the import-file and how to import successfully, please visit <a href="http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc" target="_blank">http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc</a>';
|
||||
$lng['domains']['import_description'] = 'Detailed information about the structure of the import-file and how to import successfully, please visit <a href="https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation" target="_blank">https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation</a>';
|
||||
$lng['usersettings']['custom_notes']['title'] = 'Custom notes';
|
||||
$lng['usersettings']['custom_notes']['description'] = 'Feel free to put any notes you want/need in here. They will show up in the admin/customer overview for the corresponding user.';
|
||||
$lng['usersettings']['custom_notes']['show'] = 'Show your notes on the dashboard of the user';
|
||||
$lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID and PHP-FPM cannot be activated at the same time';
|
||||
|
||||
// Added in Froxlor 0.9.34
|
||||
$lng['admin']['configfiles']['legend'] = 'You are about to configure a service/daemon. The following legend explains the nomenclature.';
|
||||
$lng['admin']['configfiles']['legend'] = '<h3>You are about to configure a service/daemon</h3>';
|
||||
$lng['admin']['configfiles']['commands'] = '<span class="red">Commands:</span> These commands are to be executed line by line as root-user in a shell. It is safe to copy the whole block and paste it into the shell.';
|
||||
$lng['admin']['configfiles']['files'] = '<span class="red">Configfiles:</span> This is an example of the contents of a configuration file. The commands before these textfields should open an editor with the target file. Just copy and paste the contents into the editor and save the file.<br><br><span class="red">Please note:</span> The MySQL-password has not been replaced for security reasons. Please replace "MYSQL_PASSWORD" on your own. If you forgot your MySQL-password you\'ll find it in "lib/userdata.inc.php"';
|
||||
$lng['admin']['configfiles']['files'] = '<span class="red">Configfiles:</span> The commands before the textfields should open an editor with the target file. Just copy and paste the contents into the editor and save the file.<br><span class="red">Please note:</span> The MySQL-password has not been replaced for security reasons. Please replace "FROXLOR_MYSQL_PASSWORD" on your own or use the javascript form below to replace it on-site. If you forgot your MySQL-password you\'ll find it in "lib/userdata.inc.php"';
|
||||
$lng['serversettings']['apache_itksupport']['title'] = 'Use modifications for Apache ITK-MPM';
|
||||
$lng['serversettings']['apache_itksupport']['description'] = '<strong class="red">ATTENTION:</strong> use only if you acutally have apache itk-mpm enabled<br />otherwise your webserver will not be able to start';
|
||||
$lng['integrity_check']['DatabaseCharset'] = 'Characterset of database (should be UTF-8)';
|
||||
@@ -1938,7 +1940,7 @@ $lng['admin']['letsencrypt']['description'] = 'Get a free certificate from <a hr
|
||||
$lng['customer']['letsencrypt']['title'] = 'Use Let\'s Encrypt';
|
||||
$lng['customer']['letsencrypt']['description'] = 'Get a free certificate from <a href="https://letsencrypt.org">Let\'s Encrypt</a>. The certificate will be created and renewed automatically.<br><strong class="red">ATTENTION:</strong> This feature is still in beta.';
|
||||
$lng['error']['sslredirectonlypossiblewithsslipport'] = 'Using Let\'s Encrypt is only possible when the domain has at least one ssl-enabled IP/port combination assigned.';
|
||||
$lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt cannot (yet) handle wildcard-domains. Please set the ServerAlias to WWW or disable it completely';
|
||||
$lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt cannot handle wildcard-domains using ACME v1. Please set the ServerAlias to WWW or disable it completely';
|
||||
$lng['panel']['letsencrypt'] = 'Using Let\'s encrypt';
|
||||
$lng['crondesc']['cron_letsencrypt'] = 'updating Let\'s Encrypt certificates';
|
||||
$lng['serversettings']['letsencryptca']['title'] = "Let's Encrypt environment";
|
||||
@@ -1972,7 +1974,7 @@ $lng['error']['autoupdate_9'] = 'The downloaded file did not pass the integrity
|
||||
|
||||
$lng['admin']['server_php'] = 'PHP';
|
||||
$lng['domains']['termination_date'] = 'Date of termination';
|
||||
$lng['domains']['termination_date_overview'] = 'canceled until ';
|
||||
$lng['domains']['termination_date_overview'] = 'terminated as of ';
|
||||
$lng['panel']['set'] = 'Apply';
|
||||
$lng['customer']['selectserveralias_addinfo'] = 'This option can be set when editing the domain. Its initial value is inherited from the parent-domain.';
|
||||
$lng['error']['mailaccistobedeleted'] = "Another account with the same name (%s) is currently being deleted and can therefore not be added at this moment.";
|
||||
@@ -2038,8 +2040,8 @@ $lng['serversettings']['le_froxlor_enabled']['description'] = "If activated, the
|
||||
$lng['serversettings']['le_froxlor_redirect']['title'] = "Enable SSL-redirect for the froxlor vhost";
|
||||
$lng['serversettings']['le_froxlor_redirect']['description'] = "If activated, all http requests to your froxlor will be redirected to the corresponding SSL site.";
|
||||
$lng['admin']['froxlorvhost'] = 'Froxlor VirtualHost settings';
|
||||
$lng['serversettings']['option_unavailable_websrv'] = '<br><em class="red">Availble only for: %s</em>';
|
||||
$lng['serversettings']['option_unavailable'] = '<br><em class="red">Option not availble due to other settings.</em>';
|
||||
$lng['serversettings']['option_unavailable_websrv'] = '<br><em class="red">Available only for: %s</em>';
|
||||
$lng['serversettings']['option_unavailable'] = '<br><em class="red">Option not available due to other settings.</em>';
|
||||
$lng['serversettings']['letsencryptacmeconf']['title'] = "Path to the acme.conf snippet";
|
||||
$lng['serversettings']['letsencryptacmeconf']['description'] = "File name of the config snippet which allows the web server to serve the acme challenge.";
|
||||
$lng['admin']['hostname'] = 'Hostname';
|
||||
@@ -2061,4 +2063,44 @@ $lng['admin']['domain_hsts_maxage']['description'] = 'Specify the max-age value
|
||||
$lng['admin']['domain_hsts_incsub']['title'] = 'Include HSTS for any subdomain';
|
||||
$lng['admin']['domain_hsts_incsub']['description'] = 'The optional "includeSubDomains" directive, if present, signals the UA that the HSTS Policy applies to this HSTS Host as well as any subdomains of the host\'s domain name.';
|
||||
$lng['admin']['domain_hsts_preload']['title'] = 'Include domain in <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload list</a>';
|
||||
$lng['admin']['domain_hsts_preload']['description'] = 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> before sending the header with "preload".';
|
||||
$lng['admin']['domain_hsts_preload']['description'] = 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="https://hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> before sending the header with "preload".';
|
||||
|
||||
$lng['serversettings']['http2_support']['title'] = 'HTTP2 Support';
|
||||
$lng['serversettings']['http2_support']['description'] = 'enable HTTP2 support for ssl.<br><em class="red">ENABLE ONLY IF YOUR WEBSERVER SUPPORTS THIS FEATURE (nginx version 1.9.5+, apache2 version 2.4.17+)</em>';
|
||||
|
||||
$lng['error']['noipportgiven'] = 'No IP/port given';
|
||||
|
||||
// Added in froxlor 0.9.38.8
|
||||
$lng['admin']['domain_ocsp_stapling']['title'] = 'OCSP stapling';
|
||||
$lng['admin']['domain_ocsp_stapling']['description'] = 'See <a target="_blank" href="https://en.wikipedia.org/wiki/OCSP_stapling">Wikipedia</a> for a detailed explanation of OCSP stapling';
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] = '<br /><strong class="red">WARNING:</strong> Nginx version 1.3.7 or above is required for OCSP stapling. If your version is older, the webserver will NOT start correctly while OCSP stapling is enabled!';
|
||||
$lng['serversettings']['ssl']['apache24_ocsp_cache_path']['title'] = 'Apache 2.4: path to the OCSP stapling cache';
|
||||
$lng['serversettings']['ssl']['apache24_ocsp_cache_path']['description'] = 'Configures the cache used to store OCSP responses which get included in TLS handshakes.';
|
||||
$lng['serversettings']['nssextrausers']['title'] = 'Use libnss-extrausers instead of libnss-mysql';
|
||||
$lng['serversettings']['nssextrausers']['description'] = 'Do not read users from the database but from files. Please only activate if you have already gone through the required configuration steps (system -> libnss-extrausers).<br><strong class="red">For Debian/Ubuntu only (or if you have compiled libnss-extrausers yourself!)</strong>';
|
||||
$lng['admin']['domain_http2']['title'] = 'HTTP2 support';
|
||||
$lng['admin']['domain_http2']['description'] = 'See <a target="_blank" href="https://en.wikipedia.org/wiki/HTTP/2">Wikipedia</a> for a detailed explanation of HTTP2';
|
||||
$lng['admin']['testmail'] = 'SMTP test';
|
||||
$lng['success']['testmailsent'] = 'Test mail sent successfully';
|
||||
$lng['serversettings']['disable_le_selfcheck']['title'] = "Disable Let's Encrypt local self-check";
|
||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "If activated, froxlor will <strong>not</strong> perform its self-check for token accessability. Needed for NATed IP's or similar.";
|
||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM versions';
|
||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In use for php-config(s)';
|
||||
$lng['admin']['phpsettingsforsubdomains'] = 'Apply php-config to all subdomains:';
|
||||
$lng['serversettings']['phpsettingsforsubdomains']['description'] = 'If yes the chosen php-config will be updated to all subdomains';
|
||||
$lng['serversettings']['leapiversion']['title'] = "Chose Let's Encrypt ACME implementation";
|
||||
$lng['serversettings']['leapiversion']['description'] = "Chose between ACME v1 and ACME v2 implementation for Let's Encrypt.";
|
||||
$lng['error']['nowildcardwithletsencryptv2'] = 'Let\'s Encrypt can only validate wildcard-domains by DNS with ACME v2, sorry. Please set the ServerAlias to WWW or disable it completely';
|
||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Add "-pass-header Authorization" / "CGIPassAuth On" to vhosts';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'Configure the TLS protocol version';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'This is a list of ssl protocols that you want (or don\'t want) to use when using SSL. <b>Notice:</b> Some older browsers may not support the newest protcol versions.<br /><br /><b>Default value is:</b><pre>TLSv1, TLSv1.2</pre>';
|
||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Allowed extensions';
|
||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Limits the extensions of the main script FPM will allow to parse. This can prevent configuration mistakes on the web server side. You should only limit FPM to .php extensions to prevent malicious users to use other extensions to execute php code. Default value: .php';
|
||||
$lng['phpfpm']['ini_flags'] = 'Enter possible <strong>php_flag</strong>s for php.ini. One entry per line';
|
||||
$lng['phpfpm']['ini_values'] = 'Enter possible <strong>php_value</strong>s for php.ini. One entry per line';
|
||||
$lng['phpfpm']['ini_admin_flags'] = 'Enter possible <strong>php_admin_flag</strong>s for php.ini. One entry per line';
|
||||
$lng['phpfpm']['ini_admin_values'] = 'Enter possible <strong>php_admin_value</strong>s for php.ini. One entry per line';
|
||||
$lng['serversettings']['phpfpm_settings']['envpath'] = 'Paths to add to the PATH environment. Leave empty for no PATH environment variable';
|
||||
$lng['admin']['configfiles']['importexport'] = 'Import/Export';
|
||||
$lng['success']['settingsimported'] = 'Settings imported successfully';
|
||||
$lng['error']['jsonextensionnotfound'] = 'This feature requires the php json-extension.';
|
||||
|
||||
@@ -569,18 +569,18 @@ $lng['serversettings']['webalizer_quiet']['description'] = 'Verbosité du progra
|
||||
|
||||
$lng['ticket']['admin_email'] = 'root@localhost';
|
||||
$lng['ticket']['noreply_email'] = 'billets@froxlor';
|
||||
$lng['admin']['ticketsystem'] = 'Système de billets';
|
||||
$lng['menue']['ticket']['ticket'] = 'Billets de support';
|
||||
$lng['admin']['ticketsystem'] = 'Système de tickets';
|
||||
$lng['menue']['ticket']['ticket'] = 'Tickets support';
|
||||
$lng['menue']['ticket']['categories'] = 'Catégories de support';
|
||||
$lng['menue']['ticket']['archive'] = 'Archives de billets';
|
||||
$lng['menue']['ticket']['archive'] = 'Archives de tickets';
|
||||
$lng['ticket']['description'] = 'Entrez une description !';
|
||||
$lng['ticket']['ticket_new'] = 'Ouvrir un nouveau billet';
|
||||
$lng['ticket']['ticket_reply'] = 'Réponse au billet';
|
||||
$lng['ticket']['ticket_reopen'] = 'Réouvrir le billet';
|
||||
$lng['ticket']['ticket_new'] = 'Ouvrir un nouveau ticket';
|
||||
$lng['ticket']['ticket_reply'] = 'Réponse au ticket';
|
||||
$lng['ticket']['ticket_reopen'] = 'Réouvrir le ticket';
|
||||
$lng['ticket']['ticket_newcateory'] = 'Créer une nouvelle catégorie';
|
||||
$lng['ticket']['ticket_editcateory'] = 'Editer la catégorie';
|
||||
$lng['ticket']['ticket_view'] = 'Voir l\'historique du billet';
|
||||
$lng['ticket']['ticketcount'] = 'Billets';
|
||||
$lng['ticket']['ticket_view'] = 'Voir l\'historique du ticket';
|
||||
$lng['ticket']['ticketcount'] = 'Tickets';
|
||||
$lng['ticket']['ticket_answers'] = 'Réponses';
|
||||
// $lng['ticket']['lastchange'] = 'Dernière action';
|
||||
$lng['ticket']['lastchange'] = 'Dernier changement';
|
||||
@@ -601,8 +601,8 @@ $lng['ticket']['answer'] = 'Répondre';
|
||||
$lng['ticket']['close'] = 'Fermer';
|
||||
$lng['ticket']['reopen'] = 'Réouvrir';
|
||||
$lng['ticket']['archive'] = 'Archive';
|
||||
$lng['ticket']['ticket_delete'] = 'Effacer le billet';
|
||||
$lng['ticket']['lastarchived'] = 'Billets récemment archivés';
|
||||
$lng['ticket']['ticket_delete'] = 'Effacer le ticket';
|
||||
$lng['ticket']['lastarchived'] = 'Tickets récemment archivés';
|
||||
$lng['ticket']['archivedtime'] = 'Archivé';
|
||||
$lng['ticket']['open'] = 'Ouvert';
|
||||
$lng['ticket']['wait_reply'] = 'Attente d\'une réponse';
|
||||
@@ -610,43 +610,43 @@ $lng['ticket']['replied'] = 'Répondu';
|
||||
$lng['ticket']['closed'] = 'Fermé';
|
||||
$lng['ticket']['staff'] = 'L\'équipe';
|
||||
$lng['ticket']['customer'] = 'Client';
|
||||
$lng['ticket']['old_tickets'] = 'Messages du billet';
|
||||
$lng['ticket']['old_tickets'] = 'Messages du ticket';
|
||||
$lng['ticket']['search'] = 'Rechercher dans les archives';
|
||||
$lng['ticket']['nocustomer'] = 'Aucun choix';
|
||||
$lng['ticket']['archivesearch'] = 'Résultat de la recherche dans les archives';
|
||||
$lng['ticket']['noresults'] = 'Aucun billet trouvé';
|
||||
$lng['ticket']['notmorethanxopentickets'] = 'Pour éviter les abus, vous ne pouvez avoir plus de %s billets ouverts';
|
||||
$lng['ticket']['noresults'] = 'Aucun ticket trouvé';
|
||||
$lng['ticket']['notmorethanxopentickets'] = 'Pour éviter les abus, vous ne pouvez avoir plus de %s tickets ouverts';
|
||||
$lng['ticket']['supportstatus'] = 'Etat du support';
|
||||
$lng['ticket']['supportavailable'] = '<span class="ticket_low">Nos équipes de support sont disponibles et prètes à vous assister.</span>';
|
||||
$lng['ticket']['supportnotavailable'] = '<span class="ticket_high">Nos équipes de support ne sont actuellement pas disponibles.</span>';
|
||||
$lng['admin']['templates']['ticket'] = 'E-mail de notification pour les billets de support';
|
||||
$lng['admin']['templates']['SUBJECT'] = 'Sera remplacé par le sujet du billet de support.';
|
||||
$lng['admin']['templates']['new_ticket_for_customer'] = 'Informe le client que le billet a été envoyé';
|
||||
$lng['admin']['templates']['new_ticket_by_customer'] = 'Notifie l\'administrateur qu\'un nouveau billet a été ouvert par un client';
|
||||
$lng['admin']['templates']['new_reply_ticket_by_customer'] = 'Notifie l\'administrateur d\'une réponse du client au billet';
|
||||
$lng['admin']['templates']['new_ticket_by_staff'] = 'Informe le client qu\'un billet a été ouvert par l\'équipe de support';
|
||||
$lng['admin']['templates']['new_reply_ticket_by_staff'] = 'Informe le client d\'une réponse de l\'équipe de support au billet';
|
||||
$lng['mails']['new_ticket_for_customer']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nVotre demande de billet de support ayant comme sujet "{SUBJECT}" a été envoyé.\n\nVous receverez une notification lorsque votre billet aura une réponse.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['mails']['new_ticket_for_customer']['subject'] = 'Votre billet de support a été envoyé';
|
||||
$lng['mails']['new_ticket_by_customer']['mailbody'] = 'Bonjour administrateur,\n\nUn nouveau billet de support ayant comme sujet "{SUBJECT}" a été ouvert.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nl\'équipe Froxlor.';
|
||||
$lng['mails']['new_ticket_by_customer']['subject'] = 'Nouveau billet de support soumis';
|
||||
$lng['mails']['new_reply_ticket_by_customer']['mailbody'] = 'Bonjour administrateur,\n\nLe billet de support "{SUBJECT}" a reçu une réponse de la part du client.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['mails']['new_reply_ticket_by_customer']['subject'] = 'Nouvelle réponse au billet de support';
|
||||
$lng['mails']['new_ticket_by_staff']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nUn billet de support ayant comme sujet "{SUBJECT}" a été ouvert pour vous par notre équipe.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['admin']['templates']['ticket'] = 'E-mail de notification pour les tickets de support';
|
||||
$lng['admin']['templates']['SUBJECT'] = 'Sera remplacé par le sujet du ticket de support.';
|
||||
$lng['admin']['templates']['new_ticket_for_customer'] = 'Informe le client que le ticket a été envoyé';
|
||||
$lng['admin']['templates']['new_ticket_by_customer'] = 'Notifie l\'administrateur qu\'un nouveau ticket a été ouvert par un client';
|
||||
$lng['admin']['templates']['new_reply_ticket_by_customer'] = 'Notifie l\'administrateur d\'une réponse du client au ticket';
|
||||
$lng['admin']['templates']['new_ticket_by_staff'] = 'Informe le client qu\'un ticket a été ouvert par l\'équipe de support';
|
||||
$lng['admin']['templates']['new_reply_ticket_by_staff'] = 'Informe le client d\'une réponse de l\'équipe de support au ticket';
|
||||
$lng['mails']['new_ticket_for_customer']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nVotre demande de ticket de support ayant comme sujet "{SUBJECT}" a été envoyé.\n\nVous receverez une notification lorsque votre billet aura une réponse.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['mails']['new_ticket_for_customer']['subject'] = 'Votre ticket de support a été envoyé';
|
||||
$lng['mails']['new_ticket_by_customer']['mailbody'] = 'Bonjour administrateur,\n\nUn nouveau ticket de support ayant comme sujet "{SUBJECT}" a été ouvert.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nl\'équipe Froxlor.';
|
||||
$lng['mails']['new_ticket_by_customer']['subject'] = 'Nouveau ticket de support soumis';
|
||||
$lng['mails']['new_reply_ticket_by_customer']['mailbody'] = 'Bonjour administrateur,\n\nLe ticket de support "{SUBJECT}" a reçu une réponse de la part du client.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['mails']['new_reply_ticket_by_customer']['subject'] = 'Nouvelle réponse au ticket de support';
|
||||
$lng['mails']['new_ticket_by_staff']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nUn ticket de support ayant comme sujet "{SUBJECT}" a été ouvert pour vous par notre équipe.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\'équipe Froxlor.';
|
||||
$lng['mails']['new_ticket_by_staff']['subject'] = 'Nouvelle demande de support soumise';
|
||||
$lng['mails']['new_reply_ticket_by_staff']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nLe billet de support ayant comme sujet "{SUBJECT}" a reçu une réponse par notre équipe.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\équipe Froxlor.';
|
||||
$lng['mails']['new_reply_ticket_by_staff']['subject'] = 'Nouvelle réponse au billet de support';
|
||||
$lng['question']['ticket_reallyclose'] = 'Etes-vous sûr de vouloir clôturer le billet "%s" ?';
|
||||
$lng['question']['ticket_reallydelete'] = 'Etes-vous sûr de vouloir supprimer le billet "%s" ?';
|
||||
$lng['mails']['new_reply_ticket_by_staff']['mailbody'] = 'Bonjour {FIRSTNAME} {NAME},\n\nLe ticket de support ayant comme sujet "{SUBJECT}" a reçu une réponse par notre équipe.\n\nVeuillez vous connecter pour consulter le billet.\n\nMerci,\nL\équipe Froxlor.';
|
||||
$lng['mails']['new_reply_ticket_by_staff']['subject'] = 'Nouvelle réponse au ticket de support';
|
||||
$lng['question']['ticket_reallyclose'] = 'Etes-vous sûr de vouloir clôturer le ticket "%s" ?';
|
||||
$lng['question']['ticket_reallydelete'] = 'Etes-vous sûr de vouloir supprimer le ticket "%s" ?';
|
||||
$lng['question']['ticket_reallydeletecat'] = 'Etes-vous sûr de vouloir supprimer la catégorie "%s" ?';
|
||||
$lng['question']['ticket_reallyarchive'] = 'Etes-vous sûr de vouloir archiver le billet "%s" ?';
|
||||
$lng['error']['nomoreticketsavailable'] = 'Vous n\'avez plus de billets de disponibles. Veuillez contacter votre administrateur.';
|
||||
$lng['error']['nocustomerforticket'] = 'Ne peut créer de billet sans client';
|
||||
$lng['error']['categoryhastickets'] = 'La catégorie possède des billets.<br />Veuillez d\'abord supprimer tous les billets de cette catégorie.';
|
||||
$lng['admin']['ticketsettings'] = 'Paramètres des billets de support';
|
||||
$lng['admin']['archivelastrun'] = 'Derniers billets archivés';
|
||||
$lng['question']['ticket_reallyarchive'] = 'Etes-vous sûr de vouloir archiver le ticket "%s" ?';
|
||||
$lng['error']['nomoreticketsavailable'] = 'Vous n\'avez plus de tickets de disponibles. Veuillez contacter votre administrateur.';
|
||||
$lng['error']['nocustomerforticket'] = 'Impossible de créer un ticket sans clients dans la base';
|
||||
$lng['error']['categoryhastickets'] = 'La catégorie possède des tickets.<br />Veuillez d\'abord supprimer tous les tickets de cette catégorie.';
|
||||
$lng['admin']['ticketsettings'] = 'Paramètres des tickets de support';
|
||||
$lng['admin']['archivelastrun'] = 'Derniers tickets archivés';
|
||||
$lng['serversettings']['ticket']['noreply_email']['title'] = 'Adresse e-mail de non réponse';
|
||||
$lng['serversettings']['ticket']['noreply_email']['description'] = 'L\'adresse e-mail de l\'expéditeur de notification pour les billets de support, quelque chose du type no-reply@domaine.com';
|
||||
$lng['serversettings']['ticket']['noreply_email']['description'] = 'L\'adresse e-mail de l\'expéditeur de notification pour les tickets de support, quelque chose du type no-reply@domaine.com';
|
||||
$lng['serversettings']['ticket']['worktime_begin']['title'] = 'Début du support (hh:mm)';
|
||||
$lng['serversettings']['ticket']['worktime_begin']['description'] = 'Horaire de début du support';
|
||||
$lng['serversettings']['ticket']['worktime_end']['title'] = 'Fin du support (hh:mm)';
|
||||
@@ -655,21 +655,21 @@ $lng['serversettings']['ticket']['worktime_sat'] = 'Support disponible le samedi
|
||||
$lng['serversettings']['ticket']['worktime_sun'] = 'Support disponible le dimanche ?';
|
||||
$lng['serversettings']['ticket']['worktime_all']['title'] = 'Aucune limite horaire pour le support';
|
||||
$lng['serversettings']['ticket']['worktime_all']['description'] = 'Si "Oui", les options pour le début et la fin du support seront écrasés.';
|
||||
$lng['serversettings']['ticket']['archiving_days'] = 'Après combien de jours un billet fermé sera automatiquement archivé ?';
|
||||
$lng['customer']['tickets'] = 'Billet de support';
|
||||
$lng['serversettings']['ticket']['archiving_days'] = 'Après combien de jours un ticket fermé sera automatiquement archivé ?';
|
||||
$lng['customer']['tickets'] = 'Ticket de support';
|
||||
|
||||
// ADDED IN 1.2.18-svn4
|
||||
|
||||
$lng['admin']['domain_nocustomeraddingavailable'] = 'Il n\'est acutellement pas possible d\'ajouter de domaines. Vous devez d\'abord ajouter un client.';
|
||||
$lng['serversettings']['ticket']['enable'] = 'Activer le système de billets';
|
||||
$lng['serversettings']['ticket']['concurrentlyopen'] = 'Combien de billets peuvent être ouverts au même moment ?';
|
||||
$lng['serversettings']['ticket']['enable'] = 'Activer le système de tickets';
|
||||
$lng['serversettings']['ticket']['concurrentlyopen'] = 'Combien de tickets peuvent être ouverts au même moment ?';
|
||||
$lng['error']['norepymailiswrong'] = 'L\'adresse de "non réponse" n\'est pas bonne. Une adresse e-mail valide doit être entrée.';
|
||||
$lng['error']['tadminmailiswrong'] = 'L\'adresse de "l\'administrateur de billets" n\'est pas bonne. Une adresse e-mail valide doit être entrée.';
|
||||
$lng['ticket']['awaitingticketreply'] = 'Vous avez %s billet(s) de support non répondu(s).';
|
||||
$lng['error']['tadminmailiswrong'] = 'L\'adresse de "l\'administrateur de tickets" n\'est pas bonne. Une adresse e-mail valide doit être entrée.';
|
||||
$lng['ticket']['awaitingticketreply'] = 'Vous avez %s ticket(s) de support non répondu(s).';
|
||||
|
||||
// ADDED IN 1.2.18-svn5
|
||||
|
||||
$lng['serversettings']['ticket']['noreply_name'] = 'Nom de l\'expéditeur e-mail des billets';
|
||||
$lng['serversettings']['ticket']['noreply_name'] = 'Nom de l\'expéditeur e-mail des tickets';
|
||||
|
||||
// ADDED IN 1.2.19-svn1
|
||||
|
||||
@@ -679,8 +679,8 @@ $lng['serversettings']['mod_fcgid']['tmpdir']['title'] = 'Dossier temporaire pou
|
||||
|
||||
// ADDED IN 1.2.19-svn3
|
||||
|
||||
$lng['serversettings']['ticket']['reset_cycle']['title'] = 'Intervalle de réinitialisation des billets utilisés';
|
||||
$lng['serversettings']['ticket']['reset_cycle']['description'] = 'Remettre le compteur de billets à 0 dans le temps imparti';
|
||||
$lng['serversettings']['ticket']['reset_cycle']['title'] = 'Intervalle de réinitialisation des tickets utilisés';
|
||||
$lng['serversettings']['ticket']['reset_cycle']['description'] = 'Remettre le compteur de tickets à 0 dans le temps imparti';
|
||||
$lng['admin']['tickets']['daily'] = 'Journalière';
|
||||
$lng['admin']['tickets']['weekly'] = 'Hebdomadaire';
|
||||
$lng['admin']['tickets']['monthly'] = 'Mensuelle';
|
||||
|
||||
@@ -529,7 +529,7 @@ $lng['panel']['back'] = 'Zurück';
|
||||
// ADDED IN 1.2.16-svn12
|
||||
|
||||
$lng['serversettings']['mod_fcgid']['title'] = 'PHP über mod_fcgid/suexec einbinden';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'PHP wird unter dem Benutzer des Kunden ausgeführt.<br /><br /><b>Dies benötigt eine spezielle Webserver-Konfiguration für Apache, siehe <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_fcgid">FCGID-Handbuch</a>.</b>';
|
||||
$lng['serversettings']['mod_fcgid']['description'] = 'PHP wird unter dem Benutzer des Kunden ausgeführt.<br /><br /><b>Dies benötigt eine spezielle Webserver-Konfiguration für Apache, siehe <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-fcgid">FCGID-Handbuch</a>.</b>';
|
||||
$lng['serversettings']['sendalternativemail']['title'] = 'Alternative E-Mail-Adresse benutzen';
|
||||
$lng['serversettings']['sendalternativemail']['description'] = 'Während des Erstellens eines Accounts das Passwort an eine andere E-Mail-Adresse senden';
|
||||
$lng['emails']['alternative_emailaddress'] = 'Alternative E-Mail-Adresse';
|
||||
@@ -934,6 +934,7 @@ $lng['admin']['phpsettings']['phpinisettings'] = 'php.ini-Einstellungen';
|
||||
$lng['error']['nopermissionsorinvalidid'] = 'Entweder fehlen Ihnen die nötigen Rechte diese Einstellung zu ändern oder es wurde eine ungültige ID übergeben';
|
||||
$lng['panel']['view'] = 'ansehen';
|
||||
$lng['question']['phpsetting_reallydelete'] = 'Wollen Sie diese PHP-Einstellungen wirklich löschen? Alle Domains die diese Einstellungen bis jetzt verwendet haben, werden dann auf die Standardeinstellungen umgestellt.';
|
||||
$lng['question']['fpmsetting_reallydelete'] = 'Wollen Sie diese PHP-FPM Einstellungen wirklich löschen? Alle PHP Konfigurationen die diese Einstellungen bis jetzt verwendet haben, werden dann auf die Standardeinstellungen umgestellt.';
|
||||
$lng['admin']['phpsettings']['addnew'] = 'Neue Konfiguration erstellen';
|
||||
$lng['error']['phpsettingidwrong'] = 'Eine PHP-Konfiguration mit dieser ID existiert nicht';
|
||||
$lng['error']['descriptioninvalid'] = 'Der Beschreibungstext ist zu kurz, zu lang oder enthält ungültige Zeichen';
|
||||
@@ -997,6 +998,7 @@ $lng['error']['ipportdoesntexist'] = 'Die gewählte IP/Port-Kombination existier
|
||||
|
||||
$lng['admin']['phpserversettings'] = 'PHP-Einstellungen';
|
||||
$lng['admin']['phpsettings']['binary'] = 'PHP-Binary';
|
||||
$lng['admin']['phpsettings']['fpmdesc'] = 'PHP-FPM Config';
|
||||
$lng['admin']['phpsettings']['file_extensions'] = 'Dateiendungen';
|
||||
$lng['admin']['phpsettings']['file_extensions_note'] = '(ohne Punkt, durch Leerzeichen getrennt)';
|
||||
$lng['admin']['mod_fcgid_maxrequests']['title'] = 'Maximale PHP-Requests für diese Domain (leer für Standardwert)';
|
||||
@@ -1075,7 +1077,7 @@ $lng['dkim']['dkim_notes']['description'] = 'Eine Notiz, welche für Menschen in
|
||||
$lng['dkim']['dkim_add_adsp']['title'] = 'DKIM-ADSP Eintrag hinzufügen';
|
||||
$lng['dkim']['dkim_add_adsp']['description'] = 'Wenn unsicher oder unbekannt, belassen sie es auf "aktiviert"';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['title'] = 'ADSP-Richtlinie';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Mehr Informationen zu dieser Einstellung (englisch) <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/En-dkim-adsp-policies">DKIM-ADSP-Policies</a>';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Mehr Informationen zu dieser Einstellung (englisch) <a target="blank" href="https://en.wikipedia.org/wiki/Author_Domain_Signing_Practices">DKIM-ADSP-Policies</a>';
|
||||
|
||||
$lng['admin']['cron']['cronsettings'] = 'Cronjob-Einstellungen';
|
||||
$lng['cron']['cronname'] = 'Cronjob-Name';
|
||||
@@ -1271,7 +1273,7 @@ $lng['error']['intvaluetoolow'] = 'Die angegebene Zahl ist zu klein (Feld "%s")'
|
||||
$lng['error']['intvaluetoohigh'] = 'Die angegebene Zahl ist zu groß (Feld "%s")';
|
||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||
$lng['serversettings']['phpfpm']['title'] = 'Aktiviere PHP-FPM';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>Dies benötigt eine spezielle Webserver-Konfiguration, siehe FPM-Handbuch für <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_phpfpm">Apache2</a> oder <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookNginx_phpfpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>Dies benötigt eine spezielle Webserver-Konfiguration, siehe FPM-Handbuch für <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-php-fpm">Apache2</a> oder <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/nginx-with-php-fpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm_settings']['configdir'] = 'Pfad zu php-fpm-Konfigurationen';
|
||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Alias-Ordner der php-fpm Konfiguration';
|
||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'Kommando zum Neustarten von php-fpm';
|
||||
@@ -1383,7 +1385,7 @@ $lng['traffic']['mail'] = 'Mail (MiB)';
|
||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['title'] = 'Idle-Timeout';
|
||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['description'] = 'Timeout-Einstellung für mod_FastCGI.';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['title'] = 'Idle-Timeout';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] = 'Timeout-Einstellung für PHP5-FPM FastCGI.';
|
||||
$lng['serversettings']['phpfpm_settings']['idle_timeout']['description'] = 'Timeout-Einstellung für PHP-FPM FastCGI.';
|
||||
|
||||
// ADDED IN 0.9.27-svn2
|
||||
$lng['admin']['delete_statistics'] = 'Statistiken Löschen';
|
||||
@@ -1551,7 +1553,7 @@ $lng['serversettings']['panel_password_special_char_required']['description'] =
|
||||
$lng['serversettings']['panel_password_special_char']['title'] = 'Sonderzeichen-Liste';
|
||||
$lng['serversettings']['panel_password_special_char']['description'] = 'Mindestens eines dieser Sonderzeichen muss in dem Passwort vorkommen, sofern die Sonderzeichen-Option aktiviert ist.';
|
||||
$lng['phpfpm']['use_mod_proxy']['title'] = 'Verwende mod_proxy / mod_proxy_fcgi';
|
||||
$lng['phpfpm']['use_mod_proxy']['description'] = 'Diese Option kann aktiviert werden, um php-fpm via mod_proxy_fcgi einzubinden. Dies setzt mindestens apache-2.4.9 voraus';
|
||||
$lng['phpfpm']['use_mod_proxy']['description'] = '<strong class="red">Muss gesetzt sein bei Debian 9.x (Stretch)</strong>. Diese Option kann aktiviert werden, um php-fpm via mod_proxy_fcgi einzubinden. Dies setzt mindestens apache-2.4.9 voraus';
|
||||
$lng['error']['no_phpinfo'] = 'Entschuldigung, es ist nicht möglich die phpinfo() auszulesen.';
|
||||
|
||||
$lng['admin']['movetoadmin'] = 'Kunde verschieben';
|
||||
@@ -1565,16 +1567,16 @@ $lng['domains']['import_file'] = 'CSV-Datei';
|
||||
$lng['success']['domain_import_successfully'] = 'Erfolgreich %s Domains importiert.';
|
||||
$lng['error']['domain_import_error'] = 'Der folgende Fehler trat beim Importieren der Domains auf: %s';
|
||||
$lng['admin']['note'] = 'Hinweis';
|
||||
$lng['domains']['import_description'] = 'Detaillierte Informationen über den Aufbau der Importdatei und einen erfolgreichen Import gibt es hier: <a href="http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc" target="_blank">http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc</a> (englisch)';
|
||||
$lng['domains']['import_description'] = 'Detaillierte Informationen über den Aufbau der Importdatei und einen erfolgreichen Import gibt es hier: <a href="https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation" target="_blank">https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation</a> (englisch)';
|
||||
$lng['usersettings']['custom_notes']['title'] = 'Eigene Notizen';
|
||||
$lng['usersettings']['custom_notes']['description'] = 'Hier können Notizen je nach Lust und Laune eingetragen werden. Diese werden in der Administrator/Kunden-Übersicht bei dem jeweiligen Benutzer angezeigt.';
|
||||
$lng['usersettings']['custom_notes']['show'] = 'Zeige die Notizen auf dem Dashboard des Benutzers';
|
||||
$lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID und PHP-FPM können nicht gleichzeitig aktiviert werden.';
|
||||
|
||||
// Added in Froxlor 0.9.34
|
||||
$lng['admin']['configfiles']['legend'] = 'Du konfigurierst nun einen Service/Daemon. Die folgende Legende zeigt unsere Nomenklatur.';
|
||||
$lng['admin']['configfiles']['legend'] = '<h3>Du konfigurierst nun einen Service/Daemon.</h3>';
|
||||
$lng['admin']['configfiles']['commands'] = '<span class="red">Kommandos:</span> Die angezeigten Befehle müssen als Benutzer root in einer Shell ausgeführt werden. Es kann auch problemlos der ganze Block kopiert und in die Shell eingefügt werden.';
|
||||
$lng['admin']['configfiles']['files'] = '<span class="red">Konfigurationsdateien:</span> Dies ist der Inhalt einer Konfigurationsdatei. Der Befehl direkt vor dem Textfeld sollte einen Editor mit der Zieldatei öffnen. Der Inhalt kann nun einfach kopiert und in den Editor eingefügt und die Datei gespeichert werden.<br><br><span class="red">Beachten Sie:</span> Das MySQL-Passwort wurde aus Sicherheitsgründen nicht ersetzt. Bitte ersetzen Sie "MYSQL_PASSWORD" manuell durch das entsprechende Passwort. Falls Sie es vergessen haben sollten, finden Sie es in der Datei "lib/userdata.inc.php".';
|
||||
$lng['admin']['configfiles']['files'] = '<span class="red">Konfigurationsdateien:</span> Der Befehl direkt vor dem Textfeld sollte einen Editor mit der Zieldatei öffnen. Der Inhalt kann nun einfach kopiert und in den Editor eingefügt und die Datei gespeichert werden.<br><span class="red">Bitte beachten:</span> Das MySQL-Passwort wurde aus Sicherheitsgründen nicht ersetzt. Bitte ersetze "FROXLOR_MYSQL_PASSWORD" manuell oder nutze das folgende Formular, um es temporär auf dieser Seite zu setzen. Falls das Passwort vergessen wurde, findet es sich in der Datei "lib/userdata.inc.php".';
|
||||
$lng['serversettings']['apache_itksupport']['title'] = 'Anpassungen für Apache ITK-MPM verwenden';
|
||||
$lng['serversettings']['apache_itksupport']['description'] = '<div class="red">Achtung: Bitte nur verwenden, wenn wirklich Apache itk-mpm verwendet wird, ansonsten wird der Webserver nicht starten.</div>';
|
||||
$lng['integrity_check']['DatabaseCharset'] = 'Characterset der Datenbank (sollte UTF-8 sein)';
|
||||
@@ -1591,7 +1593,7 @@ $lng['admin']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat v
|
||||
$lng['customer']['letsencrypt']['title'] = 'Benutze Let\'s Encrypt';
|
||||
$lng['customer']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von <a href="https://letsencrypt.org">Let\'s Encrypt</a>. Das Zertifikat wird automatisch erstellt und verlängert.<br><strong class="red">ACHTUNG:</strong> Dieses Feature befindet sich noch im Test.';
|
||||
$lng['error']['sslredirectonlypossiblewithsslipport'] = 'Die Nutzung von Let\'s Encrypt ist nur möglich, wenn die Domain mindestens eine IP/Port - Kombination mit aktiviertem SSL zugewiesen hat.';
|
||||
$lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt kann (noch) nicht mit Wildcard-Domains umgehen. Bitte den ServerAlias auf WWW setzen oder deaktivieren';
|
||||
$lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt kann in ACME v1 nicht mit Wildcard-Domains umgehen. Bitte den ServerAlias auf WWW setzen oder deaktivieren';
|
||||
$lng['panel']['letsencrypt'] = 'Benutzt Let\'s encrypt';
|
||||
$lng['crondesc']['cron_letsencrypt'] = 'aktualisiert Let\'s Encrypt Zertifikate';
|
||||
$lng['serversettings']['letsencryptca']['title'] = "Let's Encrypt Umgebung";
|
||||
@@ -1710,6 +1712,45 @@ $lng['admin']['webserversettings_ssl'] = 'Webserver SSL-Einstellungen';
|
||||
$lng['admin']['domain_hsts_maxage']['title'] = 'HTTP Strict Transport Security (HSTS)';
|
||||
$lng['admin']['domain_hsts_maxage']['description'] = '"max-age" Wert für den Strict-Transport-Security Header<br>Der Wert <i>0</i> deaktiviert HSTS für diese Domain. Meist wird der Wert <i>31536000</i> gerne genutzt (ein Jahr).';
|
||||
$lng['admin']['domain_hsts_incsub']['title'] = 'Inkludiere HSTS für jede Subdomain';
|
||||
$lng['admin']['domain_hsts_incsub']['description'] = 'Die optionale "includeSubDomains" Direktive, wenn vorhanden, signalisiert dem UA, dass die HSTS that the HSTS Regel für diese Domain und auch jede Subdomain dieser gilt.';
|
||||
$lng['admin']['domain_hsts_incsub']['description'] = 'Die optionale "includeSubDomains" Direktive, wenn vorhanden, signalisiert dem UA, dass die HSTS Regel für diese Domain und auch jede Subdomain dieser gilt.';
|
||||
$lng['admin']['domain_hsts_preload']['title'] = 'Füge Domain in die <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload Liste</a> hinzu';
|
||||
$lng['admin']['domain_hsts_preload']['description'] = 'Wenn die Domain in die HSTS preload Liste, verwaltet von Chrome (und genutzt von Firefox und Safari), hinzugefügt werden soll, dann aktiviere diese Einstellung.<br>Die preload-Direktive zu senden kann PERMANTENTE KONSEQUENZEN haben und dazu führen, dass Benutzer auf diese Domain und auch Subdomains nicht zugreifen können.<br>Beachte Details unter <a href="hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> bevor ein Header mit "preload" gesendet wird.';
|
||||
$lng['admin']['domain_hsts_preload']['description'] = 'Wenn die Domain in die HSTS preload Liste, verwaltet von Chrome (und genutzt von Firefox und Safari), hinzugefügt werden soll, dann aktiviere diese Einstellung.<br>Die preload-Direktive zu senden kann PERMANTENTE KONSEQUENZEN haben und dazu führen, dass Benutzer auf diese Domain und auch Subdomains nicht zugreifen können.<br>Beachte Details unter <a href="https://hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> bevor ein Header mit "preload" gesendet wird.';
|
||||
|
||||
$lng['serversettings']['http2_support']['title'] = 'HTTP2 Unterstützung';
|
||||
$lng['serversettings']['http2_support']['description'] = 'Aktiviere HTTP2 Unterstützung für SSL.<br><em class="red">NUR AKTIVIEREN, WENN DER WEBSERVER DIESE FUNKTION UNTERSTÜTZT (nginx version 1.9.5+, apache2 version 2.4.17+)</em>';
|
||||
|
||||
$lng['error']['noipportgiven'] = 'Keine IP/Port angegeben';
|
||||
|
||||
// Added in froxlor 0.9.38.8
|
||||
$lng['admin']['domain_ocsp_stapling']['title'] = 'OCSP stapling';
|
||||
$lng['admin']['domain_ocsp_stapling']['description'] = 'Siehe <a target="_blank" href="https://de.wikipedia.org/wiki/Online_Certificate_Status_Protocol_stapling">Wikipedia</a> für eine ausführliche Beschreibung von OCSP-Stapling';
|
||||
$lng['admin']['domain_ocsp_stapling']['nginx_version_warning'] = '<br /><strong class="red">WARNUNG:</strong> Nginx unterstützt OCSP-Stapling erst ab Version 1.3.7. Wenn Ihre Version älter ist, wird der Webserver bei aktiviertem OCSP-Stapling NICHT korrekt starten.';
|
||||
$lng['serversettings']['ssl']['apache24_ocsp_cache_path']['title'] = 'Apache 2.4: Pfad zum OCSP-Stapling-Cache';
|
||||
$lng['serversettings']['ssl']['apache24_ocsp_cache_path']['description'] = 'Konfiguriert den Cache-Pfad zum Zwischenspeichern der OCSP-Antworten,<br />die an TLS-Handshakes angehängt werden.';
|
||||
$lng['serversettings']['nssextrausers']['title'] = 'Verwende libnss-extrausers anstatt libnss-mysql';
|
||||
$lng['serversettings']['nssextrausers']['description'] = 'Lese Benutzer nicht direkt aus der Datenbank sondern über Dateien, bitte nur aktivieren, wenn die entsprechende Konfiguration vorgenommen wurde (System -> libnss-extrausers).<br><strong class="red">Nur für Debian/Ubuntu (oder wenn libnss-extrausers manuell kompiliert wurde!)</strong>';
|
||||
$lng['admin']['domain_http2']['title'] = 'HTTP2 Unterstützung';
|
||||
$lng['admin']['domain_http2']['description'] = 'Siehe <a target="_blank" href="https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol#HTTP.2F2">Wikipedia</a> für eine ausführliche Beschreibung von HTTP2';
|
||||
$lng['admin']['testmail'] = 'SMTP Test';
|
||||
$lng['success']['testmailsent'] = 'Test E-Mail erfolgreich gesendet';
|
||||
$lng['serversettings']['disable_le_selfcheck']['title'] = "Deaktiviere Let's Encrypt lokale Selbstprüfung";
|
||||
$lng['serversettings']['disable_le_selfcheck']['description'] = "Wenn aktiviert wird Froxlor <strong>keine</strong> Erreichbarkeitsprüfung des Tokens vornehmen. Nötig bei ge-NAT-eten IP's oder Ähnlichem";
|
||||
$lng['menue']['phpsettings']['fpmdaemons'] = 'PHP-FPM Versionen';
|
||||
$lng['admin']['phpsettings']['activephpconfigs'] = 'In Verwendung für PHP-Konfiguration(en)';
|
||||
$lng['admin']['phpsettingsforsubdomains'] = 'PHP-Config für alle Subdomains übernehmen:';
|
||||
$lng['serversettings']['phpsettingsforsubdomains']['description'] = 'Wenn ja, wird die gewählte PHP-Config für alle Subdomains übernommen';
|
||||
$lng['serversettings']['leapiversion']['title'] = "Wähle Let's Encrypt ACME Implementierung";
|
||||
$lng['serversettings']['leapiversion']['description'] = "Wähle zwischen ACME v1 und ACME v2 Implementierung von Let's Encrypt.";
|
||||
$lng['error']['nowildcardwithletsencryptv2'] = 'Let\'s Encrypt kann in ACME v2 Wildcard-Domains nur via DNS validieren, sorry. Bitte den ServerAlias auf WWW setzen oder deaktivieren';
|
||||
$lng['admin']['phpsettings']['pass_authorizationheader'] = 'Füge "-pass-header Authorization" / "CGIPassAuth On" in Vhosts ein';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['title'] = 'SSL Protokollversion festlegen';
|
||||
$lng['serversettings']['ssl']['ssl_protocols']['description'] = 'Dies ist eine Liste von SSL/TLS Protokollversionen die genutzt werden sollen (oder auch nicht genutzt werden sollen), wenn SSL verwendet wird. <b>Hinweis:</b> Ältere Browser sind möglicherweise nicht vollständig zum neusten Protokoll kompatibel.<br /><br /><b>Standard-Wert ist:</b><pre>TLSv1, TLSv1.2</pre>';
|
||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['title'] = 'Erlaubte Dateiendungen';
|
||||
$lng['serversettings']['phpfpm_settings']['limit_extensions']['description'] = 'Beschränkt die Dateierweiterungen des Haupt-Skripts, das FPM zu parsen erlaubt. Dies kann Konfigurationsfehler auf der Webserverseite verhindern. Sie sollten FPM nur auf .php Erweiterungen beschränken, um zu verhindern, dass bösartige Nutzter andere Erweiterungen verwenden, um PHP Code auszuführen. Standardwert: .php';
|
||||
$lng['phpfpm']['ini_flags'] = 'Mögliche <strong>php_flag</strong>s für die php.ini. Pro Zeile eine Direktive';
|
||||
$lng['phpfpm']['ini_values'] = 'Mögliche <strong>php_value</strong>s für die php.ini. Pro Zeile eine Direktive';
|
||||
$lng['phpfpm']['ini_admin_flags'] = 'Mögliche <strong>php_admin_flag</strong>s für die php.ini. Pro Zeile eine Direktive';
|
||||
$lng['phpfpm']['ini_admin_values'] = 'Mögliche <strong>php_admin_value</strong>s für die php.ini. Pro Zeile eine Direktive';
|
||||
$lng['serversettings']['phpfpm_settings']['envpath'] = 'Pfade für die PATH Umgebungsvariable. Leerlassen, um keine PATH Umgebungsvariable zu setzen.';
|
||||
$lng['success']['settingsimported'] = 'Einstellungnen erfolgreich importiert';
|
||||
$lng['error']['jsonextensionnotfound'] = 'Diese Funktion benötigt die PHP json-Erweiterung.';
|
||||
|
||||
@@ -435,7 +435,7 @@ $lng['panel']['translator'] = 'Traduttore';
|
||||
$lng['error']['stringformaterror'] = 'Il valore per il campo "%s" non è nel formato atteso.';
|
||||
|
||||
// ADDED IN 1.2.15-rc1
|
||||
// Translated by marone42@googlemail.com on 03/15/2007 (see https://trac.froxlor.org/ticket/126#comment:21)
|
||||
// Translated by marone42@googlemail.com on 03/15/2007
|
||||
|
||||
$lng['admin']['phpversion'] = 'Versione PHP';
|
||||
$lng['admin']['mysqlserverversion'] = 'Versione MySQL Server';
|
||||
@@ -1050,7 +1050,7 @@ $lng['dkim']['dkim_notes']['description'] = 'Nota potrebbe essere di interesse,
|
||||
$lng['dkim']['dkim_add_adsp']['title'] = 'Aggiungi un valore DKIM ADSP';
|
||||
$lng['dkim']['dkim_add_adsp']['description'] = 'Se non si sa di cosa si tratta, lasciare "enabled"';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['title'] = 'Regola ADSP';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Per ulteriori informazioni su questa impostazione leggere <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/En-dkim-adsp-policies">DKIM ADSP policies</a>';
|
||||
$lng['dkim']['dkim_add_adsppolicy']['description'] = 'Per ulteriori informazioni su questa impostazione leggere <a target="blank" href="https://en.wikipedia.org/wiki/Author_Domain_Signing_Practices">DKIM ADSP policies</a>';
|
||||
|
||||
$lng['admin']['cron']['cronsettings'] = 'Impostazioni Cronjob';
|
||||
$lng['cron']['cronname'] = 'Nome cronjob';
|
||||
@@ -1171,7 +1171,7 @@ $lng['serversettings']['perl_path']['description'] = 'Rilevante solo se si utili
|
||||
// ADDED IN FROXLOR 0.9.12-svn1
|
||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'Abilita FCGID per i vhost Froxlor';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Se attivato, Froxlor verrà eseguito con un utente locale<br /><strong>ATTENZIONE:</strong>Questo richiede una configurazione manuale, vedi <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_fcgid">FCGID - handbook</a>';
|
||||
$lng['serversettings']['mod_fcgid_ownvhost']['description'] = 'Se attivato, Froxlor verrà eseguito con un utente locale<br /><strong>ATTENZIONE:</strong>Questo richiede una configurazione manuale, vedi <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-fcgid">FCGID - handbook</a>';
|
||||
$lng['admin']['mod_fcgid_user'] = 'Utente locale per FCGID (Froxlor vhost)';
|
||||
$lng['admin']['mod_fcgid_group'] = 'Gruppo locale per FCGID (Froxlor vhost)';
|
||||
|
||||
@@ -1361,7 +1361,7 @@ $lng['admin']['store_defaultindex'] = 'Archivio del file indice predefinito al p
|
||||
$lng['admin']['ipsandports']['ssl_cert_chainfile']['title'] = 'Percorso al file catena dei certificati SSL';
|
||||
$lng['admin']['ipsandports']['ssl_cert_chainfile']['description'] = 'Principalmente Bundle CA, o similare, presubilmente vuoi impostare questo se hai acquistato un certificato SSL.';
|
||||
$lng['serversettings']['phpfpm']['title'] = 'Abilita php-fpm';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>Questa impostazione richiede una configurazione speciale del server web. Vedi il manuale FPM per <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookApache2_phpfpm">Apache2</a> o <a target="blank" href="http://redmine.froxlor.org/projects/froxlor/wiki/HandbookNginx_phpfpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm']['description'] = '<b>Questa impostazione richiede una configurazione speciale del server web. Vedi il manuale FPM per <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/apache2-with-php-fpm">Apache2</a> o <a target="blank" href="https://github.com/Froxlor/Froxlor/wiki/nginx-with-php-fpm">nginx</a></b>';
|
||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configurazione cartella Alias per php-fpm';
|
||||
$lng['gender']['title'] = 'Titolo';
|
||||
$lng['gender']['male'] = 'Sig.';
|
||||
@@ -1795,7 +1795,7 @@ $lng['domains']['import_file'] = 'File CSV';
|
||||
$lng['success']['domain_import_successfully'] = 'Importato %s dominii con successo.';
|
||||
$lng['error']['domain_import_error'] = 'Il seguente errore è occorsonell \'importazione di dominii: %s';
|
||||
$lng['admin']['note'] = 'Nota';
|
||||
$lng['domains']['import_description'] = 'Per ottenere informazioni dettagliate sulla struttura del file di importazione e su come importare con successo, visita <a href="http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc" target="_blank">http://redmine.froxlor.org/projects/froxlor/wiki/DomainBulkActionDoc</a>';
|
||||
$lng['domains']['import_description'] = 'Per ottenere informazioni dettagliate sulla struttura del file di importazione e su come importare con successo, visita <a href="https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation" target="_blank">https://github.com/Froxlor/Froxlor/wiki/Domain-import-documenation</a>';
|
||||
$lng['usersettings']['custom_notes']['title'] = 'Note personali';
|
||||
$lng['usersettings']['custom_notes']['description'] = 'Sentiti libero di inserire qualsi nota vuoi o necessiti qui. Apparirano nel riepilogo dell\'amministratore/cliente perl \'utente corrispondente.';
|
||||
$lng['usersettings']['custom_notes']['show'] = 'Mostra le tue note nel cruscotto dell\'utente';
|
||||
|
||||
@@ -233,7 +233,7 @@ abstract class DnsBase
|
||||
$pubkey_file_handler = fopen($pubkey_filename, "w");
|
||||
fwrite($pubkey_file_handler, $domain['dkim_pubkey']);
|
||||
fclose($pubkey_file_handler);
|
||||
safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
||||
safe_exec("chmod 0644 " . escapeshellarg($pubkey_filename));
|
||||
}
|
||||
|
||||
$dkimdomains .= $domain['domain'] . "\n";
|
||||
|
||||
83
scripts/classes/class.Extrausers.php
Normal file
83
scripts/classes/class.Extrausers.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2017 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 Froxlor team <team@froxlor.org> (2017-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
*/
|
||||
class Extrausers
|
||||
{
|
||||
|
||||
public static function generateFiles(&$cronlog)
|
||||
{
|
||||
// passwd
|
||||
$passwd = '/var/lib/extrausers/passwd';
|
||||
$sql = "SELECT username,'x' as password,uid,gid,'Froxlor User' as comment,homedir,shell, login_enabled FROM ftp_users ORDER BY uid ASC";
|
||||
self::_generateFile($passwd, $sql, $cronlog);
|
||||
|
||||
// group
|
||||
$group = '/var/lib/extrausers/group';
|
||||
$sql = "SELECT groupname,'x' as password,gid,members FROM ftp_groups ORDER BY gid ASC";
|
||||
self::_generateFile($group, $sql, $cronlog);
|
||||
|
||||
// shadow
|
||||
$shadow = '/var/lib/extrausers/shadow';
|
||||
$sql = "SELECT username,password FROM ftp_users ORDER BY gid ASC";
|
||||
self::_generateFile($shadow, $sql, $cronlog);
|
||||
|
||||
// set correct permissions
|
||||
@chmod('/var/lib/extrausers/', 0755);
|
||||
@chmod('/var/lib/extrausers/passwd', 0644);
|
||||
@chmod('/var/lib/extrausers/group', 0644);
|
||||
@chmod('/var/lib/extrausers/shadow', 0640);
|
||||
}
|
||||
|
||||
private static function _generateFile($file, $query, &$cronlog)
|
||||
{
|
||||
$type = basename($file);
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Creating ' . $type . ' file');
|
||||
|
||||
if (! file_exists($file)) {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, $type . ' file does not yet exist');
|
||||
@mkdir(dirname($file), 0750, true);
|
||||
touch($file);
|
||||
}
|
||||
|
||||
$data_sel_stmt = Database::query($query);
|
||||
$data_content = "";
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Writing ' . $data_sel_stmt->rowCount() . ' entries to ' . $type . ' file');
|
||||
while ($u = $data_sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
switch ($type) {
|
||||
case 'passwd':
|
||||
if ($u['login_enabled'] != 'Y') {
|
||||
$u['password'] = '*';
|
||||
$u['shell'] = '/bin/false';
|
||||
$u['comment'] = 'Locked Froxlor User';
|
||||
}
|
||||
$line = $u['username'] . ':' . $u['password'] . ':' . $u['uid'] . ':' . $u['gid'] . ':' . $u['comment'] . ':' . $u['homedir'] . ':' . $u['shell'] . PHP_EOL;
|
||||
break;
|
||||
case 'group':
|
||||
$line = $u['groupname'] . ':' . $u['password'] . ':' . $u['gid'] . ':' . $u['members'] . PHP_EOL;
|
||||
break;
|
||||
case 'shadow':
|
||||
$line = $u['username'] . ':' . $u['password'] . ':' . floor(time() / 86400 - 1) . ':0:99999:7:::' . PHP_EOL;
|
||||
break;
|
||||
}
|
||||
$data_content .= $line;
|
||||
}
|
||||
if (file_put_contents($file, $data_content) !== false) {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Succesfully wrote ' . $type . ' file');
|
||||
} else {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Error when writing ' . $type . ' file entries');
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user