Compare commits
126 Commits
| 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 |
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>
|
||||||
28
README.md
28
README.md
@@ -17,7 +17,7 @@ Developed by experienced server administrators, this panel simplifies the effort
|
|||||||
9. Have fun!
|
9. Have fun!
|
||||||
|
|
||||||
### Detailed installation
|
### Detailed installation
|
||||||
http://redmine.froxlor.org/projects/froxlor/wiki/Installationtarball
|
https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-from-tarball
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
|
||||||
@@ -30,12 +30,12 @@ irc://chat.freenode.net/froxlor
|
|||||||
|
|
||||||
### Forum
|
### Forum
|
||||||
|
|
||||||
The community is located on http://forum.froxlor.org
|
The community is located on https://forum.froxlor.org/
|
||||||
|
|
||||||
### Wiki
|
### Wiki
|
||||||
|
|
||||||
More documentation may be found in the froxlor - wiki:
|
More documentation may be found in the froxlor - wiki:
|
||||||
http://redmine.froxlor.org/projects/froxlor/wiki
|
https://github.com/Froxlor/Froxlor/wiki
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@@ -44,31 +44,21 @@ May be found in COPYING
|
|||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
### Tarball
|
### 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
|
### 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
|
/etc/apt/sources.list.d/froxlor.list
|
||||||
> deb http://debian.froxlor.org {wheezy|jessie} main
|
> deb http://debian.froxlor.org {wheezy|jessie} main
|
||||||
|
|
||||||
### Gentoo repository
|
### 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
|
## Contributing
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
[see here](.github/CONTRIBUTING.md)
|
||||||
|
|||||||
@@ -94,6 +94,14 @@ return array(
|
|||||||
'plausibility_check_method' => 'checkMysqlAccessHost',
|
'plausibility_check_method' => 'checkMysqlAccessHost',
|
||||||
'save_method' => 'storeSettingMysqlAccessHost',
|
'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(
|
'system_index_file_extension' => array(
|
||||||
'label' => $lng['serversettings']['index_file_extension'],
|
'label' => $lng['serversettings']['index_file_extension'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
|
|||||||
@@ -80,6 +80,19 @@ return array(
|
|||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
'visible' => Settings::Get('system.use_ssl')
|
'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
|
* FCGID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -179,17 +179,6 @@ return array(
|
|||||||
'nginx'
|
'nginx'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'system_nginx_http2_support' => array(
|
|
||||||
'label' => $lng['serversettings']['nginx_http2_support'],
|
|
||||||
'settinggroup' => 'system',
|
|
||||||
'varname' => 'nginx_http2_support',
|
|
||||||
'type' => 'bool',
|
|
||||||
'default' => false,
|
|
||||||
'save_method' => 'storeSettingField',
|
|
||||||
'websrv_avail' => array(
|
|
||||||
'nginx'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'system_nginx_php_backend' => array(
|
'system_nginx_php_backend' => array(
|
||||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
|
|||||||
@@ -30,6 +30,20 @@ return array(
|
|||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField',
|
||||||
'overview_option' => true
|
'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(
|
'system_ssl_cipher_list' => array(
|
||||||
'label' => $lng['serversettings']['ssl']['ssl_cipher_list'],
|
'label' => $lng['serversettings']['ssl']['ssl_cipher_list'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
@@ -79,6 +93,17 @@ return array(
|
|||||||
'default' => '',
|
'default' => '',
|
||||||
'save_method' => 'storeSettingField'
|
'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(
|
'system_leenabled' => array(
|
||||||
'label' => $lng['serversettings']['leenabled'],
|
'label' => $lng['serversettings']['leenabled'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
@@ -95,7 +120,20 @@ return array(
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'file',
|
'string_type' => 'file',
|
||||||
'default' => '/etc/apache2/conf-enabled/acme.conf',
|
'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(
|
'system_letsencryptca' => array(
|
||||||
'label' => $lng['serversettings']['letsencryptca'],
|
'label' => $lng['serversettings']['letsencryptca'],
|
||||||
@@ -105,8 +143,8 @@ return array(
|
|||||||
'default' => 'testing',
|
'default' => 'testing',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options' => array(
|
'option_options' => array(
|
||||||
'testing' => 'https://acme-staging.api.letsencrypt.org (Test)',
|
'testing' => 'https://acme-staging' . (Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)',
|
||||||
'production' => 'https://acme-v01.api.letsencrypt.org (Live)'
|
'production' => 'https://acme-v0' . Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)'
|
||||||
),
|
),
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
),
|
||||||
@@ -153,6 +191,14 @@ return array(
|
|||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
|
),
|
||||||
|
'system_disable_le_selfcheck' => array(
|
||||||
|
'label' => $lng['serversettings']['disable_le_selfcheck'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'disable_le_selfcheck',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ return array(
|
|||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'default' => 30,
|
'default' => 30,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -40,15 +40,6 @@ return array(
|
|||||||
'option_options_method' => 'getPhpConfigs',
|
'option_options_method' => 'getPhpConfigs',
|
||||||
'save_method' => 'storeSettingField'
|
'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(
|
'system_phpfpm_aliasconfigdir' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||||
'settinggroup' => 'phpfpm',
|
'settinggroup' => 'phpfpm',
|
||||||
@@ -73,9 +64,22 @@ return array(
|
|||||||
'varname' => 'peardir',
|
'varname' => 'peardir',
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'string_type' => 'dir',
|
'string_type' => 'dir',
|
||||||
|
'string_delimiter' => ':',
|
||||||
|
'string_emptyallowed' => true,
|
||||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||||
'save_method' => 'storeSettingField'
|
'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(
|
'system_phpfpm_fastcgi_ipcdir' => array(
|
||||||
'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'],
|
'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'],
|
||||||
'settinggroup' => 'phpfpm',
|
'settinggroup' => 'phpfpm',
|
||||||
@@ -85,72 +89,6 @@ return array(
|
|||||||
'default' => '/var/lib/apache2/fastcgi/',
|
'default' => '/var/lib/apache2/fastcgi/',
|
||||||
'save_method' => 'storeSettingField'
|
'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(
|
'system_phpfpm_use_mod_proxy' => array(
|
||||||
'label' => $lng['phpfpm']['use_mod_proxy'],
|
'label' => $lng['phpfpm']['use_mod_proxy'],
|
||||||
'settinggroup' => 'phpfpm',
|
'settinggroup' => 'phpfpm',
|
||||||
@@ -160,6 +98,38 @@ return array(
|
|||||||
'visible' => Settings::Get('system.apache24'),
|
'visible' => Settings::Get('system.apache24'),
|
||||||
'save_method' => 'storeSettingField'
|
'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 {
|
} else {
|
||||||
|
|
||||||
$language_options = '';
|
$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);
|
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -840,13 +840,13 @@ if ($page == 'admins'
|
|||||||
}
|
}
|
||||||
|
|
||||||
$language_options = '';
|
$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);
|
$language_options.= makeoption($language_name, $language_file, $result['def_language'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']);
|
$ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']);
|
||||||
$ipsandports_stmt = Database::query("
|
$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)) {
|
while ($row = $ipsandports_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
$replace_arr = Array(
|
$replace_arr = Array(
|
||||||
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
||||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
'<SQL_UNPRIVILEGED_PASSWORD>' => 'FROXLOR_MYSQL_PASSWORD',
|
||||||
'<SQL_DB>' => $sql['db'],
|
'<SQL_DB>' => $sql['db'],
|
||||||
'<SQL_HOST>' => $sql['host'],
|
'<SQL_HOST>' => $sql['host'],
|
||||||
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
||||||
@@ -82,6 +82,12 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
$config_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . '/lib/configfiles/');
|
$config_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . '/lib/configfiles/');
|
||||||
|
|
||||||
if ($distribution != "") {
|
if ($distribution != "") {
|
||||||
|
|
||||||
|
if (!file_exists($config_dir . '/' . $distribution . ".xml")) {
|
||||||
|
trigger_error("Unknown distribution, are you playing around with the URL?");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// create configparser object
|
// create configparser object
|
||||||
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");
|
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");
|
||||||
|
|
||||||
@@ -93,6 +99,11 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
if ($service != "") {
|
if ($service != "") {
|
||||||
|
|
||||||
|
if (!isset($services[$service])) {
|
||||||
|
trigger_error("Unknown service, are you playing around with the URL?");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$daemons = $services[$service]->getDaemons();
|
$daemons = $services[$service]->getDaemons();
|
||||||
|
|
||||||
if ($daemon == "") {
|
if ($daemon == "") {
|
||||||
@@ -136,6 +147,11 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
if ($distribution != "" && $service != "" && $daemon != "") {
|
if ($distribution != "" && $service != "" && $daemon != "") {
|
||||||
|
|
||||||
|
if (!isset($daemons[$daemon])) {
|
||||||
|
trigger_error("Unknown daemon, are you playing around with the URL?");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$confarr = $daemons[$daemon]->getConfig();
|
$confarr = $daemons[$daemon]->getConfig();
|
||||||
|
|
||||||
$configpage = '';
|
$configpage = '';
|
||||||
|
|||||||
@@ -532,6 +532,14 @@ if ($page == 'customers'
|
|||||||
$phpenabled = intval($_POST['phpenabled']);
|
$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;
|
$perlenabled = 0;
|
||||||
if (isset($_POST['perlenabled'])) {
|
if (isset($_POST['perlenabled'])) {
|
||||||
$perlenabled = intval($_POST['perlenabled']);
|
$perlenabled = intval($_POST['perlenabled']);
|
||||||
@@ -693,6 +701,7 @@ if ($page == 'customers'
|
|||||||
'tickets' => $tickets,
|
'tickets' => $tickets,
|
||||||
'mysqls' => $mysqls,
|
'mysqls' => $mysqls,
|
||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
|
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||||
'imap' => $email_imap,
|
'imap' => $email_imap,
|
||||||
'pop3' => $email_pop3,
|
'pop3' => $email_pop3,
|
||||||
'perlenabled' => $perlenabled,
|
'perlenabled' => $perlenabled,
|
||||||
@@ -733,6 +742,7 @@ if ($page == 'customers'
|
|||||||
`mysqls` = :mysqls,
|
`mysqls` = :mysqls,
|
||||||
`standardsubdomain` = '0',
|
`standardsubdomain` = '0',
|
||||||
`phpenabled` = :phpenabled,
|
`phpenabled` = :phpenabled,
|
||||||
|
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||||
`imap` = :imap,
|
`imap` = :imap,
|
||||||
`pop3` = :pop3,
|
`pop3` = :pop3,
|
||||||
`perlenabled` = :perlenabled,
|
`perlenabled` = :perlenabled,
|
||||||
@@ -910,7 +920,7 @@ if ($page == 'customers'
|
|||||||
'customerid' => $customerid,
|
'customerid' => $customerid,
|
||||||
'adminid' => $userinfo['adminid'],
|
'adminid' => $userinfo['adminid'],
|
||||||
'docroot' => $documentroot,
|
'docroot' => $documentroot,
|
||||||
'adddate' => date('Y-m-d'),
|
'adddate' => time(),
|
||||||
'phpenabled' => $phpenabled
|
'phpenabled' => $phpenabled
|
||||||
);
|
);
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
@@ -1024,7 +1034,7 @@ if ($page == 'customers'
|
|||||||
} else {
|
} else {
|
||||||
$language_options = '';
|
$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);
|
$language_options.= makeoption($language_name, $language_file, Settings::Get('panel.standardlanguage'), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,6 +1053,26 @@ if ($page == 'customers'
|
|||||||
$gender_options .= makeoption($lng['gender']['male'], 1, null, true, true);
|
$gender_options .= makeoption($lng['gender']['male'], 1, null, true, true);
|
||||||
$gender_options .= makeoption($lng['gender']['female'], 2, 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_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_add.php';
|
||||||
$customer_add_form = htmlform::genHTMLForm($customer_add_data);
|
$customer_add_form = htmlform::genHTMLForm($customer_add_data);
|
||||||
|
|
||||||
@@ -1205,6 +1235,14 @@ if ($page == 'customers'
|
|||||||
$phpenabled = intval($_POST['phpenabled']);
|
$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;
|
$perlenabled = 0;
|
||||||
if (isset($_POST['perlenabled'])) {
|
if (isset($_POST['perlenabled'])) {
|
||||||
$perlenabled = intval($_POST['perlenabled']);
|
$perlenabled = intval($_POST['perlenabled']);
|
||||||
@@ -1283,7 +1321,7 @@ if ($page == 'customers'
|
|||||||
'customerid' => $result['customerid'],
|
'customerid' => $result['customerid'],
|
||||||
'adminid' => $userinfo['adminid'],
|
'adminid' => $userinfo['adminid'],
|
||||||
'docroot' => $result['documentroot'],
|
'docroot' => $result['documentroot'],
|
||||||
'adddate' => date('Y-m-d')
|
'adddate' => time()
|
||||||
);
|
);
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
@@ -1457,6 +1495,7 @@ if ($page == 'customers'
|
|||||||
'mysqls' => $mysqls,
|
'mysqls' => $mysqls,
|
||||||
'deactivated' => $deactivated,
|
'deactivated' => $deactivated,
|
||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
|
'allowed_phpconfigs' => empty($allowed_phpconfigs) ? "" : json_encode($allowed_phpconfigs),
|
||||||
'imap' => $email_imap,
|
'imap' => $email_imap,
|
||||||
'pop3' => $email_pop3,
|
'pop3' => $email_pop3,
|
||||||
'perlenabled' => $perlenabled,
|
'perlenabled' => $perlenabled,
|
||||||
@@ -1490,6 +1529,7 @@ if ($page == 'customers'
|
|||||||
`mysqls` = :mysqls,
|
`mysqls` = :mysqls,
|
||||||
`deactivated` = :deactivated,
|
`deactivated` = :deactivated,
|
||||||
`phpenabled` = :phpenabled,
|
`phpenabled` = :phpenabled,
|
||||||
|
`allowed_phpconfigs` = :allowed_phpconfigs,
|
||||||
`email_quota` = :email_quota,
|
`email_quota` = :email_quota,
|
||||||
`imap` = :imap,
|
`imap` = :imap,
|
||||||
`pop3` = :pop3,
|
`pop3` = :pop3,
|
||||||
@@ -1630,7 +1670,7 @@ if ($page == 'customers'
|
|||||||
} else {
|
} else {
|
||||||
$language_options = '';
|
$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);
|
$language_options.= makeoption($language_name, $language_file, $result['def_language'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1695,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']['male'], 1, ($result['gender'] == '1' ? true : false), true, true);
|
||||||
$gender_options .= makeoption($lng['gender']['female'], 2, ($result['gender'] == '2' ? 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_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_edit.php';
|
||||||
$customer_edit_form = htmlform::genHTMLForm($customer_edit_data);
|
$customer_edit_form = htmlform::genHTMLForm($customer_edit_data);
|
||||||
|
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
standard_error('admin_domain_emailsystemhostname');
|
standard_error('admin_domain_emailsystemhostname');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($_POST['domain'], '--') !== false) {
|
if (substr($_POST['domain'], 0, 4) == 'xn--') {
|
||||||
standard_error('domain_nopunycode');
|
standard_error('domain_nopunycode');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,14 +590,20 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$http2 = isset($_POST['http2']) && (int)$_POST['http2'] == 1 ? 1 : 0;
|
||||||
|
|
||||||
// HSTS
|
// HSTS
|
||||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
$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_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;
|
$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 {
|
} else {
|
||||||
$ssl_redirect = 0;
|
$ssl_redirect = 0;
|
||||||
$letsencrypt = 0;
|
$letsencrypt = 0;
|
||||||
|
$http2 = 0;
|
||||||
// we need this for the serialize
|
// we need this for the serialize
|
||||||
// if ssl is disabled or no ssl-ip/port exists
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
$ssl_ipandports[] = - 1;
|
$ssl_ipandports[] = - 1;
|
||||||
@@ -606,10 +612,14 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$hsts_maxage = 0;
|
$hsts_maxage = 0;
|
||||||
$hsts_sub = 0;
|
$hsts_sub = 0;
|
||||||
$hsts_preload = 0;
|
$hsts_preload = 0;
|
||||||
|
|
||||||
|
// OCSP stapling
|
||||||
|
$ocsp_stapling = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ssl_redirect = 0;
|
$ssl_redirect = 0;
|
||||||
$letsencrypt = 0;
|
$letsencrypt = 0;
|
||||||
|
$http2 = 0;
|
||||||
// we need this for the serialize
|
// we need this for the serialize
|
||||||
// if ssl is disabled or no ssl-ip/port exists
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
$ssl_ipandports[] = - 1;
|
$ssl_ipandports[] = - 1;
|
||||||
@@ -618,12 +628,20 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$hsts_maxage = 0;
|
$hsts_maxage = 0;
|
||||||
$hsts_sub = 0;
|
$hsts_sub = 0;
|
||||||
$hsts_preload = 0;
|
$hsts_preload = 0;
|
||||||
|
|
||||||
|
// OCSP stapling
|
||||||
|
$ocsp_stapling = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't enable let's encrypt for wildcard - domains
|
// We can't enable let's encrypt for wildcard - domains if using acme-v1
|
||||||
if ($serveraliasoption == '0' && $letsencrypt == '1') {
|
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||||
standard_error('nowildcardwithletsencrypt');
|
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
|
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||||
if ($ssl_redirect > 0 && $letsencrypt == 1) {
|
if ($ssl_redirect > 0 && $letsencrypt == 1) {
|
||||||
@@ -787,9 +805,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'termination_date' => $termination_date,
|
'termination_date' => $termination_date,
|
||||||
'issubof' => $issubof,
|
'issubof' => $issubof,
|
||||||
'letsencrypt' => $letsencrypt,
|
'letsencrypt' => $letsencrypt,
|
||||||
|
'http2' => $http2,
|
||||||
'hsts_maxage' => $hsts_maxage,
|
'hsts_maxage' => $hsts_maxage,
|
||||||
'hsts_sub' => $hsts_sub,
|
'hsts_sub' => $hsts_sub,
|
||||||
'hsts_preload' => $hsts_preload
|
'hsts_preload' => $hsts_preload,
|
||||||
|
'ocsp_stapling' => $ocsp_stapling
|
||||||
);
|
);
|
||||||
|
|
||||||
$security_questions = array(
|
$security_questions = array(
|
||||||
@@ -839,9 +859,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||||
'ismainbutsubto' => $issubof,
|
'ismainbutsubto' => $issubof,
|
||||||
'letsencrypt' => $letsencrypt,
|
'letsencrypt' => $letsencrypt,
|
||||||
|
'http2' => $http2,
|
||||||
'hsts' => $hsts_maxage,
|
'hsts' => $hsts_maxage,
|
||||||
'hsts_sub' => $hsts_sub,
|
'hsts_sub' => $hsts_sub,
|
||||||
'hsts_preload' => $hsts_preload
|
'hsts_preload' => $hsts_preload,
|
||||||
|
'ocsp_stapling' => $ocsp_stapling
|
||||||
);
|
);
|
||||||
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
@@ -876,9 +898,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
|
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
|
||||||
`ismainbutsubto` = :ismainbutsubto,
|
`ismainbutsubto` = :ismainbutsubto,
|
||||||
`letsencrypt` = :letsencrypt,
|
`letsencrypt` = :letsencrypt,
|
||||||
|
`http2` = :http2,
|
||||||
`hsts` = :hsts,
|
`hsts` = :hsts,
|
||||||
`hsts_sub` = :hsts_sub,
|
`hsts_sub` = :hsts_sub,
|
||||||
`hsts_preload` = :hsts_preload
|
`hsts_preload` = :hsts_preload,
|
||||||
|
`ocsp_stapling` = :ocsp_stapling
|
||||||
");
|
");
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
$domainid = Database::lastInsertId();
|
$domainid = Database::lastInsertId();
|
||||||
@@ -1058,11 +1082,15 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$phpconfigs = '';
|
$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)) {
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
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 {
|
} else {
|
||||||
$phpconfigs .= makeoption($row['description'], $row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true);
|
$phpconfigs .= makeoption($row['description'], $row['id'], Settings::Get('system.mod_fcgid_defaultini'), true, true);
|
||||||
}
|
}
|
||||||
@@ -1340,6 +1368,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
|
|
||||||
$phpenabled = isset($_POST['phpenabled']) ? intval($_POST['phpenabled']) : 0;
|
$phpenabled = isset($_POST['phpenabled']) ? intval($_POST['phpenabled']) : 0;
|
||||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 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) {
|
if ((int) Settings::Get('system.mod_fcgid') == 1 || (int) Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$phpsettingid = (int) $_POST['phpsettingid'];
|
$phpsettingid = (int) $_POST['phpsettingid'];
|
||||||
@@ -1369,6 +1398,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$phpsettingid = $result['phpsettingid'];
|
$phpsettingid = $result['phpsettingid'];
|
||||||
|
$phpfs = 1;
|
||||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||||
}
|
}
|
||||||
@@ -1376,6 +1406,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$phpenabled = $result['phpenabled'];
|
$phpenabled = $result['phpenabled'];
|
||||||
$openbasedir = $result['openbasedir'];
|
$openbasedir = $result['openbasedir'];
|
||||||
$phpsettingid = $result['phpsettingid'];
|
$phpsettingid = $result['phpsettingid'];
|
||||||
|
$phpfs = 1;
|
||||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||||
}
|
}
|
||||||
@@ -1416,11 +1447,16 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$letsencrypt = (int) $_POST['letsencrypt'];
|
$letsencrypt = (int) $_POST['letsencrypt'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$http2 = isset($_POST['http2']) && (int)$_POST['http2'] == 1 ? 1 : 0;
|
||||||
|
|
||||||
// HSTS
|
// HSTS
|
||||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
$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_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;
|
$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();
|
$ssl_ipandports = array();
|
||||||
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
|
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
|
||||||
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
|
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
|
||||||
@@ -1450,6 +1486,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
$ssl_redirect = 0;
|
$ssl_redirect = 0;
|
||||||
$letsencrypt = 0;
|
$letsencrypt = 0;
|
||||||
|
$http2 = 0;
|
||||||
// we need this for the serialize
|
// we need this for the serialize
|
||||||
// if ssl is disabled or no ssl-ip/port exists
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
$ssl_ipandports[] = - 1;
|
$ssl_ipandports[] = - 1;
|
||||||
@@ -1458,10 +1495,14 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$hsts_maxage = 0;
|
$hsts_maxage = 0;
|
||||||
$hsts_sub = 0;
|
$hsts_sub = 0;
|
||||||
$hsts_preload = 0;
|
$hsts_preload = 0;
|
||||||
|
|
||||||
|
// OCSP stapling
|
||||||
|
$ocsp_stapling = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$ssl_redirect = 0;
|
$ssl_redirect = 0;
|
||||||
$letsencrypt = 0;
|
$letsencrypt = 0;
|
||||||
|
$http2 = 0;
|
||||||
// we need this for the serialize
|
// we need this for the serialize
|
||||||
// if ssl is disabled or no ssl-ip/port exists
|
// if ssl is disabled or no ssl-ip/port exists
|
||||||
$ssl_ipandports[] = - 1;
|
$ssl_ipandports[] = - 1;
|
||||||
@@ -1470,12 +1511,20 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$hsts_maxage = 0;
|
$hsts_maxage = 0;
|
||||||
$hsts_sub = 0;
|
$hsts_sub = 0;
|
||||||
$hsts_preload = 0;
|
$hsts_preload = 0;
|
||||||
|
|
||||||
|
// OCSP stapling
|
||||||
|
$ocsp_stapling = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't enable let's encrypt for wildcard domains
|
// We can't enable let's encrypt for wildcard domains when using acme-v1
|
||||||
if ($serveraliasoption == '0' && $letsencrypt == '1') {
|
if ($serveraliasoption == '0' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||||
standard_error('nowildcardwithletsencrypt');
|
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
|
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||||
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
||||||
@@ -1601,6 +1650,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'phpenabled' => $phpenabled,
|
'phpenabled' => $phpenabled,
|
||||||
'openbasedir' => $openbasedir,
|
'openbasedir' => $openbasedir,
|
||||||
'phpsettingid' => $phpsettingid,
|
'phpsettingid' => $phpsettingid,
|
||||||
|
'phpsettingsforsubdomains' => $phpfs,
|
||||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||||
'specialsettings' => $specialsettings,
|
'specialsettings' => $specialsettings,
|
||||||
@@ -1613,9 +1663,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'ipandport' => serialize($ipandports),
|
'ipandport' => serialize($ipandports),
|
||||||
'ssl_ipandport' => serialize($ssl_ipandports),
|
'ssl_ipandport' => serialize($ssl_ipandports),
|
||||||
'letsencrypt' => $letsencrypt,
|
'letsencrypt' => $letsencrypt,
|
||||||
|
'http2' => $http2,
|
||||||
'hsts_maxage' => $hsts_maxage,
|
'hsts_maxage' => $hsts_maxage,
|
||||||
'hsts_sub' => $hsts_sub,
|
'hsts_sub' => $hsts_sub,
|
||||||
'hsts_preload' => $hsts_preload
|
'hsts_preload' => $hsts_preload,
|
||||||
|
'ocsp_stapling' => $ocsp_stapling
|
||||||
);
|
);
|
||||||
|
|
||||||
$security_questions = array(
|
$security_questions = array(
|
||||||
@@ -1634,7 +1686,28 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
|
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
|
||||||
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
|
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
|
||||||
|
|
||||||
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'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload']) {
|
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');
|
inserttask('1');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1786,9 +1859,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$update_data['termination_date'] = $termination_date;
|
$update_data['termination_date'] = $termination_date;
|
||||||
$update_data['ismainbutsubto'] = $issubof;
|
$update_data['ismainbutsubto'] = $issubof;
|
||||||
$update_data['letsencrypt'] = $letsencrypt;
|
$update_data['letsencrypt'] = $letsencrypt;
|
||||||
|
$update_data['http2'] = $http2;
|
||||||
$update_data['hsts'] = $hsts_maxage;
|
$update_data['hsts'] = $hsts_maxage;
|
||||||
$update_data['hsts_sub'] = $hsts_sub;
|
$update_data['hsts_sub'] = $hsts_sub;
|
||||||
$update_data['hsts_preload'] = $hsts_preload;
|
$update_data['hsts_preload'] = $hsts_preload;
|
||||||
|
$update_data['ocsp_stapling'] = $ocsp_stapling;
|
||||||
$update_data['id'] = $id;
|
$update_data['id'] = $id;
|
||||||
|
|
||||||
$update_stmt = Database::prepare("
|
$update_stmt = Database::prepare("
|
||||||
@@ -1818,9 +1893,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
`termination_date` = :termination_date,
|
`termination_date` = :termination_date,
|
||||||
`ismainbutsubto` = :ismainbutsubto,
|
`ismainbutsubto` = :ismainbutsubto,
|
||||||
`letsencrypt` = :letsencrypt,
|
`letsencrypt` = :letsencrypt,
|
||||||
|
`http2` = :http2,
|
||||||
`hsts` = :hsts,
|
`hsts` = :hsts,
|
||||||
`hsts_sub` = :hsts_sub,
|
`hsts_sub` = :hsts_sub,
|
||||||
`hsts_preload` = :hsts_preload
|
`hsts_preload` = :hsts_preload,
|
||||||
|
`ocsp_stapling` = :ocsp_stapling
|
||||||
WHERE `id` = :id
|
WHERE `id` = :id
|
||||||
");
|
");
|
||||||
Database::pexecute($update_stmt, $update_data);
|
Database::pexecute($update_stmt, $update_data);
|
||||||
@@ -1829,11 +1906,18 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$_update_data['adminid'] = $adminid;
|
$_update_data['adminid'] = $adminid;
|
||||||
$_update_data['phpenabled'] = $phpenabled;
|
$_update_data['phpenabled'] = $phpenabled;
|
||||||
$_update_data['openbasedir'] = $openbasedir;
|
$_update_data['openbasedir'] = $openbasedir;
|
||||||
$_update_data['phpsettingid'] = $phpsettingid;
|
|
||||||
$_update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
|
$_update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
|
||||||
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
|
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
|
||||||
$_update_data['parentdomainid'] = $id;
|
$_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,
|
// if we have no more ssl-ip's for this domain,
|
||||||
// all its subdomains must have "ssl-redirect = 0"
|
// all its subdomains must have "ssl-redirect = 0"
|
||||||
// and disable let's encrypt
|
// and disable let's encrypt
|
||||||
@@ -1848,10 +1932,9 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
`adminid` = :adminid,
|
`adminid` = :adminid,
|
||||||
`phpenabled` = :phpenabled,
|
`phpenabled` = :phpenabled,
|
||||||
`openbasedir` = :openbasedir,
|
`openbasedir` = :openbasedir,
|
||||||
`phpsettingid` = :phpsettingid,
|
|
||||||
`mod_fcgid_starter` = :mod_fcgid_starter,
|
`mod_fcgid_starter` = :mod_fcgid_starter,
|
||||||
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests
|
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests
|
||||||
" . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
" . $update_phpconfig . $upd_specialsettings . $updatechildren . $update_sslredirect . "
|
||||||
WHERE `parentdomainid` = :parentdomainid
|
WHERE `parentdomainid` = :parentdomainid
|
||||||
");
|
");
|
||||||
Database::pexecute($_update_stmt, $_update_data);
|
Database::pexecute($_update_stmt, $_update_data);
|
||||||
@@ -2121,10 +2204,18 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$result['add_date'] = date('Y-m-d', $result['add_date']);
|
$result['add_date'] = date('Y-m-d', $result['add_date']);
|
||||||
|
|
||||||
$phpconfigs = '';
|
$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)) {
|
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);
|
$result = htmlentities_array($result);
|
||||||
@@ -2164,6 +2255,8 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
|
|
||||||
// update customer/admin counters
|
// update customer/admin counters
|
||||||
updateCounters(false);
|
updateCounters(false);
|
||||||
|
inserttask('1');
|
||||||
|
inserttask('4');
|
||||||
|
|
||||||
$result_str = $result['imported'] . ' / ' . $result['all'];
|
$result_str = $result['imported'] . ' / ' . $result['all'];
|
||||||
standard_success('domain_import_successfully', $result_str, array(
|
standard_success('domain_import_successfully', $result_str, array(
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ if ($page == 'overview') {
|
|||||||
$default_lang = $userinfo['def_language'];
|
$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);
|
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ if ($page == 'log'
|
|||||||
'user' => $lng['logger']['user'],
|
'user' => $lng['logger']['user'],
|
||||||
'text' => $lng['logger']['action']
|
'text' => $lng['logger']['action']
|
||||||
);
|
);
|
||||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||||
$result_stmt = Database::query('
|
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy();
|
||||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
$result_stmt = Database::query($query . ' ' . $paging->getSqlLimit());
|
||||||
);
|
$result_cnt_stmt = Database::query($query);
|
||||||
$logs_count = Database::num_rows();
|
$logs_count = $result_cnt_stmt->rowCount();
|
||||||
$paging->setEntries($logs_count);
|
$paging->setEntries($logs_count);
|
||||||
$sortcode = $paging->getHtmlSortCode($lng);
|
$sortcode = $paging->getHtmlSortCode($lng);
|
||||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
@@ -67,7 +67,7 @@ if ($page == 'log'
|
|||||||
foreach ($clog as $action => $logrows) {
|
foreach ($clog as $action => $logrows) {
|
||||||
$_action = 0;
|
$_action = 0;
|
||||||
foreach ($logrows as $row) {
|
foreach ($logrows as $row) {
|
||||||
if ($paging->checkDisplay($i)) {
|
// if ($paging->checkDisplay($i)) {
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ if ($page == 'log'
|
|||||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||||
$count++;
|
$count++;
|
||||||
$_action = $action;
|
$_action = $action;
|
||||||
}
|
// }
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
* @package Panel
|
* @package Panel
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'admin');
|
define('AREA', 'admin');
|
||||||
require './lib/init.php';
|
require './lib/init.php';
|
||||||
|
|
||||||
@@ -27,104 +26,111 @@ if (isset($_POST['id'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($page == 'overview') {
|
if ($page == 'overview') {
|
||||||
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
|
|
||||||
$tablecontent = '';
|
$tablecontent = '';
|
||||||
$count = 0;
|
$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)) {
|
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
$domainresult = false;
|
$domainresult = false;
|
||||||
$query_params = array('id' => $row['id']);
|
$query_params = array(
|
||||||
|
'id' => $row['id']
|
||||||
$query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."`
|
);
|
||||||
|
|
||||||
|
$query = "SELECT * FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||||
WHERE `phpsettingid` = :id
|
WHERE `phpsettingid` = :id
|
||||||
AND `parentdomainid` = '0'";
|
AND `parentdomainid` = '0'";
|
||||||
|
|
||||||
if ((int)$userinfo['domains_see_all'] == 0) {
|
if ((int) $userinfo['domains_see_all'] == 0) {
|
||||||
$query .= " AND `adminid` = :adminid";
|
$query .= " AND `adminid` = :adminid";
|
||||||
$query_params['adminid'] = $userinfo['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("
|
$ssdids_res = Database::query("
|
||||||
SELECT DISTINCT `standardsubdomain` FROM `".TABLE_PANEL_CUSTOMERS."`
|
SELECT DISTINCT `standardsubdomain` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||||
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;"
|
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;");
|
||||||
);
|
|
||||||
$ssdids = array();
|
$ssdids = array();
|
||||||
while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) {
|
while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$ssdids[] = $ssd['standardsubdomain'];
|
$ssdids[] = $ssd['standardsubdomain'];
|
||||||
}
|
}
|
||||||
if (count($ssdids) > 0) {
|
if (count($ssdids) > 0) {
|
||||||
$query .= " AND `id` NOT IN (".implode(', ', $ssdids).")";
|
$query .= " AND `id` NOT IN (" . implode(', ', $ssdids) . ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$domainresult_stmt = Database::prepare($query);
|
$domainresult_stmt = Database::prepare($query);
|
||||||
Database::pexecute($domainresult_stmt, $query_params);
|
Database::pexecute($domainresult_stmt, $query_params);
|
||||||
|
|
||||||
$domains = '';
|
$domains = '';
|
||||||
if (Database::num_rows() > 0) {
|
if (Database::num_rows() > 0) {
|
||||||
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
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
|
// check whether we use that config as froxor-vhost config
|
||||||
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id']
|
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id'] || Settings::Get('phpfpm.vhost_defaultini') == $row['id']) {
|
||||||
|| Settings::Get('phpfpm.vhost_defaultini') == $row['id']
|
|
||||||
) {
|
|
||||||
$domains .= Settings::Get('system.hostname');
|
$domains .= Settings::Get('system.hostname');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($domains == '') {
|
if ($domains == '') {
|
||||||
$domains = $lng['admin']['phpsettings']['notused'];
|
$domains = $lng['admin']['phpsettings']['notused'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// check whether this is our default config
|
// check whether this is our default config
|
||||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
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'])) {
|
||||||
&& Settings::Get('system.mod_fcgid_defaultini') == $row['id'])
|
$row['description'] = '<b>' . $row['description'] . '</b>';
|
||||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
|
||||||
&& Settings::Get('phpfpm.defaultini') == $row['id'])
|
|
||||||
) {
|
|
||||||
$row['description'] = '<b>'.$row['description'].'</b>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$count ++;
|
$count ++;
|
||||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
|
|
||||||
if ((int)$userinfo['change_serversettings'] == 1) {
|
if ((int) $userinfo['change_serversettings'] == 1) {
|
||||||
|
|
||||||
if (isset($_POST['send'])
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
&& $_POST['send'] == 'send'
|
|
||||||
) {
|
|
||||||
$description = validate($_POST['description'], 'description');
|
$description = validate($_POST['description'], 'description');
|
||||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||||
|
|
||||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
$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_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array(
|
||||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
'-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]*$/');
|
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||||
// disable fpm stuff
|
// disable fpm stuff
|
||||||
|
$fpm_config_id = 1;
|
||||||
$fpm_enableslowlog = 0;
|
$fpm_enableslowlog = 0;
|
||||||
$fpm_reqtermtimeout = 0;
|
$fpm_reqtermtimeout = 0;
|
||||||
$fpm_reqslowtimeout = 0;
|
$fpm_reqslowtimeout = 0;
|
||||||
}
|
$fpm_pass_authorizationheader = 0;
|
||||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
} elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
$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_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_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
|
// disable fcgid stuff
|
||||||
$binary = '/usr/bin/php-cgi';
|
$binary = '/usr/bin/php-cgi';
|
||||||
$file_extensions = 'php';
|
$file_extensions = 'php';
|
||||||
@@ -132,13 +138,11 @@ if ($page == 'overview') {
|
|||||||
$mod_fcgid_maxrequests = 0;
|
$mod_fcgid_maxrequests = 0;
|
||||||
$mod_fcgid_umask = "022";
|
$mod_fcgid_umask = "022";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($description) == 0
|
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||||
|| strlen($description) > 50
|
|
||||||
) {
|
|
||||||
standard_error('descriptioninvalid');
|
standard_error('descriptioninvalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||||
`description` = :desc,
|
`description` = :desc,
|
||||||
@@ -150,8 +154,9 @@ if ($page == 'overview') {
|
|||||||
`fpm_slowlog` = :fpmslow,
|
`fpm_slowlog` = :fpmslow,
|
||||||
`fpm_reqterm` = :fpmreqterm,
|
`fpm_reqterm` = :fpmreqterm,
|
||||||
`fpm_reqslow` = :fpmreqslow,
|
`fpm_reqslow` = :fpmreqslow,
|
||||||
`phpsettings` = :phpsettings"
|
`phpsettings` = :phpsettings,
|
||||||
);
|
`fpmsettingid` = :fpmsettingid,
|
||||||
|
`pass_authorizationheader` = :fpmpassauth");
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
'desc' => $description,
|
'desc' => $description,
|
||||||
'binary' => $binary,
|
'binary' => $binary,
|
||||||
@@ -162,123 +167,133 @@ if ($page == 'overview') {
|
|||||||
'fpmslow' => $fpm_enableslowlog,
|
'fpmslow' => $fpm_enableslowlog,
|
||||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||||
'phpsettings' => $phpsettings
|
'phpsettings' => $phpsettings,
|
||||||
|
'fpmsettingid' => $fpm_config_id,
|
||||||
|
'fpmpassauth' => $fpm_pass_authorizationheader
|
||||||
);
|
);
|
||||||
Database::pexecute($ins_stmt, $ins_data);
|
Database::pexecute($ins_stmt, $ins_data);
|
||||||
|
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'");
|
$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 {
|
} else {
|
||||||
|
|
||||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
$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);
|
$phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data);
|
||||||
|
|
||||||
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
||||||
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
|
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||||
);
|
$result = Database::pexecute_first($result_stmt, array(
|
||||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
'id' => $id
|
||||||
|
));
|
||||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
|
||||||
&& Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $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)) {
|
||||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
|
||||||
&& Settings::Get('phpfpm.vhost_defaultini') == $id)
|
|
||||||
) {
|
|
||||||
standard_error('cannotdeletehostnamephpconfig');
|
standard_error('cannotdeletehostnamephpconfig');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
if ((Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_defaultini') == $id) || (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.defaultini') == $id)) {
|
||||||
&& Settings::Get('system.mod_fcgid_defaultini') == $id)
|
|
||||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
|
||||||
&& Settings::Get('phpfpm.defaultini') == $id)
|
|
||||||
) {
|
|
||||||
standard_error('cannotdeletedefaultphpconfig');
|
standard_error('cannotdeletedefaultphpconfig');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result['id'] != 0
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
||||||
&& $result['id'] == $id
|
{
|
||||||
&& (int)$userinfo['change_serversettings'] == 1
|
|
||||||
&& $id != 1 // cannot delete the default php.config
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
) {
|
|
||||||
|
|
||||||
if (isset($_POST['send'])
|
|
||||||
&& $_POST['send'] == 'send'
|
|
||||||
) {
|
|
||||||
// set php-config to default for all domains using the
|
// set php-config to default for all domains using the
|
||||||
// config that is to be deleted
|
// config that is to be deleted
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id"
|
`phpsettingid` = '1' WHERE `phpsettingid` = :id");
|
||||||
);
|
Database::pexecute($upd_stmt, array(
|
||||||
Database::pexecute($upd_stmt, array('id' => $id));
|
'id' => $id
|
||||||
|
));
|
||||||
|
|
||||||
$del_stmt = Database::prepare("
|
$del_stmt = Database::prepare("
|
||||||
DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||||
);
|
Database::pexecute($del_stmt, array(
|
||||||
Database::pexecute($del_stmt, array('id' => $id));
|
'id' => $id
|
||||||
|
));
|
||||||
|
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
$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));
|
redirectTo($filename, array(
|
||||||
|
'page' => $page,
|
||||||
|
's' => $s
|
||||||
|
));
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
|
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id");
|
||||||
);
|
$result = Database::pexecute_first($result_stmt, array(
|
||||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
'id' => $id
|
||||||
|
));
|
||||||
if ($result['id'] != 0
|
|
||||||
&& $result['id'] == $id
|
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['change_serversettings'] == 1) {
|
||||||
&& (int)$userinfo['change_serversettings'] == 1
|
|
||||||
) {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
|
|
||||||
if (isset($_POST['send'])
|
|
||||||
&& $_POST['send'] == 'send'
|
|
||||||
) {
|
|
||||||
$description = validate($_POST['description'], 'description');
|
$description = validate($_POST['description'], 'description');
|
||||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||||
|
|
||||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
$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_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array(
|
||||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
'-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]*$/');
|
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||||
// disable fpm stuff
|
// disable fpm stuff
|
||||||
|
$fpm_config_id = 1;
|
||||||
$fpm_enableslowlog = 0;
|
$fpm_enableslowlog = 0;
|
||||||
$fpm_reqtermtimeout = 0;
|
$fpm_reqtermtimeout = 0;
|
||||||
$fpm_reqslowtimeout = 0;
|
$fpm_reqslowtimeout = 0;
|
||||||
}
|
$fpm_pass_authorizationheader = 0;
|
||||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
} elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
$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_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_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
|
// disable fcgid stuff
|
||||||
$binary = '/usr/bin/php-cgi';
|
$binary = '/usr/bin/php-cgi';
|
||||||
$file_extensions = 'php';
|
$file_extensions = 'php';
|
||||||
@@ -286,13 +301,11 @@ if ($page == 'overview') {
|
|||||||
$mod_fcgid_maxrequests = 0;
|
$mod_fcgid_maxrequests = 0;
|
||||||
$mod_fcgid_umask = "022";
|
$mod_fcgid_umask = "022";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($description) == 0
|
if (strlen($description) == 0 || strlen($description) > 50) {
|
||||||
|| strlen($description) > 50
|
|
||||||
) {
|
|
||||||
standard_error('descriptioninvalid');
|
standard_error('descriptioninvalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$upd_stmt = Database::prepare("
|
$upd_stmt = Database::prepare("
|
||||||
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||||
`description` = :desc,
|
`description` = :desc,
|
||||||
@@ -304,39 +317,292 @@ if ($page == 'overview') {
|
|||||||
`fpm_slowlog` = :fpmslow,
|
`fpm_slowlog` = :fpmslow,
|
||||||
`fpm_reqterm` = :fpmreqterm,
|
`fpm_reqterm` = :fpmreqterm,
|
||||||
`fpm_reqslow` = :fpmreqslow,
|
`fpm_reqslow` = :fpmreqslow,
|
||||||
`phpsettings` = :phpsettings
|
`phpsettings` = :phpsettings,
|
||||||
WHERE `id` = :id"
|
`fpmsettingid` = :fpmsettingid,
|
||||||
);
|
`pass_authorizationheader` = :fpmpassauth
|
||||||
|
WHERE `id` = :id");
|
||||||
$upd_data = array(
|
$upd_data = array(
|
||||||
'desc' => $description,
|
'desc' => $description,
|
||||||
'binary' => $binary,
|
'binary' => $binary,
|
||||||
'fext' => $file_extensions,
|
'fext' => $file_extensions,
|
||||||
'starter' => $mod_fcgid_starter,
|
'starter' => $mod_fcgid_starter,
|
||||||
'mreq' => $mod_fcgid_maxrequests,
|
'mreq' => $mod_fcgid_maxrequests,
|
||||||
'umask' => $mod_fcgid_umask,
|
'umask' => $mod_fcgid_umask,
|
||||||
'fpmslow' => $fpm_enableslowlog,
|
'fpmslow' => $fpm_enableslowlog,
|
||||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||||
'phpsettings' => $phpsettings,
|
'phpsettings' => $phpsettings,
|
||||||
'id' => $id
|
'fpmsettingid' => $fpm_config_id,
|
||||||
|
'fpmpassauth' => $fpm_pass_authorizationheader,
|
||||||
|
'id' => $id
|
||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, $upd_data);
|
Database::pexecute($upd_stmt, $upd_data);
|
||||||
|
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
$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 {
|
} 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);
|
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);
|
||||||
|
|
||||||
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
||||||
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
||||||
|
|
||||||
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
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 {
|
} else {
|
||||||
standard_error('nopermissionsorinvalidid');
|
standard_error('nopermissionsorinvalidid');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,3 +290,107 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
|||||||
}
|
}
|
||||||
eval("echo \"" . getTemplate("settings/integritycheck") . "\";");
|
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;
|
$add = false;
|
||||||
while (list($language_file, $language_name) = each($languages)) {
|
foreach ($languages as $language_file => $language_name) {
|
||||||
|
|
||||||
$templates_done = array();
|
$templates_done = array();
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
@@ -328,7 +328,7 @@ if ($action == '') {
|
|||||||
$language_options = '';
|
$language_options = '';
|
||||||
$template_options = '';
|
$template_options = '';
|
||||||
|
|
||||||
while (list($language_file, $language_name) = each($languages)) {
|
foreach ($languages as $language_file => $language_name) {
|
||||||
$templates = array();
|
$templates = array();
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ if ($page == 'overview') {
|
|||||||
if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') {
|
if ($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') {
|
||||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||||
|
|
||||||
if (strpos($_POST['subdomain'], '--') !== false) {
|
if (substr($_POST['subdomain'], 0, 4) == 'xn--') {
|
||||||
standard_error('domain_nopunycode');
|
standard_error('domain_nopunycode');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,6 +327,9 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
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,
|
// 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
|
// set default path to subdomain or domain name
|
||||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||||
@@ -334,9 +337,6 @@ if ($page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
}
|
}
|
||||||
if (strstr($path, ":") !== FALSE) {
|
|
||||||
standard_error('pathmaynotcontaincolon');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$_doredirect = true;
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
@@ -405,6 +405,10 @@ if ($page == 'overview') {
|
|||||||
// assign default config
|
// assign default config
|
||||||
$phpsid_result['phpsettingid'] = 1;
|
$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
|
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`customerid` = :customerid,
|
`customerid` = :customerid,
|
||||||
@@ -415,6 +419,7 @@ if ($page == 'overview') {
|
|||||||
`wwwserveralias` = :wwwserveralias,
|
`wwwserveralias` = :wwwserveralias,
|
||||||
`isemaildomain` = :isemaildomain,
|
`isemaildomain` = :isemaildomain,
|
||||||
`iswildcarddomain` = :iswildcarddomain,
|
`iswildcarddomain` = :iswildcarddomain,
|
||||||
|
`phpenabled` = :phpenabled,
|
||||||
`openbasedir` = :openbasedir,
|
`openbasedir` = :openbasedir,
|
||||||
`openbasedir_path` = :openbasedir_path,
|
`openbasedir_path` = :openbasedir_path,
|
||||||
`speciallogfile` = :speciallogfile,
|
`speciallogfile` = :speciallogfile,
|
||||||
@@ -437,6 +442,7 @@ if ($page == 'overview') {
|
|||||||
"isemaildomain" => $domain_check['subcanemaildomain'] == '3' ? '1' : '0',
|
"isemaildomain" => $domain_check['subcanemaildomain'] == '3' ? '1' : '0',
|
||||||
"openbasedir" => $domain_check['openbasedir'],
|
"openbasedir" => $domain_check['openbasedir'],
|
||||||
"openbasedir_path" => $openbasedir_path,
|
"openbasedir_path" => $openbasedir_path,
|
||||||
|
"phpenabled" => $domain_check['phpenabled'],
|
||||||
"speciallogfile" => $domain_check['speciallogfile'],
|
"speciallogfile" => $domain_check['speciallogfile'],
|
||||||
"specialsettings" => $domain_check['specialsettings'],
|
"specialsettings" => $domain_check['specialsettings'],
|
||||||
"ssl_redirect" => $ssl_redirect,
|
"ssl_redirect" => $ssl_redirect,
|
||||||
@@ -532,6 +538,27 @@ if ($page == 'overview') {
|
|||||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
||||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
$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_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domains_add.php';
|
||||||
$subdomain_add_form = htmlform::genHTMLForm($subdomain_add_data);
|
$subdomain_add_form = htmlform::genHTMLForm($subdomain_add_data);
|
||||||
|
|
||||||
@@ -569,6 +596,9 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!preg_match('/^https?\:\/\//', $path) || !validateUrl($path)) {
|
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,
|
// 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
|
// set default path to subdomain or domain name
|
||||||
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
if ((($path == '') || ($path == '/')) && Settings::Get('system.documentroot_use_default_value') == 1) {
|
||||||
@@ -576,9 +606,6 @@ if ($page == 'overview') {
|
|||||||
} else {
|
} else {
|
||||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||||
}
|
}
|
||||||
if (strstr($path, ":") !== FALSE) {
|
|
||||||
standard_error('pathmaynotcontaincolon');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$_doredirect = true;
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
@@ -622,6 +649,13 @@ if ($page == 'overview') {
|
|||||||
$openbasedir_path = '0';
|
$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') {
|
if (isset($_POST['ssl_redirect']) && $_POST['ssl_redirect'] == '1') {
|
||||||
// a ssl-redirect only works if there actually is a
|
// a ssl-redirect only works if there actually is a
|
||||||
// ssl ip/port assigned to the domain
|
// ssl ip/port assigned to the domain
|
||||||
@@ -647,10 +681,15 @@ if ($page == 'overview') {
|
|||||||
$letsencrypt = '0';
|
$letsencrypt = '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't enable let's encrypt for wildcard - domains
|
// We can't enable let's encrypt for wildcard - domains when using acme-v1
|
||||||
if ($iswildcarddomain == '1' && $letsencrypt == '1') {
|
if ($iswildcarddomain == '1' && $letsencrypt == '1' && Settings::Get('system.leapiversion') == '1') {
|
||||||
standard_error('nowildcardwithletsencrypt');
|
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
|
// Temporarily deactivate ssl_redirect until Let's Encrypt certificate was generated
|
||||||
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
if ($ssl_redirect > 0 && $letsencrypt == 1 && $result['letsencrypt'] != $letsencrypt) {
|
||||||
@@ -690,6 +729,7 @@ if ($page == 'overview') {
|
|||||||
|| $hsts_maxage != $result['hsts']
|
|| $hsts_maxage != $result['hsts']
|
||||||
|| $hsts_sub != $result['hsts_sub']
|
|| $hsts_sub != $result['hsts_sub']
|
||||||
|| $hsts_preload != $result['hsts_preload']
|
|| $hsts_preload != $result['hsts_preload']
|
||||||
|
|| $phpsettingid != $result['phpsettingid']
|
||||||
) {
|
) {
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
||||||
|
|
||||||
@@ -704,7 +744,8 @@ if ($page == 'overview') {
|
|||||||
`letsencrypt`= :letsencrypt,
|
`letsencrypt`= :letsencrypt,
|
||||||
`hsts` = :hsts,
|
`hsts` = :hsts,
|
||||||
`hsts_sub` = :hsts_sub,
|
`hsts_sub` = :hsts_sub,
|
||||||
`hsts_preload` = :hsts_preload
|
`hsts_preload` = :hsts_preload,
|
||||||
|
`phpsettingid` = :phpsettingid
|
||||||
WHERE `customerid`= :customerid
|
WHERE `customerid`= :customerid
|
||||||
AND `id`= :id"
|
AND `id`= :id"
|
||||||
);
|
);
|
||||||
@@ -720,6 +761,7 @@ if ($page == 'overview') {
|
|||||||
"hsts" => $hsts_maxage,
|
"hsts" => $hsts_maxage,
|
||||||
"hsts_sub" => $hsts_sub,
|
"hsts_sub" => $hsts_sub,
|
||||||
"hsts_preload" => $hsts_preload,
|
"hsts_preload" => $hsts_preload,
|
||||||
|
"phpsettingid" => $phpsettingid,
|
||||||
"customerid" => $userinfo['customerid'],
|
"customerid" => $userinfo['customerid'],
|
||||||
"id" => $id
|
"id" => $id
|
||||||
);
|
);
|
||||||
@@ -844,6 +886,27 @@ if ($page == 'overview') {
|
|||||||
$result_ipandport['ip'] .= $rowip['ip'] . "<br />";
|
$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'];
|
$domainip = $result_ipandport['ip'];
|
||||||
$result = htmlentities_array($result);
|
$result = htmlentities_array($result);
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ if ($page == 'overview') {
|
|||||||
$row['destination'] = explode(' ', $row['destination']);
|
$row['destination'] = explode(' ', $row['destination']);
|
||||||
uasort($row['destination'], 'strcasecmp');
|
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]);
|
$row['destination'][$dest_id] = $idna_convert->decode($row['destination'][$dest_id]);
|
||||||
|
|
||||||
if ($row['destination'][$dest_id] == $row['email_full']) {
|
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']));
|
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $result['popaccountid']));
|
||||||
$update_users_query_addon .= " , `email_accounts_used` = `email_accounts_used` - 1 ";
|
$update_users_query_addon .= " , `email_accounts_used` = `email_accounts_used` - 1 ";
|
||||||
$number_forwarders-= 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 {
|
} else {
|
||||||
$number_forwarders = 0;
|
$number_forwarders = 0;
|
||||||
@@ -323,7 +324,7 @@ if ($page == 'overview') {
|
|||||||
$forwarders = '';
|
$forwarders = '';
|
||||||
$forwarders_count = 0;
|
$forwarders_count = 0;
|
||||||
|
|
||||||
while (list($dest_id, $destination) = each($result['destination'])) {
|
foreach ($result['destination'] as $dest_id => $destination) {
|
||||||
$destination = $idna_convert->decode($destination);
|
$destination = $idna_convert->decode($destination);
|
||||||
|
|
||||||
if ($destination != $result['email_full'] && $destination != '') {
|
if ($destination != $result['email_full'] && $destination != '') {
|
||||||
@@ -652,7 +653,7 @@ if ($page == 'overview') {
|
|||||||
|
|
||||||
$password = validatePassword($password);
|
$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);
|
$cryptPassword = makeCryptPassword($password);
|
||||||
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
||||||
SET " . (Settings::Get('system.mailpwcleartext') == '1' ? "`password` = :password, " : '') . "
|
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'])) {
|
if ($userinfo['email_quota'] != '-1' && ($quota == 0 || ($quota + $userinfo['email_quota_used'] - $result['quota']) > $userinfo['email_quota'])) {
|
||||||
standard_error('allocatetoomuchquota', $quota);
|
standard_error('allocatetoomuchquota', $quota);
|
||||||
} else {
|
} 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 . "`
|
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_USERS . "`
|
||||||
SET `quota` = :quota
|
SET `quota` = :quota
|
||||||
WHERE `id` = :id
|
WHERE `id` = :id
|
||||||
@@ -834,7 +835,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($stmt, array("cid" => $userinfo['customerid']));
|
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));
|
redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -895,7 +896,7 @@ if ($page == 'overview') {
|
|||||||
);
|
);
|
||||||
Database::pexecute($stmt, array("cid" => $userinfo['customerid']));
|
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));
|
redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||||
} else {
|
} 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));
|
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
|
// refs #293
|
||||||
if (isset($_POST['delete_userfiles']) && (int)$_POST['delete_userfiles'] == 1) {
|
if (isset($_POST['delete_userfiles']) && (int)$_POST['delete_userfiles'] == 1) {
|
||||||
inserttask('8', $userinfo['loginname'], $result['homedir']);
|
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 . "`
|
$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'] . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'");
|
||||||
|
inserttask(5);
|
||||||
$description = validate($_POST['ftp_description'], 'description');
|
$description = validate($_POST['ftp_description'], 'description');
|
||||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||||
SET `description` = :desc, `shell` = :shell
|
SET `description` = :desc, `shell` = :shell
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ if ($page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$language_options = '';
|
$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);
|
$language_options .= makeoption($language_name, $language_file, $default_lang, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,17 +16,15 @@
|
|||||||
* @package Panel
|
* @package Panel
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require './lib/init.php';
|
require './lib/init.php';
|
||||||
|
|
||||||
// redirect if this customer page is hidden via settings
|
// 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');
|
redirectTo('customer_index.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page == 'log'
|
if ($page == 'log') {
|
||||||
) {
|
|
||||||
if ($action == '') {
|
if ($action == '') {
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'date' => $lng['logger']['date'],
|
'date' => $lng['logger']['date'],
|
||||||
@@ -34,37 +32,39 @@ if ($page == 'log'
|
|||||||
'user' => $lng['logger']['user'],
|
'user' => $lng['logger']['user'],
|
||||||
'text' => $lng['logger']['action']
|
'text' => $lng['logger']['action']
|
||||||
);
|
);
|
||||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||||
$result_stmt = Database::prepare('
|
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy();
|
||||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
$result_stmt = Database::prepare($query . ' ' . $paging->getSqlLimit());
|
||||||
);
|
Database::pexecute($result_stmt, array(
|
||||||
Database::pexecute($result_stmt, array("loginname" => $userinfo['loginname']));
|
"loginname" => $userinfo['loginname']
|
||||||
$logs_count = Database::num_rows();
|
));
|
||||||
|
$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);
|
$paging->setEntries($logs_count);
|
||||||
$sortcode = $paging->getHtmlSortCode($lng);
|
$sortcode = $paging->getHtmlSortCode($lng);
|
||||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||||
$clog = array();
|
$clog = array();
|
||||||
|
|
||||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
if (!isset($clog[$row['action']])
|
if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
|
||||||
|| !is_array($clog[$row['action']])
|
|
||||||
) {
|
|
||||||
$clog[$row['action']] = array();
|
$clog[$row['action']] = array();
|
||||||
}
|
}
|
||||||
$clog[$row['action']][$row['logid']] = $row;
|
$clog[$row['action']][$row['logid']] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($paging->sortfield == 'date'
|
if ($paging->sortfield == 'date' && $paging->sortorder == 'desc') {
|
||||||
&& $paging->sortorder == 'desc'
|
|
||||||
) {
|
|
||||||
krsort($clog);
|
krsort($clog);
|
||||||
} else {
|
} else {
|
||||||
ksort($clog);
|
ksort($clog);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$log_count = 0;
|
$log_count = 0;
|
||||||
@@ -72,51 +72,50 @@ if ($page == 'log'
|
|||||||
foreach ($clog as $action => $logrows) {
|
foreach ($clog as $action => $logrows) {
|
||||||
$_action = 0;
|
$_action = 0;
|
||||||
foreach ($logrows as $row) {
|
foreach ($logrows as $row) {
|
||||||
if ($paging->checkDisplay($i)) {
|
// if ($paging->checkDisplay($i)) {
|
||||||
$row = htmlentities_array($row);
|
$row = htmlentities_array($row);
|
||||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||||
|
|
||||||
if ($_action != $action) {
|
if ($_action != $action) {
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case USR_ACTION:
|
case USR_ACTION:
|
||||||
$_action = $lng['admin']['customer'];
|
$_action = $lng['admin']['customer'];
|
||||||
break;
|
break;
|
||||||
case RES_ACTION:
|
case RES_ACTION:
|
||||||
$_action = $lng['logger']['reseller'];
|
$_action = $lng['logger']['reseller'];
|
||||||
break;
|
break;
|
||||||
case ADM_ACTION:
|
case ADM_ACTION:
|
||||||
$_action = $lng['logger']['admin'];
|
$_action = $lng['logger']['admin'];
|
||||||
break;
|
break;
|
||||||
case CRON_ACTION:
|
case CRON_ACTION:
|
||||||
$_action = $lng['logger']['cron'];
|
$_action = $lng['logger']['cron'];
|
||||||
break;
|
break;
|
||||||
case LOGIN_ACTION:
|
case LOGIN_ACTION:
|
||||||
$_action = $lng['logger']['login'];
|
$_action = $lng['logger']['login'];
|
||||||
break;
|
break;
|
||||||
case LOG_ERROR:
|
case LOG_ERROR:
|
||||||
$_action = $lng['logger']['intern'];
|
$_action = $lng['logger']['intern'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$_action = $lng['logger']['unknown'];
|
$_action = $lng['logger']['unknown'];
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
$row['action'] = $_action;
|
|
||||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$log_count++;
|
$row['action'] = $_action;
|
||||||
$row['type'] = getLogLevelDesc($row['type']);
|
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
|
||||||
$count++;
|
|
||||||
$_action = $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') . "\";");
|
eval("echo \"" . getTemplate('logger/logger') . "\";");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,10 +20,6 @@
|
|||||||
define('AREA', 'customer');
|
define('AREA', 'customer');
|
||||||
require './lib/init.php';
|
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'])) {
|
if (isset($_POST['id'])) {
|
||||||
|
|
||||||
|
|||||||
@@ -56,13 +56,29 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
|||||||
if (strpos($record, '--') !== false) {
|
if (strpos($record, '--') !== false) {
|
||||||
$errors[] = $lng['error']['domain_nopunycode'];
|
$errors[] = $lng['error']['domain_nopunycode'];
|
||||||
} else {
|
} 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);
|
$record = $idna_convert->encode($record);
|
||||||
|
|
||||||
|
if ($add_wildcard_again) {
|
||||||
|
$record = '*.'.$record;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* see https://redmine.froxlor.org/issues/1697
|
||||||
|
*
|
||||||
if ($type != 'SRV' && $type != 'TXT') {
|
if ($type != 'SRV' && $type != 'TXT') {
|
||||||
$check_dom = $record . '.example.com';
|
$check_dom = $record . '.example.com';
|
||||||
if (! validateDomain($check_dom)) {
|
if (! validateDomain($check_dom)) {
|
||||||
$errors[] = sprintf($lng['error']['subdomainiswrong'], $idna_convert->decode($record));
|
$errors[] = sprintf($lng['error']['subdomainiswrong'], $idna_convert->decode($record));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (strlen($record) > 63) {
|
if (strlen($record) > 63) {
|
||||||
$errors[] = $lng['error']['dns_record_toolong'];
|
$errors[] = $lng['error']['dns_record_toolong'];
|
||||||
}
|
}
|
||||||
@@ -112,6 +128,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
|||||||
if (substr($content, - 1) == '.') {
|
if (substr($content, - 1) == '.') {
|
||||||
// remove it for checks
|
// remove it for checks
|
||||||
$content = substr($content, 0, - 1);
|
$content = substr($content, 0, - 1);
|
||||||
|
} else {
|
||||||
|
// add domain name
|
||||||
|
$content .= '.' . $domain;
|
||||||
}
|
}
|
||||||
if (! validateDomain($content)) {
|
if (! validateDomain($content)) {
|
||||||
$errors[] = $lng['error']['dns_cname_invaliddom'];
|
$errors[] = $lng['error']['dns_cname_invaliddom'];
|
||||||
@@ -171,8 +190,8 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// append trailing dot (again)
|
// append trailing dot if there's none
|
||||||
if ($target != '.') {
|
if (substr($content, - 1) != '.') {
|
||||||
$content .= '.';
|
$content .= '.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ if ($action == 'login') {
|
|||||||
$language_options = '';
|
$language_options = '';
|
||||||
$language_options .= makeoption($lng['login']['profile_lng'], 'profile', 'profile', true, true);
|
$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);
|
$language_options .= makeoption($language_name, $language_file, 'profile', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ CREATE TABLE `mail_virtual` (
|
|||||||
`id` int(11) NOT NULL auto_increment,
|
`id` int(11) NOT NULL auto_increment,
|
||||||
`email` varchar(255) NOT NULL default '',
|
`email` varchar(255) NOT NULL default '',
|
||||||
`email_full` 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',
|
`domainid` int(11) NOT NULL default '0',
|
||||||
`customerid` int(11) NOT NULL default '0',
|
`customerid` int(11) NOT NULL default '0',
|
||||||
`popaccountid` int(11) NOT NULL default '0',
|
`popaccountid` int(11) NOT NULL default '0',
|
||||||
@@ -198,6 +198,7 @@ CREATE TABLE `panel_customers` (
|
|||||||
`lepublickey` mediumtext default NULL,
|
`lepublickey` mediumtext default NULL,
|
||||||
`leprivatekey` mediumtext default NULL,
|
`leprivatekey` mediumtext default NULL,
|
||||||
`leregistered` tinyint(1) NOT NULL default '0',
|
`leregistered` tinyint(1) NOT NULL default '0',
|
||||||
|
`allowed_phpconfigs` varchar(500) NOT NULL default '',
|
||||||
PRIMARY KEY (`customerid`),
|
PRIMARY KEY (`customerid`),
|
||||||
UNIQUE KEY `loginname` (`loginname`)
|
UNIQUE KEY `loginname` (`loginname`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
@@ -257,6 +258,8 @@ CREATE TABLE `panel_domains` (
|
|||||||
`hsts` varchar(10) NOT NULL default '0',
|
`hsts` varchar(10) NOT NULL default '0',
|
||||||
`hsts_sub` tinyint(1) NOT NULL default '0',
|
`hsts_sub` tinyint(1) NOT NULL default '0',
|
||||||
`hsts_preload` 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`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `customerid` (`customerid`),
|
KEY `customerid` (`customerid`),
|
||||||
KEY `parentdomain` (`parentdomainid`),
|
KEY `parentdomain` (`parentdomainid`),
|
||||||
@@ -411,6 +414,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('phpfpm', 'max_requests', '0'),
|
('phpfpm', 'max_requests', '0'),
|
||||||
('phpfpm', 'tmpdir', '/var/customers/tmp/'),
|
('phpfpm', 'tmpdir', '/var/customers/tmp/'),
|
||||||
('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'),
|
('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'),
|
||||||
|
('phpfpm', 'envpath', '/usr/local/bin:/usr/bin:/bin'),
|
||||||
('phpfpm', 'enabled_ownvhost', '0'),
|
('phpfpm', 'enabled_ownvhost', '0'),
|
||||||
('phpfpm', 'vhost_httpuser', 'froxlorlocal'),
|
('phpfpm', 'vhost_httpuser', 'froxlorlocal'),
|
||||||
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
|
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
|
||||||
@@ -420,6 +424,102 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('phpfpm', 'vhost_defaultini', '2'),
|
('phpfpm', 'vhost_defaultini', '2'),
|
||||||
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
||||||
('phpfpm', 'use_mod_proxy', '0'),
|
('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'),
|
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||||
('system', 'lastaccountnumber', '0'),
|
('system', 'lastaccountnumber', '0'),
|
||||||
('system', 'lastguid', '9999'),
|
('system', 'lastguid', '9999'),
|
||||||
@@ -499,10 +599,11 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'ssl_cert_chainfile', ''),
|
('system', 'ssl_cert_chainfile', ''),
|
||||||
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
||||||
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
||||||
('system', 'nginx_http2_support', '0'),
|
('system', 'http2_support', '0'),
|
||||||
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
||||||
('system', 'phpreload_command', ''),
|
('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', 'documentroot_use_default_value', '0'),
|
||||||
('system', 'passwordcryptfunc', '3'),
|
('system', 'passwordcryptfunc', '3'),
|
||||||
('system', 'axfrservers', ''),
|
('system', 'axfrservers', ''),
|
||||||
@@ -530,6 +631,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'letsencryptkeysize', '4096'),
|
('system', 'letsencryptkeysize', '4096'),
|
||||||
('system', 'letsencryptreuseold', 0),
|
('system', 'letsencryptreuseold', 0),
|
||||||
('system', 'leenabled', '0'),
|
('system', 'leenabled', '0'),
|
||||||
|
('system', 'leapiversion', '1'),
|
||||||
('system', 'backupenabled', '0'),
|
('system', 'backupenabled', '0'),
|
||||||
('system', 'dnsenabled', '0'),
|
('system', 'dnsenabled', '0'),
|
||||||
('system', 'dns_server', 'bind'),
|
('system', 'dns_server', 'bind'),
|
||||||
@@ -550,6 +652,9 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'hsts_incsub', '0'),
|
('system', 'hsts_incsub', '0'),
|
||||||
('system', 'hsts_preload', '0'),
|
('system', 'hsts_preload', '0'),
|
||||||
('system', 'leregistered', '0'),
|
('system', 'leregistered', '0'),
|
||||||
|
('system', 'nssextrausers', '0'),
|
||||||
|
('system', 'disable_le_selfcheck', '0'),
|
||||||
|
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
|
||||||
('panel', 'decimal_places', '4'),
|
('panel', 'decimal_places', '4'),
|
||||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||||
('panel', 'phpmyadmin_url', ''),
|
('panel', 'phpmyadmin_url', ''),
|
||||||
@@ -581,8 +686,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('panel', 'password_special_char_required', '0'),
|
('panel', 'password_special_char_required', '0'),
|
||||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
('panel', 'customer_hide_options', ''),
|
('panel', 'customer_hide_options', ''),
|
||||||
('panel', 'version', '0.9.38.7'),
|
('panel', 'version', '0.9.39'),
|
||||||
('panel', 'db_version', '201612110');
|
('panel', 'db_version', '201801260');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
@@ -748,6 +853,33 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
|
|||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) 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`;
|
DROP TABLE IF EXISTS `panel_phpconfigs`;
|
||||||
CREATE TABLE `panel_phpconfigs` (
|
CREATE TABLE `panel_phpconfigs` (
|
||||||
`id` int(11) unsigned NOT NULL auto_increment,
|
`id` int(11) unsigned NOT NULL auto_increment,
|
||||||
@@ -761,14 +893,17 @@ CREATE TABLE `panel_phpconfigs` (
|
|||||||
`fpm_reqterm` varchar(15) NOT NULL default '60s',
|
`fpm_reqterm` varchar(15) NOT NULL default '60s',
|
||||||
`fpm_reqslow` varchar(15) NOT NULL default '5s',
|
`fpm_reqslow` varchar(15) NOT NULL default '5s',
|
||||||
`phpsettings` text NOT NULL,
|
`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;
|
) 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
|
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
||||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_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`;
|
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
* @package Install
|
* @package Install
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class FroxlorInstall
|
class FroxlorInstall
|
||||||
{
|
{
|
||||||
@@ -74,10 +74,17 @@ class FroxlorInstall
|
|||||||
/**
|
/**
|
||||||
* currently used language
|
* currently used language
|
||||||
*
|
*
|
||||||
* @var unknown
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_activelng = 'english';
|
private $_activelng = 'english';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check whether to abort due to errors
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $_abort = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor
|
* Class constructor
|
||||||
*/
|
*/
|
||||||
@@ -154,7 +161,7 @@ class FroxlorInstall
|
|||||||
$this->_guessServerName();
|
$this->_guessServerName();
|
||||||
$this->_guessServerIP();
|
$this->_guessServerIP();
|
||||||
$this->_guessWebserver();
|
$this->_guessWebserver();
|
||||||
|
|
||||||
$this->_getPostField('mysql_host', '127.0.0.1');
|
$this->_getPostField('mysql_host', '127.0.0.1');
|
||||||
$this->_getPostField('mysql_database', 'froxlor');
|
$this->_getPostField('mysql_database', 'froxlor');
|
||||||
$this->_getPostField('mysql_unpriv_user', 'froxlor');
|
$this->_getPostField('mysql_unpriv_user', 'froxlor');
|
||||||
@@ -169,22 +176,22 @@ class FroxlorInstall
|
|||||||
$this->_getPostField('httpuser', $posixusername['name']);
|
$this->_getPostField('httpuser', $posixusername['name']);
|
||||||
$posixgroup = posix_getgrgid(posix_getgid());
|
$posixgroup = posix_getgrgid(posix_getgid());
|
||||||
$this->_getPostField('httpgroup', $posixgroup['name']);
|
$this->_getPostField('httpgroup', $posixgroup['name']);
|
||||||
|
|
||||||
if ($this->_data['mysql_host'] == 'localhost' || $this->_data['mysql_host'] == '127.0.0.1') {
|
if ($this->_data['mysql_host'] == 'localhost' || $this->_data['mysql_host'] == '127.0.0.1') {
|
||||||
$this->_data['mysql_access_host'] = $this->_data['mysql_host'];
|
$this->_data['mysql_access_host'] = $this->_data['mysql_host'];
|
||||||
} else {
|
} else {
|
||||||
$this->_data['mysql_access_host'] = $this->_data['serverip'];
|
$this->_data['mysql_access_host'] = $this->_data['serverip'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// check system-hostname to be a FQDN
|
// check system-hostname to be a FQDN
|
||||||
if ($this->_validate_ip($this->_data['servername']) !== false) {
|
if ($this->_validate_ip($this->_data['servername']) !== false) {
|
||||||
$this->_data['servername'] = '';
|
$this->_data['servername'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->_data['serverip']) || $this->_validate_ip($this->_data['serverip']) == false) {
|
if (empty($this->_data['serverip']) || $this->_validate_ip($this->_data['serverip']) == false) {
|
||||||
return 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']) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -199,12 +206,12 @@ class FroxlorInstall
|
|||||||
private function _doInstall()
|
private function _doInstall()
|
||||||
{
|
{
|
||||||
$content = "<table class=\"noborder\">";
|
$content = "<table class=\"noborder\">";
|
||||||
|
|
||||||
// check for mysql-root-connection
|
// check for mysql-root-connection
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
|
||||||
|
|
||||||
$options = array(
|
$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'] . ";";
|
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";";
|
||||||
$fatal_fail = false;
|
$fatal_fail = false;
|
||||||
@@ -227,9 +234,9 @@ class FroxlorInstall
|
|||||||
$fatal_fail = true;
|
$fatal_fail = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $fatal_fail) {
|
if (! $fatal_fail) {
|
||||||
|
|
||||||
// ok, if we are here, the database connection is up and running
|
// ok, if we are here, the database connection is up and running
|
||||||
$content .= $this->_status_message('green', "OK");
|
$content .= $this->_status_message('green', "OK");
|
||||||
// check for existing db and create backup if so
|
// check for existing db and create backup if so
|
||||||
@@ -238,36 +245,37 @@ class FroxlorInstall
|
|||||||
$content .= $this->_createDatabaseAndUser($db_root);
|
$content .= $this->_createDatabaseAndUser($db_root);
|
||||||
// importing data to new database
|
// importing data to new database
|
||||||
$content .= $this->_importDatabaseData();
|
$content .= $this->_importDatabaseData();
|
||||||
// create DB object for new database
|
if (! $this->_abort) {
|
||||||
$options = array(
|
// create DB object for new database
|
||||||
'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"'
|
||||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
);
|
||||||
$another_fail = false;
|
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||||
try {
|
$another_fail = false;
|
||||||
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
try {
|
||||||
} catch (PDOException $e) {
|
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
||||||
// dafuq? this should have happened in _importDatabaseData()
|
} catch (PDOException $e) {
|
||||||
$content .= $this->_status_message('red', $e->getMessage());
|
// dafuq? this should have happened in _importDatabaseData()
|
||||||
$another_fail = true;
|
$content .= $this->_status_message('red', $e->getMessage());
|
||||||
}
|
$another_fail = true;
|
||||||
;
|
}
|
||||||
|
|
||||||
if (! $another_fail) {
|
if (! $another_fail) {
|
||||||
// change settings accordingly
|
// change settings accordingly
|
||||||
$content .= $this->_doSettings($db);
|
$content .= $this->_doSettings($db);
|
||||||
// create entries
|
// create entries
|
||||||
$content .= $this->_doDataEntries($db);
|
$content .= $this->_doDataEntries($db);
|
||||||
$db = null;
|
$db = null;
|
||||||
// create config-file
|
// create config-file
|
||||||
$content .= $this->_createUserdataConf();
|
$content .= $this->_createUserdataConf();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= "</table>";
|
$content .= "</table>";
|
||||||
|
|
||||||
// check if we have unrecoverable errors
|
// check if we have unrecoverable errors
|
||||||
if ($fatal_fail || $another_fail) {
|
if ($fatal_fail || $another_fail || $this->_abort) {
|
||||||
// D'oh
|
// D'oh
|
||||||
$navigation = '';
|
$navigation = '';
|
||||||
$msgcolor = 'red';
|
$msgcolor = 'red';
|
||||||
@@ -282,9 +290,9 @@ class FroxlorInstall
|
|||||||
$link = '../index.php';
|
$link = '../index.php';
|
||||||
$linktext = $this->_lng['click_here_to_login'];
|
$linktext = $this->_lng['click_here_to_login'];
|
||||||
}
|
}
|
||||||
|
|
||||||
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'pagecontent' => $content,
|
'pagecontent' => $content,
|
||||||
'pagenavigation' => $navigation
|
'pagenavigation' => $navigation
|
||||||
@@ -297,7 +305,7 @@ class FroxlorInstall
|
|||||||
private function _createUserdataConf()
|
private function _createUserdataConf()
|
||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['creating_configfile']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['creating_configfile']);
|
||||||
$userdata = "<?php\n";
|
$userdata = "<?php\n";
|
||||||
$userdata .= "// automatically generated userdata.inc.php for Froxlor\n";
|
$userdata .= "// automatically generated userdata.inc.php for Froxlor\n";
|
||||||
@@ -312,7 +320,7 @@ class FroxlorInstall
|
|||||||
$userdata .= "// enable debugging to browser in case of SQL errors\n";
|
$userdata .= "// enable debugging to browser in case of SQL errors\n";
|
||||||
$userdata .= "\$sql['debug'] = false;\n";
|
$userdata .= "\$sql['debug'] = false;\n";
|
||||||
$userdata .= "?>";
|
$userdata .= "?>";
|
||||||
|
|
||||||
// test if we can store the userdata.inc.php in ../lib
|
// test if we can store the userdata.inc.php in ../lib
|
||||||
if ($fp = @fopen(dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php', 'w')) {
|
if ($fp = @fopen(dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php', 'w')) {
|
||||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
$result = @fputs($fp, $userdata, strlen($userdata));
|
||||||
@@ -329,7 +337,7 @@ class FroxlorInstall
|
|||||||
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
||||||
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,9 +351,9 @@ class FroxlorInstall
|
|||||||
private function _doDataEntries(&$db)
|
private function _doDataEntries(&$db)
|
||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']);
|
||||||
|
|
||||||
// and lets insert the default ip and port
|
// and lets insert the default ip and port
|
||||||
$stmt = $db->prepare("
|
$stmt = $db->prepare("
|
||||||
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "` SET
|
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "` SET
|
||||||
@@ -359,7 +367,7 @@ class FroxlorInstall
|
|||||||
'serverip' => $this->_data['serverip']
|
'serverip' => $this->_data['serverip']
|
||||||
));
|
));
|
||||||
$defaultip = $db->lastInsertId();
|
$defaultip = $db->lastInsertId();
|
||||||
|
|
||||||
// insert the defaultip
|
// insert the defaultip
|
||||||
$upd_stmt = $db->prepare("
|
$upd_stmt = $db->prepare("
|
||||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||||
@@ -369,9 +377,9 @@ class FroxlorInstall
|
|||||||
$upd_stmt->execute(array(
|
$upd_stmt->execute(array(
|
||||||
'defaultip' => $defaultip
|
'defaultip' => $defaultip
|
||||||
));
|
));
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
// last but not least create the main admin
|
// last but not least create the main admin
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
|
||||||
$ins_data = array(
|
$ins_data = array(
|
||||||
@@ -406,11 +414,11 @@ class FroxlorInstall
|
|||||||
`subdomains` = -1,
|
`subdomains` = -1,
|
||||||
`traffic` = -1048576
|
`traffic` = -1048576
|
||||||
");
|
");
|
||||||
|
|
||||||
$ins_stmt->execute($ins_data);
|
$ins_stmt->execute($ins_data);
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,14 +449,14 @@ class FroxlorInstall
|
|||||||
private function _doSettings(&$db)
|
private function _doSettings(&$db)
|
||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['changing_data']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['changing_data']);
|
||||||
$upd_stmt = $db->prepare("
|
$upd_stmt = $db->prepare("
|
||||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||||
`value` = :value
|
`value` = :value
|
||||||
WHERE `settinggroup` = :group AND `varname` = :varname
|
WHERE `settinggroup` = :group AND `varname` = :varname
|
||||||
");
|
");
|
||||||
|
|
||||||
$this->_updateSetting($upd_stmt, 'admin@' . $this->_data['servername'], 'panel', 'adminmail');
|
$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['serverip'], 'system', 'ipaddress');
|
||||||
$this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname');
|
$this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname');
|
||||||
@@ -457,7 +465,7 @@ class FroxlorInstall
|
|||||||
$this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver');
|
$this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver');
|
||||||
$this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser');
|
$this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser');
|
||||||
$this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup');
|
$this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup');
|
||||||
|
|
||||||
// necessary changes for webservers != apache2
|
// necessary changes for webservers != apache2
|
||||||
if ($this->_data['webserver'] == "apache24") {
|
if ($this->_data['webserver'] == "apache24") {
|
||||||
$this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
$this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
||||||
@@ -477,25 +485,25 @@ class FroxlorInstall
|
|||||||
$this->_updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file');
|
$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, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||||
|
|
||||||
// insert the lastcronrun to be the installation date
|
// insert the lastcronrun to be the installation date
|
||||||
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
||||||
|
|
||||||
// set specific times for some crons (traffic only at night, etc.)
|
// 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()));
|
$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';");
|
$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()));
|
$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_used_tickets_reset.php';");
|
||||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_ticketarchive.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
|
// insert task 99 to generate a correct cron.d-file automatically
|
||||||
$db->query("INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '99';");
|
$db->query("INSERT INTO `" . TABLE_PANEL_TASKS . "` SET `type` = '99';");
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,22 +519,28 @@ class FroxlorInstall
|
|||||||
$content = "";
|
$content = "";
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
||||||
$options = array(
|
$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'] . ";";
|
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||||
$fatal_fail = false;
|
$fatal_fail = false;
|
||||||
try {
|
try {
|
||||||
$db = new PDO($dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options);
|
$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) {
|
} catch (PDOException $e) {
|
||||||
$content .= $this->_status_message('red', $e->getMessage());
|
$content .= $this->_status_message('red', $e->getMessage());
|
||||||
$fatal_fail = true;
|
$fatal_fail = true;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
if (! $fatal_fail) {
|
if (! $fatal_fail) {
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['importing_data']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['importing_data']);
|
||||||
$db_schema = dirname(dirname(__FILE__)) . '/froxlor.sql';
|
$db_schema = dirname(dirname(__FILE__)) . '/froxlor.sql';
|
||||||
$sql_query = @file_get_contents($db_schema);
|
$sql_query = @file_get_contents($db_schema);
|
||||||
@@ -534,14 +548,23 @@ class FroxlorInstall
|
|||||||
$sql_query = $this->_split_sql_file($sql_query, ';');
|
$sql_query = $this->_split_sql_file($sql_query, ';');
|
||||||
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
||||||
if (trim($sql_query[$i]) != '') {
|
if (trim($sql_query[$i]) != '') {
|
||||||
$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;
|
$db = null;
|
||||||
|
|
||||||
$content .= $this->_status_message('green', 'OK');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,56 +578,56 @@ class FroxlorInstall
|
|||||||
private function _createDatabaseAndUser(&$db_root)
|
private function _createDatabaseAndUser(&$db_root)
|
||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
// so first we have to delete the database and
|
// so first we have to delete the database and
|
||||||
// the user given for the unpriv-user if they exit
|
// the user given for the unpriv-user if they exit
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['prepare_db']);
|
$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 = $db_root->prepare("DELETE FROM `mysql`.`user` WHERE `User` = :user AND `Host` = :accesshost");
|
||||||
$del_stmt->execute(array(
|
$del_stmt->execute(array(
|
||||||
'user' => $this->_data['mysql_unpriv_user'],
|
'user' => $this->_data['mysql_unpriv_user'],
|
||||||
'accesshost' => $this->_data['mysql_access_host']
|
'accesshost' => $this->_data['mysql_access_host']
|
||||||
));
|
));
|
||||||
|
|
||||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost");
|
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost");
|
||||||
$del_stmt->execute(array(
|
$del_stmt->execute(array(
|
||||||
'user' => $this->_data['mysql_unpriv_user'],
|
'user' => $this->_data['mysql_unpriv_user'],
|
||||||
'accesshost' => $this->_data['mysql_access_host']
|
'accesshost' => $this->_data['mysql_access_host']
|
||||||
));
|
));
|
||||||
|
|
||||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost");
|
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost");
|
||||||
$del_stmt->execute(array(
|
$del_stmt->execute(array(
|
||||||
'user' => $this->_data['mysql_unpriv_user'],
|
'user' => $this->_data['mysql_unpriv_user'],
|
||||||
'accesshost' => $this->_data['mysql_access_host']
|
'accesshost' => $this->_data['mysql_access_host']
|
||||||
));
|
));
|
||||||
|
|
||||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost");
|
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost");
|
||||||
$del_stmt->execute(array(
|
$del_stmt->execute(array(
|
||||||
'user' => $this->_data['mysql_unpriv_user'],
|
'user' => $this->_data['mysql_unpriv_user'],
|
||||||
'accesshost' => $this->_data['mysql_access_host']
|
'accesshost' => $this->_data['mysql_access_host']
|
||||||
));
|
));
|
||||||
|
|
||||||
$del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `" . str_replace('`', '', $this->_data['mysql_database']) . "`;");
|
$del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `" . str_replace('`', '', $this->_data['mysql_database']) . "`;");
|
||||||
$del_stmt->execute();
|
$del_stmt->execute();
|
||||||
|
|
||||||
$db_root->query("FLUSH PRIVILEGES;");
|
$db_root->query("FLUSH PRIVILEGES;");
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
// we have to create a new user and database for the froxlor unprivileged mysql access
|
// 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']);
|
$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 = $db_root->prepare("CREATE DATABASE `" . str_replace('`', '', $this->_data['mysql_database']) . "` CHARACTER SET=utf8 COLLATE=utf8_general_ci");
|
||||||
$ins_stmt->execute();
|
$ins_stmt->execute();
|
||||||
|
|
||||||
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
|
$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)) {
|
if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) {
|
||||||
$mysql_access_host_array[] = 'localhost';
|
$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';
|
$mysql_access_host_array[] = '127.0.0.1';
|
||||||
}
|
}
|
||||||
|
|
||||||
$mysql_access_host_array[] = $this->_data['serverip'];
|
$mysql_access_host_array[] = $this->_data['serverip'];
|
||||||
foreach ($mysql_access_host_array as $mysql_access_host) {
|
foreach ($mysql_access_host_array as $mysql_access_host) {
|
||||||
$_db = str_replace('`', '', $this->_data['mysql_database']);
|
$_db = str_replace('`', '', $this->_data['mysql_database']);
|
||||||
@@ -623,11 +646,11 @@ class FroxlorInstall
|
|||||||
"password" => $this->_data['mysql_unpriv_pass']
|
"password" => $this->_data['mysql_unpriv_pass']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$db_root->query("FLUSH PRIVILEGES;");
|
$db_root->query("FLUSH PRIVILEGES;");
|
||||||
$this->_data['mysql_access_host'] = implode(',', $mysql_access_host_array);
|
$this->_data['mysql_access_host'] = implode(',', $mysql_access_host_array);
|
||||||
$content .= $this->_status_message('green', 'OK');
|
$content .= $this->_status_message('green', 'OK');
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,7 +664,7 @@ class FroxlorInstall
|
|||||||
private function _backupExistingDatabase(&$db_root)
|
private function _backupExistingDatabase(&$db_root)
|
||||||
{
|
{
|
||||||
$content = "";
|
$content = "";
|
||||||
|
|
||||||
// check for existing of former database
|
// check for existing of former database
|
||||||
$tables_exist = false;
|
$tables_exist = false;
|
||||||
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database";
|
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database";
|
||||||
@@ -650,19 +673,19 @@ class FroxlorInstall
|
|||||||
'database' => $this->_data['mysql_database']
|
'database' => $this->_data['mysql_database']
|
||||||
));
|
));
|
||||||
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
|
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
|
||||||
|
|
||||||
// check result
|
// check result
|
||||||
if ($result_stmt !== false && $rows > 0) {
|
if ($result_stmt !== false && $rows > 0) {
|
||||||
$tables_exist = true;
|
$tables_exist = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tables_exist) {
|
if ($tables_exist) {
|
||||||
// tell whats going on
|
// tell whats going on
|
||||||
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
|
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
|
||||||
|
|
||||||
// create temporary backup-filename
|
// create temporary backup-filename
|
||||||
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
||||||
|
|
||||||
// look for mysqldump
|
// look for mysqldump
|
||||||
$do_backup = false;
|
$do_backup = false;
|
||||||
if (file_exists("/usr/bin/mysqldump")) {
|
if (file_exists("/usr/bin/mysqldump")) {
|
||||||
@@ -672,7 +695,7 @@ class FroxlorInstall
|
|||||||
$do_backup = true;
|
$do_backup = true;
|
||||||
$mysql_dump = '/usr/local/bin/mysqldump';
|
$mysql_dump = '/usr/local/bin/mysqldump';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($do_backup) {
|
if ($do_backup) {
|
||||||
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
||||||
$output = exec($command);
|
$output = exec($command);
|
||||||
@@ -685,7 +708,7 @@ class FroxlorInstall
|
|||||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
|
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -702,12 +725,12 @@ class FroxlorInstall
|
|||||||
}
|
}
|
||||||
// language selection
|
// language selection
|
||||||
$language_options = '';
|
$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);
|
$language_options .= makeoption($language_name, $language_file, $this->_activelng, true, true);
|
||||||
}
|
}
|
||||||
// get language-form-template
|
// get language-form-template
|
||||||
eval("\$content .= \"" . $this->_getTemplate("lngform") . "\";");
|
eval("\$content .= \"" . $this->_getTemplate("lngform") . "\";");
|
||||||
|
|
||||||
// form-data
|
// form-data
|
||||||
$formdata = "";
|
$formdata = "";
|
||||||
/**
|
/**
|
||||||
@@ -747,7 +770,7 @@ class FroxlorInstall
|
|||||||
$style = '';
|
$style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* admin data
|
* admin data
|
||||||
*/
|
*/
|
||||||
@@ -771,7 +794,7 @@ class FroxlorInstall
|
|||||||
$formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password');
|
$formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password');
|
||||||
// activate newsfeed?
|
// activate newsfeed?
|
||||||
$formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true);
|
$formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server data
|
* Server data
|
||||||
*/
|
*/
|
||||||
@@ -818,11 +841,11 @@ class FroxlorInstall
|
|||||||
$style = '';
|
$style = '';
|
||||||
}
|
}
|
||||||
$formdata .= $this->_getSectionItemString('httpgroup', true, $style);
|
$formdata .= $this->_getSectionItemString('httpgroup', true, $style);
|
||||||
|
|
||||||
// get data-form-template
|
// get data-form-template
|
||||||
$language = htmlspecialchars($this->_activelng);
|
$language = htmlspecialchars($this->_activelng);
|
||||||
eval("\$content .= \"" . $this->_getTemplate("dataform2") . "\";");
|
eval("\$content .= \"" . $this->_getTemplate("dataform2") . "\";");
|
||||||
|
|
||||||
$navigation = '';
|
$navigation = '';
|
||||||
return array(
|
return array(
|
||||||
'pagecontent' => $content,
|
'pagecontent' => $content,
|
||||||
@@ -839,7 +862,7 @@ class FroxlorInstall
|
|||||||
* optional css
|
* optional css
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* optional type of input-box (default: text)
|
* optional type of input-box (default: text)
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function _getSectionItemString($fieldname = null, $required = false, $style = "", $type = 'text')
|
private function _getSectionItemString($fieldname = null, $required = false, $style = "", $type = 'text')
|
||||||
@@ -899,26 +922,26 @@ class FroxlorInstall
|
|||||||
*/
|
*/
|
||||||
private function _requirementCheck()
|
private function _requirementCheck()
|
||||||
{
|
{
|
||||||
|
|
||||||
// indicator whether we need to abort or not
|
// indicator whether we need to abort or not
|
||||||
$_die = false;
|
$_die = false;
|
||||||
|
|
||||||
$content = "<table class=\"noborder\">";
|
$content = "<table class=\"noborder\">";
|
||||||
|
|
||||||
// check for correct php version
|
// check for correct php version
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
||||||
|
|
||||||
if (version_compare("5.3.0", PHP_VERSION, ">=")) {
|
if (version_compare("5.3.0", PHP_VERSION, ">=")) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
if (version_compare("5.6.0", PHP_VERSION, ">=")) {
|
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 {
|
} else {
|
||||||
$content .= $this->_status_message('green', PHP_VERSION);
|
$content .= $this->_status_message('green', PHP_VERSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if magic_quotes_runtime is active | get_magic_quotes_runtime() is always FALSE since 5.4
|
// 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", "<")) {
|
if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
||||||
@@ -930,85 +953,94 @@ class FroxlorInstall
|
|||||||
$content .= $this->_status_message('green', 'off');
|
$content .= $this->_status_message('green', 'off');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for php_pdo and pdo_mysql
|
// check for php_pdo and pdo_mysql
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
||||||
|
|
||||||
if (! extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) {
|
if (! extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for xml-extension
|
// check for xml-extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpxml']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpxml']);
|
||||||
|
|
||||||
if (! extension_loaded('xml')) {
|
if (! extension_loaded('xml')) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for filter-extension
|
// check for filter-extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpfilter']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpfilter']);
|
||||||
|
|
||||||
if (! extension_loaded('filter')) {
|
if (! extension_loaded('filter')) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for posix-extension
|
// check for posix-extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpposix']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpposix']);
|
||||||
|
|
||||||
if (! extension_loaded('posix')) {
|
if (! extension_loaded('posix')) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for bstring-extension
|
// check for bstring-extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
|
||||||
|
|
||||||
if (! extension_loaded('mbstring')) {
|
if (! extension_loaded('mbstring')) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for curl extension
|
// check for curl extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpcurl']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpcurl']);
|
||||||
|
|
||||||
if (! extension_loaded('curl')) {
|
if (! extension_loaded('curl')) {
|
||||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||||
$_die = true;
|
$_die = true;
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for bcmath extension
|
// check for bcmath extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
|
||||||
|
|
||||||
if (! extension_loaded('bcmath')) {
|
if (! extension_loaded('bcmath')) {
|
||||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['bcmathdescription']);
|
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['bcmathdescription']);
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for zip extension
|
// check for zip extension
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpzip']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpzip']);
|
||||||
|
|
||||||
if (! extension_loaded('zip')) {
|
if (! extension_loaded('zip')) {
|
||||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['zipdescription']);
|
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['zipdescription']);
|
||||||
} else {
|
} else {
|
||||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
$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
|
// check for open_basedir
|
||||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
|
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
|
||||||
$php_ob = @ini_get("open_basedir");
|
$php_ob = @ini_get("open_basedir");
|
||||||
@@ -1018,7 +1050,7 @@ class FroxlorInstall
|
|||||||
$content .= $this->_status_message('green', 'off');
|
$content .= $this->_status_message('green', 'off');
|
||||||
}
|
}
|
||||||
$content .= "</table>";
|
$content .= "</table>";
|
||||||
|
|
||||||
// check if we have unrecoverable errors
|
// check if we have unrecoverable errors
|
||||||
$navigation = '';
|
$navigation = '';
|
||||||
if ($_die) {
|
if ($_die) {
|
||||||
@@ -1033,7 +1065,7 @@ class FroxlorInstall
|
|||||||
$linktext = $this->_lng['click_here_to_continue'];
|
$linktext = $this->_lng['click_here_to_continue'];
|
||||||
}
|
}
|
||||||
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'pagecontent' => $content,
|
'pagecontent' => $content,
|
||||||
'pagenavigation' => $navigation
|
'pagenavigation' => $navigation
|
||||||
@@ -1050,7 +1082,7 @@ class FroxlorInstall
|
|||||||
header("Pragma: no-cache");
|
header("Pragma: no-cache");
|
||||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
|
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()));
|
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time()));
|
||||||
|
|
||||||
// ensure that default timezone is set
|
// ensure that default timezone is set
|
||||||
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
|
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
|
||||||
@date_default_timezone_set(@date_default_timezone_get());
|
@date_default_timezone_set(@date_default_timezone_get());
|
||||||
@@ -1068,7 +1100,7 @@ class FroxlorInstall
|
|||||||
// includes the usersettings (MySQL-Username/Passwort)
|
// includes the usersettings (MySQL-Username/Passwort)
|
||||||
// to test if Froxlor is already installed
|
// to test if Froxlor is already installed
|
||||||
require $this->_basepath . '/lib/userdata.inc.php';
|
require $this->_basepath . '/lib/userdata.inc.php';
|
||||||
|
|
||||||
if (isset($sql) && is_array($sql)) {
|
if (isset($sql) && is_array($sql)) {
|
||||||
// use sparkle theme for the notice
|
// use sparkle theme for the notice
|
||||||
$installed_hint = file_get_contents($this->_basepath . '/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
$installed_hint = file_get_contents($this->_basepath . '/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
||||||
@@ -1085,7 +1117,7 @@ class FroxlorInstall
|
|||||||
{
|
{
|
||||||
// set default
|
// set default
|
||||||
$standardlanguage = 'english';
|
$standardlanguage = 'english';
|
||||||
|
|
||||||
// check either _GET or _POST
|
// check either _GET or _POST
|
||||||
if (isset($_GET['language']) && isset($this->_languages[$_GET['language']])) {
|
if (isset($_GET['language']) && isset($this->_languages[$_GET['language']])) {
|
||||||
$this->_activelng = $_GET['language'];
|
$this->_activelng = $_GET['language'];
|
||||||
@@ -1106,7 +1138,7 @@ class FroxlorInstall
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
|
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
|
||||||
if (file_exists($lngfile)) {
|
if (file_exists($lngfile)) {
|
||||||
// includes file /lng/$language.lng.php if it exists
|
// includes file /lng/$language.lng.php if it exists
|
||||||
@@ -1120,7 +1152,7 @@ class FroxlorInstall
|
|||||||
*
|
*
|
||||||
* @param string $template
|
* @param string $template
|
||||||
* name of the template including subdirectory
|
* name of the template including subdirectory
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function _getTemplate($template = null)
|
private function _getTemplate($template = null)
|
||||||
@@ -1137,7 +1169,7 @@ class FroxlorInstall
|
|||||||
} else {
|
} else {
|
||||||
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
|
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $templatefile;
|
return $templatefile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1168,14 +1200,13 @@ class FroxlorInstall
|
|||||||
$this->_data['servername'] = $_POST['servername'];
|
$this->_data['servername'] = $_POST['servername'];
|
||||||
return;
|
return;
|
||||||
// from $_SERVER
|
// from $_SERVER
|
||||||
} else
|
} else if (! empty($_SERVER['SERVER_NAME'])) {
|
||||||
if (! empty($_SERVER['SERVER_NAME'])) {
|
// no ips
|
||||||
// no ips
|
if ($this->_validate_ip($_SERVER['SERVER_NAME']) == false) {
|
||||||
if ($this->_validate_ip($_SERVER['SERVER_NAME']) == false) {
|
$this->_data['servername'] = $_SERVER['SERVER_NAME'];
|
||||||
$this->_data['servername'] = $_SERVER['SERVER_NAME'];
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// empty
|
// empty
|
||||||
$this->_data['servername'] = '';
|
$this->_data['servername'] = '';
|
||||||
}
|
}
|
||||||
@@ -1208,7 +1239,7 @@ class FroxlorInstall
|
|||||||
$this->_data['webserver'] = $_POST['webserver'];
|
$this->_data['webserver'] = $_POST['webserver'];
|
||||||
} else {
|
} else {
|
||||||
if (strtoupper(@php_sapi_name()) == "APACHE2HANDLER" || stristr($_SERVER['SERVER_SOFTWARE'], "apache/2")) {
|
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")) {
|
} elseif (substr(strtoupper(@php_sapi_name()), 0, 8) == "LIGHTTPD" || stristr($_SERVER['SERVER_SOFTWARE'], "lighttpd")) {
|
||||||
$this->_data['webserver'] = 'lighttpd';
|
$this->_data['webserver'] = 'lighttpd';
|
||||||
} elseif (substr(strtoupper(@php_sapi_name()), 0, 8) == "NGINX" || stristr($_SERVER['SERVER_SOFTWARE'], "nginx")) {
|
} elseif (substr(strtoupper(@php_sapi_name()), 0, 8) == "NGINX" || stristr($_SERVER['SERVER_SOFTWARE'], "nginx")) {
|
||||||
@@ -1294,17 +1325,17 @@ class FroxlorInstall
|
|||||||
*/
|
*/
|
||||||
private function _split_sql_file($sql, $delimiter)
|
private function _split_sql_file($sql, $delimiter)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Split up our string into "possible" SQL statements.
|
// Split up our string into "possible" SQL statements.
|
||||||
$tokens = explode($delimiter, $sql);
|
$tokens = explode($delimiter, $sql);
|
||||||
|
|
||||||
// try to save mem.
|
// try to save mem.
|
||||||
$sql = "";
|
$sql = "";
|
||||||
$output = array();
|
$output = array();
|
||||||
|
|
||||||
// we don't actually care about the matches preg gives us.
|
// we don't actually care about the matches preg gives us.
|
||||||
$matches = array();
|
$matches = array();
|
||||||
|
|
||||||
// this is faster than calling count($tokens) every time through the loop.
|
// this is faster than calling count($tokens) every time through the loop.
|
||||||
$token_count = count($tokens);
|
$token_count = count($tokens);
|
||||||
for ($i = 0; $i < $token_count; $i ++) {
|
for ($i = 0; $i < $token_count; $i ++) {
|
||||||
@@ -1312,12 +1343,12 @@ class FroxlorInstall
|
|||||||
if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0))) {
|
if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0))) {
|
||||||
// This is the total number of single quotes in the token.
|
// This is the total number of single quotes in the token.
|
||||||
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
|
$total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
|
||||||
|
|
||||||
// Counts single quotes that are preceded by an odd number of backslashes,
|
// Counts single quotes that are preceded by an odd number of backslashes,
|
||||||
// which means they're escaped quotes.
|
// which means they're escaped quotes.
|
||||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
|
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
|
||||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||||
|
|
||||||
// If the number of unescaped quotes is even, then the delimiter
|
// If the number of unescaped quotes is even, then the delimiter
|
||||||
// did NOT occur inside a string literal.
|
// did NOT occur inside a string literal.
|
||||||
if (($unescaped_quotes % 2) == 0) {
|
if (($unescaped_quotes % 2) == 0) {
|
||||||
@@ -1340,7 +1371,7 @@ class FroxlorInstall
|
|||||||
// which means they're escaped quotes.
|
// which means they're escaped quotes.
|
||||||
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
|
$escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
|
||||||
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
$unescaped_quotes = $total_quotes - $escaped_quotes;
|
||||||
|
|
||||||
if (($unescaped_quotes % 2) == 1) {
|
if (($unescaped_quotes % 2) == 1) {
|
||||||
// odd number of unescaped quotes. In combination with the previous incomplete
|
// 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)
|
// 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']['phpcurl'] = 'PHP curl-extension...';
|
||||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
|
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
|
||||||
$lng['requirements']['phpzip'] = 'PHP zip-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']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
||||||
$lng['requirements']['zipdescription'] = 'The auto-update feature requires the zip extension.';
|
$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']['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']['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.';
|
$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']['servername'] = 'Server name (FQDN, no ip-address)';
|
||||||
$lng['install']['serverip'] = 'Server IP';
|
$lng['install']['serverip'] = 'Server IP';
|
||||||
$lng['install']['webserver'] = 'Webserver';
|
$lng['install']['webserver'] = 'Webserver';
|
||||||
$lng['install']['apache2'] = 'Apache 2';
|
$lng['install']['apache2'] = 'Apache 2.2';
|
||||||
$lng['install']['apache24'] = 'Apache 2.4';
|
$lng['install']['apache24'] = 'Apache 2.4';
|
||||||
$lng['install']['lighttpd'] = 'LigHTTPd';
|
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||||
$lng['install']['nginx'] = 'NGINX';
|
$lng['install']['nginx'] = 'NGINX';
|
||||||
@@ -83,8 +85,8 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
|
|||||||
$lng['install']['creating_entries'] = 'Inserting new values...';
|
$lng['install']['creating_entries'] = 'Inserting new values...';
|
||||||
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
||||||
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to lib/.';
|
$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 lib/userdata.inc.php, please create it manually with the following content:';
|
$lng['install']['creating_configfile_failed'] = 'Could not create '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php, please create it manually with the following content:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
||||||
|
|
||||||
$lng['click_here_to_refresh'] = 'Click here to check again';
|
$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']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||||
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||||
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans lib/.';
|
$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 lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
$lng['install']['creating_configfile_failed'] = 'Impossible de créer '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
||||||
|
|
||||||
$lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';
|
$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']['phpcurl'] = 'PHP curl-Erweiterung...';
|
||||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
|
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
|
||||||
$lng['requirements']['phpzip'] = 'PHP zip-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']['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']['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']['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']['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.';
|
$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']['creating_entries'] = 'Trage neue Werte ein...';
|
||||||
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
||||||
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
||||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach lib/ verschieben.';
|
$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 lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
$lng['install']['creating_configfile_failed'] = 'Konnte '.dirname(dirname(__DIR__)).'/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
||||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
||||||
|
|
||||||
$lng['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen';
|
$lng['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen';
|
||||||
|
|||||||
@@ -14,9 +14,11 @@
|
|||||||
* @package Install
|
* @package Install
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
if (!defined('_CRON_UPDATE')) {
|
||||||
header('Location: ../../../../index.php');
|
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||||
exit();
|
header('Location: ../../../../index.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFroxlorVersion('0.9-r0')) {
|
if (isFroxlorVersion('0.9-r0')) {
|
||||||
@@ -3591,3 +3593,290 @@ if (isFroxlorVersion('0.9.38.6')) {
|
|||||||
showUpdateStep("Updating from 0.9.38.6 to 0.9.38.7", false);
|
showUpdateStep("Updating from 0.9.38.6 to 0.9.38.7", false);
|
||||||
updateToVersion('0.9.38.7');
|
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 />';
|
$question .= '<input type="password" class="text" name="smtp_passwd" value="" /><br />';
|
||||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
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')
|
if (!defined('_CRON_UPDATE')) {
|
||||||
|| (defined('AREA') && AREA != 'admin')
|
if (!defined('AREA')
|
||||||
|| !isset($userinfo['loginname'])
|
|| (defined('AREA') && AREA != 'admin')
|
||||||
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
|| !isset($userinfo['loginname'])
|
||||||
) {
|
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||||
header('Location: ../index.php');
|
) {
|
||||||
exit;
|
header('Location: ../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||||
|
|||||||
@@ -93,6 +93,13 @@ class DomainBulkAction
|
|||||||
/* 16 */ 'use_ssl',
|
/* 16 */ 'use_ssl',
|
||||||
/* 17 */ 'registration_date',
|
/* 17 */ 'registration_date',
|
||||||
/* 18 */ 'ips',
|
/* 18 */ 'ips',
|
||||||
|
/* 19 */ 'letsencrypt',
|
||||||
|
/* 20 */ 'hsts',
|
||||||
|
/* 21 */ 'hsts_sub',
|
||||||
|
/* 22 */ 'hsts_preload',
|
||||||
|
/* 23 */ 'ocsp_stapling',
|
||||||
|
/* 24 */ 'phpenabled',
|
||||||
|
/* 25 */ 'http2',
|
||||||
/* automatically added */
|
/* automatically added */
|
||||||
'adminid',
|
'adminid',
|
||||||
'customerid',
|
'customerid',
|
||||||
@@ -180,13 +187,14 @@ class DomainBulkAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// preapre insert statement as it is used a few times
|
// 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("
|
$this->_ins_stmt = Database::prepare("
|
||||||
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
INSERT INTO `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
`domain` = :domain,
|
`domain` = :domain,
|
||||||
`adminid` = :adminid,
|
`adminid` = :adminid,
|
||||||
`customerid` = :customerid,
|
`customerid` = :customerid,
|
||||||
`documentroot` = :documentroot,
|
`documentroot` = :documentroot,
|
||||||
`aliasdomain` = :aliasdomain,
|
|
||||||
`isbinddomain` = :isbinddomain,
|
`isbinddomain` = :isbinddomain,
|
||||||
`isemaildomain` = :isemaildomain,
|
`isemaildomain` = :isemaildomain,
|
||||||
`email_only` = :email_only,
|
`email_only` = :email_only,
|
||||||
@@ -200,7 +208,14 @@ class DomainBulkAction
|
|||||||
`specialsettings` = :specialsettings,
|
`specialsettings` = :specialsettings,
|
||||||
`ssl_redirect` = :ssl_redirect,
|
`ssl_redirect` = :ssl_redirect,
|
||||||
`registration_date` = :registration_date,
|
`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
|
// prepare insert statement for ip/port <> domain
|
||||||
@@ -293,6 +308,7 @@ class DomainBulkAction
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check for alias-domain
|
// check for alias-domain
|
||||||
|
$hasAlias = false;
|
||||||
if (! empty($domain_data['aliasdomain'])) {
|
if (! empty($domain_data['aliasdomain'])) {
|
||||||
// format
|
// format
|
||||||
$domain_data['aliasdomain'] = $idna_convert->encode(preg_replace(array(
|
$domain_data['aliasdomain'] = $idna_convert->encode(preg_replace(array(
|
||||||
@@ -311,6 +327,7 @@ class DomainBulkAction
|
|||||||
// - we'd better skip
|
// - we'd better skip
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$hasAlias = $domain_data['aliasdomain'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for use_ssl and ssl_redirect
|
// check for use_ssl and ssl_redirect
|
||||||
@@ -335,6 +352,38 @@ class DomainBulkAction
|
|||||||
$domain_data['ssl_redirect'] = 0;
|
$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
|
// add to known domains
|
||||||
$this->_knownDomains[] = $domain_data['domain'];
|
$this->_knownDomains[] = $domain_data['domain'];
|
||||||
|
|
||||||
@@ -416,13 +465,21 @@ class DomainBulkAction
|
|||||||
$use_ssl = (bool)$domain_data['use_ssl'];
|
$use_ssl = (bool)$domain_data['use_ssl'];
|
||||||
// don't need that for the domain-insert-statement
|
// don't need that for the domain-insert-statement
|
||||||
unset($domain_data['use_ssl']);
|
unset($domain_data['use_ssl']);
|
||||||
|
// don't need alias
|
||||||
|
unset($domain_data['aliasdomain']);
|
||||||
|
|
||||||
// finally ADD the domain to panel_domains
|
// finally ADD the domain to panel_domains
|
||||||
Database::pexecute($this->_ins_stmt, $domain_data);
|
Database::pexecute($this->_ins_stmt, $domain_data);
|
||||||
|
|
||||||
// get the newly inserted domain-id
|
// get the newly inserted domain-id
|
||||||
$domain_id = Database::lastInsertId();
|
$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
|
// insert domain <-> ip/port reference
|
||||||
if (empty($iplist)) {
|
if (empty($iplist)) {
|
||||||
$iplist = Settings::Get('system.ipaddress');
|
$iplist = Settings::Get('system.ipaddress');
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ class Database {
|
|||||||
// build up connection string
|
// build up connection string
|
||||||
$driver = 'mysql';
|
$driver = 'mysql';
|
||||||
$dsn = $driver.":";
|
$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');
|
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
||||||
|
|
||||||
$dbconf["dsn"] = array(
|
$dbconf["dsn"] = array(
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class DbManagerMySQL {
|
|||||||
* @param string $host (unused in mysql)
|
* @param string $host (unused in mysql)
|
||||||
*/
|
*/
|
||||||
public function disableUser($username = null, $host = null) {
|
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);
|
Database::pexecute($stmt, array(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,31 @@ class DnsEntry
|
|||||||
|
|
||||||
public function __toString()
|
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;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,11 +85,10 @@ class IntegrityCheck {
|
|||||||
// fix database
|
// fix database
|
||||||
Database::query('ALTER DATABASE `' . Database::getDbName() . '` CHARACTER SET utf8 COLLATE utf8_general_ci');
|
Database::query('ALTER DATABASE `' . Database::getDbName() . '` CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||||
// fix all tables
|
// fix all tables
|
||||||
$handle = Database::query('SHOW TABLES');
|
$handle = Database::query('SHOW FULL TABLES WHERE Table_type != "VIEW"');
|
||||||
while ($row = $handle->fetch(PDO::FETCH_ASSOC)) {
|
while ($row = $handle->fetch(PDO::FETCH_BOTH)) {
|
||||||
foreach ($row as $table) {
|
$table = $row[0];
|
||||||
Database::query('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
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");
|
$this->_log->logAction(ADM_ACTION, LOG_WARNING, "database charset was different from UTF-8, integrity-check fixed that");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ class paging {
|
|||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
private $natSorting = false;
|
private $natSorting = false;
|
||||||
|
|
||||||
|
private $_limit = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class constructor. Loads settings from request or from userdata and saves them to session.
|
* 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'
|
* @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
|
// entries per page and natsorting-flag are not
|
||||||
// passed as parameter anymore, because these are
|
// passed as parameter anymore, because these are
|
||||||
@@ -230,6 +232,8 @@ class paging {
|
|||||||
'adminsession' => $userinfo['adminsession']
|
'adminsession' => $userinfo['adminsession']
|
||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, $upd_data);
|
Database::pexecute($upd_stmt, $upd_data);
|
||||||
|
|
||||||
|
$this->_limit = $limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -378,6 +382,11 @@ class paging {
|
|||||||
* @return string always empty
|
* @return string always empty
|
||||||
*/
|
*/
|
||||||
public function getSqlLimit() {
|
public function getSqlLimit() {
|
||||||
|
|
||||||
|
if ($this->_limit > 0) {
|
||||||
|
$_offset = ($this->pageno - 1) * $this->_limit;
|
||||||
|
return ' LIMIT '.$_offset.','.$this->_limit;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* currently not in use
|
* currently not in use
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -91,6 +91,12 @@ class phpinterface {
|
|||||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||||
);
|
);
|
||||||
$this->_php_configs_cache[$php_config_id] = Database::pexecute_first($stmt, array('id' => $php_config_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];
|
return $this->_php_configs_cache[$php_config_id];
|
||||||
|
|||||||
@@ -18,19 +18,28 @@
|
|||||||
* @since 0.9.16
|
* @since 0.9.16
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
class phpinterface_fpm
|
||||||
class phpinterface_fpm {
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Domain-Data array
|
* Domain-Data array
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $_domain = array();
|
private $_domain = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin-Date cache array
|
* fpm config
|
||||||
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
private $_fpm_cfg = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin-Date cache array
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
private $_admin_cache = array();
|
private $_admin_cache = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,119 +47,38 @@ class phpinterface_fpm {
|
|||||||
* Mostly taken from http://php.net/manual/en/ini.list.php
|
* Mostly taken from http://php.net/manual/en/ini.list.php
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $_ini = 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'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* main constructor
|
* 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->_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
|
* @param array $phpconfig
|
||||||
*/
|
*/
|
||||||
public function createConfig($phpconfig) {
|
public function createConfig($phpconfig)
|
||||||
|
{
|
||||||
$fh = @fopen($this->getConfigFile(), 'w');
|
$fh = @fopen($this->getConfigFile(), 'w');
|
||||||
|
|
||||||
if ($fh) {
|
if ($fh) {
|
||||||
$fpm_pm = Settings::Get('phpfpm.pm');
|
$fpm_pm = $this->_fpm_cfg['pm'];
|
||||||
$fpm_children = (int)Settings::Get('phpfpm.max_children');
|
$fpm_children = (int) $this->_fpm_cfg['max_children'];
|
||||||
$fpm_start_servers = (int)Settings::Get('phpfpm.start_servers');
|
$fpm_start_servers = (int) $this->_fpm_cfg['start_servers'];
|
||||||
$fpm_min_spare_servers = (int)Settings::Get('phpfpm.min_spare_servers');
|
$fpm_min_spare_servers = (int) $this->_fpm_cfg['min_spare_servers'];
|
||||||
$fpm_max_spare_servers = (int)Settings::Get('phpfpm.max_spare_servers');
|
$fpm_max_spare_servers = (int) $this->_fpm_cfg['max_spare_servers'];
|
||||||
$fpm_requests = (int)Settings::Get('phpfpm.max_requests');
|
$fpm_requests = (int) $this->_fpm_cfg['max_requests'];
|
||||||
$fpm_process_idle_timeout = (int)Settings::Get('phpfpm.idle_timeout');
|
$fpm_process_idle_timeout = (int) $this->_fpm_cfg['idle_timeout'];
|
||||||
|
$fpm_limit_extensions = $this->_fpm_cfg['limit_extensions'];
|
||||||
|
|
||||||
if ($fpm_children == 0) {
|
if ($fpm_children == 0) {
|
||||||
$fpm_children = 1;
|
$fpm_children = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fpm_config = ';PHP-FPM configuration for "'.$this->_domain['domain'].'" created on ' . date("Y.m.d H:i:s") . "\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 .= '[' . $this->_domain['domain'] . ']' . "\n";
|
||||||
$fpm_config.= 'listen = '.$this->getSocketFile()."\n";
|
$fpm_config .= 'listen = ' . $this->getSocketFile() . "\n";
|
||||||
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
||||||
$fpm_config.= 'listen.owner = '.$this->_domain['guid']."\n";
|
$fpm_config .= 'listen.owner = ' . $this->_domain['guid'] . "\n";
|
||||||
$fpm_config.= 'listen.group = '.$this->_domain['guid']."\n";
|
$fpm_config .= 'listen.group = ' . $this->_domain['guid'] . "\n";
|
||||||
} else {
|
} else {
|
||||||
$fpm_config.= 'listen.owner = '.$this->_domain['loginname']."\n";
|
$fpm_config .= 'listen.owner = ' . $this->_domain['loginname'] . "\n";
|
||||||
$fpm_config.= 'listen.group = '.$this->_domain['loginname']."\n";
|
$fpm_config .= 'listen.group = ' . $this->_domain['loginname'] . "\n";
|
||||||
}
|
}
|
||||||
// see #1418 why this is 0660
|
// see #1418 why this is 0660
|
||||||
$fpm_config.= 'listen.mode = 0660'."\n";
|
$fpm_config .= 'listen.mode = 0660' . "\n";
|
||||||
|
|
||||||
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
if ($this->_domain['loginname'] == 'froxlor.panel') {
|
||||||
$fpm_config.= 'user = '.$this->_domain['guid']."\n";
|
$fpm_config .= 'user = ' . $this->_domain['guid'] . "\n";
|
||||||
$fpm_config.= 'group = '.$this->_domain['guid']."\n";
|
$fpm_config .= 'group = ' . $this->_domain['guid'] . "\n";
|
||||||
} else {
|
} else {
|
||||||
$fpm_config.= 'user = '.$this->_domain['loginname']."\n";
|
$fpm_config .= 'user = ' . $this->_domain['loginname'] . "\n";
|
||||||
$fpm_config.= 'group = '.$this->_domain['loginname']."\n";
|
$fpm_config .= 'group = ' . $this->_domain['loginname'] . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$fpm_config.= 'pm = '.$fpm_pm."\n";
|
$fpm_config .= 'pm = ' . $fpm_pm . "\n";
|
||||||
$fpm_config.= 'pm.max_children = '.$fpm_children."\n";
|
$fpm_config .= 'pm.max_children = ' . $fpm_children . "\n";
|
||||||
|
|
||||||
if ($fpm_pm == 'dynamic') {
|
if ($fpm_pm == 'dynamic') {
|
||||||
// honor max_children
|
// honor max_children
|
||||||
if ($fpm_children < $fpm_min_spare_servers) {
|
if ($fpm_children < $fpm_min_spare_servers) {
|
||||||
@@ -214,35 +143,40 @@ class phpinterface_fpm {
|
|||||||
if ($fpm_start_servers > $fpm_max_spare_servers) {
|
if ($fpm_start_servers > $fpm_max_spare_servers) {
|
||||||
$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.start_servers = ' . $fpm_start_servers . "\n";
|
||||||
$fpm_config.= 'pm.min_spare_servers = '.$fpm_min_spare_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.max_spare_servers = ' . $fpm_max_spare_servers . "\n";
|
||||||
} elseif ($fpm_pm == 'ondemand') {
|
} 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
|
// possible slowlog configs
|
||||||
if ($phpconfig['fpm_slowlog'] == '1') {
|
if ($phpconfig['fpm_slowlog'] == '1') {
|
||||||
$fpm_config.= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
$fpm_config .= 'request_terminate_timeout = ' . $phpconfig['fpm_reqterm'] . "\n";
|
||||||
$fpm_config.= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
$fpm_config .= 'request_slowlog_timeout = ' . $phpconfig['fpm_reqslow'] . "\n";
|
||||||
$slowlog = makeCorrectFile(Settings::Get('system.logfiles_directory') . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
$slowlog = makeCorrectFile(Settings::Get('system.logfiles_directory') . '/' . $this->_domain['loginname'] . '-php-slow.log');
|
||||||
$fpm_config.= 'slowlog = ' . $slowlog . "\n";
|
$fpm_config .= 'slowlog = ' . $slowlog . "\n";
|
||||||
$fpm_config.= 'catch_workers_output = yes' . "\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'] . '/');
|
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
||||||
if (!is_dir($tmpdir)) {
|
if (! is_dir($tmpdir)) {
|
||||||
$this->getTempDir();
|
$this->getTempDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fpm_config.= 'env[TMP] = '.$tmpdir."\n";
|
$env_path = Settings::Get('phpfpm.envpath');
|
||||||
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
|
if (!empty($env_path)) {
|
||||||
$fpm_config.= 'env[TEMP] = '.$tmpdir."\n";
|
$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 = '';
|
$openbasedir = '';
|
||||||
if ($this->_domain['loginname'] != 'froxlor.panel') {
|
if ($this->_domain['loginname'] != 'froxlor.panel') {
|
||||||
if ($this->_domain['openbasedir'] == '1') {
|
if ($this->_domain['openbasedir'] == '1') {
|
||||||
@@ -251,47 +185,45 @@ class phpinterface_fpm {
|
|||||||
foreach ($_custom_openbasedir as $cobd) {
|
foreach ($_custom_openbasedir as $cobd) {
|
||||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||||
}
|
}
|
||||||
|
|
||||||
$_custom_openbasedir = explode(':', Settings::Get('system.phpappendopenbasedir'));
|
$_custom_openbasedir = explode(':', Settings::Get('system.phpappendopenbasedir'));
|
||||||
foreach ($_custom_openbasedir as $cobd) {
|
foreach ($_custom_openbasedir as $cobd) {
|
||||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->_domain['openbasedir_path'] == '0'
|
if ($this->_domain['openbasedir_path'] == '0' && strstr($this->_domain['documentroot'], ":") === false) {
|
||||||
&& strstr($this->_domain['documentroot'], ":") === false
|
|
||||||
) {
|
|
||||||
$openbasedir = appendOpenBasedirPath($this->_domain['documentroot'], true);
|
$openbasedir = appendOpenBasedirPath($this->_domain['documentroot'], true);
|
||||||
} else {
|
} else {
|
||||||
$openbasedir = appendOpenBasedirPath($this->_domain['customerroot'], true);
|
$openbasedir = appendOpenBasedirPath($this->_domain['customerroot'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||||
$openbasedir .= $_phpappendopenbasedir;
|
$openbasedir .= $_phpappendopenbasedir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fpm_config.= 'php_admin_value[session.save_path] = ' . 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";
|
$fpm_config .= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||||
|
|
||||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||||
$php_ini_variables = array(
|
$php_ini_variables = array(
|
||||||
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
||||||
'PEAR_DIR' => Settings::Get('phpfpm.peardir'),
|
'PEAR_DIR' => Settings::Get('phpfpm.peardir'),
|
||||||
'TMP_DIR' => $this->getTempDir(),
|
'TMP_DIR' => $this->getTempDir(),
|
||||||
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
||||||
'ADMIN_EMAIL' => $admin['email'],
|
'ADMIN_EMAIL' => $admin['email'],
|
||||||
'DOMAIN' => $this->_domain['domain'],
|
'DOMAIN' => $this->_domain['domain'],
|
||||||
'CUSTOMER' => $this->_domain['loginname'],
|
'CUSTOMER' => $this->_domain['loginname'],
|
||||||
'ADMIN' => $admin['loginname'],
|
'ADMIN' => $admin['loginname'],
|
||||||
'OPEN_BASEDIR' => $openbasedir,
|
'OPEN_BASEDIR' => $openbasedir,
|
||||||
'OPEN_BASEDIR_C' => '',
|
'OPEN_BASEDIR_C' => '',
|
||||||
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
'OPEN_BASEDIR_GLOBAL' => Settings::Get('system.phpappendopenbasedir'),
|
||||||
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
|
'DOCUMENT_ROOT' => makeCorrectDir($this->_domain['documentroot'])
|
||||||
);
|
);
|
||||||
|
|
||||||
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||||
$phpini_array = explode("\n", $phpini);
|
$phpini_array = explode("\n", $phpini);
|
||||||
|
|
||||||
$fpm_config.= "\n\n";
|
$fpm_config .= "\n\n";
|
||||||
foreach ($phpini_array as $inisection) {
|
foreach ($phpini_array as $inisection) {
|
||||||
$is = explode("=", $inisection);
|
$is = explode("=", $inisection);
|
||||||
foreach ($this->_ini as $sec => $possibles) {
|
foreach ($this->_ini as $sec => $possibles) {
|
||||||
@@ -300,17 +232,17 @@ class phpinterface_fpm {
|
|||||||
if (trim($is[0]) == 'open_basedir' && $openbasedir == '') {
|
if (trim($is[0]) == 'open_basedir' && $openbasedir == '') {
|
||||||
continue;
|
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
|
// now check if 'sendmail_path' has not beed set in the custom-php.ini
|
||||||
// if not we use our fallback-default as usual
|
// if not we use our fallback-default as usual
|
||||||
if (strpos($fpm_config, 'php_admin_value[sendmail_path]') === false) {
|
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));
|
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
}
|
}
|
||||||
@@ -322,108 +254,138 @@ class phpinterface_fpm {
|
|||||||
*
|
*
|
||||||
* @param string $phpconfig
|
* @param string $phpconfig
|
||||||
*/
|
*/
|
||||||
public function createIniFile($phpconfig) {
|
public function createIniFile($phpconfig)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fpm-config file
|
* 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
|
* @return string the full path to the file
|
||||||
*/
|
*/
|
||||||
public function getConfigFile($createifnotexists = true) {
|
public function getConfigFile($createifnotexists = true)
|
||||||
|
{
|
||||||
$configdir = makeCorrectDir(Settings::Get('phpfpm.configdir'));
|
$configdir = $this->_fpm_cfg['config_dir'];
|
||||||
$config = makeCorrectFile($configdir.'/'.$this->_domain['domain'].'.conf');
|
$config = makeCorrectFile($configdir . '/' . $this->_domain['domain'] . '.conf');
|
||||||
|
|
||||||
if (!is_dir($configdir) && $createifnotexists) {
|
if (! is_dir($configdir) && $createifnotexists) {
|
||||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return path of fpm-socket file
|
* 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
|
* @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'));
|
$socketdir = makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir'));
|
||||||
$socket = strtolower(makeCorrectFile($socketdir.'/'.$this->_domain['loginname'].'-'.$this->_domain['domain'].'-php-fpm.socket'));
|
// 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));
|
if (! is_dir($socketdir) && $createifnotexists) {
|
||||||
safe_exec('chown -R '.Settings::Get('system.httpuser').':'.Settings::Get('system.httpgroup').' '.escapeshellarg($socketdir));
|
safe_exec('mkdir -p ' . escapeshellarg($socketdir));
|
||||||
|
safe_exec('chown -R ' . Settings::Get('system.httpuser') . ':' . Settings::Get('system.httpgroup') . ' ' . escapeshellarg($socketdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $socket;
|
return $socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fpm-temp directory
|
* 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
|
* @return string the directory
|
||||||
*/
|
*/
|
||||||
public function getTempDir($createifnotexists = true) {
|
public function getTempDir($createifnotexists = true)
|
||||||
|
{
|
||||||
$tmpdir = makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/');
|
$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('mkdir -p ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tmpdir;
|
return $tmpdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fastcgi-fakedirectory directory
|
* 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
|
* @return string the directory
|
||||||
*/
|
*/
|
||||||
public function getAliasConfigDir($createifnotexists = true) {
|
public function getAliasConfigDir($createifnotexists = true)
|
||||||
|
{
|
||||||
|
|
||||||
// ensure default...
|
// ensure default...
|
||||||
if (Settings::Get('phpfpm.aliasconfigdir') == null) {
|
if (Settings::Get('phpfpm.aliasconfigdir') == null) {
|
||||||
Settings::Set('phpfpm.aliasconfigdir', '/var/www/php-fpm');
|
Settings::Set('phpfpm.aliasconfigdir', '/var/www/php-fpm');
|
||||||
}
|
}
|
||||||
|
|
||||||
$configdir = makeCorrectDir(Settings::Get('phpfpm.aliasconfigdir') . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
$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('mkdir -p ' . escapeshellarg($configdir));
|
||||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $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
|
* 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
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function _getAdminData($adminid) {
|
private function _getAdminData($adminid)
|
||||||
|
{
|
||||||
$adminid = intval($adminid);
|
$adminid = intval($adminid);
|
||||||
|
|
||||||
if (!isset($this->_admin_cache[$adminid])) {
|
if (! isset($this->_admin_cache[$adminid])) {
|
||||||
$stmt = Database::prepare("
|
$stmt = Database::prepare("
|
||||||
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id"
|
SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = :id");
|
||||||
);
|
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array(
|
||||||
$this->_admin_cache[$adminid] = Database::pexecute_first($stmt, array('id' => $adminid));
|
'id' => $adminid
|
||||||
|
));
|
||||||
}
|
}
|
||||||
return $this->_admin_cache[$adminid];
|
return $this->_admin_cache[$adminid];
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,88 +1,88 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* PHPMailer RFC821 SMTP email transport class.
|
* PHPMailer RFC821 SMTP email transport class.
|
||||||
* PHP Version 5
|
* PHP Version 5
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2014 Marcus Bointon
|
* @copyright 2014 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
* @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
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer RFC821 SMTP email transport class.
|
* PHPMailer RFC821 SMTP email transport class.
|
||||||
* Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
|
* Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Chris Ryan
|
* @author Chris Ryan
|
||||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
class SMTP
|
class SMTP
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The PHPMailer SMTP version number.
|
* The PHPMailer SMTP version number.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '5.2.21';
|
const VERSION = '5.2.26';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP line break constant.
|
* SMTP line break constant.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const CRLF = "\r\n";
|
const CRLF = "\r\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The SMTP port to use if one is not specified.
|
* The SMTP port to use if one is not specified.
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
const DEFAULT_SMTP_PORT = 25;
|
const DEFAULT_SMTP_PORT = 25;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum line length allowed by RFC 2822 section 2.1.1
|
* The maximum line length allowed by RFC 2822 section 2.1.1
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
const MAX_LINE_LENGTH = 998;
|
const MAX_LINE_LENGTH = 998;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level for no output
|
* Debug level for no output
|
||||||
*/
|
*/
|
||||||
const DEBUG_OFF = 0;
|
const DEBUG_OFF = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show client -> server messages
|
* Debug level to show client -> server messages
|
||||||
*/
|
*/
|
||||||
const DEBUG_CLIENT = 1;
|
const DEBUG_CLIENT = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show client -> server and server -> client messages
|
* Debug level to show client -> server and server -> client messages
|
||||||
*/
|
*/
|
||||||
const DEBUG_SERVER = 2;
|
const DEBUG_SERVER = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show connection status, client -> server and server -> client messages
|
* Debug level to show connection status, client -> server and server -> client messages
|
||||||
*/
|
*/
|
||||||
const DEBUG_CONNECTION = 3;
|
const DEBUG_CONNECTION = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show all messages
|
* Debug level to show all messages
|
||||||
*/
|
*/
|
||||||
const DEBUG_LOWLEVEL = 4;
|
const DEBUG_LOWLEVEL = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PHPMailer SMTP Version number.
|
* The PHPMailer SMTP Version number.
|
||||||
* @var string
|
* @var string
|
||||||
* @deprecated Use the `VERSION` constant instead
|
* @deprecated Use the `VERSION` constant instead
|
||||||
* @see SMTP::VERSION
|
* @see SMTP::VERSION
|
||||||
*/
|
*/
|
||||||
public $Version = '5.2.21';
|
public $Version = '5.2.26';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP server port number.
|
* SMTP server port number.
|
||||||
* @var integer
|
* @var integer
|
||||||
@@ -90,7 +90,7 @@ class SMTP
|
|||||||
* @see SMTP::DEFAULT_SMTP_PORT
|
* @see SMTP::DEFAULT_SMTP_PORT
|
||||||
*/
|
*/
|
||||||
public $SMTP_PORT = 25;
|
public $SMTP_PORT = 25;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP reply line ending.
|
* SMTP reply line ending.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -98,7 +98,7 @@ class SMTP
|
|||||||
* @see SMTP::CRLF
|
* @see SMTP::CRLF
|
||||||
*/
|
*/
|
||||||
public $CRLF = "\r\n";
|
public $CRLF = "\r\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug output level.
|
* Debug output level.
|
||||||
* Options:
|
* Options:
|
||||||
@@ -110,7 +110,7 @@ class SMTP
|
|||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $do_debug = self::DEBUG_OFF;
|
public $do_debug = self::DEBUG_OFF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How to handle debug output.
|
* How to handle debug output.
|
||||||
* Options:
|
* Options:
|
||||||
@@ -125,7 +125,7 @@ class SMTP
|
|||||||
* @var string|callable
|
* @var string|callable
|
||||||
*/
|
*/
|
||||||
public $Debugoutput = 'echo';
|
public $Debugoutput = 'echo';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to use VERP.
|
* Whether to use VERP.
|
||||||
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||||
@@ -133,7 +133,7 @@ class SMTP
|
|||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
public $do_verp = false;
|
public $do_verp = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The timeout value for connection, in seconds.
|
* The timeout value for connection, in seconds.
|
||||||
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
||||||
@@ -142,31 +142,36 @@ class SMTP
|
|||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $Timeout = 300;
|
public $Timeout = 300;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How long to wait for commands to complete, in seconds.
|
* How long to wait for commands to complete, in seconds.
|
||||||
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $Timelimit = 300;
|
public $Timelimit = 300;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array patterns to extract smtp transaction id from smtp reply
|
* @var array Patterns to extract an SMTP transaction id from reply to a DATA command.
|
||||||
* Only first capture group will be use, use non-capturing group to deal with it
|
* The first capture group in each regex will be used as the ID.
|
||||||
* Extend this class to override this property to fulfil your needs.
|
|
||||||
*/
|
*/
|
||||||
protected $smtp_transaction_id_patterns = array(
|
protected $smtp_transaction_id_patterns = array(
|
||||||
'exim' => '/[0-9]{3} OK id=(.*)/',
|
'exim' => '/[0-9]{3} OK id=(.*)/',
|
||||||
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
|
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
|
||||||
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
|
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string The last transaction ID issued in response to a DATA command,
|
||||||
|
* if one was detected
|
||||||
|
*/
|
||||||
|
protected $last_smtp_transaction_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The socket for the server connection.
|
* The socket for the server connection.
|
||||||
* @var resource
|
* @var resource
|
||||||
*/
|
*/
|
||||||
protected $smtp_conn;
|
protected $smtp_conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error information, if any, for the last SMTP command.
|
* Error information, if any, for the last SMTP command.
|
||||||
* @var array
|
* @var array
|
||||||
@@ -177,14 +182,14 @@ class SMTP
|
|||||||
'smtp_code' => '',
|
'smtp_code' => '',
|
||||||
'smtp_code_ex' => ''
|
'smtp_code_ex' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The reply the server sent to us for HELO.
|
* The reply the server sent to us for HELO.
|
||||||
* If null, no HELO string has yet been received.
|
* If null, no HELO string has yet been received.
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
protected $helo_rply = null;
|
protected $helo_rply = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of SMTP extensions sent in reply to EHLO command.
|
* The set of SMTP extensions sent in reply to EHLO command.
|
||||||
* Indexes of the array are extension names.
|
* Indexes of the array are extension names.
|
||||||
@@ -195,13 +200,13 @@ class SMTP
|
|||||||
* @var array|null
|
* @var array|null
|
||||||
*/
|
*/
|
||||||
protected $server_caps = null;
|
protected $server_caps = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The most recent reply received from the server.
|
* The most recent reply received from the server.
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $last_reply = '';
|
protected $last_reply = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output debugging info via a user-selected method.
|
* Output debugging info via a user-selected method.
|
||||||
* @see SMTP::$Debugoutput
|
* @see SMTP::$Debugoutput
|
||||||
@@ -227,12 +232,11 @@ class SMTP
|
|||||||
break;
|
break;
|
||||||
case 'html':
|
case 'html':
|
||||||
//Cleans up output a bit for a better looking, HTML-safe output
|
//Cleans up output a bit for a better looking, HTML-safe output
|
||||||
echo htmlentities(
|
echo gmdate('Y-m-d H:i:s') . ' ' . htmlentities(
|
||||||
preg_replace('/[\r\n]+/', '', $str),
|
preg_replace('/[\r\n]+/', '', $str),
|
||||||
ENT_QUOTES,
|
ENT_QUOTES,
|
||||||
'UTF-8'
|
'UTF-8'
|
||||||
)
|
) . "<br>\n";
|
||||||
. "<br>\n";
|
|
||||||
break;
|
break;
|
||||||
case 'echo':
|
case 'echo':
|
||||||
default:
|
default:
|
||||||
@@ -242,10 +246,10 @@ class SMTP
|
|||||||
"\n",
|
"\n",
|
||||||
"\n \t ",
|
"\n \t ",
|
||||||
trim($str)
|
trim($str)
|
||||||
)."\n";
|
) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to an SMTP server.
|
* Connect to an SMTP server.
|
||||||
* @param string $host SMTP server IP or host name
|
* @param string $host SMTP server IP or host name
|
||||||
@@ -276,7 +280,8 @@ class SMTP
|
|||||||
}
|
}
|
||||||
// Connect to the SMTP server
|
// Connect to the SMTP server
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
"Connection: opening to $host:$port, timeout=$timeout, options=".var_export($options, true),
|
"Connection: opening to $host:$port, timeout=$timeout, options=" .
|
||||||
|
var_export($options, true),
|
||||||
self::DEBUG_CONNECTION
|
self::DEBUG_CONNECTION
|
||||||
);
|
);
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
@@ -339,7 +344,7 @@ class SMTP
|
|||||||
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
|
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiate a TLS (encrypted) session.
|
* Initiate a TLS (encrypted) session.
|
||||||
* @access public
|
* @access public
|
||||||
@@ -350,28 +355,28 @@ class SMTP
|
|||||||
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Allow the best TLS version(s) we can
|
//Allow the best TLS version(s) we can
|
||||||
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
||||||
|
|
||||||
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
|
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
|
||||||
//so add them back in manually if we can
|
//so add them back in manually if we can
|
||||||
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
|
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
|
||||||
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
|
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
|
||||||
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin encrypted connection
|
// Begin encrypted connection
|
||||||
if (!stream_socket_enable_crypto(
|
set_error_handler(array($this, 'errorHandler'));
|
||||||
|
$crypto_ok = stream_socket_enable_crypto(
|
||||||
$this->smtp_conn,
|
$this->smtp_conn,
|
||||||
true,
|
true,
|
||||||
$crypto_method
|
$crypto_method
|
||||||
)) {
|
);
|
||||||
return false;
|
restore_error_handler();
|
||||||
}
|
return $crypto_ok;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform SMTP authentication.
|
* Perform SMTP authentication.
|
||||||
* Must be run after hello().
|
* Must be run after hello().
|
||||||
@@ -396,23 +401,22 @@ class SMTP
|
|||||||
$this->setError('Authentication is not allowed before HELO/EHLO');
|
$this->setError('Authentication is not allowed before HELO/EHLO');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists('EHLO', $this->server_caps)) {
|
if (array_key_exists('EHLO', $this->server_caps)) {
|
||||||
// SMTP extensions are available. Let's try to find a proper authentication method
|
// SMTP extensions are available; try to find a proper authentication method
|
||||||
|
|
||||||
if (!array_key_exists('AUTH', $this->server_caps)) {
|
if (!array_key_exists('AUTH', $this->server_caps)) {
|
||||||
$this->setError('Authentication is not allowed at this stage');
|
$this->setError('Authentication is not allowed at this stage');
|
||||||
// 'at this stage' means that auth may be allowed after the stage changes
|
// 'at this stage' means that auth may be allowed after the stage changes
|
||||||
// e.g. after STARTTLS
|
// e.g. after STARTTLS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
|
self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
|
||||||
self::edebug(
|
self::edebug(
|
||||||
'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
|
'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
|
||||||
self::DEBUG_LOWLEVEL
|
self::DEBUG_LOWLEVEL
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($authtype)) {
|
if (empty($authtype)) {
|
||||||
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
|
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
|
||||||
if (in_array($method, $this->server_caps['AUTH'])) {
|
if (in_array($method, $this->server_caps['AUTH'])) {
|
||||||
@@ -424,9 +428,9 @@ class SMTP
|
|||||||
$this->setError('No supported authentication methods found');
|
$this->setError('No supported authentication methods found');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL);
|
self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($authtype, $this->server_caps['AUTH'])) {
|
if (!in_array($authtype, $this->server_caps['AUTH'])) {
|
||||||
$this->setError("The requested authentication method \"$authtype\" is not supported by the server");
|
$this->setError("The requested authentication method \"$authtype\" is not supported by the server");
|
||||||
return false;
|
return false;
|
||||||
@@ -469,7 +473,7 @@ class SMTP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$oauth = $OAuth->getOauth64();
|
$oauth = $OAuth->getOauth64();
|
||||||
|
|
||||||
// Start authentication
|
// Start authentication
|
||||||
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
|
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -499,7 +503,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
//msg1
|
//msg1
|
||||||
$msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
|
$msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
|
||||||
|
|
||||||
if (!$this->sendCommand(
|
if (!$this->sendCommand(
|
||||||
'AUTH NTLM',
|
'AUTH NTLM',
|
||||||
'AUTH NTLM ' . base64_encode($msg1),
|
'AUTH NTLM ' . base64_encode($msg1),
|
||||||
@@ -532,10 +536,10 @@ class SMTP
|
|||||||
}
|
}
|
||||||
// Get the challenge
|
// Get the challenge
|
||||||
$challenge = base64_decode(substr($this->last_reply, 4));
|
$challenge = base64_decode(substr($this->last_reply, 4));
|
||||||
|
|
||||||
// Build the response
|
// Build the response
|
||||||
$response = $username . ' ' . $this->hmac($challenge, $password);
|
$response = $username . ' ' . $this->hmac($challenge, $password);
|
||||||
|
|
||||||
// send encoded credentials
|
// send encoded credentials
|
||||||
return $this->sendCommand('Username', base64_encode($response), 235);
|
return $this->sendCommand('Username', base64_encode($response), 235);
|
||||||
default:
|
default:
|
||||||
@@ -544,13 +548,13 @@ class SMTP
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate an MD5 HMAC hash.
|
* Calculate an MD5 HMAC hash.
|
||||||
* Works like hash_hmac('md5', $data, $key)
|
* Works like hash_hmac('md5', $data, $key)
|
||||||
* in case that function is not available
|
* in case that function is not available
|
||||||
* @param string $data The data to hash
|
* @param string $data The data to hash
|
||||||
* @param string $key The key to hash with
|
* @param string $key The key to hash with
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
@@ -559,15 +563,15 @@ class SMTP
|
|||||||
if (function_exists('hash_hmac')) {
|
if (function_exists('hash_hmac')) {
|
||||||
return hash_hmac('md5', $data, $key);
|
return hash_hmac('md5', $data, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following borrowed from
|
// The following borrowed from
|
||||||
// http://php.net/manual/en/function.mhash.php#27225
|
// http://php.net/manual/en/function.mhash.php#27225
|
||||||
|
|
||||||
// RFC 2104 HMAC implementation for php.
|
// RFC 2104 HMAC implementation for php.
|
||||||
// Creates an md5 HMAC.
|
// Creates an md5 HMAC.
|
||||||
// Eliminates the need to install mhash to compute a HMAC
|
// Eliminates the need to install mhash to compute a HMAC
|
||||||
// by Lance Rushing
|
// by Lance Rushing
|
||||||
|
|
||||||
$bytelen = 64; // byte length for md5
|
$bytelen = 64; // byte length for md5
|
||||||
if (strlen($key) > $bytelen) {
|
if (strlen($key) > $bytelen) {
|
||||||
$key = pack('H*', md5($key));
|
$key = pack('H*', md5($key));
|
||||||
@@ -577,10 +581,10 @@ class SMTP
|
|||||||
$opad = str_pad('', $bytelen, chr(0x5c));
|
$opad = str_pad('', $bytelen, chr(0x5c));
|
||||||
$k_ipad = $key ^ $ipad;
|
$k_ipad = $key ^ $ipad;
|
||||||
$k_opad = $key ^ $opad;
|
$k_opad = $key ^ $opad;
|
||||||
|
|
||||||
return md5($k_opad . pack('H*', md5($k_ipad . $data)));
|
return md5($k_opad . pack('H*', md5($k_ipad . $data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check connection state.
|
* Check connection state.
|
||||||
* @access public
|
* @access public
|
||||||
@@ -603,7 +607,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the socket and clean up the state of the class.
|
* Close the socket and clean up the state of the class.
|
||||||
* Don't use this function without first trying to use QUIT.
|
* Don't use this function without first trying to use QUIT.
|
||||||
@@ -623,7 +627,7 @@ class SMTP
|
|||||||
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP DATA command.
|
* Send an SMTP DATA command.
|
||||||
* Issues a data command and sends the msg_data to the server,
|
* Issues a data command and sends the msg_data to the server,
|
||||||
@@ -642,7 +646,7 @@ class SMTP
|
|||||||
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
if (!$this->sendCommand('DATA', 'DATA', 354)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The server is ready to accept data!
|
/* The server is ready to accept data!
|
||||||
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
|
* According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
|
||||||
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
|
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
|
||||||
@@ -650,21 +654,21 @@ class SMTP
|
|||||||
* We will also look for lines that start with a '.' and prepend an additional '.'.
|
* We will also look for lines that start with a '.' and prepend an additional '.'.
|
||||||
* NOTE: this does not count towards line-length limit.
|
* NOTE: this does not count towards line-length limit.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Normalize line breaks before exploding
|
// Normalize line breaks before exploding
|
||||||
$lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
|
$lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
|
||||||
|
|
||||||
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
|
||||||
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
|
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
|
||||||
* process all lines before a blank line as headers.
|
* process all lines before a blank line as headers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
$field = substr($lines[0], 0, strpos($lines[0], ':'));
|
||||||
$in_headers = false;
|
$in_headers = false;
|
||||||
if (!empty($field) && strpos($field, ' ') === false) {
|
if (!empty($field) && strpos($field, ' ') === false) {
|
||||||
$in_headers = true;
|
$in_headers = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$lines_out = array();
|
$lines_out = array();
|
||||||
if ($in_headers and $line == '') {
|
if ($in_headers and $line == '') {
|
||||||
@@ -694,7 +698,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$lines_out[] = $line;
|
$lines_out[] = $line;
|
||||||
|
|
||||||
//Send the lines to the server
|
//Send the lines to the server
|
||||||
foreach ($lines_out as $line_out) {
|
foreach ($lines_out as $line_out) {
|
||||||
//RFC2821 section 4.5.2
|
//RFC2821 section 4.5.2
|
||||||
@@ -704,17 +708,18 @@ class SMTP
|
|||||||
$this->client_send($line_out . self::CRLF);
|
$this->client_send($line_out . self::CRLF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Message data has been sent, complete the command
|
//Message data has been sent, complete the command
|
||||||
//Increase timelimit for end of DATA command
|
//Increase timelimit for end of DATA command
|
||||||
$savetimelimit = $this->Timelimit;
|
$savetimelimit = $this->Timelimit;
|
||||||
$this->Timelimit = $this->Timelimit * 2;
|
$this->Timelimit = $this->Timelimit * 2;
|
||||||
$result = $this->sendCommand('DATA END', '.', 250);
|
$result = $this->sendCommand('DATA END', '.', 250);
|
||||||
|
$this->recordLastTransactionID();
|
||||||
//Restore timelimit
|
//Restore timelimit
|
||||||
$this->Timelimit = $savetimelimit;
|
$this->Timelimit = $savetimelimit;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP HELO or EHLO command.
|
* Send an SMTP HELO or EHLO command.
|
||||||
* Used to identify the sending server to the receiving server.
|
* Used to identify the sending server to the receiving server.
|
||||||
@@ -730,7 +735,7 @@ class SMTP
|
|||||||
//Try extended hello first (RFC 2821)
|
//Try extended hello first (RFC 2821)
|
||||||
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP HELO or EHLO command.
|
* Send an SMTP HELO or EHLO command.
|
||||||
* Low-level implementation used by hello()
|
* Low-level implementation used by hello()
|
||||||
@@ -751,7 +756,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
return $noerror;
|
return $noerror;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a reply to HELO/EHLO command to discover server extensions.
|
* Parse a reply to HELO/EHLO command to discover server extensions.
|
||||||
* In case of HELO, the only parameter that can be discovered is a server name.
|
* In case of HELO, the only parameter that can be discovered is a server name.
|
||||||
@@ -762,7 +767,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
$this->server_caps = array();
|
$this->server_caps = array();
|
||||||
$lines = explode("\n", $this->helo_rply);
|
$lines = explode("\n", $this->helo_rply);
|
||||||
|
|
||||||
foreach ($lines as $n => $s) {
|
foreach ($lines as $n => $s) {
|
||||||
//First 4 chars contain response code followed by - or space
|
//First 4 chars contain response code followed by - or space
|
||||||
$s = trim(substr($s, 4));
|
$s = trim(substr($s, 4));
|
||||||
@@ -793,7 +798,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP MAIL command.
|
* Send an SMTP MAIL command.
|
||||||
* Starts a mail transaction from the email address specified in
|
* Starts a mail transaction from the email address specified in
|
||||||
@@ -814,7 +819,7 @@ class SMTP
|
|||||||
250
|
250
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP QUIT command.
|
* Send an SMTP QUIT command.
|
||||||
* Closes the socket if there is no error or the $close_on_error argument is true.
|
* Closes the socket if there is no error or the $close_on_error argument is true.
|
||||||
@@ -833,7 +838,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
return $noerror;
|
return $noerror;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP RCPT command.
|
* Send an SMTP RCPT command.
|
||||||
* Sets the TO argument to $toaddr.
|
* Sets the TO argument to $toaddr.
|
||||||
@@ -851,7 +856,7 @@ class SMTP
|
|||||||
array(250, 251)
|
array(250, 251)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP RSET command.
|
* Send an SMTP RSET command.
|
||||||
* Abort any transaction that is currently in progress.
|
* Abort any transaction that is currently in progress.
|
||||||
@@ -863,7 +868,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->sendCommand('RSET', 'RSET', 250);
|
return $this->sendCommand('RSET', 'RSET', 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a command to an SMTP server and check its return code.
|
* Send a command to an SMTP server and check its return code.
|
||||||
* @param string $command The command name - not sent to the server
|
* @param string $command The command name - not sent to the server
|
||||||
@@ -884,7 +889,7 @@ class SMTP
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->client_send($commandstring . self::CRLF);
|
$this->client_send($commandstring . self::CRLF);
|
||||||
|
|
||||||
$this->last_reply = $this->get_lines();
|
$this->last_reply = $this->get_lines();
|
||||||
// Fetch SMTP code and possible error code explanation
|
// Fetch SMTP code and possible error code explanation
|
||||||
$matches = array();
|
$matches = array();
|
||||||
@@ -893,7 +898,8 @@ class SMTP
|
|||||||
$code_ex = (count($matches) > 2 ? $matches[2] : null);
|
$code_ex = (count($matches) > 2 ? $matches[2] : null);
|
||||||
// Cut off error code from each response line
|
// Cut off error code from each response line
|
||||||
$detail = preg_replace(
|
$detail = preg_replace(
|
||||||
"/{$code}[ -]".($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '')."/m",
|
"/{$code}[ -]" .
|
||||||
|
($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m",
|
||||||
'',
|
'',
|
||||||
$this->last_reply
|
$this->last_reply
|
||||||
);
|
);
|
||||||
@@ -903,9 +909,9 @@ class SMTP
|
|||||||
$code_ex = null;
|
$code_ex = null;
|
||||||
$detail = substr($this->last_reply, 4);
|
$detail = substr($this->last_reply, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
|
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
|
||||||
|
|
||||||
if (!in_array($code, (array)$expect)) {
|
if (!in_array($code, (array)$expect)) {
|
||||||
$this->setError(
|
$this->setError(
|
||||||
"$command command failed",
|
"$command command failed",
|
||||||
@@ -919,11 +925,11 @@ class SMTP
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setError('');
|
$this->setError('');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP SAML command.
|
* Send an SMTP SAML command.
|
||||||
* Starts a mail transaction from the email address specified in $from.
|
* Starts a mail transaction from the email address specified in $from.
|
||||||
@@ -941,7 +947,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP VRFY command.
|
* Send an SMTP VRFY command.
|
||||||
* @param string $name The name to verify
|
* @param string $name The name to verify
|
||||||
@@ -952,7 +958,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP NOOP command.
|
* Send an SMTP NOOP command.
|
||||||
* Used to keep keep-alives alive, doesn't actually do anything
|
* Used to keep keep-alives alive, doesn't actually do anything
|
||||||
@@ -963,7 +969,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->sendCommand('NOOP', 'NOOP', 250);
|
return $this->sendCommand('NOOP', 'NOOP', 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an SMTP TURN command.
|
* Send an SMTP TURN command.
|
||||||
* This is an optional command for SMTP that this class does not support.
|
* This is an optional command for SMTP that this class does not support.
|
||||||
@@ -979,7 +985,7 @@ class SMTP
|
|||||||
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
|
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send raw data to the server.
|
* Send raw data to the server.
|
||||||
* @param string $data The data to send
|
* @param string $data The data to send
|
||||||
@@ -989,9 +995,12 @@ class SMTP
|
|||||||
public function client_send($data)
|
public function client_send($data)
|
||||||
{
|
{
|
||||||
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
|
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
|
||||||
return fwrite($this->smtp_conn, $data);
|
set_error_handler(array($this, 'errorHandler'));
|
||||||
|
$result = fwrite($this->smtp_conn, $data);
|
||||||
|
restore_error_handler();
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the latest error.
|
* Get the latest error.
|
||||||
* @access public
|
* @access public
|
||||||
@@ -1001,7 +1010,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get SMTP extensions available on the server
|
* Get SMTP extensions available on the server
|
||||||
* @access public
|
* @access public
|
||||||
@@ -1011,7 +1020,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->server_caps;
|
return $this->server_caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A multipurpose method
|
* A multipurpose method
|
||||||
* The method works in three ways, dependent on argument value and current state
|
* The method works in three ways, dependent on argument value and current state
|
||||||
@@ -1037,7 +1046,7 @@ class SMTP
|
|||||||
$this->setError('No HELO/EHLO was sent');
|
$this->setError('No HELO/EHLO was sent');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the tight logic knot ;)
|
// the tight logic knot ;)
|
||||||
if (!array_key_exists($name, $this->server_caps)) {
|
if (!array_key_exists($name, $this->server_caps)) {
|
||||||
if ($name == 'HELO') {
|
if ($name == 'HELO') {
|
||||||
@@ -1049,10 +1058,10 @@ class SMTP
|
|||||||
$this->setError('HELO handshake was used. Client knows nothing about server extensions');
|
$this->setError('HELO handshake was used. Client knows nothing about server extensions');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->server_caps[$name];
|
return $this->server_caps[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the last reply from the server.
|
* Get the last reply from the server.
|
||||||
* @access public
|
* @access public
|
||||||
@@ -1062,7 +1071,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->last_reply;
|
return $this->last_reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the SMTP server's response.
|
* Read the SMTP server's response.
|
||||||
* Either before eof or socket timeout occurs on the operation.
|
* Either before eof or socket timeout occurs on the operation.
|
||||||
@@ -1089,8 +1098,10 @@ class SMTP
|
|||||||
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
|
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
|
||||||
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
|
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
|
||||||
$data .= $str;
|
$data .= $str;
|
||||||
// If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
|
// If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
|
||||||
if ((isset($str[3]) and $str[3] == ' ')) {
|
// or 4th character is a space, we are done reading, break the loop,
|
||||||
|
// string array access is a micro-optimisation over strlen
|
||||||
|
if (!isset($str[3]) or (isset($str[3]) and $str[3] == ' ')) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Timed-out? Log and break
|
// Timed-out? Log and break
|
||||||
@@ -1105,7 +1116,7 @@ class SMTP
|
|||||||
// Now check if reads took too long
|
// Now check if reads took too long
|
||||||
if ($endtime and time() > $endtime) {
|
if ($endtime and time() > $endtime) {
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
'SMTP -> get_lines(): timelimit reached ('.
|
'SMTP -> get_lines(): timelimit reached (' .
|
||||||
$this->Timelimit . ' sec)',
|
$this->Timelimit . ' sec)',
|
||||||
self::DEBUG_LOWLEVEL
|
self::DEBUG_LOWLEVEL
|
||||||
);
|
);
|
||||||
@@ -1114,7 +1125,7 @@ class SMTP
|
|||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable or disable VERP address generation.
|
* Enable or disable VERP address generation.
|
||||||
* @param boolean $enabled
|
* @param boolean $enabled
|
||||||
@@ -1123,7 +1134,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
$this->do_verp = $enabled;
|
$this->do_verp = $enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get VERP address generation mode.
|
* Get VERP address generation mode.
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@@ -1132,7 +1143,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->do_verp;
|
return $this->do_verp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set error messages and codes.
|
* Set error messages and codes.
|
||||||
* @param string $message The error message
|
* @param string $message The error message
|
||||||
@@ -1149,7 +1160,7 @@ class SMTP
|
|||||||
'smtp_code_ex' => $smtp_code_ex
|
'smtp_code_ex' => $smtp_code_ex
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set debug output method.
|
* Set debug output method.
|
||||||
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
|
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
|
||||||
@@ -1158,7 +1169,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
$this->Debugoutput = $method;
|
$this->Debugoutput = $method;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get debug output method.
|
* Get debug output method.
|
||||||
* @return string
|
* @return string
|
||||||
@@ -1167,7 +1178,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->Debugoutput;
|
return $this->Debugoutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set debug output level.
|
* Set debug output level.
|
||||||
* @param integer $level
|
* @param integer $level
|
||||||
@@ -1176,7 +1187,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
$this->do_debug = $level;
|
$this->do_debug = $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get debug output level.
|
* Get debug output level.
|
||||||
* @return integer
|
* @return integer
|
||||||
@@ -1185,7 +1196,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->do_debug;
|
return $this->do_debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SMTP timeout.
|
* Set SMTP timeout.
|
||||||
* @param integer $timeout
|
* @param integer $timeout
|
||||||
@@ -1194,7 +1205,7 @@ class SMTP
|
|||||||
{
|
{
|
||||||
$this->Timeout = $timeout;
|
$this->Timeout = $timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get SMTP timeout.
|
* Get SMTP timeout.
|
||||||
* @return integer
|
* @return integer
|
||||||
@@ -1203,47 +1214,63 @@ class SMTP
|
|||||||
{
|
{
|
||||||
return $this->Timeout;
|
return $this->Timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reports an error number and string.
|
* Reports an error number and string.
|
||||||
* @param integer $errno The error number returned by PHP.
|
* @param integer $errno The error number returned by PHP.
|
||||||
* @param string $errmsg The error message returned by PHP.
|
* @param string $errmsg The error message returned by PHP.
|
||||||
|
* @param string $errfile The file the error occurred in
|
||||||
|
* @param integer $errline The line number the error occurred on
|
||||||
*/
|
*/
|
||||||
protected function errorHandler($errno, $errmsg)
|
protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
|
||||||
{
|
{
|
||||||
$notice = 'Connection: Failed to connect to server.';
|
$notice = 'Connection failed.';
|
||||||
$this->setError(
|
$this->setError(
|
||||||
$notice,
|
$notice,
|
||||||
$errno,
|
$errno,
|
||||||
$errmsg
|
$errmsg
|
||||||
);
|
);
|
||||||
$this->edebug(
|
$this->edebug(
|
||||||
$notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
|
$notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]",
|
||||||
self::DEBUG_CONNECTION
|
self::DEBUG_CONNECTION
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will return the ID of the last smtp transaction based on a list of patterns provided
|
* Extract and return the ID of the last SMTP transaction based on
|
||||||
* in SMTP::$smtp_transaction_id_patterns.
|
* a list of patterns provided in SMTP::$smtp_transaction_id_patterns.
|
||||||
|
* Relies on the host providing the ID in response to a DATA command.
|
||||||
* If no reply has been received yet, it will return null.
|
* If no reply has been received yet, it will return null.
|
||||||
* If no pattern has been matched, it will return false.
|
* If no pattern was matched, it will return false.
|
||||||
* @return bool|null|string
|
* @return bool|null|string
|
||||||
*/
|
*/
|
||||||
|
protected function recordLastTransactionID()
|
||||||
|
{
|
||||||
|
$reply = $this->getLastReply();
|
||||||
|
|
||||||
|
if (empty($reply)) {
|
||||||
|
$this->last_smtp_transaction_id = null;
|
||||||
|
} else {
|
||||||
|
$this->last_smtp_transaction_id = false;
|
||||||
|
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
|
||||||
|
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
|
||||||
|
$this->last_smtp_transaction_id = $matches[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->last_smtp_transaction_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the queue/transaction ID of the last SMTP transaction
|
||||||
|
* If no reply has been received yet, it will return null.
|
||||||
|
* If no pattern was matched, it will return false.
|
||||||
|
* @return bool|null|string
|
||||||
|
* @see recordLastTransactionID()
|
||||||
|
*/
|
||||||
public function getLastTransactionID()
|
public function getLastTransactionID()
|
||||||
{
|
{
|
||||||
$reply = $this->getLastReply();
|
return $this->last_smtp_transaction_id;
|
||||||
|
|
||||||
if (empty($reply)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
|
|
||||||
if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
|
|
||||||
return $matches[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,6 @@ class lescript
|
|||||||
{
|
{
|
||||||
|
|
||||||
// https://letsencrypt.org/repository/
|
// https://letsencrypt.org/repository/
|
||||||
public $license;
|
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
|
|
||||||
@@ -111,19 +110,7 @@ class lescript
|
|||||||
}
|
}
|
||||||
$accountUrl=$this->client->getLastLocation();
|
$accountUrl=$this->client->getLastLocation();
|
||||||
|
|
||||||
$this->log('Accepting lets encrypt Terms of Service');
|
$leregistered = 1;
|
||||||
|
|
||||||
$this->license = $this->client->getAgreementURL();
|
|
||||||
|
|
||||||
// Terms of Service are optional according to ACME specs; if no ToS are presented, no need to update registration
|
|
||||||
if (!empty($this->license)) {
|
|
||||||
$response = $this->postRegAgreement(parse_url($accountUrl, PHP_URL_PATH));
|
|
||||||
if ($this->client->getLastCode() != 202) {
|
|
||||||
throw new \RuntimeException("Terms of Service not accepted. Whole response: " . json_encode($response));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$leregistered=1;
|
|
||||||
$this->setLeRegisteredState($leregistered); // Account registered
|
$this->setLeRegisteredState($leregistered); // Account registered
|
||||||
$this->log('Lets encrypt Terms of Service accepted');
|
$this->log('Lets encrypt Terms of Service accepted');
|
||||||
}
|
}
|
||||||
@@ -227,17 +214,19 @@ class lescript
|
|||||||
$this->log("Token for $domain saved at $tokenPath and should be available at $uri");
|
$this->log("Token for $domain saved at $tokenPath and should be available at $uri");
|
||||||
|
|
||||||
// simple self check
|
// simple self check
|
||||||
$selfcheckContextOptions = array('http' => array('header' => "User-Agent: Froxlor/".$this->version));
|
if (Settings::Get('system.disable_le_selfcheck') == '0')
|
||||||
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
{
|
||||||
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
$selfcheckContextOptions = array('http' => array('header' => "User-Agent: Froxlor/".$this->version));
|
||||||
$errmsg = json_encode(error_get_last());
|
$selfcheckContext = stream_context_create($selfcheckContextOptions);
|
||||||
if ($errmsg != "null") {
|
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
|
||||||
$errmsg = "; PHP error: " . $errmsg;
|
$errmsg = json_encode(error_get_last());
|
||||||
} else {
|
if ($errmsg != "null") {
|
||||||
$errmsg = "";
|
$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");
|
$this->log("Sending request to challenge");
|
||||||
@@ -371,21 +360,16 @@ class lescript
|
|||||||
|
|
||||||
private function postNewReg()
|
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');
|
$this->log('Sending registration to letsencrypt server');
|
||||||
|
|
||||||
return $this->signedRequest('/acme/new-reg', array(
|
return $this->signedRequest('/acme/new-reg', array(
|
||||||
'resource' => 'new-reg',
|
'resource' => 'new-reg',
|
||||||
'agreement' => $this->license
|
'agreement' => $directory['meta']['terms-of-service']
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
private function postRegAgreement($uri)
|
|
||||||
{
|
|
||||||
$this->log('Accepting agreement at URL: ' . $this->license);
|
|
||||||
|
|
||||||
return $this->signedRequest($uri, array(
|
|
||||||
'resource' => 'reg',
|
|
||||||
'agreement' => $this->license
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,49 +574,6 @@ class Client
|
|||||||
preg_match_all('~Link: <(.+)>;rel="up"~', $this->lastHeader, $matches);
|
preg_match_all('~Link: <(.+)>;rel="up"~', $this->lastHeader, $matches);
|
||||||
return $matches[1];
|
return $matches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAgreementURLFromLastResponse()
|
|
||||||
{
|
|
||||||
if (preg_match_all('~Link: <(.+)>;rel="terms-of-service"~', $this->lastHeader, $matches)) {
|
|
||||||
return $matches[1][0];
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
public function getAgreementURLFromDirectory()
|
|
||||||
{
|
|
||||||
// FIXME: Current license should be found in /directory but LE does not implement this yet
|
|
||||||
// $this->curl('GET', '/directory');
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
public function getAgreementURLFromTermsUrl()
|
|
||||||
{
|
|
||||||
$this->curl('GET', '/terms');
|
|
||||||
if (preg_match_all('~Location: (.+)~', $this->lastHeader, $matches)) {
|
|
||||||
return trim($matches[1][0]);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAgreementURL()
|
|
||||||
{
|
|
||||||
// 1. check the header of the last response
|
|
||||||
$license=$this->getAgreementURLFromLastResponse();
|
|
||||||
if (!empty($license)) return $license;
|
|
||||||
|
|
||||||
// 2. query directory for license
|
|
||||||
$license=$this->getAgreementURLFromDirectory();
|
|
||||||
if (!empty($license)) return $license;
|
|
||||||
|
|
||||||
// 3. query /terms endpoint (not ACME standard but implemented by let's enrypt)
|
|
||||||
$license=$this->getAgreementURLFromTermsUrl();
|
|
||||||
if (!empty($license)) return $license;
|
|
||||||
|
|
||||||
// Fallback: use latest known license. This is only valid for let's encrypt and should be removed as soon as there is an official
|
|
||||||
// ACME-endpoint to get the current ToS
|
|
||||||
return "https://letsencrypt.org/documents/LE-SA-v1.1.1-August-1-2016.pdf";
|
|
||||||
// return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Base64UrlSafeEncoder
|
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
|
* @since 0.9.29
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
class ConfigIO
|
||||||
class ConfigIO {
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*/
|
*/
|
||||||
public function __construct() {}
|
public function __construct()
|
||||||
|
{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clean up former created configs, including (if enabled)
|
* clean up former created configs, including (if enabled)
|
||||||
@@ -32,39 +33,40 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function cleanUp() {
|
public function cleanUp()
|
||||||
|
{
|
||||||
|
|
||||||
// old error logs
|
// old error logs
|
||||||
$this->_cleanErrLogs();
|
$this->_cleanErrLogs();
|
||||||
|
|
||||||
// awstats files
|
// awstats files
|
||||||
$this->_cleanAwstatsFiles();
|
$this->_cleanAwstatsFiles();
|
||||||
|
|
||||||
// fcgid files
|
// fcgid files
|
||||||
$this->_cleanFcgidFiles();
|
$this->_cleanFcgidFiles();
|
||||||
|
|
||||||
// php-fpm files
|
// php-fpm files
|
||||||
$this->_cleanFpmFiles();
|
$this->_cleanFpmFiles();
|
||||||
|
|
||||||
// clean webserver-configs
|
// clean webserver-configs
|
||||||
$this->_cleanWebserverConfigs();
|
$this->_cleanWebserverConfigs();
|
||||||
|
|
||||||
// old htpasswd files
|
// old htpasswd files
|
||||||
$this->_cleanHtpasswdFiles();
|
$this->_cleanHtpasswdFiles();
|
||||||
|
|
||||||
// customer-specified ssl-certificates
|
// customer-specified ssl-certificates
|
||||||
$this->_cleanCustomerSslCerts();
|
$this->_cleanCustomerSslCerts();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _cleanErrLogs() {
|
private function _cleanErrLogs()
|
||||||
|
{
|
||||||
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
|
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . "/logs/");
|
||||||
if (@is_dir($err_dir)) {
|
if (@is_dir($err_dir)) {
|
||||||
// now get rid of old stuff
|
// now get rid of old stuff
|
||||||
//(but append /*.log so we don't delete the directory)
|
// (but append /*.log so we don't delete the directory)
|
||||||
$err_dir.='/*.log';
|
$err_dir .= '/*.log';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($err_dir));
|
safe_exec('rm -f ' . makeCorrectFile($err_dir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,8 +75,9 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanCustomerSslCerts() {
|
private function _cleanCustomerSslCerts()
|
||||||
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* only clean up if we're actually using SSL
|
* only clean up if we're actually using SSL
|
||||||
*/
|
*/
|
||||||
@@ -82,14 +85,14 @@ class ConfigIO {
|
|||||||
// get correct directory
|
// get correct directory
|
||||||
$configdir = $this->_getFile('system', 'customer_ssl_path');
|
$configdir = $this->_getFile('system', 'customer_ssl_path');
|
||||||
if ($configdir !== false) {
|
if ($configdir !== false) {
|
||||||
|
|
||||||
$configdir = makeCorrectDir($configdir);
|
$configdir = makeCorrectDir($configdir);
|
||||||
|
|
||||||
if (@is_dir($configdir)) {
|
if (@is_dir($configdir)) {
|
||||||
// now get rid of old stuff
|
// now get rid of old stuff
|
||||||
//(but append /* so we don't delete the directory)
|
// (but append /* so we don't delete the directory)
|
||||||
$configdir.='/*';
|
$configdir .= '/*';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,39 +103,38 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanWebserverConfigs() {
|
private function _cleanWebserverConfigs()
|
||||||
|
{
|
||||||
|
|
||||||
// get directories
|
// get directories
|
||||||
$configdirs = array();
|
$configdirs = array();
|
||||||
$dir = $this->_getFile('system', 'apacheconf_vhost');
|
$dir = $this->_getFile('system', 'apacheconf_vhost');
|
||||||
if ($dir !== false)
|
if ($dir !== false)
|
||||||
$configdirs[] = makeCorrectDir($dir);
|
$configdirs[] = makeCorrectDir($dir);
|
||||||
|
|
||||||
$dir = $this->_getFile('system', 'apacheconf_diroptions');
|
$dir = $this->_getFile('system', 'apacheconf_diroptions');
|
||||||
if ($dir !== false)
|
if ($dir !== false)
|
||||||
$configdirs[] = makeCorrectDir($dir);
|
$configdirs[] = makeCorrectDir($dir);
|
||||||
|
|
||||||
// file pattern
|
// file pattern
|
||||||
$pattern = "/^([0-9]){2}_(froxlor|syscp)_(.+)\.conf$/";
|
$pattern = "/^([0-9]){2}_(froxlor|syscp)_(.+)\.conf$/";
|
||||||
|
|
||||||
// check ALL the folders
|
// check ALL the folders
|
||||||
foreach ($configdirs as $config_dir) {
|
foreach ($configdirs as $config_dir) {
|
||||||
|
|
||||||
// check directory
|
// check directory
|
||||||
if (@is_dir($config_dir)) {
|
if (@is_dir($config_dir)) {
|
||||||
|
|
||||||
// create directory iterator
|
// create directory iterator
|
||||||
$its = new RecursiveIteratorIterator(
|
$its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($config_dir));
|
||||||
new RecursiveDirectoryIterator($config_dir)
|
|
||||||
);
|
|
||||||
|
|
||||||
// iterate through all subdirs,
|
// iterate through all subdirs,
|
||||||
// look for vhost/diroption files
|
// look for vhost/diroption files
|
||||||
// and delete them
|
// and delete them
|
||||||
foreach ($its as $fullFileName => $it ) {
|
foreach ($its as $fullFileName => $it) {
|
||||||
if ($it->isFile() && preg_match($pattern, $it->getFilename())) {
|
if ($it->isFile() && preg_match($pattern, $it->getFilename())) {
|
||||||
// remove file
|
// 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
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanHtpasswdFiles() {
|
private function _cleanHtpasswdFiles()
|
||||||
|
{
|
||||||
|
|
||||||
// get correct directory
|
// get correct directory
|
||||||
$configdir = $this->_getFile('system', 'apacheconf_htpasswddir');
|
$configdir = $this->_getFile('system', 'apacheconf_htpasswddir');
|
||||||
|
|
||||||
if ($configdir !== false) {
|
if ($configdir !== false) {
|
||||||
$configdir = makeCorrectDir($configdir);
|
$configdir = makeCorrectDir($configdir);
|
||||||
|
|
||||||
if (@is_dir($configdir)) {
|
if (@is_dir($configdir)) {
|
||||||
// now get rid of old stuff
|
// now get rid of old stuff
|
||||||
//(but append /* so we don't delete the directory)
|
// (but append /* so we don't delete the directory)
|
||||||
$configdir.='/*';
|
$configdir .= '/*';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,37 +169,36 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanAwstatsFiles() {
|
private function _cleanAwstatsFiles()
|
||||||
|
{
|
||||||
if (Settings::Get('system.awstats_enabled') == '0') {
|
if (Settings::Get('system.awstats_enabled') == '0') {
|
||||||
return;
|
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['header'] = "## GENERATED BY FROXLOR\n";
|
||||||
$awstatsclean['headerold'] = "## GENERATED BY SYSCP\n";
|
$awstatsclean['headerold'] = "## GENERATED BY SYSCP\n";
|
||||||
$awstatsclean['path'] = $this->_getFile('system', 'awstats_conf');
|
$awstatsclean['path'] = $this->_getFile('system', 'awstats_conf');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* don't do anything if the directory does not exist
|
* 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
|
* fixes #45
|
||||||
*/
|
*/
|
||||||
if ($awstatsclean['path'] !== false && is_dir($awstatsclean['path'])) {
|
if ($awstatsclean['path'] !== false && is_dir($awstatsclean['path'])) {
|
||||||
$awstatsclean['dir'] = dir($awstatsclean['path']);
|
$awstatsclean['dir'] = dir($awstatsclean['path']);
|
||||||
while ($awstatsclean['entry'] = $awstatsclean['dir']->read()) {
|
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
|
* don't do anything if the file does not exist
|
||||||
*/
|
*/
|
||||||
if (@file_exists($awstatsclean['fullentry'])) {
|
if (@file_exists($awstatsclean['fullentry'])) {
|
||||||
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
|
$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']);
|
fclose($awstatsclean['fh']);
|
||||||
|
|
||||||
if ($awstatsclean['headerRead'] == $awstatsclean['header']
|
if ($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] == $awstatsclean['headerold']) {
|
||||||
|| $awstatsclean['headerRead'] == $awstatsclean['headerold']
|
|
||||||
) {
|
|
||||||
$awstats_conf_file = makeCorrectFile($awstatsclean['fullentry']);
|
$awstats_conf_file = makeCorrectFile($awstatsclean['fullentry']);
|
||||||
@unlink($awstats_conf_file);
|
@unlink($awstats_conf_file);
|
||||||
}
|
}
|
||||||
@@ -204,7 +206,7 @@ class ConfigIO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($awstatsclean);
|
unset($awstatsclean);
|
||||||
//end dhr
|
// end dhr
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -212,39 +214,37 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanFcgidFiles() {
|
private function _cleanFcgidFiles()
|
||||||
|
{
|
||||||
if (Settings::Get('system.mod_fcgid') == '0') {
|
if (Settings::Get('system.mod_fcgid') == '0') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get correct directory
|
// get correct directory
|
||||||
$configdir = $this->_getFile('system', 'mod_fcgid_configdir');
|
$configdir = $this->_getFile('system', 'mod_fcgid_configdir');
|
||||||
if ($configdir !== false) {
|
if ($configdir !== false) {
|
||||||
|
|
||||||
$configdir = makeCorrectDir($configdir);
|
$configdir = makeCorrectDir($configdir);
|
||||||
|
|
||||||
if (@is_dir($configdir)) {
|
if (@is_dir($configdir)) {
|
||||||
// create directory iterator
|
// create directory iterator
|
||||||
$its = new RecursiveIteratorIterator(
|
$its = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($configdir));
|
||||||
new RecursiveDirectoryIterator($configdir)
|
|
||||||
);
|
|
||||||
|
|
||||||
// iterate through all subdirs,
|
// iterate through all subdirs,
|
||||||
// look for php-fcgi-starter files
|
// look for php-fcgi-starter files
|
||||||
// and take immutable-flag away from them
|
// and take immutable-flag away from them
|
||||||
// so we can delete them :)
|
// so we can delete them :)
|
||||||
foreach ($its as $fullFileName => $it ) {
|
foreach ($its as $fullFileName => $it) {
|
||||||
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter') {
|
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter') {
|
||||||
// set chattr -i
|
// set chattr -i
|
||||||
removeImmutable($its->getPathname());
|
removeImmutable($its->getPathname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// now get rid of old stuff
|
// now get rid of old stuff
|
||||||
//(but append /* so we don't delete the directory)
|
// (but append /* so we don't delete the directory)
|
||||||
$configdir.='/*';
|
$configdir .= '/*';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
safe_exec('rm -rf ' . makeCorrectFile($configdir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,33 +254,36 @@ class ConfigIO {
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
private function _cleanFpmFiles() {
|
private function _cleanFpmFiles()
|
||||||
|
{
|
||||||
if (Settings::Get('phpfpm.enabled') == '0') {
|
if (Settings::Get('phpfpm.enabled') == '0') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get correct directory
|
// get all fpm config paths
|
||||||
$configdir = $this->_getFile('phpfpm', 'configdir');
|
$fpmconf_sel = Database::prepare("SELECT config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
|
||||||
if ($configdir !== false) {
|
Database::pexecute($fpmconf_sel);
|
||||||
|
$fpmconf_paths = $fpmconf_sel->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$configdir = makeCorrectDir($configdir);
|
// clean all php-fpm config-dirs
|
||||||
|
foreach ($fpmconf_paths as $configdir) {
|
||||||
|
$configdir = makeCorrectDir($configdir['config_dir']);
|
||||||
if (@is_dir($configdir)) {
|
if (@is_dir($configdir)) {
|
||||||
// now get rid of old stuff
|
// now get rid of old stuff
|
||||||
//(but append /* so we don't delete the directory)
|
// (but append /*.conf so we don't delete the directory)
|
||||||
$configdir.='/*';
|
$configdir .= '/*.conf';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
safe_exec('rm -f ' . makeCorrectFile($configdir));
|
||||||
|
} else {
|
||||||
|
safe_exec('mkdir -p ' . $configdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// also remove aliasconfigdir #1273
|
// also remove aliasconfigdir #1273
|
||||||
$aliasconfigdir = $this->_getFile('phpfpm', 'aliasconfigdir');
|
$aliasconfigdir = $this->_getFile('phpfpm', 'aliasconfigdir');
|
||||||
if ($aliasconfigdir !== false) {
|
if ($aliasconfigdir !== false) {
|
||||||
$aliasconfigdir = makeCorrectDir($aliasconfigdir);
|
$aliasconfigdir = makeCorrectDir($aliasconfigdir);
|
||||||
if (@is_dir($aliasconfigdir)) {
|
if (@is_dir($aliasconfigdir)) {
|
||||||
$aliasconfigdir.='/*';
|
$aliasconfigdir .= '/*';
|
||||||
safe_exec('rm -rf '. makeCorrectFile($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
|
* returns a file/direcotry from the settings and checks whether it exists
|
||||||
*
|
*
|
||||||
* @param string $group settings-group
|
* @param string $group
|
||||||
* @param string $varname var-name
|
* settings-group
|
||||||
* @param boolean $check_exists check if the file exists
|
* @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
|
* @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
|
// read from settings
|
||||||
$file = Settings::Get($group.'.'.$varname);
|
$file = Settings::Get($group . '.' . $varname);
|
||||||
|
|
||||||
// check whether it exists
|
// check whether it exists
|
||||||
if ($check_exists && @file_exists($file) == false) {
|
if ($check_exists && @file_exists($file) == false) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
* @since 0.9.31
|
* @since 0.9.31
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
class WebserverBase
|
||||||
class WebserverBase {
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array with all entries required for all
|
* returns an array with all entries required for all
|
||||||
@@ -26,28 +26,45 @@ class WebserverBase {
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getVhostsToCreate() {
|
public static function getVhostsToCreate()
|
||||||
|
{
|
||||||
$query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`,
|
$query = "SELECT `d`.*, `pd`.`domain` AS `parentdomain`, `c`.`loginname`,
|
||||||
`d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`,
|
`d`.`phpsettingid`, `c`.`adminid`, `c`.`guid`, `c`.`email`,
|
||||||
`c`.`documentroot` AS `customerroot`, `c`.`deactivated`,
|
`c`.`documentroot` AS `customerroot`, `c`.`deactivated`,
|
||||||
`c`.`phpenabled` AS `phpenabled_customer`,
|
`c`.`phpenabled` AS `phpenabled_customer`,
|
||||||
`d`.`phpenabled` AS `phpenabled_vhost`,
|
`d`.`phpenabled` AS `phpenabled_vhost`,
|
||||||
`d`.`mod_fcgid_starter`,`d`.`mod_fcgid_maxrequests`
|
`d`.`mod_fcgid_starter`,`d`.`mod_fcgid_maxrequests`,
|
||||||
FROM `".TABLE_PANEL_DOMAINS."` `d`
|
`d`.`ocsp_stapling`
|
||||||
|
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||||
|
|
||||||
LEFT JOIN `".TABLE_PANEL_CUSTOMERS."` `c` USING(`customerid`)
|
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||||
LEFT JOIN `".TABLE_PANEL_DOMAINS."` `pd` ON (`pd`.`id` = `d`.`parentdomainid`)
|
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `pd` ON (`pd`.`id` = `d`.`parentdomainid`)
|
||||||
|
|
||||||
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
WHERE `d`.`aliasdomain` IS NULL AND `d`.`email_only` <> '1'
|
||||||
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;
|
ORDER BY `d`.`parentdomainid` DESC, `d`.`iswildcarddomain`, `d`.`domain` ASC;
|
||||||
";
|
";
|
||||||
|
|
||||||
$result_domains_stmt = Database::query($query);
|
$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();
|
$domains = array();
|
||||||
while ($domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
|
|
||||||
// set whole domain
|
// set whole domain
|
||||||
$domains[$domain['domain']] = $domain;
|
$domains[$domain['domain']] = $domain;
|
||||||
// set empty-defaults for non-ssl
|
// set empty-defaults for non-ssl
|
||||||
@@ -56,31 +73,38 @@ class WebserverBase {
|
|||||||
$domains[$domain['domain']]['ssl_key_file'] = '';
|
$domains[$domain['domain']]['ssl_key_file'] = '';
|
||||||
$domains[$domain['domain']]['ssl_ca_file'] = '';
|
$domains[$domain['domain']]['ssl_ca_file'] = '';
|
||||||
$domains[$domain['domain']]['ssl_cert_chainfile'] = '';
|
$domains[$domain['domain']]['ssl_cert_chainfile'] = '';
|
||||||
|
|
||||||
// now, if the domain has an ssl ip/port assigned, get
|
// now, if the domain has an ssl ip/port assigned, get
|
||||||
// the corresponding information from the db
|
// the corresponding information from the db
|
||||||
if (domainHasSslIpPort($domain['id'])) {
|
if (domainHasSslIpPort($domain['id'])) {
|
||||||
|
|
||||||
$ip_stmt = Database::prepare("
|
$ssl_ip = Database::pexecute_first($ip_stmt, array(
|
||||||
SELECT `di`.`id_domain` , `p`.`ssl`, `p`.`ssl_cert_file`, `p`.`ssl_key_file`, `p`.`ssl_ca_file`, `p`.`ssl_cert_chainfile`
|
'domainid' => $domain['id']
|
||||||
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']));
|
|
||||||
|
|
||||||
// set ssl info for domain
|
// set ssl info for domain
|
||||||
$domains[$domain['domain']]['ssl'] = '1';
|
$domains[$domain['domain']]['ssl'] = '1';
|
||||||
$domains[$domain['domain']]['ssl_cert_file'] = $ssl_ip['ssl_cert_file'];
|
$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_key_file'] = $ssl_ip['ssl_key_file'];
|
||||||
$domains[$domain['domain']]['ssl_ca_file'] = $ssl_ip['ssl_ca_file'];
|
$domains[$domain['domain']]['ssl_ca_file'] = $ssl_ip['ssl_ca_file'];
|
||||||
$domains[$domain['domain']]['ssl_cert_chainfile'] = $ssl_ip['ssl_cert_chainfile'];
|
$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;
|
return $domains;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4469,9 +4469,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|||||||
<!-- libnss-mysql -->
|
<!-- libnss-mysql -->
|
||||||
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
|
<daemon name="libnss" title="libnss-mysql (required for FCGID/php-fpm/mpm-itk)">
|
||||||
<install><![CDATA[apt-get install nscd
|
<install><![CDATA[apt-get install nscd
|
||||||
wget http://debian.froxlor.org/pool/main/libn/libnss-mysql-bg/libnss-mysql-bg_1.5-3%2Bfrx1_amd64.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%2Bfrx1_amd64.deb
|
dpkg -i libnss-mysql-bg_1.5-3+frx1_amd64.deb
|
||||||
rm libnss-mysql-bg_1.5-3%2Bfrx1_amd64.deb
|
rm libnss-mysql-bg_1.5-3+frx1_amd64.deb
|
||||||
]]></install>
|
]]></install>
|
||||||
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
|
<file name="/etc/libnss-mysql.cfg" chown="root:root" chmod="0600"
|
||||||
backup="true">
|
backup="true">
|
||||||
@@ -4634,6 +4634,42 @@ aliases: files
|
|||||||
</content>
|
</content>
|
||||||
</file>
|
</file>
|
||||||
</daemon>
|
</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 -->
|
<!-- Logrotate -->
|
||||||
<daemon name="logrotate" title="Logrotate">
|
<daemon name="logrotate" title="Logrotate">
|
||||||
<install><![CDATA[apt-get install logrotate]]></install>
|
<install><![CDATA[apt-get install logrotate]]></install>
|
||||||
|
|||||||
@@ -1624,6 +1624,42 @@ netmasks: files
|
|||||||
netgroup: files
|
netgroup: files
|
||||||
bootparams: 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
|
automount: files
|
||||||
aliases: files
|
aliases: files
|
||||||
]]>
|
]]>
|
||||||
|
|||||||
@@ -2089,7 +2089,7 @@ LoadModule mod_ctrls_admin.c
|
|||||||
# (http://www.castaglia.org/proftpd/modules/mod_vroot.html)
|
# (http://www.castaglia.org/proftpd/modules/mod_vroot.html)
|
||||||
# Using this module rather than the kernel's chroot() system call works
|
# Using this module rather than the kernel's chroot() system call works
|
||||||
# around issues with PAM and chroot (http://bugzilla.redhat.com/506735)
|
# 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
|
# Provide a flexible way of specifying that certain configuration directives
|
||||||
# only apply to certain sessions, based on credentials such as connection
|
# 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
@@ -1642,6 +1642,42 @@ aliases: files
|
|||||||
<!-- clear group chache -->
|
<!-- clear group chache -->
|
||||||
<command><![CDATA[nscd --invalidate=group]]></command>
|
<command><![CDATA[nscd --invalidate=group]]></command>
|
||||||
</daemon>
|
</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 -->
|
<!-- Logrotate -->
|
||||||
<daemon name="logrotate" title="Logrotate">
|
<daemon name="logrotate" title="Logrotate">
|
||||||
<install><![CDATA[apt-get install logrotate]]></install>
|
<install><![CDATA[apt-get install logrotate]]></install>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<froxlor>
|
<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>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
@@ -5433,6 +5433,42 @@ netmasks: files
|
|||||||
netgroup: files
|
netgroup: files
|
||||||
bootparams: 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
|
automount: files
|
||||||
aliases: 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 *** - 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");
|
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
|
// including update procedures
|
||||||
|
define('_CRON_UPDATE', 1);
|
||||||
include_once FROXLOR_INSTALL_DIR.'/install/updatesql.php';
|
include_once FROXLOR_INSTALL_DIR.'/install/updatesql.php';
|
||||||
// pew - everything went better than expected
|
// 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');
|
$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
|
* @package Formfields
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'customer_add' => array(
|
'customer_add' => array(
|
||||||
'title' => $lng['admin']['customer_add'],
|
'title' => $lng['admin']['customer_add'],
|
||||||
@@ -29,20 +28,30 @@ return array(
|
|||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
),
|
),
|
||||||
'createstdsubdomain' => array(
|
'createstdsubdomain' => array(
|
||||||
'label' => $lng['admin']['stdsubdomain_add'].'?',
|
'label' => $lng['admin']['stdsubdomain_add'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1')
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'value' => array(
|
||||||
|
'1'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'store_defaultindex' => array(
|
'store_defaultindex' => array(
|
||||||
'label' => $lng['admin']['store_defaultindex'].'?',
|
'label' => $lng['admin']['store_defaultindex'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1')
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'value' => array(
|
||||||
|
'1'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'new_customer_password' => array(
|
'new_customer_password' => array(
|
||||||
'label' => $lng['login']['password'],
|
'label' => $lng['login']['password'],
|
||||||
@@ -53,15 +62,20 @@ return array(
|
|||||||
'label' => $lng['customer']['generated_pwd'],
|
'label' => $lng['customer']['generated_pwd'],
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'visible' => (Settings::Get('panel.password_regex') == ''),
|
'visible' => (Settings::Get('panel.password_regex') == ''),
|
||||||
'value' => generatePassword(),
|
'value' => generatePassword()
|
||||||
),
|
),
|
||||||
'sendpassword' => array(
|
'sendpassword' => array(
|
||||||
'label' => $lng['admin']['sendpassword'],
|
'label' => $lng['admin']['sendpassword'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1')
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'value' => array(
|
||||||
|
'1'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'def_language' => array(
|
'def_language' => array(
|
||||||
'label' => $lng['login']['language'],
|
'label' => $lng['login']['language'],
|
||||||
@@ -135,7 +149,10 @@ return array(
|
|||||||
'label' => $lng['usersettings']['custom_notes']['show'],
|
'label' => $lng['usersettings']['custom_notes']['show'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
|
'label' => $lng['panel']['yes'],
|
||||||
|
'value' => '1'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'value' => array()
|
'value' => array()
|
||||||
)
|
)
|
||||||
@@ -206,18 +223,28 @@ return array(
|
|||||||
'label' => $lng['customer']['email_imap'],
|
'label' => $lng['customer']['email_imap'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1'),
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'value' => array(
|
||||||
|
'1'
|
||||||
|
),
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
),
|
),
|
||||||
'email_pop3' => array(
|
'email_pop3' => array(
|
||||||
'label' => $lng['customer']['email_pop3'],
|
'label' => $lng['customer']['email_pop3'],
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1'),
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'value' => array(
|
||||||
|
'1'
|
||||||
|
),
|
||||||
'mandatory' => true
|
'mandatory' => true
|
||||||
),
|
),
|
||||||
'ftps' => array(
|
'ftps' => array(
|
||||||
@@ -244,28 +271,51 @@ return array(
|
|||||||
'ul_field' => $mysqls_ul
|
'ul_field' => $mysqls_ul
|
||||||
),
|
),
|
||||||
'phpenabled' => array(
|
'phpenabled' => array(
|
||||||
'label' => $lng['admin']['phpenabled'].'?',
|
'label' => $lng['admin']['phpenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
'value' => array('1')
|
'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(
|
'perlenabled' => array(
|
||||||
'label' => $lng['admin']['perlenabled'].'?',
|
'label' => $lng['admin']['perlenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
)
|
'label' => $lng['panel']['yes'],
|
||||||
|
'value' => '1'
|
||||||
|
)
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'dnsenabled' => array(
|
'dnsenabled' => array(
|
||||||
'label' => $lng['admin']['dnsenabled'].'?',
|
'label' => $lng['admin']['dnsenabled'] . '?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
array(
|
||||||
),
|
'label' => $lng['panel']['yes'],
|
||||||
|
'value' => '1'
|
||||||
|
)
|
||||||
|
),
|
||||||
'visible' => (Settings::Get('system.dnsenabled') == '1' ? true : false)
|
'visible' => (Settings::Get('system.dnsenabled') == '1' ? true : false)
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -260,6 +260,14 @@ return array(
|
|||||||
),
|
),
|
||||||
'value' => array($result['phpenabled'])
|
'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(
|
'perlenabled' => array(
|
||||||
'label' => $lng['admin']['perlenabled'].'?',
|
'label' => $lng['admin']['perlenabled'].'?',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
|||||||
@@ -173,6 +173,19 @@ return array(
|
|||||||
),
|
),
|
||||||
'value' => array()
|
'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()
|
||||||
|
),
|
||||||
'no_ssl_available_info' => array(
|
'no_ssl_available_info' => array(
|
||||||
'visible' => ($ssl_ipsandports == '' ? true : false),
|
'visible' => ($ssl_ipsandports == '' ? true : false),
|
||||||
'label' => 'SSL',
|
'label' => 'SSL',
|
||||||
@@ -213,7 +226,24 @@ return array(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
'value' => array()
|
'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(
|
'section_c' => array(
|
||||||
|
|||||||
@@ -207,6 +207,21 @@ return array(
|
|||||||
$result['letsencrypt']
|
$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(
|
'no_ssl_available_info' => array(
|
||||||
'visible' => ($ssl_ipsandports == '' ? true : false),
|
'visible' => ($ssl_ipsandports == '' ? true : false),
|
||||||
'label' => 'SSL',
|
'label' => 'SSL',
|
||||||
@@ -251,7 +266,26 @@ return array(
|
|||||||
'value' => array(
|
'value' => array(
|
||||||
$result['hsts_preload']
|
$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']
|
||||||
|
)
|
||||||
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'section_c' => array(
|
'section_c' => array(
|
||||||
@@ -291,6 +325,21 @@ return array(
|
|||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $phpconfigs
|
'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(
|
'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'],
|
'label' => $lng['admin']['mod_fcgid_starter']['title'],
|
||||||
|
|||||||
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,
|
'maxlength' => 255,
|
||||||
'value' => '/usr/bin/php-cgi'
|
'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(
|
'file_extensions' => array(
|
||||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||||
@@ -84,6 +90,15 @@ return array(
|
|||||||
'maxlength' => 10,
|
'maxlength' => 10,
|
||||||
'value' => '5s'
|
'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(
|
'phpsettings' => array(
|
||||||
'style' => 'align-top',
|
'style' => 'align-top',
|
||||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ return array(
|
|||||||
'maxlength' => 255,
|
'maxlength' => 255,
|
||||||
'value' => $result['binary']
|
'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(
|
'file_extensions' => array(
|
||||||
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
'visible' => (Settings::Get('system.mod_fcgid') == 1 ? true : false),
|
||||||
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
'label' => $lng['admin']['phpsettings']['file_extensions'],
|
||||||
@@ -87,6 +93,15 @@ return array(
|
|||||||
'maxlength' => 10,
|
'maxlength' => 10,
|
||||||
'value' => $result['fpm_reqslow']
|
'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(
|
'phpsettings' => array(
|
||||||
'style' => 'align-top',
|
'style' => 'align-top',
|
||||||
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
'label' => $lng['admin']['phpsettings']['phpinisettings'],
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ return array(
|
|||||||
'label' => $lng['domain']['openbasedirpath'],
|
'label' => $lng['domain']['openbasedirpath'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $openbasedir
|
'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
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -81,6 +81,12 @@ return array(
|
|||||||
'label' => $lng['domain']['openbasedirpath'],
|
'label' => $lng['domain']['openbasedirpath'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $openbasedir
|
'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
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -54,20 +54,8 @@ function generateDkimEntries($domain)
|
|||||||
// end-part
|
// end-part
|
||||||
$dkim_txt .= 't=s';
|
$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
|
// dkim-entry
|
||||||
$zone_dkim[] = $txt_record_split;
|
$zone_dkim[] = $dkim_txt;
|
||||||
|
|
||||||
// adsp-entry
|
// adsp-entry
|
||||||
if (Settings::Get('dkim.dkim_add_adsp') == "1") {
|
if (Settings::Get('dkim.dkim_add_adsp') == "1") {
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ function phpErrHandler($errno, $errstr, $errfile, $errline, $errcontext) {
|
|||||||
if (empty($theme)) {
|
if (empty($theme)) {
|
||||||
$theme = "Sparkle";
|
$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
|
// 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');
|
$err_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$theme.'/misc/phperrornice.tpl');
|
||||||
// replace values
|
// replace values
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ function dieWithMail($message, $subject = "[froxlor] Cronjob error") {
|
|||||||
$_mail->Password = Settings::Get('system.mail_smtp_passwd');
|
$_mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||||
$_mail->SMTPSecure = 'tls';
|
$_mail->SMTPSecure = 'tls';
|
||||||
|
} else {
|
||||||
|
$mail->SMTPAutoTLS = false;
|
||||||
}
|
}
|
||||||
$_mail->Port = Settings::Get('system.mail_smtp_port');
|
$_mail->Port = Settings::Get('system.mail_smtp_port');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,3 +63,15 @@ function standard_error($errors = '', $replacer = '') {
|
|||||||
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
||||||
exit;
|
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
|
* 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
|
* @return array The trim'med array
|
||||||
* @author Florian Lippert <flo@syscp.org>
|
* @author Florian Lippert <flo@syscp.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function array_trim($source)
|
function array_trim($source)
|
||||||
{
|
{
|
||||||
$returnval = array();
|
$returnval = array();
|
||||||
|
if (is_array($source)) {
|
||||||
if(is_array($source))
|
foreach ($source as $var => $val) {
|
||||||
{
|
if ($val != ' ' && $val != '') {
|
||||||
while(list($var, $val) = each($source))
|
$returnval[$var] = $val;
|
||||||
{
|
}
|
||||||
if($val != ' '
|
|
||||||
&& $val != '')$returnval[$var] = $val;
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$returnval = $source;
|
$returnval = $source;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnval;
|
return $returnval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,33 +16,36 @@
|
|||||||
* @package Functions
|
* @package Functions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function storeSettingMysqlAccessHost($fieldname, $fielddata, $newfieldvalue)
|
function storeSettingMysqlAccessHost($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = storeSettingField($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));
|
$mysql_access_host_array = array_map('trim', explode(',', $newfieldvalue));
|
||||||
|
|
||||||
if(in_array('127.0.0.1', $mysql_access_host_array)
|
if (in_array('127.0.0.1', $mysql_access_host_array) && ! in_array('localhost', $mysql_access_host_array)) {
|
||||||
&& !in_array('localhost', $mysql_access_host_array))
|
|
||||||
{
|
|
||||||
$mysql_access_host_array[] = 'localhost';
|
$mysql_access_host_array[] = 'localhost';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!in_array('127.0.0.1', $mysql_access_host_array)
|
if (! in_array('127.0.0.1', $mysql_access_host_array) && in_array('localhost', $mysql_access_host_array)) {
|
||||||
&& in_array('localhost', $mysql_access_host_array))
|
|
||||||
{
|
|
||||||
$mysql_access_host_array[] = '127.0.0.1';
|
$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));
|
$mysql_access_host_array = array_unique(array_trim($mysql_access_host_array));
|
||||||
$newfieldvalue = implode(',', $mysql_access_host_array);
|
$newfieldvalue = implode(',', $mysql_access_host_array);
|
||||||
correctMysqlUsers($mysql_access_host_array);
|
correctMysqlUsers($mysql_access_host_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $returnvalue;
|
return $returnvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
function cleanMySQLAccessHost($value)
|
||||||
|
{
|
||||||
|
if (substr($value, 0, 1) == '[' && substr($value, - 1) == ']') {
|
||||||
|
return substr($value, 1, - 1);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|||||||
@@ -156,7 +156,8 @@ if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
|||||||
if (get_magic_quotes_gpc()) {
|
if (get_magic_quotes_gpc()) {
|
||||||
$in = array(&$_GET, &$_POST, &$_COOKIE);
|
$in = array(&$_GET, &$_POST, &$_COOKIE);
|
||||||
|
|
||||||
while (list($k, $v) = each($in)) {
|
$_in = $in;
|
||||||
|
foreach ($_in as $k => $v) {
|
||||||
foreach ($v as $key => $val) {
|
foreach ($v as $key => $val) {
|
||||||
if (!is_array($val)) {
|
if (!is_array($val)) {
|
||||||
$in[$k][$key] = stripslashes($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');
|
$mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||||
$mail->SMTPSecure = 'tls';
|
$mail->SMTPSecure = 'tls';
|
||||||
|
} else {
|
||||||
|
$mail->SMTPAutoTLS = false;
|
||||||
}
|
}
|
||||||
$mail->Port = Settings::Get('system.mail_smtp_port');
|
$mail->Port = Settings::Get('system.mail_smtp_port');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,6 +279,12 @@ return array(
|
|||||||
'label' => $lng['menue']['phpsettings']['maintitle'],
|
'label' => $lng['menue']['phpsettings']['maintitle'],
|
||||||
'show_element' => (Settings::Get('system.mod_fcgid') == true || Settings::Get('phpfpm.enabled') == true)
|
'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(
|
array(
|
||||||
'url' => 'admin_settings.php?page=phpinfo',
|
'url' => 'admin_settings.php?page=phpinfo',
|
||||||
'label' => $lng['admin']['phpinfo'],
|
'label' => $lng['admin']['phpinfo'],
|
||||||
@@ -313,6 +319,10 @@ return array(
|
|||||||
array(
|
array(
|
||||||
'url' => 'admin_message.php?page=message',
|
'url' => 'admin_message.php?page=message',
|
||||||
'label' => $lng['admin']['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_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
|
||||||
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
|
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
|
||||||
define('TABLE_DOMAIN_DNS', 'domain_dns_entries');
|
define('TABLE_DOMAIN_DNS', 'domain_dns_entries');
|
||||||
|
define('TABLE_PANEL_FPMDAEMONS', 'panel_fpmdaemons');
|
||||||
|
|
||||||
require dirname(__FILE__).'/version.inc.php';
|
require dirname(__FILE__).'/version.inc.php';
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Main version variable
|
// Main version variable
|
||||||
$version = '0.9.38.7';
|
$version = '0.9.39';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
$dbversion = '201612110';
|
$dbversion = '201801260';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
$branding = '';
|
$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']['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_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']['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['admin']['cron']['cronsettings'] = 'Instellingen cron-taken';
|
||||||
$lng['cron']['cronname'] = 'naam cron-taak';
|
$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
|
// ADDED IN FROXLOR 0.9.12-svn1
|
||||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||||
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'FCGID inschakelen voor de VHost voor Froxlor';
|
$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_user'] = 'Lokale gebruiker voor FCGID (Froxlor vhost)';
|
||||||
$lng['admin']['mod_fcgid_group'] = 'Lokale groep 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
|
// ADDED IN 1.2.16-svn12
|
||||||
|
|
||||||
$lng['serversettings']['mod_fcgid']['title'] = 'Enable FCGID';
|
$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']['title'] = 'Use alternative email-address';
|
||||||
$lng['serversettings']['sendalternativemail']['description'] = 'Send the password-email to a different address during email-account-creation';
|
$lng['serversettings']['sendalternativemail']['description'] = 'Send the password-email to a different address during email-account-creation';
|
||||||
$lng['emails']['alternative_emailaddress'] = 'Alternative e-mail-address';
|
$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['error']['nopermissionsorinvalidid'] = 'You don\'t have enough permissions to change these settings or an invalid id was given.';
|
||||||
$lng['panel']['view'] = 'view';
|
$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']['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['admin']['phpsettings']['addnew'] = 'Create new settings';
|
||||||
$lng['error']['phpsettingidwrong'] = 'A PHP Configuration with this id doesn\'t exist';
|
$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.';
|
$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']['phpserversettings'] = 'PHP Settings';
|
||||||
$lng['admin']['phpsettings']['binary'] = 'PHP Binary';
|
$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'] = 'File extensions';
|
||||||
$lng['admin']['phpsettings']['file_extensions_note'] = '(without dot, separated by spaces)';
|
$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)';
|
$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']['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_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']['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['admin']['cron']['cronsettings'] = 'Cronjob settings';
|
||||||
$lng['cron']['cronname'] = 'cronjob-name';
|
$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['error']['intvaluetoohigh'] = 'The given number is too high (field %s)';
|
||||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||||
$lng['serversettings']['phpfpm']['title'] = 'Enable 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']['configdir'] = 'Configuration directory of php-fpm';
|
||||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configuration Alias-directory of php-fpm';
|
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configuration Alias-directory of php-fpm';
|
||||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'php-fpm restart command';
|
$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']['title'] = 'Idle Timeout';
|
||||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['description'] = 'Timeout setting for Mod FastCGI.';
|
$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']['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
|
// ADDED IN 0.9.27-svn2
|
||||||
$lng['panel']['cancel'] = 'Cancel';
|
$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']['title'] = 'Special characters list';
|
||||||
$lng['serversettings']['panel_password_special_char']['description'] = 'One of these characters is required if the above option is set.';
|
$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']['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['error']['no_phpinfo'] = 'Sorry, unable to read phpinfo()';
|
||||||
|
|
||||||
$lng['admin']['movetoadmin'] = 'Move customer';
|
$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['success']['domain_import_successfully'] = 'Successfully imported %s domains.';
|
||||||
$lng['error']['domain_import_error'] = 'Following error occurred while importing domains: %s';
|
$lng['error']['domain_import_error'] = 'Following error occurred while importing domains: %s';
|
||||||
$lng['admin']['note'] = 'Note';
|
$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']['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']['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['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';
|
$lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID and PHP-FPM cannot be activated at the same time';
|
||||||
|
|
||||||
// Added in Froxlor 0.9.34
|
// 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']['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']['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['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)';
|
$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']['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['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']['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['panel']['letsencrypt'] = 'Using Let\'s encrypt';
|
||||||
$lng['crondesc']['cron_letsencrypt'] = 'updating Let\'s Encrypt certificates';
|
$lng['crondesc']['cron_letsencrypt'] = 'updating Let\'s Encrypt certificates';
|
||||||
$lng['serversettings']['letsencryptca']['title'] = "Let's Encrypt environment";
|
$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['admin']['server_php'] = 'PHP';
|
||||||
$lng['domains']['termination_date'] = 'Date of termination';
|
$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['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['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.";
|
$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']['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['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['admin']['froxlorvhost'] = 'Froxlor VirtualHost settings';
|
||||||
$lng['serversettings']['option_unavailable_websrv'] = '<br><em class="red">Availble only for: %s</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 availble due to other settings.</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']['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['serversettings']['letsencryptacmeconf']['description'] = "File name of the config snippet which allows the web server to serve the acme challenge.";
|
||||||
$lng['admin']['hostname'] = 'Hostname';
|
$lng['admin']['hostname'] = 'Hostname';
|
||||||
@@ -2063,7 +2065,42 @@ $lng['admin']['domain_hsts_incsub']['description'] = 'The optional "includeSubDo
|
|||||||
$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']['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="https://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']['nginx_http2_support']['title'] = 'Nginx HTTP2 Support';
|
$lng['serversettings']['http2_support']['title'] = 'HTTP2 Support';
|
||||||
$lng['serversettings']['nginx_http2_support']['description'] = 'enable http2 support for ssl. ENABLE ONLY IF YOUR Nginx SUPPORT THIS FEATURE. (version 1.9.5+)';
|
$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';
|
$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']['admin_email'] = 'root@localhost';
|
||||||
$lng['ticket']['noreply_email'] = 'billets@froxlor';
|
$lng['ticket']['noreply_email'] = 'billets@froxlor';
|
||||||
$lng['admin']['ticketsystem'] = 'Système de billets';
|
$lng['admin']['ticketsystem'] = 'Système de tickets';
|
||||||
$lng['menue']['ticket']['ticket'] = 'Billets de support';
|
$lng['menue']['ticket']['ticket'] = 'Tickets support';
|
||||||
$lng['menue']['ticket']['categories'] = 'Catégories de 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']['description'] = 'Entrez une description !';
|
||||||
$lng['ticket']['ticket_new'] = 'Ouvrir un nouveau billet';
|
$lng['ticket']['ticket_new'] = 'Ouvrir un nouveau ticket';
|
||||||
$lng['ticket']['ticket_reply'] = 'Réponse au billet';
|
$lng['ticket']['ticket_reply'] = 'Réponse au ticket';
|
||||||
$lng['ticket']['ticket_reopen'] = 'Réouvrir le billet';
|
$lng['ticket']['ticket_reopen'] = 'Réouvrir le ticket';
|
||||||
$lng['ticket']['ticket_newcateory'] = 'Créer une nouvelle catégorie';
|
$lng['ticket']['ticket_newcateory'] = 'Créer une nouvelle catégorie';
|
||||||
$lng['ticket']['ticket_editcateory'] = 'Editer la catégorie';
|
$lng['ticket']['ticket_editcateory'] = 'Editer la catégorie';
|
||||||
$lng['ticket']['ticket_view'] = 'Voir l\'historique du billet';
|
$lng['ticket']['ticket_view'] = 'Voir l\'historique du ticket';
|
||||||
$lng['ticket']['ticketcount'] = 'Billets';
|
$lng['ticket']['ticketcount'] = 'Tickets';
|
||||||
$lng['ticket']['ticket_answers'] = 'Réponses';
|
$lng['ticket']['ticket_answers'] = 'Réponses';
|
||||||
// $lng['ticket']['lastchange'] = 'Dernière action';
|
// $lng['ticket']['lastchange'] = 'Dernière action';
|
||||||
$lng['ticket']['lastchange'] = 'Dernier changement';
|
$lng['ticket']['lastchange'] = 'Dernier changement';
|
||||||
@@ -601,8 +601,8 @@ $lng['ticket']['answer'] = 'Répondre';
|
|||||||
$lng['ticket']['close'] = 'Fermer';
|
$lng['ticket']['close'] = 'Fermer';
|
||||||
$lng['ticket']['reopen'] = 'Réouvrir';
|
$lng['ticket']['reopen'] = 'Réouvrir';
|
||||||
$lng['ticket']['archive'] = 'Archive';
|
$lng['ticket']['archive'] = 'Archive';
|
||||||
$lng['ticket']['ticket_delete'] = 'Effacer le billet';
|
$lng['ticket']['ticket_delete'] = 'Effacer le ticket';
|
||||||
$lng['ticket']['lastarchived'] = 'Billets récemment archivés';
|
$lng['ticket']['lastarchived'] = 'Tickets récemment archivés';
|
||||||
$lng['ticket']['archivedtime'] = 'Archivé';
|
$lng['ticket']['archivedtime'] = 'Archivé';
|
||||||
$lng['ticket']['open'] = 'Ouvert';
|
$lng['ticket']['open'] = 'Ouvert';
|
||||||
$lng['ticket']['wait_reply'] = 'Attente d\'une réponse';
|
$lng['ticket']['wait_reply'] = 'Attente d\'une réponse';
|
||||||
@@ -610,43 +610,43 @@ $lng['ticket']['replied'] = 'Répondu';
|
|||||||
$lng['ticket']['closed'] = 'Fermé';
|
$lng['ticket']['closed'] = 'Fermé';
|
||||||
$lng['ticket']['staff'] = 'L\'équipe';
|
$lng['ticket']['staff'] = 'L\'équipe';
|
||||||
$lng['ticket']['customer'] = 'Client';
|
$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']['search'] = 'Rechercher dans les archives';
|
||||||
$lng['ticket']['nocustomer'] = 'Aucun choix';
|
$lng['ticket']['nocustomer'] = 'Aucun choix';
|
||||||
$lng['ticket']['archivesearch'] = 'Résultat de la recherche dans les archives';
|
$lng['ticket']['archivesearch'] = 'Résultat de la recherche dans les archives';
|
||||||
$lng['ticket']['noresults'] = 'Aucun billet trouvé';
|
$lng['ticket']['noresults'] = 'Aucun ticket trouvé';
|
||||||
$lng['ticket']['notmorethanxopentickets'] = 'Pour éviter les abus, vous ne pouvez avoir plus de %s billets ouverts';
|
$lng['ticket']['notmorethanxopentickets'] = 'Pour éviter les abus, vous ne pouvez avoir plus de %s tickets ouverts';
|
||||||
$lng['ticket']['supportstatus'] = 'Etat du support';
|
$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']['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['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']['ticket'] = 'E-mail de notification pour les tickets de support';
|
||||||
$lng['admin']['templates']['SUBJECT'] = 'Sera remplacé par le sujet du billet 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 billet a été envoyé';
|
$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 billet a été ouvert par un client';
|
$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 billet';
|
$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 billet a été ouvert par l\'équipe de support';
|
$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 billet';
|
$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 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']['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 billet de support a été envoyé';
|
$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 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']['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 billet de support soumis';
|
$lng['mails']['new_ticket_by_customer']['subject'] = 'Nouveau ticket 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']['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 billet de support';
|
$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 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['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_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']['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 billet de support';
|
$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 billet "%s" ?';
|
$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 billet "%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_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['question']['ticket_reallyarchive'] = 'Etes-vous sûr de vouloir archiver le ticket "%s" ?';
|
||||||
$lng['error']['nomoreticketsavailable'] = 'Vous n\'avez plus de billets de disponibles. Veuillez contacter votre administrateur.';
|
$lng['error']['nomoreticketsavailable'] = 'Vous n\'avez plus de tickets de disponibles. Veuillez contacter votre administrateur.';
|
||||||
$lng['error']['nocustomerforticket'] = 'Ne peut créer de billet sans client';
|
$lng['error']['nocustomerforticket'] = 'Impossible de créer un ticket sans clients dans la base';
|
||||||
$lng['error']['categoryhastickets'] = 'La catégorie possède des billets.<br />Veuillez d\'abord supprimer tous les billets de cette catégorie.';
|
$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 billets de support';
|
$lng['admin']['ticketsettings'] = 'Paramètres des tickets de support';
|
||||||
$lng['admin']['archivelastrun'] = 'Derniers billets archivés';
|
$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']['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']['title'] = 'Début du support (hh:mm)';
|
||||||
$lng['serversettings']['ticket']['worktime_begin']['description'] = 'Horaire de début du support';
|
$lng['serversettings']['ticket']['worktime_begin']['description'] = 'Horaire de début du support';
|
||||||
$lng['serversettings']['ticket']['worktime_end']['title'] = 'Fin du support (hh:mm)';
|
$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_sun'] = 'Support disponible le dimanche ?';
|
||||||
$lng['serversettings']['ticket']['worktime_all']['title'] = 'Aucune limite horaire pour le support';
|
$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']['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['serversettings']['ticket']['archiving_days'] = 'Après combien de jours un ticket fermé sera automatiquement archivé ?';
|
||||||
$lng['customer']['tickets'] = 'Billet de support';
|
$lng['customer']['tickets'] = 'Ticket de support';
|
||||||
|
|
||||||
// ADDED IN 1.2.18-svn4
|
// 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['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']['enable'] = 'Activer le système de tickets';
|
||||||
$lng['serversettings']['ticket']['concurrentlyopen'] = 'Combien de billets peuvent être ouverts au même moment ?';
|
$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']['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['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 billet(s) de support non répondu(s).';
|
$lng['ticket']['awaitingticketreply'] = 'Vous avez %s ticket(s) de support non répondu(s).';
|
||||||
|
|
||||||
// ADDED IN 1.2.18-svn5
|
// 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
|
// 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
|
// 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']['title'] = 'Intervalle de réinitialisation des tickets utilisés';
|
||||||
$lng['serversettings']['ticket']['reset_cycle']['description'] = 'Remettre le compteur de billets à 0 dans le temps imparti';
|
$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']['daily'] = 'Journalière';
|
||||||
$lng['admin']['tickets']['weekly'] = 'Hebdomadaire';
|
$lng['admin']['tickets']['weekly'] = 'Hebdomadaire';
|
||||||
$lng['admin']['tickets']['monthly'] = 'Mensuelle';
|
$lng['admin']['tickets']['monthly'] = 'Mensuelle';
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ $lng['panel']['back'] = 'Zurück';
|
|||||||
// ADDED IN 1.2.16-svn12
|
// ADDED IN 1.2.16-svn12
|
||||||
|
|
||||||
$lng['serversettings']['mod_fcgid']['title'] = 'PHP über mod_fcgid/suexec einbinden';
|
$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']['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['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';
|
$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['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['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']['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['admin']['phpsettings']['addnew'] = 'Neue Konfiguration erstellen';
|
||||||
$lng['error']['phpsettingidwrong'] = 'Eine PHP-Konfiguration mit dieser ID existiert nicht';
|
$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';
|
$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']['phpserversettings'] = 'PHP-Einstellungen';
|
||||||
$lng['admin']['phpsettings']['binary'] = 'PHP-Binary';
|
$lng['admin']['phpsettings']['binary'] = 'PHP-Binary';
|
||||||
|
$lng['admin']['phpsettings']['fpmdesc'] = 'PHP-FPM Config';
|
||||||
$lng['admin']['phpsettings']['file_extensions'] = 'Dateiendungen';
|
$lng['admin']['phpsettings']['file_extensions'] = 'Dateiendungen';
|
||||||
$lng['admin']['phpsettings']['file_extensions_note'] = '(ohne Punkt, durch Leerzeichen getrennt)';
|
$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)';
|
$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']['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_adsp']['description'] = 'Wenn unsicher oder unbekannt, belassen sie es auf "aktiviert"';
|
||||||
$lng['dkim']['dkim_add_adsppolicy']['title'] = 'ADSP-Richtlinie';
|
$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['admin']['cron']['cronsettings'] = 'Cronjob-Einstellungen';
|
||||||
$lng['cron']['cronname'] = 'Cronjob-Name';
|
$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['error']['intvaluetoohigh'] = 'Die angegebene Zahl ist zu groß (Feld "%s")';
|
||||||
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
$lng['admin']['phpfpm_settings'] = 'PHP-FPM';
|
||||||
$lng['serversettings']['phpfpm']['title'] = 'Aktiviere 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']['configdir'] = 'Pfad zu php-fpm-Konfigurationen';
|
||||||
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Alias-Ordner der php-fpm Konfiguration';
|
$lng['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Alias-Ordner der php-fpm Konfiguration';
|
||||||
$lng['serversettings']['phpfpm_settings']['reload'] = 'Kommando zum Neustarten von php-fpm';
|
$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']['title'] = 'Idle-Timeout';
|
||||||
$lng['serversettings']['mod_fcgid']['idle_timeout']['description'] = 'Timeout-Einstellung für mod_FastCGI.';
|
$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']['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
|
// ADDED IN 0.9.27-svn2
|
||||||
$lng['admin']['delete_statistics'] = 'Statistiken Löschen';
|
$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']['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['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']['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['error']['no_phpinfo'] = 'Entschuldigung, es ist nicht möglich die phpinfo() auszulesen.';
|
||||||
|
|
||||||
$lng['admin']['movetoadmin'] = 'Kunde verschieben';
|
$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['success']['domain_import_successfully'] = 'Erfolgreich %s Domains importiert.';
|
||||||
$lng['error']['domain_import_error'] = 'Der folgende Fehler trat beim Importieren der Domains auf: %s';
|
$lng['error']['domain_import_error'] = 'Der folgende Fehler trat beim Importieren der Domains auf: %s';
|
||||||
$lng['admin']['note'] = 'Hinweis';
|
$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']['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']['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['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.';
|
$lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID und PHP-FPM können nicht gleichzeitig aktiviert werden.';
|
||||||
|
|
||||||
// Added in Froxlor 0.9.34
|
// 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']['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']['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['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)';
|
$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']['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['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']['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['panel']['letsencrypt'] = 'Benutzt Let\'s encrypt';
|
||||||
$lng['crondesc']['cron_letsencrypt'] = 'aktualisiert Let\'s Encrypt Zertifikate';
|
$lng['crondesc']['cron_letsencrypt'] = 'aktualisiert Let\'s Encrypt Zertifikate';
|
||||||
$lng['serversettings']['letsencryptca']['title'] = "Let's Encrypt Umgebung";
|
$lng['serversettings']['letsencryptca']['title'] = "Let's Encrypt Umgebung";
|
||||||
@@ -1714,7 +1716,41 @@ $lng['admin']['domain_hsts_incsub']['description'] = 'Die optionale "includeSubD
|
|||||||
$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']['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="https://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']['nginx_http2_support']['title'] = 'Nginx HTTP2 Unterstützung';
|
$lng['serversettings']['http2_support']['title'] = 'HTTP2 Unterstützung';
|
||||||
$lng['serversettings']['nginx_http2_support']['description'] = 'Aktiviere http2 Unterstützung für SSL. NUR AKTIVIEREN, WENN nginx DIESE FUNKTION UNTERSTÜTZT (version 1.9.5+)';
|
$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';
|
$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.';
|
$lng['error']['stringformaterror'] = 'Il valore per il campo "%s" non è nel formato atteso.';
|
||||||
|
|
||||||
// ADDED IN 1.2.15-rc1
|
// 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']['phpversion'] = 'Versione PHP';
|
||||||
$lng['admin']['mysqlserverversion'] = 'Versione MySQL Server';
|
$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']['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_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']['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['admin']['cron']['cronsettings'] = 'Impostazioni Cronjob';
|
||||||
$lng['cron']['cronname'] = 'Nome 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
|
// ADDED IN FROXLOR 0.9.12-svn1
|
||||||
$lng['admin']['fcgid_settings'] = 'FCGID';
|
$lng['admin']['fcgid_settings'] = 'FCGID';
|
||||||
$lng['serversettings']['mod_fcgid_ownvhost']['title'] = 'Abilita FCGID per i vhost Froxlor';
|
$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_user'] = 'Utente locale per FCGID (Froxlor vhost)';
|
||||||
$lng['admin']['mod_fcgid_group'] = 'Gruppo 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']['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['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']['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['serversettings']['phpfpm_settings']['aliasconfigdir'] = 'Configurazione cartella Alias per php-fpm';
|
||||||
$lng['gender']['title'] = 'Titolo';
|
$lng['gender']['title'] = 'Titolo';
|
||||||
$lng['gender']['male'] = 'Sig.';
|
$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['success']['domain_import_successfully'] = 'Importato %s dominii con successo.';
|
||||||
$lng['error']['domain_import_error'] = 'Il seguente errore è occorsonell \'importazione di dominii: %s';
|
$lng['error']['domain_import_error'] = 'Il seguente errore è occorsonell \'importazione di dominii: %s';
|
||||||
$lng['admin']['note'] = 'Nota';
|
$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']['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']['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';
|
$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");
|
$pubkey_file_handler = fopen($pubkey_filename, "w");
|
||||||
fwrite($pubkey_file_handler, $domain['dkim_pubkey']);
|
fwrite($pubkey_file_handler, $domain['dkim_pubkey']);
|
||||||
fclose($pubkey_file_handler);
|
fclose($pubkey_file_handler);
|
||||||
safe_exec("chmod 0664 " . escapeshellarg($pubkey_filename));
|
safe_exec("chmod 0644 " . escapeshellarg($pubkey_filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dkimdomains .= $domain['domain'] . "\n";
|
$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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -68,6 +68,9 @@ for ($x = 1; $x < count($argv); $x++) {
|
|||||||
|
|
||||||
$cronlog->setCronDebugFlag(defined('CRON_DEBUG_FLAG'));
|
$cronlog->setCronDebugFlag(defined('CRON_DEBUG_FLAG'));
|
||||||
|
|
||||||
|
$tasks_cnt_stmt = Database::query("SELECT COUNT(*) as jobcnt FROM `panel_tasks`");
|
||||||
|
$tasks_cnt = $tasks_cnt_stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
// do we have anything to include?
|
// do we have anything to include?
|
||||||
if (count($jobs_to_run) > 0) {
|
if (count($jobs_to_run) > 0) {
|
||||||
// include all jobs we want to execute
|
// include all jobs we want to execute
|
||||||
@@ -76,6 +79,22 @@ if (count($jobs_to_run) > 0) {
|
|||||||
$cronfile = getCronFile($cron);
|
$cronfile = getCronFile($cron);
|
||||||
require_once $cronfile;
|
require_once $cronfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($tasks_cnt['jobcnt'] > 0)
|
||||||
|
{
|
||||||
|
if (Settings::Get('system.nssextrausers') == 1)
|
||||||
|
{
|
||||||
|
include_once makeCorrectFile(FROXLOR_INSTALL_DIR.'/scripts/classes/class.Extrausers.php');
|
||||||
|
Extrausers::generateFiles($cronlog);
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear NSCD cache if using fcgid or fpm, #1570
|
||||||
|
if (Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
|
||||||
|
$false_val = false;
|
||||||
|
safe_exec('nscd -i passwd 1> /dev/null', $false_val, array('>'));
|
||||||
|
safe_exec('nscd -i group 1> /dev/null', $false_val, array('>'));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite($debugHandler, 'Cronfiles have been included' . "\n");
|
fwrite($debugHandler, 'Cronfiles have been included' . "\n");
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ if (! defined('MASTER_CRONJOB'))
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (Settings::Get('system.leapiversion') == '2') {
|
||||||
|
// use ACME v2 is specified
|
||||||
|
require_once __DIR__ . '/cron_letsencrypt_v2.php';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updating Let's Encrypt certificates");
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updating Let's Encrypt certificates");
|
||||||
|
|
||||||
if (! extension_loaded('curl')) {
|
if (! extension_loaded('curl')) {
|
||||||
|
|||||||
294
scripts/jobs/cron_letsencrypt_v2.php
Normal file
294
scripts/jobs/cron_letsencrypt_v2.php
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
<?php
|
||||||
|
if (! defined('MASTER_CRONJOB'))
|
||||||
|
die('You cannot access this file directly!');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2016 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Florian Aders <kontakt-froxlor@neteraser.de>
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2016-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Cron
|
||||||
|
*
|
||||||
|
* @since 0.9.35
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updating Let's Encrypt certificates");
|
||||||
|
|
||||||
|
if (! extension_loaded('curl')) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_ERR, "Let's Encrypt requires the php cURL extension to be installed.");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$certificates_stmt = Database::query("
|
||||||
|
SELECT
|
||||||
|
domssl.`id`,
|
||||||
|
domssl.`domainid`,
|
||||||
|
domssl.expirationdate,
|
||||||
|
domssl.`ssl_cert_file`,
|
||||||
|
domssl.`ssl_key_file`,
|
||||||
|
domssl.`ssl_ca_file`,
|
||||||
|
domssl.`ssl_csr_file`,
|
||||||
|
dom.`domain`,
|
||||||
|
dom.`wwwserveralias`,
|
||||||
|
dom.`iswildcarddomain`,
|
||||||
|
dom.`documentroot`,
|
||||||
|
dom.`id` AS 'domainid',
|
||||||
|
dom.`ssl_redirect`,
|
||||||
|
cust.`leprivatekey`,
|
||||||
|
cust.`lepublickey`,
|
||||||
|
cust.`leregistered`,
|
||||||
|
cust.`customerid`,
|
||||||
|
cust.`loginname`
|
||||||
|
FROM
|
||||||
|
`" . TABLE_PANEL_CUSTOMERS . "` AS cust,
|
||||||
|
`" . TABLE_PANEL_DOMAINS . "` AS dom
|
||||||
|
LEFT JOIN
|
||||||
|
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` AS domssl ON
|
||||||
|
dom.`id` = domssl.`domainid`
|
||||||
|
WHERE
|
||||||
|
dom.`customerid` = cust.`customerid`
|
||||||
|
AND dom.`letsencrypt` = 1
|
||||||
|
AND dom.`aliasdomain` IS NULL
|
||||||
|
AND dom.`iswildcarddomain` = 0
|
||||||
|
AND (
|
||||||
|
domssl.`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY)
|
||||||
|
OR domssl.`expirationdate` IS NULL
|
||||||
|
)
|
||||||
|
");
|
||||||
|
|
||||||
|
$aliasdomains_stmt = Database::prepare("
|
||||||
|
SELECT
|
||||||
|
dom.`id` as domainid,
|
||||||
|
dom.`domain`,
|
||||||
|
dom.`wwwserveralias`,
|
||||||
|
dom.`iswildcarddomain`
|
||||||
|
FROM `" . TABLE_PANEL_DOMAINS . "` AS dom
|
||||||
|
WHERE
|
||||||
|
dom.`aliasdomain` = :id
|
||||||
|
AND dom.`letsencrypt` = 1
|
||||||
|
AND dom.`iswildcarddomain` = 0
|
||||||
|
");
|
||||||
|
|
||||||
|
$updcert_stmt = Database::prepare("
|
||||||
|
REPLACE INTO
|
||||||
|
`" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
|
SET
|
||||||
|
`id` = :id,
|
||||||
|
`domainid` = :domainid,
|
||||||
|
`ssl_cert_file` = :crt,
|
||||||
|
`ssl_key_file` = :key,
|
||||||
|
`ssl_ca_file` = :ca,
|
||||||
|
`ssl_cert_chainfile` = :chain,
|
||||||
|
`ssl_csr_file` = :csr,
|
||||||
|
`expirationdate` = :expirationdate
|
||||||
|
");
|
||||||
|
|
||||||
|
$upddom_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `ssl_redirect` = '1' WHERE `id` = :domainid");
|
||||||
|
|
||||||
|
// flag for re-generation of vhost files
|
||||||
|
$changedetected = 0;
|
||||||
|
|
||||||
|
// first - generate LE for system-vhost if enabled
|
||||||
|
if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
||||||
|
|
||||||
|
$certrow = array(
|
||||||
|
'loginname' => 'froxlor.panel',
|
||||||
|
'domain' => Settings::Get('system.hostname'),
|
||||||
|
'domainid' => 0,
|
||||||
|
'documentroot' => FROXLOR_INSTALL_DIR,
|
||||||
|
'leprivatekey' => Settings::Get('system.leprivatekey'),
|
||||||
|
'lepublickey' => Settings::Get('system.lepublickey'),
|
||||||
|
'leregistered' => Settings::Get('system.leregistered'),
|
||||||
|
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
|
||||||
|
'expirationdate' => null,
|
||||||
|
'ssl_cert_file' => null,
|
||||||
|
'ssl_key_file' => null,
|
||||||
|
'ssl_ca_file' => null,
|
||||||
|
'ssl_csr_file' => null,
|
||||||
|
'id' => null
|
||||||
|
);
|
||||||
|
|
||||||
|
$froxlor_ssl_settings_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "`
|
||||||
|
WHERE `domainid` = '0' AND
|
||||||
|
(`expirationdate` < DATE_ADD(NOW(), INTERVAL 30 DAY) OR `expirationdate` IS NULL)
|
||||||
|
");
|
||||||
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
|
|
||||||
|
$insert_or_update_required = true;
|
||||||
|
if ($froxlor_ssl) {
|
||||||
|
$certrow['id'] = $froxlor_ssl['id'];
|
||||||
|
$certrow['expirationdate'] = $froxlor_ssl['expirationdate'];
|
||||||
|
$certrow['ssl_cert_file'] = $froxlor_ssl['ssl_cert_file'];
|
||||||
|
$certrow['ssl_key_file'] = $froxlor_ssl['ssl_key_file'];
|
||||||
|
$certrow['ssl_ca_file'] = $froxlor_ssl['ssl_ca_file'];
|
||||||
|
$certrow['ssl_csr_file'] = $froxlor_ssl['ssl_csr_file'];
|
||||||
|
} else {
|
||||||
|
// check whether we have an entry with valid certificates which just does not need
|
||||||
|
// updating yet, so we need to skip this here
|
||||||
|
$froxlor_ssl_settings_stmt = Database::prepare("
|
||||||
|
SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
$froxlor_ssl = Database::pexecute_first($froxlor_ssl_settings_stmt);
|
||||||
|
if ($froxlor_ssl && ! empty($froxlor_ssl['ssl_cert_file'])) {
|
||||||
|
$insert_or_update_required = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($insert_or_update_required) {
|
||||||
|
$domains = array(
|
||||||
|
$certrow['domain']
|
||||||
|
);
|
||||||
|
|
||||||
|
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
||||||
|
// - this temp. deactivation of the ssl-redirect is handled by the webserver-cronjob
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updating " . $certrow['domain']);
|
||||||
|
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf(array(
|
||||||
|
'loginname' => $certrow['loginname']
|
||||||
|
));
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Initialize Lescript with documentroot
|
||||||
|
$le = new lescript_v2($cronlog, $version);
|
||||||
|
|
||||||
|
// Initialize Lescript
|
||||||
|
$le->initAccount($certrow, true);
|
||||||
|
|
||||||
|
// Request the new certificate (old key may be used)
|
||||||
|
$return = $le->signDomains($domains, $certrow['ssl_key_file']);
|
||||||
|
|
||||||
|
// We are interessted in the expirationdate
|
||||||
|
$newcert = openssl_x509_parse($return['crt']);
|
||||||
|
|
||||||
|
// Store the new data
|
||||||
|
Database::pexecute($updcert_stmt, array(
|
||||||
|
'id' => $certrow['id'],
|
||||||
|
'domainid' => $certrow['domainid'],
|
||||||
|
'crt' => $return['crt'],
|
||||||
|
'key' => $return['key'],
|
||||||
|
'ca' => $return['chain'],
|
||||||
|
'chain' => $return['chain'],
|
||||||
|
'csr' => $return['csr'],
|
||||||
|
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
||||||
|
));
|
||||||
|
|
||||||
|
if ($certrow['ssl_redirect'] == 3) {
|
||||||
|
Settings::Set('system.le_froxlor_redirect', '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updated Let's Encrypt certificate for " . $certrow['domain']);
|
||||||
|
|
||||||
|
$changedetected = 1;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_ERR, "Could not get Let's Encrypt certificate for " . $certrow['domain'] . ": " . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// customer domains
|
||||||
|
$certrows = $certificates_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
foreach ($certrows as $certrow) {
|
||||||
|
|
||||||
|
// set logger to corresponding loginname for the log to appear in the users system-log
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf(array(
|
||||||
|
'loginname' => $certrow['loginname']
|
||||||
|
));
|
||||||
|
|
||||||
|
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
||||||
|
if ($certrow['ssl_redirect'] != 2) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updating " . $certrow['domain']);
|
||||||
|
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: " . $certrow['domain']);
|
||||||
|
$domains = array(
|
||||||
|
$certrow['domain']
|
||||||
|
);
|
||||||
|
if ($certrow['iswildcarddomain'] == 1) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: *." . $certrow['domain']);
|
||||||
|
$domains[] = '*.' . $certrow['domain'];
|
||||||
|
}
|
||||||
|
elseif ($certrow['wwwserveralias'] == 1) {
|
||||||
|
// add www.<domain> to SAN list
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $certrow['domain']);
|
||||||
|
$domains[] = 'www.' . $certrow['domain'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// add alias domains (and possibly www.<aliasdomain>) to SAN list
|
||||||
|
Database::pexecute($aliasdomains_stmt, array(
|
||||||
|
'id' => $certrow['domainid']
|
||||||
|
));
|
||||||
|
$aliasdomains = $aliasdomains_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
foreach ($aliasdomains as $aliasdomain) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: " . $aliasdomain['domain']);
|
||||||
|
$domains[] = $aliasdomain['domain'];
|
||||||
|
if ($aliasdomain['iswildcarddomain'] == 1) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: *." . $aliasdomain['domain']);
|
||||||
|
$domains[] = '*.' . $aliasdomain['domain'];
|
||||||
|
}
|
||||||
|
elseif ($aliasdomain['wwwserveralias'] == 1) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Adding SAN entry: www." . $aliasdomain['domain']);
|
||||||
|
$domains[] = 'www.' . $aliasdomain['domain'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Initialize Lescript with documentroot
|
||||||
|
$le = new lescript_v2($cronlog, $version);
|
||||||
|
|
||||||
|
// Initialize Lescript
|
||||||
|
$le->initAccount($certrow);
|
||||||
|
|
||||||
|
// Request the new certificate (old key may be used)
|
||||||
|
$return = $le->signDomains($domains, $certrow['ssl_key_file']);
|
||||||
|
|
||||||
|
// We are interessted in the expirationdate
|
||||||
|
$newcert = openssl_x509_parse($return['crt']);
|
||||||
|
|
||||||
|
// Store the new data
|
||||||
|
Database::pexecute($updcert_stmt, array(
|
||||||
|
'id' => $certrow['id'],
|
||||||
|
'domainid' => $certrow['domainid'],
|
||||||
|
'crt' => $return['crt'],
|
||||||
|
'key' => $return['key'],
|
||||||
|
'ca' => $return['chain'],
|
||||||
|
'chain' => $return['chain'],
|
||||||
|
'csr' => $return['csr'],
|
||||||
|
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
||||||
|
));
|
||||||
|
|
||||||
|
if ($certrow['ssl_redirect'] == 3) {
|
||||||
|
Database::pexecute($upddom_stmt, array(
|
||||||
|
'domainid' => $certrow['domainid']
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Updated Let's Encrypt certificate for " . $certrow['domain']);
|
||||||
|
|
||||||
|
$changedetected = 1;
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_ERR, "Could not get Let's Encrypt certificate for " . $certrow['domain'] . ": " . $e->getMessage());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_WARNING, "Skipping Let's Encrypt generation for " . $certrow['domain'] . " due to an enabled ssl_redirect");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have a change in a certificate, we need to update the webserver - configs
|
||||||
|
// This is easiest done by just creating a new task ;)
|
||||||
|
if ($changedetected) {
|
||||||
|
inserttask(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset logger
|
||||||
|
$cronlog = FroxlorLogger::getInstanceOf(array(
|
||||||
|
'loginname' => 'cronjob'
|
||||||
|
));
|
||||||
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Let's Encrypt certificates have been updated");
|
||||||
@@ -227,7 +227,7 @@ class pdns extends DnsBase
|
|||||||
// build up connection string
|
// build up connection string
|
||||||
$driver = 'mysql';
|
$driver = 'mysql';
|
||||||
$dsn = $driver.":";
|
$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');
|
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
||||||
$dbconf = array();
|
$dbconf = array();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -44,7 +44,15 @@ class apache_fcgid extends apache
|
|||||||
if (Settings::Get('system.apache24') == '1'
|
if (Settings::Get('system.apache24') == '1'
|
||||||
&& Settings::Get('phpfpm.use_mod_proxy') == '1'
|
&& Settings::Get('phpfpm.use_mod_proxy') == '1'
|
||||||
) {
|
) {
|
||||||
$php_options_text.= ' <FilesMatch \.php$>'. "\n";
|
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
|
||||||
|
$extensions = explode(" ", $filesmatch);
|
||||||
|
$filesmatch = "";
|
||||||
|
foreach ($extensions as $ext) {
|
||||||
|
$filesmatch .= substr($ext, 1).'|';
|
||||||
|
}
|
||||||
|
// start block, cut off last pipe and close block
|
||||||
|
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
|
||||||
|
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
|
||||||
$php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost'. "\n";
|
$php_options_text.= ' SetHandler proxy:unix:' . $php->getInterface()->getSocketFile() . '|fcgi://localhost'. "\n";
|
||||||
$php_options_text.= ' </FilesMatch>' . "\n";
|
$php_options_text.= ' </FilesMatch>' . "\n";
|
||||||
|
|
||||||
@@ -54,15 +62,35 @@ class apache_fcgid extends apache
|
|||||||
// for this path, as this would be the first require and therefore grant all access
|
// for this path, as this would be the first require and therefore grant all access
|
||||||
if ($mypath_dir->isUserProtected() == false) {
|
if ($mypath_dir->isUserProtected() == false) {
|
||||||
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
||||||
|
if ($phpconfig['pass_authorizationheader'] == '1') {
|
||||||
|
$php_options_text.= ' CGIPassAuth On' . "\n";
|
||||||
|
}
|
||||||
$php_options_text.= ' Require all granted' . "\n";
|
$php_options_text.= ' Require all granted' . "\n";
|
||||||
$php_options_text.= ' AllowOverride All' . "\n";
|
$php_options_text.= ' AllowOverride All' . "\n";
|
||||||
$php_options_text.= ' </Directory>' . "\n";
|
$php_options_text.= ' </Directory>' . "\n";
|
||||||
|
} elseif ($phpconfig['pass_authorizationheader'] == '1') {
|
||||||
|
// allow Pass of Authorization header
|
||||||
|
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
||||||
|
$php_options_text.= ' CGIPassAuth On' . "\n";
|
||||||
|
$php_options_text.= ' </Directory>' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . Settings::Get('phpfpm.idle_timeout') . "\n";
|
$addheader = "";
|
||||||
|
if ($phpconfig['pass_authorizationheader'] == '1') {
|
||||||
|
$addheader = " -pass-header Authorization";
|
||||||
|
}
|
||||||
|
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
|
||||||
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
||||||
$php_options_text.= ' <FilesMatch "\.php$">' . "\n";
|
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
|
||||||
|
$extensions = explode(" ", $filesmatch);
|
||||||
|
$filesmatch = "";
|
||||||
|
foreach ($extensions as $ext) {
|
||||||
|
$filesmatch .= substr($ext, 1).'|';
|
||||||
|
}
|
||||||
|
// start block, cut off last pipe and close block
|
||||||
|
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
|
||||||
|
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
|
||||||
$php_options_text.= ' SetHandler php5-fastcgi'. "\n";
|
$php_options_text.= ' SetHandler php5-fastcgi'. "\n";
|
||||||
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
||||||
$php_options_text.= ' Options +ExecCGI' . "\n";
|
$php_options_text.= ' Options +ExecCGI' . "\n";
|
||||||
@@ -155,6 +183,16 @@ class apache_fcgid extends apache
|
|||||||
) {
|
) {
|
||||||
$user = Settings::Get('phpfpm.vhost_httpuser');
|
$user = Settings::Get('phpfpm.vhost_httpuser');
|
||||||
$group = Settings::Get('phpfpm.vhost_httpgroup');
|
$group = Settings::Get('phpfpm.vhost_httpgroup');
|
||||||
|
|
||||||
|
// get fpm config
|
||||||
|
$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
|
||||||
|
");
|
||||||
|
$fpm_config = Database::pexecute_first($fpm_sel_stmt, array(
|
||||||
|
'phpconfigid' => Settings::Get('phpfpm.vhost_defaultini')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$domain = array(
|
$domain = array(
|
||||||
@@ -167,7 +205,8 @@ class apache_fcgid extends apache
|
|||||||
'openbasedir' => 0,
|
'openbasedir' => 0,
|
||||||
'email' => Settings::Get('panel.adminmail'),
|
'email' => Settings::Get('panel.adminmail'),
|
||||||
'loginname' => 'froxlor.panel',
|
'loginname' => 'froxlor.panel',
|
||||||
'documentroot' => $mypath
|
'documentroot' => $mypath,
|
||||||
|
'fpm_config_id' => isset($fpm_config['id']) ? $fpm_config['id'] : 1
|
||||||
);
|
);
|
||||||
|
|
||||||
// all the files and folders have to belong to the local user
|
// all the files and folders have to belong to the local user
|
||||||
|
|||||||
@@ -58,8 +58,22 @@ class lighttpd extends HttpConfigBase
|
|||||||
public function reload()
|
public function reload()
|
||||||
{
|
{
|
||||||
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
if ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: reloading php-fpm');
|
// get all start/stop commands
|
||||||
safe_exec(escapeshellcmd(Settings::Get('phpfpm.reload')));
|
$startstop_sel = Database::prepare("SELECT reload_cmd, config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
|
||||||
|
Database::pexecute($startstop_sel);
|
||||||
|
$restart_cmds = $startstop_sel->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
// restart all php-fpm instances
|
||||||
|
foreach ($restart_cmds as $restart_cmd) {
|
||||||
|
// check whether the config dir is empty (no domains uses this daemon)
|
||||||
|
// so we need to create a dummy
|
||||||
|
$isDirEmpty = !(new \FilesystemIterator($restart_cmd['config_dir']))->valid();
|
||||||
|
if ($isDirEmpty) {
|
||||||
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: fpm config directory "' . $restart_cmd['config_dir'] . '" is empty. Creating dummy.');
|
||||||
|
phpinterface_fpm::createDummyPool($restart_cmd['config_dir']);
|
||||||
|
}
|
||||||
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: running ' . $restart_cmd['reload_cmd']);
|
||||||
|
safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: reloading lighttpd');
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'lighttpd::reload: reloading lighttpd');
|
||||||
safe_exec(escapeshellcmd(Settings::Get('system.apachereload_command')));
|
safe_exec(escapeshellcmd(Settings::Get('system.apachereload_command')));
|
||||||
@@ -535,7 +549,8 @@ class lighttpd extends HttpConfigBase
|
|||||||
|
|
||||||
if ($domain['ssl_cert_file'] != '') {
|
if ($domain['ssl_cert_file'] != '') {
|
||||||
|
|
||||||
$ssl_settings .= 'ssl.engine = "enable"' . "\n";
|
// ssl.engine only necessary once in the ip/port vhost (SERVER['socket'] condition)
|
||||||
|
//$ssl_settings .= 'ssl.engine = "enable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.use-compression = "disable"' . "\n";
|
$ssl_settings .= 'ssl.use-compression = "disable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n";
|
$ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n";
|
$ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n";
|
||||||
|
|||||||
@@ -73,8 +73,22 @@ class nginx extends HttpConfigBase
|
|||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: restarting php processes');
|
||||||
safe_exec(Settings::Get('system.phpreload_command'));
|
safe_exec(Settings::Get('system.phpreload_command'));
|
||||||
} elseif ((int) Settings::Get('phpfpm.enabled') == 1) {
|
} elseif ((int) Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: reloading php-fpm');
|
// get all start/stop commands
|
||||||
safe_exec(escapeshellcmd(Settings::Get('phpfpm.reload')));
|
$startstop_sel = Database::prepare("SELECT reload_cmd, config_dir FROM `" . TABLE_PANEL_FPMDAEMONS . "`");
|
||||||
|
Database::pexecute($startstop_sel);
|
||||||
|
$restart_cmds = $startstop_sel->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
// restart all php-fpm instances
|
||||||
|
foreach ($restart_cmds as $restart_cmd) {
|
||||||
|
// check whether the config dir is empty (no domains uses this daemon)
|
||||||
|
// so we need to create a dummy
|
||||||
|
$isDirEmpty = !(new \FilesystemIterator($restart_cmd['config_dir']))->valid();
|
||||||
|
if ($isDirEmpty) {
|
||||||
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: fpm config directory "' . $restart_cmd['config_dir'] . '" is empty. Creating dummy.');
|
||||||
|
phpinterface_fpm::createDummyPool($restart_cmd['config_dir']);
|
||||||
|
}
|
||||||
|
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'nginx::reload: running ' . $restart_cmd['reload_cmd']);
|
||||||
|
safe_exec(escapeshellcmd($restart_cmd['reload_cmd']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +210,7 @@ class nginx extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$http2 = $ssl_vhost == true && Settings::Get('system.nginx_http2_support') == '1';
|
$http2 = $ssl_vhost == true && Settings::Get('system.http2_support') == '1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this HAS to be set for the default host in nginx or else no vhost will work
|
* this HAS to be set for the default host in nginx or else no vhost will work
|
||||||
@@ -418,7 +432,7 @@ class nginx extends HttpConfigBase
|
|||||||
$_vhost_content .= $this->processSpecialConfigTemplate($ipandport['default_vhostconf_domain'], $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n";
|
$_vhost_content .= $this->processSpecialConfigTemplate($ipandport['default_vhostconf_domain'], $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$http2 = $ssl_vhost == true && Settings::Get('system.nginx_http2_support') == '1';
|
$http2 = $ssl_vhost == true && (isset($domain['http2']) && $domain['http2'] == '1' && Settings::Get('system.http2_support') == '1');
|
||||||
|
|
||||||
$vhost_content .= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ($http2 == true ? ' http2' : '') . ';' . "\n";
|
$vhost_content .= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ($http2 == true ? ' http2' : '') . ';' . "\n";
|
||||||
}
|
}
|
||||||
@@ -609,7 +623,7 @@ class nginx extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
// obsolete: ssl on now belongs to the listen block as 'ssl' at the end
|
// obsolete: ssl on now belongs to the listen block as 'ssl' at the end
|
||||||
// $sslsettings .= "\t" . 'ssl on;' . "\n";
|
// $sslsettings .= "\t" . 'ssl on;' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_protocols TLSv1 TLSv1.2;' . "\n";
|
$sslsettings .= "\t" . 'ssl_protocols ' . str_replace(",", " ", Settings::Get('system.ssl_protocols')) . ';' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
||||||
@@ -634,6 +648,14 @@ class nginx extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
$sslsettings .= '";' . "\n";
|
$sslsettings .= '";' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((isset($domain_or_ip['ocsp_stapling']) && $domain_or_ip['ocsp_stapling'] == "1") ||
|
||||||
|
(isset($domain_or_ip['letsencrypt']) && $domain_or_ip['letsencrypt'] == "1") ) {
|
||||||
|
$sslsettings .= "\t" . 'ssl_stapling on;' . "\n";
|
||||||
|
$sslsettings .= "\t" . 'ssl_stapling_verify on;' . "\n";
|
||||||
|
$sslsettings .= "\t" . 'ssl_trusted_certificate ' .
|
||||||
|
makeCorrectFile($domain_or_ip['ssl_cert_file']) . ';' . "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -711,6 +733,11 @@ class nginx extends HttpConfigBase
|
|||||||
if ($single['path'] == '/') {
|
if ($single['path'] == '/') {
|
||||||
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
||||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||||
|
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
||||||
|
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
||||||
|
} else {
|
||||||
|
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
|
||||||
|
}
|
||||||
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
|
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
|
||||||
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
|
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
|
||||||
$path_options .= "\t\t" . '}' . "\n";
|
$path_options .= "\t\t" . '}' . "\n";
|
||||||
@@ -768,6 +795,11 @@ class nginx extends HttpConfigBase
|
|||||||
$path_options .= "\t" . 'location ' . makeCorrectDir($single['path']) . ' {' . "\n";
|
$path_options .= "\t" . 'location ' . makeCorrectDir($single['path']) . ' {' . "\n";
|
||||||
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
$path_options .= "\t\t" . 'auth_basic "' . $single['authname'] . '";' . "\n";
|
||||||
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
$path_options .= "\t\t" . 'auth_basic_user_file ' . makeCorrectFile($single['usrf']) . ';' . "\n";
|
||||||
|
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
|
||||||
|
$path_options .= "\t\t" . 'index index.php index.html index.htm;' . "\n";
|
||||||
|
} else {
|
||||||
|
$path_options .= "\t\t" . 'index index.html index.htm;' . "\n";
|
||||||
|
}
|
||||||
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
|
$path_options .= "\t\t" . 'location ~ ^(.+?\.php)(/.*)?$ {' . "\n";
|
||||||
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
|
$path_options .= "\t\t\t" . 'try_files ' . $domain['nonexistinguri'] . ' @php;' . "\n";
|
||||||
$path_options .= "\t\t" . '}' . "\n";
|
$path_options .= "\t\t" . '}' . "\n";
|
||||||
|
|||||||
@@ -168,9 +168,17 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)Settings::Get('system.vmail_uid') . ':' . (int)Settings::Get('system.vmail_gid') . ' ' . escapeshellarg($usermaildir));
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)Settings::Get('system.vmail_uid') . ':' . (int)Settings::Get('system.vmail_gid') . ' ' . escapeshellarg($usermaildir));
|
||||||
safe_exec('chown -R ' . (int)Settings::Get('system.vmail_uid') . ':' . (int)Settings::Get('system.vmail_gid') . ' ' . escapeshellarg($usermaildir));
|
safe_exec('chown -R ' . (int)Settings::Get('system.vmail_uid') . ':' . (int)Settings::Get('system.vmail_gid') . ' ' . escapeshellarg($usermaildir));
|
||||||
|
|
||||||
|
if (Settings::Get('system.nssextrausers') == 1)
|
||||||
|
{
|
||||||
|
// explicitly create files after user has been created to avoid unknown user issues for apache/php-fpm when task#1 runs after this
|
||||||
|
include_once makeCorrectFile(FROXLOR_INSTALL_DIR.'/scripts/classes/class.Extrausers.php');
|
||||||
|
Extrausers::generateFiles($cronlog);
|
||||||
|
}
|
||||||
|
|
||||||
// clear NSCD cache if using fcgid or fpm, #1570
|
// clear NSCD cache if using fcgid or fpm, #1570
|
||||||
if (Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
|
if (Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) {
|
||||||
$false_val = false;
|
$false_val = false;
|
||||||
|
safe_exec('nscd -i passwd 1> /dev/null', $false_val, array('>'));
|
||||||
safe_exec('nscd -i group 1> /dev/null', $false_val, array('>'));
|
safe_exec('nscd -i group 1> /dev/null', $false_val, array('>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ while ($row_database = $databases_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
Database::needRoot(true, $row_database['dbserver']);
|
Database::needRoot(true, $row_database['dbserver']);
|
||||||
$last_dbserver = $row_database['dbserver'];
|
$last_dbserver = $row_database['dbserver'];
|
||||||
|
|
||||||
$database_list = array();
|
$databases_list = array();
|
||||||
$databases_list_result_stmt = Database::query("SHOW DATABASES");
|
$databases_list_result_stmt = Database::query("SHOW DATABASES");
|
||||||
while ($databases_list_row = $databases_list_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($databases_list_row = $databases_list_result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$databases_list[] = strtolower($databases_list_row['Database']);
|
$databases_list[] = strtolower($databases_list_row['Database']);
|
||||||
@@ -501,9 +501,7 @@ while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
Database::pexecute($result_quota_stmt, array('customerid' => $row['customerid']));
|
Database::pexecute($result_quota_stmt, array('customerid' => $row['customerid']));
|
||||||
|
|
||||||
// get correct user
|
// get correct user
|
||||||
if (Settings::Get('system.mod_fcgid') == 1
|
if ((Settings::Get('system.mod_fcgid') == 1 || Settings::Get('phpfpm.enabled') == 1) && $row['deactivated'] == '0') {
|
||||||
&& $row['deactivated'] == '0'
|
|
||||||
) {
|
|
||||||
$user = $row['loginname'];
|
$user = $row['loginname'];
|
||||||
$group = $row['loginname'];
|
$group = $row['loginname'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ if (Settings::Get('system.mail_use_smtp')) {
|
|||||||
$mail->Password = Settings::Get('system.mail_smtp_passwd');
|
$mail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||||
$mail->SMTPSecure = 'tls';
|
$mail->SMTPSecure = 'tls';
|
||||||
|
} else {
|
||||||
|
$mail->SMTPAutoTLS = false;
|
||||||
}
|
}
|
||||||
$mail->Port = Settings::Get('system.mail_smtp_port');
|
$mail->Port = Settings::Get('system.mail_smtp_port');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,25 +11,15 @@ $header
|
|||||||
|
|
||||||
<section>
|
<section>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p>{$lng['admin']['configfiles']['legend']}</p><br />
|
<p>{$lng['admin']['configfiles']['legend']}</p>
|
||||||
|
<p>{$lng['admin']['configfiles']['commands']}</p>
|
||||||
|
<p>{$lng['admin']['configfiles']['files']}</p>
|
||||||
<p>
|
<p>
|
||||||
{$lng['admin']['configfiles']['commands']}<br />
|
|
||||||
<textarea class="shell" rows="2" readonly>
|
|
||||||
chmod u+x example-script.sh
|
|
||||||
./example-script.sh</textarea>
|
|
||||||
</p><br />
|
|
||||||
<p>
|
|
||||||
{$lng['admin']['configfiles']['files']}<br />
|
|
||||||
<textarea class="filecontent" rows="5">Lorem ipsum dolor sit amet,
|
|
||||||
consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
|
|
||||||
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
|
|
||||||
eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
|
|
||||||
no sea takimata sanctus est Lorem ipsum dolor sit amet.</textarea>
|
|
||||||
</p>
|
|
||||||
<form id="configfiles_setmysqlpw" action="#">
|
<form id="configfiles_setmysqlpw" action="#">
|
||||||
MYSQL_PASSWORD: <input type="text" class="text" id="configfiles_mysqlpw" name="configfiles_mysqlpw" value="" />
|
FROXLOR_MYSQL_PASSWORD: <input type="text" class="text" id="configfiles_mysqlpw" name="configfiles_mysqlpw" value="" />
|
||||||
<input type="submit" value="{$lng['panel']['set']}" />
|
<input type="submit" value="{$lng['panel']['set']}" />
|
||||||
</form>
|
</form>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
24
templates/Sparkle/admin/phpconfig/fpmconfig_add.tpl
vendored
Normal file
24
templates/Sparkle/admin/phpconfig/fpmconfig_add.tpl
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
$header
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h2>
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/phpsettings_add_big.png" alt="{$title}" />
|
||||||
|
{$title}
|
||||||
|
</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<form action="{$linker->getLink(array('section' => 'phpsettings'))}" method="post" enctype="application/x-www-form-urlencoded">
|
||||||
|
<input type="hidden" name="s" value="$s" />
|
||||||
|
<input type="hidden" name="page" value="$page" />
|
||||||
|
<input type="hidden" name="action" value="$action" />
|
||||||
|
<input type="hidden" name="send" value="send" />
|
||||||
|
|
||||||
|
<table class="full">
|
||||||
|
{$fpmconfig_add_form}
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
$footer
|
||||||
25
templates/Sparkle/admin/phpconfig/fpmconfig_edit.tpl
vendored
Normal file
25
templates/Sparkle/admin/phpconfig/fpmconfig_edit.tpl
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
$header
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h2>
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/phpsettings_edit_big.png" alt="{$title}" />
|
||||||
|
{$title}
|
||||||
|
</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<form action="{$linker->getLink(array('section' => 'phpsettings'))}" method="post" enctype="application/x-www-form-urlencoded">
|
||||||
|
<input type="hidden" name="s" value="$s"/>
|
||||||
|
<input type="hidden" name="page" value="$page"/>
|
||||||
|
<input type="hidden" name="action" value="edit"/>
|
||||||
|
<input type="hidden" name="id" value="$id"/>
|
||||||
|
<input type="hidden" name="send" value="send" />
|
||||||
|
|
||||||
|
<table class="full">
|
||||||
|
{$fpmconfig_edit_form}
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
$footer
|
||||||
42
templates/Sparkle/admin/phpconfig/fpmdaemons.tpl
vendored
Normal file
42
templates/Sparkle/admin/phpconfig/fpmdaemons.tpl
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
$header
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h2>
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/phpsettings_big.png" alt="" />
|
||||||
|
{$lng['menue']['phpsettings']['maintitle']}
|
||||||
|
</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
|
||||||
|
<div class="overviewadd">
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />
|
||||||
|
<a href="{$linker->getLink(array('section' => 'phpsettings', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['phpsettings']['addnew']}</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="full hl">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{$lng['admin']['phpsettings']['description']}</th>
|
||||||
|
<th>{$lng['admin']['phpsettings']['activephpconfigs']}</th>
|
||||||
|
<th>{$lng['serversettings']['phpfpm_settings']['reload']}</th>
|
||||||
|
<th>{$lng['serversettings']['phpfpm_settings']['configdir']}</th>
|
||||||
|
<th>{$lng['serversettings']['phpfpm_settings']['pm']}</th>
|
||||||
|
<th>{$lng['panel']['options']}</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
$tablecontent
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<if 15 < $count>
|
||||||
|
<div class="overviewadd">
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />
|
||||||
|
<a href="{$linker->getLink(array('section' => 'phpsettings', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['phpsettings']['addnew']}</a>
|
||||||
|
</div>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</article>
|
||||||
|
$footer
|
||||||
17
templates/Sparkle/admin/phpconfig/fpmdaemons_overview.tpl
vendored
Normal file
17
templates/Sparkle/admin/phpconfig/fpmdaemons_overview.tpl
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<tr class="top">
|
||||||
|
<td><strong>{$row['description']}</strong></td>
|
||||||
|
<td>{$configs}</td>
|
||||||
|
<td>{$row['reload_cmd']}</td>
|
||||||
|
<td>{$row['config_dir']}</td>
|
||||||
|
<td>{$row['pm']}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{$linker->getLink(array('section' => 'phpsettings', 'page' => $page, 'action' => 'edit', 'id' => $row['id']))}">
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/edit.png" alt="{$lng['panel']['edit']}" title="{$lng['panel']['edit']}" />
|
||||||
|
</a>
|
||||||
|
<if $row['id'] != 1>
|
||||||
|
<a href="{$linker->getLink(array('section' => 'phpsettings', 'page' => $page, 'action' => 'delete', 'id' => $row['id']))}">
|
||||||
|
<img src="templates/{$theme}/assets/img/icons/delete.png" alt="{$lng['panel']['delete']}" title="{$lng['panel']['delete']}" />
|
||||||
|
</a>
|
||||||
|
</if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
@@ -19,7 +19,11 @@ $header
|
|||||||
<tr>
|
<tr>
|
||||||
<th>{$lng['admin']['phpsettings']['description']}</th>
|
<th>{$lng['admin']['phpsettings']['description']}</th>
|
||||||
<th>{$lng['admin']['phpsettings']['activedomains']}</th>
|
<th>{$lng['admin']['phpsettings']['activedomains']}</th>
|
||||||
<th>{$lng['admin']['phpsettings']['binary']}</th>
|
<if Settings::Get('phpfpm.enabled') == '1'>
|
||||||
|
<th>{$lng['admin']['phpsettings']['fpmdesc']}</th>
|
||||||
|
<else>
|
||||||
|
<th>{$lng['admin']['phpsettings']['binary']}</th>
|
||||||
|
</if>
|
||||||
<th>{$lng['admin']['phpsettings']['file_extensions']}</th>
|
<th>{$lng['admin']['phpsettings']['file_extensions']}</th>
|
||||||
<th>{$lng['panel']['options']}</th>
|
<th>{$lng['panel']['options']}</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user