Compare commits

..

110 Commits

Author SHA1 Message Date
Michael Kaufmann
00eb5ed87b set version to 0.9.40.1 for bugfix release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-11-27 18:41:05 +01:00
Michael Kaufmann
1dc9ea6fb1 Merge branch '0.9.x' of github.com:Froxlor/Froxlor into 0.9.x 2018-11-27 11:50:25 +01:00
Michael Kaufmann
1b63936a26 fix typo in function name, fixes #601
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-11-27 11:50:05 +01:00
Michael Kaufmann
4760bddfe0 Merge pull request #585 from Xavjer/0.9.x
#584 - PHP deprecated warning
2018-11-13 17:38:54 +01:00
Cédric Wyss
03f62365b1 #584 - Revert change for PHP <=5.4.6 2018-11-13 17:29:39 +01:00
Cédric Wyss
3c0416ac44 #584 - PHP deprecated warning 2018-11-13 16:02:37 +01:00
Michael Kaufmann
247efb1c0a set version to 0.9.40 for upcoming release
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-11-10 11:34:50 +01:00
Michael Kaufmann
98c55435ae Merge pull request #583 from heavygale/patch-1
Update archive.tpl
2018-10-27 17:14:28 +02:00
Max
981f5840b3 Update archive.tpl 2018-10-27 14:57:27 +02:00
Michael Kaufmann
c1809fc084 Merge pull request #579 from quthla/patch-1
Add TLSv1.3
2018-10-20 14:02:17 +02:00
quthla
090bdaaea8 Add TLSv1.3 2018-10-20 13:29:25 +02:00
Michael Kaufmann
611bec6849 Merge pull request #578 from stweil/lgtm
Fix warnings from LGTM
2018-10-17 11:55:36 +02:00
Stefan Weil
8cf797374d Add missing variable declarations
This fixes warnings from LGTM:

    Variable i is used like a local variable,
    but is missing a declaration.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-17 11:49:59 +02:00
Stefan Weil
20177e06fc Add missing semicolons
This fixes warnings from LGTM:

    Avoid automated semicolon insertion (91% of all statements
    in the enclosing function have an explicit semicolon).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-17 11:45:25 +02:00
Michael Kaufmann
aa6f3d33eb clearify description and enhance validation for path-field in backup-job-planning
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-10-11 14:52:45 +02:00
Michael Kaufmann
23d4bee184 add override-required info to php-config edit formfields like in add formfields, refs #573
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-28 11:00:56 +02:00
Michael Kaufmann
37988fa645 forgot to add override_fpmconfig flag to panel_phpconfigs, refs #573
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-28 10:57:43 +02:00
Michael Kaufmann
6c7ee0c222 add possibility to specify pm-related settings per php-config (if override of fpm-daemon settings is set to yes), fixes #573
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-28 10:55:08 +02:00
Michael Kaufmann
108c4c25b3 move 'enable http/2' setting from froxlor-vhost-settings to webserver-settings, fixes #575
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-26 13:29:30 +02:00
Michael Kaufmann
095e54d88d fix missing update in version.inc.php
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-25 08:17:31 +02:00
Michael Kaufmann
bd036a0fde remove unnecessary string-break; use standardlanguage-variable as fallback language for installer
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-25 08:12:21 +02:00
Michael Kaufmann
f766c6f920 Merge pull request #572 from markuspetermann/master
Fixed class.lescript_v2.php to work with ACMEv2
2018-09-25 08:09:16 +02:00
Markus Petermann
4588bc7f5c Merge branch 'master' of github.com:markuspetermann/Froxlor 2018-09-19 15:14:46 +02:00
Markus Petermann
9e289a2380 Fixed class.lescript_v2.php to work with ACMEv2
Account(kid) needs to be saved for future requests.
Install/Update part is untested.
2018-09-19 15:11:27 +02:00
Michael Kaufmann
f0edf97ac7 do not follow url location/redirect when using LE selfcheck
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-19 11:15:42 +02:00
Michael Kaufmann
91195fda89 check for all needed php extensions and mysqldump tool in setup process, fixes #569
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-19 11:15:03 +02:00
Michael Kaufmann
6161ad1bd3 make CURLOPT_FOLLOWLOCATION optional in HttpClient::urlGet
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-19 11:09:27 +02:00
Michael Kaufmann
f72d87228b restrict sending of emails when user is locked
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-09-19 11:07:54 +02:00
Markus Petermann
4f0acd176a Fixed class.lescript_v2.php to work with ACMEv2
Account(kid) needs to be saved for future requests.
Install/Update part is untested.
2018-09-18 02:20:17 +02:00
Markus Petermann
5f29b2cc4a Fixed class.lescript_v2.php to work with ACMEv2
When requesting a certificate for multiple Domains/SANs, the request must be done in a single order.
2018-09-18 00:53:51 +02:00
Michael Kaufmann
164f1a921e Merge pull request #570 from markuspetermann/patch-1
Fixed class.lescript_v2.php to work with ACMEv2
2018-09-15 13:25:01 +02:00
markuspetermann
94c4d52476 Fixed class.lescript_v2.php to work with ACMEv2
As GET /document never returns any Reply-Nonce Header, getLastNonce() caused an infinite loop.
The Content-Type for v2 must be application/jose+json.
2018-09-15 12:41:27 +02:00
Michael Kaufmann
b777053133 allow a higher amount of diskspace and traffic to be entered in the forms, fixes #560
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-08-15 10:59:16 +02:00
Michael Kaufmann
d0c2888508 Merge pull request #494 from xelaz/master
extend nginx letsencrypt (.well-known) redirect regex to https
2018-08-15 08:03:45 +02:00
Michael Kaufmann
ff8afef614 Merge pull request #563 from Froxlor/revert-561-patch-1
Revert "acme challenges can include hyphens (-)"
2018-08-12 18:11:45 +02:00
Michael Kaufmann
a28b2e8115 Revert "acme challenges can include hyphens (-)" 2018-08-12 18:11:36 +02:00
Michael Kaufmann
b0e348a2c5 Merge pull request #561 from oliverrahner/patch-1
acme challenges can include hyphens (-)
2018-08-12 17:09:03 +02:00
Oliver Rahner
512abda38d acme challenges can include hyphens (-)
made a small adjustment so that acme challenges like "CrgFuFZU-U7mwXxjjHZi8if851XGVjdPRtWN91LTWmM" also don't get redirected
2018-08-09 16:33:27 +02:00
Michael Kaufmann
1690cadab9 show link to clear plaintext email account passwords if enabled; set store-plaintext-passwords default to 'off'; fixes #557
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
2018-07-10 09:47:01 +02:00
Michael Kaufmann
436d141bd1 fix ticket access when posting answer
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-06-21 07:52:11 +02:00
Michael Kaufmann
aa881560cc deny access to tickets not owned by current user, thx to chbi
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-06-19 21:46:11 +02:00
Michael Kaufmann
06ef81cc5b adjust year in copyright in std-customer-index file, thx to demlak
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-06-17 09:41:31 +02:00
Michael Kaufmann
4a99e4ba57 Merge pull request #556 from nachtgeist/master
fix triggering an LE CSR when changing www on a main domain, fixes #526
2018-06-05 07:52:03 +02:00
Daniel Reichelt
2ba4137e7d fix triggering an LE CSR when changing www on a main domain
Prior to this, LE CSRs were triggered only when the wwwserveralias was
changed on alias domains, but not on main domains.

Fixes #526
2018-06-05 06:51:20 +02:00
Daniel Reichelt
72835c56ad trim trailing whitespace 2018-06-05 06:51:10 +02:00
Michael Kaufmann
b80bdcbc4f forgot to add version file
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-29 15:54:44 +02:00
Michael Kaufmann
c1e62e6be7 get rid of serialization completely to avoid possible code execution, fixes #555
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-29 15:47:41 +02:00
Michael Kaufmann
10330f8a7a fix fallback redirect code when customredirect is enabled and default is selected
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-24 17:44:36 +02:00
Michael Kaufmann
18fb422a69 correct order of settings
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-24 14:50:52 +02:00
Michael Kaufmann
f8236dff7b fix not quite correctly webserver-log-piping
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-24 14:44:59 +02:00
Michael Kaufmann
bad680cfdb enhancements for webserver-log settings
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-24 13:23:37 +02:00
Michael Kaufmann
5a070d6d91 add settings to customize webserver logs
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-24 11:36:13 +02:00
Robert Förster (Dessa)
07a3f76568 remove wheezy configs 2018-05-10 16:42:27 +02:00
Michael Kaufmann
67b95a301b check only for existing .conf files when trying to find out whether a fpm pool config directory is empty; fixes #543
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-05-06 14:38:18 +02:00
Michael Kaufmann
6f9187d1bb Merge branch 'master' of github.com:Froxlor/Froxlor 2018-04-25 12:29:41 +02:00
Michael Kaufmann
84b8cda7ac allow usage of up to 255 characters in a txt record, fixes #548
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-04-25 12:29:30 +02:00
Michael Kaufmann
75616cc727 fix typo in german language file
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-04-25 12:27:59 +02:00
Michael Kaufmann
b3d018c506 corrected usage of default redirect code from settings; fixes #546
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
2018-04-25 12:27:40 +02:00
Robert Förster (Dessa)
2508d855e3 deprecate precise, as xenial configs are now available 2018-04-03 13:12:32 +02:00
Erik
a21f3c5a3f added xenial.xml (#533)
* added xenial.xml

* fixed touch commands as in commit 3c802038f2

* changed a2dismod php to a2dismod php7.0

* fixed overlooked a2dismod php to a2dismod php7.0
2018-04-03 12:59:14 +02:00
Michael Kaufmann
20d9be537a Merge pull request #542 from d00p/patch-1
Update README.md
2018-03-29 13:11:11 +02:00
Michael Kaufmann
30d39d622d Update README.md 2018-03-29 13:10:33 +02:00
Michael Kaufmann (d00p)
e58192edc2 show whether curl extension is installed when trying to check for a new version in admin-dashboard
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-29 11:11:39 +02:00
Michael Kaufmann (d00p)
be0099bf01 add duplicate check to switch-server-ip script
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-16 09:18:02 +01:00
Michael Kaufmann (d00p)
724e88b94f rename handler php5-fastcgi to php-fastcgi, just cosmetics; fixes #536
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-14 11:37:45 +01:00
Michael Kaufmann (d00p)
3c802038f2 split touch-command for multiple files into single ones, fixes #535
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-14 11:35:03 +01:00
Michael Kaufmann (d00p)
38b57117e2 minor fixes in froxlor-sql file
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-13 10:40:45 +01:00
Michael Kaufmann (d00p)
349fa7a761 avoid possible undefined index if no issuer-organisation is set in a certificate
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-12 10:22:50 +01:00
Michael Kaufmann (d00p)
7b52c0c78c fix default value of panel.no_robots settings; add phpdoc for Database-class-methods
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-08 17:03:17 +01:00
Michael Kaufmann (d00p)
cd5cef51e8 allow config and settings json file for config-services.php to be downloaded from a remote url
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-06 21:07:08 +01:00
Michael Kaufmann (d00p)
a621fd3b09 run cronjob at the end of config-services script (when using --apply), thx v3ng
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-06 11:05:26 +01:00
Michael Kaufmann (d00p)
0c43c5d2b5 backport config-services --import-settings parameter from 0.10.0
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-06 10:52:57 +01:00
Michael Kaufmann
aff6d82321 Merge pull request #531 from Crease29/patch-1
Link domains to HTTPS in certificate list
2018-03-04 12:11:12 +01:00
Kai Neuwerth
91cecf8c1e Link domains to HTTPS in certificate list
As an admin I want to check if the certificate of a website is working.
Therefore I click on the domain in the SSL certificate list and have to prepend "https" to the URL later.
In this case I'd link the domain to HTTPS initially.
2018-03-04 11:43:50 +01:00
Michael Kaufmann
26c3c8e6f0 Merge pull request #527 from JB1985/patch-2
Update german.lng.php
2018-03-03 14:58:38 +01:00
Michael Kaufmann
08814f8c9a Merge pull request #530 from michaelzangl/fix-hostname-error-message
Fix hostname error message
2018-03-03 14:57:22 +01:00
Michael Kaufmann
632eb98df9 Merge pull request #529 from michaelzangl/fix-installer-path
Froxlor installer: Use same file path for chmod.
2018-03-03 13:05:59 +01:00
Michael Zangl
909c983aec Fix invalidhostname error message (de). 2018-03-03 11:49:58 +01:00
Michael Zangl
8642254175 Fix invalidhostname error message. 2018-03-03 11:48:26 +01:00
Michael Zangl
7e81b0bb5a Froxlor installer: Use same file path for chmod. 2018-03-03 11:18:28 +01:00
Michael Kaufmann (d00p)
20eaa7bc08 fix missing sql-prepared-statement parameter, fixes #528
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-03-02 19:36:56 +01:00
JB1985
abb94c9189 Update german.lng.php
Übersetzung Änderung von Lets Encrypt
2018-03-02 17:28:30 +01:00
Michael Kaufmann (d00p)
2b366c8f23 add field for fullchain to be stored in ssl-certificates-table; create fullchain file if given (it's not used by froxlor); do not generate/renew certificates for disabled customers domains
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-25 18:22:15 +01:00
Michael Kaufmann (d00p)
d5b9ad3452 darn, stay php-5.3 compatible, thx greppy
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-20 21:37:06 +01:00
Michael Kaufmann (d00p)
5437fcdc89 insert tasks to rebuild configs etc. after import of settings, thx to v3ng for noticing
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-20 19:15:55 +01:00
Michael Kaufmann (d00p)
131efc544d fix syntax error in lang file, fixes #522
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-19 12:27:00 +01:00
Michael Kaufmann
160474f2b6 Merge pull request #521 from JB1985/master
Update german.lng.php
2018-02-19 09:03:32 +01:00
JB1985
168738b23a Update german.lng.php
Statt Benutze Lets Encrypt => SSL Zertifikat erstellen (Let\'s Encrypt)
2018-02-19 09:02:34 +01:00
Michael Kaufmann (d00p)
9619abdad7 when importing settings with enabled ssl flag, validate that the target system has ssl enabled ip's to avoid unexpected behaviour, tthx v3ng for testing
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-17 16:00:50 +01:00
Michael Kaufmann (d00p)
fd287e7be4 add apache restart command after enabling modules in config-templates
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-17 14:51:04 +01:00
Michael Kaufmann (d00p)
350e3d733a do not check for options if field is disabled, unset enabled-ownvhost flags for fcgid/fpm if the corresponding other one is activated; fixes #518
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-16 09:22:34 +01:00
Michael Kaufmann (d00p)
6f91bece17 fix postfix config for postfix/courier on precise and trusty, fixes #516
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-15 07:44:54 +01:00
Michael Kaufmann (d00p)
5c30961d3c set version to 0.9.39.5 for bugfix release (imap/pop3 ticks not enabled if active in hosting plan when editing hosting plan)
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-14 13:31:39 +01:00
Michael Kaufmann (d00p)
edd5ef0ca0 fix correct display of selected checkbox imap/pop3 when editing hosting plan
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-14 07:40:39 +01:00
Michael Kaufmann (d00p)
6befe85656 fix add/edit domain due to wrong access to settings; setting version to 0.9.39.4 for bugfix release
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 12:23:05 +01:00
Michael Kaufmann (d00p)
27f8c8b438 show domains of disabled customers also as disabled
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 11:49:15 +01:00
Michael Kaufmann (d00p)
fc0c796b68 avoid undefined variables/indexes
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 10:58:06 +01:00
Michael Kaufmann (d00p)
482e8c9a11 set version to 0.9.39.3 for maintenance release and upcoming debian package so the new hosting-plan feature is included
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 09:06:49 +01:00
Michael Kaufmann (d00p)
7a664a9990 clean up panel_diskspace/panel_diskspace_admins when removing customer/admin
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 08:21:45 +01:00
Michael Kaufmann (d00p)
372ab5d9c8 add domain flag to avoid generation of nginx try_files directive in webroot which is not suitable for some applications; fixes #461
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-13 08:12:58 +01:00
Michael Kaufmann (d00p)
de70dbb888 fix checked-property when applying hosting-plan for allowed-phpconfigs
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 14:58:17 +01:00
Michael Kaufmann (d00p)
4d7ceb9efe add missing question-string
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 13:33:29 +01:00
Michael Kaufmann (d00p)
bb792f228f add new hosting-plans feature
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 13:28:13 +01:00
Michael Kaufmann (d00p)
017396197e set version to 0.9.39.2 for bugfix release
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 07:49:07 +01:00
Michael Kaufmann (d00p)
216f013c96 add script to automatically configure services from shell without the need of copy/paste from the interface
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 07:47:51 +01:00
Michael Kaufmann (d00p)
05f1bf0a1f meh, forgot to uncomment the settings storage for settings-import
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-12 07:46:38 +01:00
Michael Kaufmann (d00p)
295fbae6f5 create bash script to generate proftpd-certificates in case system does not use /bin/bash as shell
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-11 16:10:10 +01:00
Michael Kaufmann (d00p)
ca4c93ac92 set default dns server in config-templates; separate CmdLineHandler from switch-server-ip script for further usage
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2018-02-11 13:57:07 +01:00
azerr
297f3f638c change sign direction 2017-12-08 17:47:09 +01:00
azerr
d2a9fa8632 extend nginx redirect regex to https 2017-12-08 15:39:05 +01:00
83 changed files with 4145 additions and 2769 deletions

View File

@@ -51,7 +51,7 @@ https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.fro
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian)
/etc/apt/sources.list.d/froxlor.list
> deb http://debian.froxlor.org {wheezy|jessie} main
> deb http://debian.froxlor.org {wheezy|jessie|stretch} main
### Gentoo repository

View File

@@ -71,7 +71,7 @@ return array(
'settinggroup' => 'panel',
'varname' => 'no_robots',
'type' => 'bool',
'default' => false,
'default' => true,
'save_method' => 'storeSettingField',
),
'panel_paging' => array(

View File

@@ -80,19 +80,6 @@ return array(
'save_method' => 'storeSettingField',
'visible' => Settings::Get('system.use_ssl')
),
'system_http2_support' => array(
'label' => $lng['serversettings']['http2_support'],
'settinggroup' => 'system',
'varname' => 'http2_support',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'websrv_avail' => array(
'apache2',
'nginx'
),
'visible' => Settings::Get('system.use_ssl')
),
/**
* FCGID
*/

View File

@@ -60,6 +60,19 @@ return array(
'apache2'
)
),
'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')
),
'system_httpuser' => array(
'label' => $lng['admin']['webserver_user'],
'settinggroup' => 'system',
@@ -112,6 +125,58 @@ return array(
'default' => '/var/customers/logs/',
'save_method' => 'storeSettingField'
),
'system_logfiles_script' => array(
'label' => $lng['serversettings']['logfiles_script'],
'settinggroup' => 'system',
'varname' => 'logfiles_script',
'type' => 'string',
'string_type' => '',
'default' => '',
'save_method' => 'storeSettingField',
'websrv_avail' => array(
'apache2'
)
),
'system_logfiles_piped' => array(
'label' => $lng['serversettings']['logfiles_piped'],
'settinggroup' => 'system',
'varname' => 'logfiles_piped',
'type' => 'bool',
'default' => false,
'save_method' => 'storeSettingField',
'websrv_avail' => array(
'apache2'
)
),
'system_logfiles_format' => array(
'label' => $lng['serversettings']['logfiles_format'],
'settinggroup' => 'system',
'varname' => 'logfiles_format',
'type' => 'string',
'default' => '',
'string_emptyallowed' => true,
'save_method' => 'storeSettingField',
'websrv_avail' => array(
'apache2',
'nginx'
)
),
'system_logfiles_type' => array(
'label' => $lng['serversettings']['logfiles_type'],
'settinggroup' => 'system',
'varname' => 'logfiles_type',
'type' => 'option',
'default' => '1',
'option_mode' => 'one',
'option_options' => array(
'1' => 'combined',
'2' => 'vhost_combined'
),
'save_method' => 'storeSettingField',
'websrv_avail' => array(
'apache2'
)
),
'system_customersslpath' => array(
'label' => $lng['serversettings']['customerssl_directory'],
'settinggroup' => 'system',

View File

@@ -40,7 +40,8 @@ return array(
'option_options' => array(
'TLSv1' => 'TLSv1',
'TLSv1.1' => 'TLSv1.1',
'TLSv1.2' => 'TLSv1.2'
'TLSv1.2' => 'TLSv1.2',
'TLSv1.3' => 'TLSv1.3'
),
'save_method' => 'storeSettingField'
),

View File

@@ -35,7 +35,7 @@ return array(
'settinggroup' => 'system',
'varname' => 'mailpwcleartext',
'type' => 'bool',
'default' => true,
'default' => false,
'save_method' => 'storeSettingField',
),
'system_passwordcryptfunc' => array(

View File

@@ -170,6 +170,11 @@ if ($page == 'admins'
");
Database::pexecute($del_stmt, array('adminid' => $id));
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_DISKSPACE_ADMINS . "` WHERE `adminid` = :adminid
");
Database::pexecute($del_stmt, array('adminid' => $id));
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
`adminid` = :userid WHERE `adminid` = :adminid

View File

@@ -307,6 +307,8 @@ if ($page == 'customers'
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE `customerid` = :id");
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DISKSPACE . "` WHERE `customerid` = :id");
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = :id");
Database::pexecute($stmt, array('id' => $id));
$stmt = Database::prepare("DELETE FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid` = :id");
@@ -1073,6 +1075,20 @@ if ($page == 'customers'
}
}
// hosting plans
$hosting_plans = "";
$plans = Database::query("
SELECT *
FROM `" . TABLE_PANEL_PLANS . "`
ORDER BY name ASC
");
if (Database::num_rows() > 0){
$hosting_plans .= makeoption("---", 0, 0, true, true);
}
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
$hosting_plans .= makeoption($row['name'], $row['id'], 0, true, true);
}
$customer_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_add.php';
$customer_add_form = htmlform::genHTMLForm($customer_add_data);
@@ -1755,6 +1771,20 @@ if ($page == 'customers'
}
}
// hosting plans
$hosting_plans = "";
$plans = Database::query("
SELECT *
FROM `" . TABLE_PANEL_PLANS . "`
ORDER BY name ASC
");
if (Database::num_rows() > 0){
$hosting_plans .= makeoption("---", 0, 0, true, true);
}
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
$hosting_plans .= makeoption($row['name'], $row['id'], 0, true, true);
}
$customer_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/customer/formfield.customer_edit.php';
$customer_edit_form = htmlform::genHTMLForm($customer_edit_data);

View File

@@ -55,7 +55,7 @@ if ($page == 'domains' || $page == 'overview') {
$syshostname = "AND `d`.`id` <> " . Settings::Get('system.hostname_id');
}
$result_stmt = Database::prepare("
SELECT `d`.*, `c`.`loginname`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`
SELECT `d`.*, `c`.`loginname`, `c`.`deactivated`, `c`.`name`, `c`.`firstname`, `c`.`company`, `c`.`standardsubdomain`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
@@ -429,6 +429,7 @@ if ($page == 'domains' || $page == 'overview') {
}
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
$notryfiles = isset($_POST['notryfiles']) && (int)$_POST['notryfiles'] == 1 ? 1 : 0;
validate($_POST['documentroot'], 'documentroot');
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
@@ -451,6 +452,7 @@ if ($page == 'domains' || $page == 'overview') {
$zonefile = '';
$dkim = '1';
$specialsettings = '';
$notryfiles = '0';
}
if ($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1') {
@@ -526,7 +528,7 @@ if ($page == 'domains' || $page == 'overview') {
$ipandports = array();
if (isset($_POST['ipandport']) && ! is_array($_POST['ipandport'])) {
$_POST['ipandport'] = unserialize($_POST['ipandport']);
$_POST['ipandport'] = json_decode($_POST['ipandport'], true);
}
if (isset($_POST['ipandport']) && is_array($_POST['ipandport'])) {
@@ -562,7 +564,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_ipandports = array();
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
$_POST['ssl_ipandport'] = json_decode($_POST['ssl_ipandport'], true);
}
// Verify SSL-Ports
@@ -604,7 +606,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_redirect = 0;
$letsencrypt = 0;
$http2 = 0;
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
@@ -620,7 +622,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_redirect = 0;
$letsencrypt = 0;
$http2 = 0;
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
@@ -690,7 +692,7 @@ if ($page == 'domains' || $page == 'overview') {
}
if (count($ssl_ipandports) == 0) {
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
}
@@ -792,15 +794,16 @@ if ($page == 'domains' || $page == 'overview') {
'dkim' => $dkim,
'speciallogfile' => $speciallogfile,
'selectserveralias' => $serveraliasoption,
'ipandport' => serialize($ipandports),
'ipandport' => json_encode($ipandports),
'ssl_redirect' => $ssl_redirect,
'ssl_ipandport' => serialize($ssl_ipandports),
'ssl_ipandport' => json_encode($ssl_ipandports),
'phpenabled' => $phpenabled,
'openbasedir' => $openbasedir,
'phpsettingid' => $phpsettingid,
'mod_fcgid_starter' => $mod_fcgid_starter,
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings,
'notryfiles' => $notryfiles,
'registration_date' => $registration_date,
'termination_date' => $termination_date,
'issubof' => $issubof,
@@ -850,6 +853,7 @@ if ($page == 'domains' || $page == 'overview') {
'openbasedir' => $openbasedir,
'speciallogfile' => $speciallogfile,
'specialsettings' => $specialsettings,
'notryfiles' => $notryfiles,
'ssl_redirect' => $ssl_redirect,
'add_date' => time(),
'registration_date' => $registration_date,
@@ -889,6 +893,7 @@ if ($page == 'domains' || $page == 'overview') {
`openbasedir` = :openbasedir,
`speciallogfile` = :speciallogfile,
`specialsettings` = :specialsettings,
`notryfiles` = :notryfiles,
`ssl_redirect` = :ssl_redirect,
`add_date` = :add_date,
`registration_date` = :registration_date,
@@ -1119,7 +1124,6 @@ if ($page == 'domains' || $page == 'overview') {
}
}
} elseif ($action == 'edit' && $id != 0) {
$result_stmt = Database::prepare("
SELECT `d`.*, `c`.`customerid`
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
@@ -1338,6 +1342,7 @@ if ($page == 'domains' || $page == 'overview') {
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
$ssfs = (isset($_POST['specialsettingsforsubdomains']) && intval($_POST['specialsettingsforsubdomains']) == 1) ? 1 : 0;
$notryfiles = isset($_POST['notryfiles']) && (int)$_POST['notryfiles'] == 1 ? 1 : 0;
$documentroot = validate($_POST['documentroot'], 'documentroot');
if ($documentroot == '') {
@@ -1359,6 +1364,7 @@ if ($page == 'domains' || $page == 'overview') {
$dkim = $result['dkim'];
$specialsettings = $result['specialsettings'];
$ssfs = (empty($specialsettings) ? 0 : 1);
$notryfiles = $result['notryfiles'];
$documentroot = $result['documentroot'];
}
@@ -1413,7 +1419,7 @@ if ($page == 'domains' || $page == 'overview') {
$ipandports = array();
if (isset($_POST['ipandport']) && ! is_array($_POST['ipandport'])) {
$_POST['ipandport'] = unserialize($_POST['ipandport']);
$_POST['ipandport'] = json_decode($_POST['ipandport'], true);
}
if (isset($_POST['ipandport']) && is_array($_POST['ipandport'])) {
@@ -1459,7 +1465,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_ipandports = array();
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
$_POST['ssl_ipandport'] = json_decode($_POST['ssl_ipandport'], true);
}
if (isset($_POST['ssl_ipandport']) && is_array($_POST['ssl_ipandport'])) {
@@ -1487,7 +1493,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_redirect = 0;
$letsencrypt = 0;
$http2 = 0;
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
@@ -1503,7 +1509,7 @@ if ($page == 'domains' || $page == 'overview') {
$ssl_redirect = 0;
$letsencrypt = 0;
$http2 = 0;
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
@@ -1596,7 +1602,7 @@ if ($page == 'domains' || $page == 'overview') {
}
if (count($ssl_ipandports) == 0) {
// we need this for the serialize
// we need this for the json-encode
// if ssl is disabled or no ssl-ip/port exists
$ssl_ipandports[] = - 1;
}
@@ -1655,13 +1661,14 @@ if ($page == 'domains' || $page == 'overview') {
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
'specialsettings' => $specialsettings,
'specialsettingsforsubdomains' => $ssfs,
'notryfiles' => $notryfiles,
'registration_date' => $registration_date,
'termination_date' => $termination_date,
'issubof' => $issubof,
'speciallogfile' => $speciallogfile,
'speciallogverified' => $speciallogverified,
'ipandport' => serialize($ipandports),
'ssl_ipandport' => serialize($ssl_ipandports),
'ipandport' => json_encode($ipandports),
'ssl_ipandport' => json_encode($ssl_ipandports),
'letsencrypt' => $letsencrypt,
'http2' => $http2,
'hsts_maxage' => $hsts_maxage,
@@ -1697,6 +1704,7 @@ if ($page == 'domains' || $page == 'overview') {
$mod_fcgid_starter != $result['mod_fcgid_starter'] ||
$mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] ||
$specialsettings != $result['specialsettings'] ||
$notryfiles != $result['notryfiles'] ||
$aliasdomain != $result['aliasdomain'] ||
$issubof != $result['ismainbutsubto'] ||
$email_only != $result['email_only'] ||
@@ -1855,6 +1863,7 @@ if ($page == 'domains' || $page == 'overview') {
$update_data['mod_fcgid_starter'] = $mod_fcgid_starter;
$update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
$update_data['specialsettings'] = $specialsettings;
$update_data['notryfiles'] = $notryfiles;
$update_data['registration_date'] = $registration_date;
$update_data['termination_date'] = $termination_date;
$update_data['ismainbutsubto'] = $issubof;
@@ -1889,6 +1898,7 @@ if ($page == 'domains' || $page == 'overview') {
`mod_fcgid_starter` = :mod_fcgid_starter,
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests,
`specialsettings` = :specialsettings,
`notryfiles` = :notryfiles,
`registration_date` = :registration_date,
`termination_date` = :termination_date,
`ismainbutsubto` = :ismainbutsubto,
@@ -2017,7 +2027,15 @@ if ($page == 'domains' || $page == 'overview') {
} else
if ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
// or when wwwserveralias or letsencrypt was changed
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
if ($aliasdomain === 0) {
// in case the wwwserveralias is set on a main domain, $aliasdomain is 0
// --> the call just above to triggerLetsEncryptCSRForAliasDestinationDomain
// is a noop...let's repeat it with the domain id of the main domain
triggerLetsEncryptCSRForAliasDestinationDomain($id, $log);
}
}
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
@@ -2239,12 +2257,12 @@ if ($page == 'domains' || $page == 'overview') {
}
}
} elseif ($action == 'jqGetCustomerPHPConfigs') {
$customerid = intval($_POST['customerid']);
$allowed_phpconfigs = getCustomerDetail($customerid, 'allowed_phpconfigs');
echo !empty($allowed_phpconfigs) ? $allowed_phpconfigs : json_encode(array());
exit;
} elseif ($action == 'import') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {

View File

@@ -85,35 +85,42 @@ if ($page == 'overview') {
if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|| (isset($lookfornewversion) && $lookfornewversion == 'yes')
) {
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
$latestversion = HttpClient::urlGet($update_check_uri);
$latestversion = explode('|', $latestversion);
if (function_exists('curl_version')) {
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
$latestversion = HttpClient::urlGet($update_check_uri);
$latestversion = explode('|', $latestversion);
if (is_array($latestversion)
&& count($latestversion) >= 1
) {
$_version = $latestversion[0];
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
if (is_array($latestversion)
&& count($latestversion) >= 1
) {
$_version = $latestversion[0];
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
// add the branding so debian guys are not gettings confused
// about their version-number
$lookfornewversion_lable = $_version.$branding;
$lookfornewversion_link = $_link;
$lookfornewversion_addinfo = $_message;
// add the branding so debian guys are not gettings confused
// about their version-number
$lookfornewversion_lable = $_version.$branding;
$lookfornewversion_link = $_link;
$lookfornewversion_addinfo = $_message;
// not numeric -> error-message
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
// check for customized version to not output
// "There is a newer version of froxlor" besides the error-message
$isnewerversion = 2;
} elseif (version_compare2($version, $_version) == -1) {
$isnewerversion = 1;
// not numeric -> error-message
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
// check for customized version to not output
// "There is a newer version of froxlor" besides the error-message
$isnewerversion = 2;
} elseif (version_compare2($version, $_version) == -1) {
$isnewerversion = 1;
} else {
$isnewerversion = 0;
}
} else {
$isnewerversion = 0;
redirectTo($update_check_uri.'/pretty', NULL, false);
}
} else {
redirectTo($update_check_uri.'/pretty', NULL, false);
$lookfornewversion_lable = "Version-check not available due to missing php-curl extension";
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
$lookfornewversion_addinfo = '';
$isnewerversion = 0;
}
} else {
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];

View File

@@ -125,12 +125,35 @@ if ($page == 'overview') {
$fpm_reqtermtimeout = 0;
$fpm_reqslowtimeout = 0;
$fpm_pass_authorizationheader = 0;
$override_fpmconfig = 0;
$stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
$def_fpmconfig = Database::pexecute_first($stmt, array(
'id' => $fpm_config_id
));
$pm = $def_fpmconfig['pm'];
$max_children = $def_fpmconfig['max_children'];
$start_servers = $def_fpmconfig['start_servers'];
$min_spare_servers = $def_fpmconfig['min_spare_servers'];
$max_spare_servers = $def_fpmconfig['max_spare_servers'];
$max_requests = $def_fpmconfig['max_requests'];
$idle_timeout = $def_fpmconfig['idle_timeout'];
$limit_extensions = $def_fpmconfig['limit_extensions'];
} elseif (Settings::Get('phpfpm.enabled') == 1) {
$fpm_config_id = intval($_POST['fpmconfig']);
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int) $_POST['phpfpm_enable_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_pass_authorizationheader = isset($_POST['phpfpm_pass_authorizationheader']) ? (int) $_POST['phpfpm_pass_authorizationheader'] : 0;
$override_fpmconfig = isset($_POST['override_fpmconfig']) ? (int) $_POST['override_fpmconfig'] : 0;
$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]+)\ ?)+$/');
// disable fcgid stuff
$binary = '/usr/bin/php-cgi';
$file_extensions = 'php';
@@ -156,7 +179,16 @@ if ($page == 'overview') {
`fpm_reqslow` = :fpmreqslow,
`phpsettings` = :phpsettings,
`fpmsettingid` = :fpmsettingid,
`pass_authorizationheader` = :fpmpassauth");
`pass_authorizationheader` = :fpmpassauth,
`override_fpmconfig` = :ofc,
`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,
'binary' => $binary,
@@ -169,7 +201,16 @@ if ($page == 'overview') {
'fpmreqslow' => $fpm_reqslowtimeout,
'phpsettings' => $phpsettings,
'fpmsettingid' => $fpm_config_id,
'fpmpassauth' => $fpm_pass_authorizationheader
'fpmpassauth' => $fpm_pass_authorizationheader,
'ofc' => $override_fpmconfig,
'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);
@@ -190,6 +231,10 @@ if ($page == 'overview') {
$fpmconfigs .= makeoption($row['description'], $row['id'], 1, true, true);
}
$pm_select = makeoption('static', 'static', 'static', true, true);
$pm_select.= makeoption('dynamic', 'dynamic', 'static', true, true);
$pm_select.= makeoption('ondemand', 'ondemand', 'static', 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);
@@ -288,12 +333,35 @@ if ($page == 'overview') {
$fpm_reqtermtimeout = 0;
$fpm_reqslowtimeout = 0;
$fpm_pass_authorizationheader = 0;
$override_fpmconfig = 0;
$stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` WHERE `id` = :id");
$def_fpmconfig = Database::pexecute_first($stmt, array(
'id' => $fpm_config_id
));
$pm = $def_fpmconfig['pm'];
$max_children = $def_fpmconfig['max_children'];
$start_servers = $def_fpmconfig['start_servers'];
$min_spare_servers = $def_fpmconfig['min_spare_servers'];
$max_spare_servers = $def_fpmconfig['max_spare_servers'];
$max_requests = $def_fpmconfig['max_requests'];
$idle_timeout = $def_fpmconfig['idle_timeout'];
$limit_extensions = $def_fpmconfig['limit_extensions'];
} elseif (Settings::Get('phpfpm.enabled') == 1) {
$fpm_config_id = intval($_POST['fpmconfig']);
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int) $_POST['phpfpm_enable_slowlog'] : 0;
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
$fpm_pass_authorizationheader = isset($_POST['phpfpm_pass_authorizationheader']) ? (int) $_POST['phpfpm_pass_authorizationheader'] : 0;
$override_fpmconfig = isset($_POST['override_fpmconfig']) ? (int) $_POST['override_fpmconfig'] : $result['override_fpmconfig'];
$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]+)\ ?)+$/');
// disable fcgid stuff
$binary = '/usr/bin/php-cgi';
$file_extensions = 'php';
@@ -319,7 +387,16 @@ if ($page == 'overview') {
`fpm_reqslow` = :fpmreqslow,
`phpsettings` = :phpsettings,
`fpmsettingid` = :fpmsettingid,
`pass_authorizationheader` = :fpmpassauth
`pass_authorizationheader` = :fpmpassauth,
`override_fpmconfig` = :ofc,
`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,
@@ -334,6 +411,15 @@ if ($page == 'overview') {
'phpsettings' => $phpsettings,
'fpmsettingid' => $fpm_config_id,
'fpmpassauth' => $fpm_pass_authorizationheader,
'ofc' => $override_fpmconfig,
'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);
@@ -351,6 +437,10 @@ if ($page == 'overview') {
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
$fpmconfigs .= makeoption($row['description'], $row['id'], $result['fpmsettingid'], true, true);
}
$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);
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);

522
admin_plans.php Normal file
View File

@@ -0,0 +1,522 @@
<?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 Panel
*
*/
define('AREA', 'admin');
require './lib/init.php';
if (isset($_POST['id'])) {
$id = intval($_POST['id']);
} elseif (isset($_GET['id'])) {
$id = intval($_GET['id']);
}
if ($page == '' || $page == 'overview') {
if ($action == '') {
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_plans");
$fields = array(
'p.name' => $lng['admin']['plans']['name'],
'p.description' => $lng['admin']['plans']['description'],
'adminname' => $lng['admin']['admin'],
'p.ts' => $lng['admin']['plans']['last_update']
);
$paging = new paging($userinfo, TABLE_PANEL_PLANS, $fields);
$plans = '';
$result_stmt = Database::prepare("
SELECT p.*, a.loginname as adminname
FROM `" . TABLE_PANEL_PLANS . "` p, `" . TABLE_PANEL_ADMINS . "` a
WHERE " . ($userinfo['customers_see_all'] ? '' : " `p`.`adminid` = :adminid AND ") . "
`p`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
Database::pexecute($result_stmt, array(
'adminid' => $userinfo['adminid']
));
$paging->setEntries(Database::num_rows());
$sortcode = $paging->getHtmlSortCode($lng);
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
$searchcode = $paging->getHtmlSearchCode($lng);
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
$i = 0;
$count = 0;
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if ($paging->checkDisplay($i)) {
$row = htmlentities_array($row);
$row['ts_format'] = date("d.m.Y H:i", $row['ts']);
eval("\$plans.=\"" . getTemplate("plans/plans_plan") . "\";");
$count ++;
}
$i ++;
}
eval("echo \"" . getTemplate("plans/plans") . "\";");
} elseif ($action == 'delete' && $id != 0) {
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_PLANS . "` WHERE `id` = :id");
$result = Database::pexecute_first($result_stmt, array(
'id' => $id
));
if ($result['id'] != 0 && $result['id'] == $id && (int) $userinfo['adminid'] == $result['adminid']) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_PLANS . "` WHERE `id` = :id");
Database::pexecute($del_stmt, array(
'id' => $id
));
$log->logAction(ADM_ACTION, LOG_INFO, "Plan '" . $result['name'] . "' has been deleted by '" . $userinfo['loginname'] . "'");
redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else {
ask_yesno('plan_reallydelete', $filename, array(
'id' => $id,
'page' => $page,
'action' => $action
), $result['name']);
}
} else {
standard_error('nopermissionsorinvalidid');
}
} elseif ($action == 'add') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$name = validate($_POST['name'], 'name');
$description = validate(str_replace("\r\n", "\n", $_POST['description']), 'description', '/^[^\0]*$/');
$value_arr = array();
$value_arr['diskspace'] = intval_ressource($_POST['diskspace']);
if (isset($_POST['diskspace_ul'])) {
$value_arr['diskspace'] = - 1;
}
$value_arr['traffic'] = doubleval_ressource($_POST['traffic']);
if (isset($_POST['traffic_ul'])) {
$value_arr['traffic'] = - 1;
}
$value_arr['subdomains'] = intval_ressource($_POST['subdomains']);
if (isset($_POST['subdomains_ul'])) {
$value_arr['subdomains'] = - 1;
}
$value_arr['emails'] = intval_ressource($_POST['emails']);
if (isset($_POST['emails_ul'])) {
$value_arr['emails'] = - 1;
}
$value_arr['email_accounts'] = intval_ressource($_POST['email_accounts']);
if (isset($_POST['email_accounts_ul'])) {
$value_arr['email_accounts'] = - 1;
}
$value_arr['email_forwarders'] = intval_ressource($_POST['email_forwarders']);
if (isset($_POST['email_forwarders_ul'])) {
$value_arr['email_forwarders'] = - 1;
}
if (Settings::Get('system.mail_quota_enabled') == '1') {
$value_arr['email_quota'] = validate($_POST['email_quota'], 'email_quota', '/^\d+$/', 'vmailquotawrong', array(
'0',
''
));
if (isset($_POST['email_quota_ul'])) {
$value_arr['email_quota'] = - 1;
}
} else {
$value_arr['email_quota'] = - 1;
}
$value_arr['email_imap'] = 0;
if (isset($_POST['email_imap'])) {
$value_arr['email_imap'] = intval_ressource($_POST['email_imap']);
}
$value_arr['email_pop3'] = 0;
if (isset($_POST['email_pop3'])) {
$value_arr['email_pop3'] = intval_ressource($_POST['email_pop3']);
}
$value_arr['ftps'] = intval_ressource($_POST['ftps']);
if (isset($_POST['ftps_ul'])) {
$value_arr['ftps'] = - 1;
}
$value_arr['tickets'] = (Settings::Get('ticket.enabled') == 1 ? intval_ressource($_POST['tickets']) : 0);
if (isset($_POST['tickets_ul']) && Settings::Get('ticket.enabled') == '1') {
$value_arr['tickets'] = - 1;
}
$value_arr['mysqls'] = intval_ressource($_POST['mysqls']);
if (isset($_POST['mysqls_ul'])) {
$value_arr['mysqls'] = - 1;
}
$value_arr['phpenabled'] = 0;
if (isset($_POST['phpenabled'])) {
$value_arr['phpenabled'] = intval($_POST['phpenabled']);
}
$value_arr['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);
$value_arr['allowed_phpconfigs'][] = $allowed_phpconfig;
}
}
$value_arr['perlenabled'] = 0;
if (isset($_POST['perlenabled'])) {
$value_arr['perlenabled'] = intval($_POST['perlenabled']);
}
$value_arr['dnsenabled'] = 0;
if (isset($_POST['dnsenabled'])) {
$value_arr['dnsenabled'] = intval($_POST['dnsenabled']);
}
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_PLANS . "`
SET `adminid` = :adminid, `name` = :name, `description` = :desc, `value` = :valuearr, `ts` = UNIX_TIMESTAMP();
");
$ins_data = array(
'adminid' => $userinfo['adminid'],
'name' => $name,
'desc' => $description,
'valuearr' => json_encode($value_arr)
);
Database::pexecute($ins_stmt, $ins_data);
$log->logAction(ADM_ACTION, LOG_WARNING, "added plan '" . $name . "'");
redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else {
$diskspace_ul = makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$traffic_ul = makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$subdomains_ul = makecheckbox('subdomains_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$emails_ul = makecheckbox('emails_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$email_accounts_ul = makecheckbox('email_accounts_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$email_forwarders_ul = makecheckbox('email_forwarders_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$email_quota_ul = makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
$mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', 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']
);
}
}
// dummy to avoid unknown variables
$language_options = null;
$gender_options = null;
$hosting_plans = null;
$plans_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_add.php';
$cust_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_add.php';
// unset unneeded stuff
unset($cust_add_data['customer_add']['sections']['section_a']);
unset($cust_add_data['customer_add']['sections']['section_b']);
unset($cust_add_data['customer_add']['sections']['section_cpre']);
// merge
$plans_add_data['plans_add']['sections'] = array_merge($plans_add_data['plans_add']['sections'], $cust_add_data['customer_add']['sections']);
$plans_add_form = htmlform::genHTMLForm($plans_add_data);
$title = $plans_add_data['plans_add']['title'];
$image = $plans_add_data['plans_add']['image'];
eval("echo \"" . getTemplate("plans/plans_add") . "\";");
}
} elseif ($action == 'edit' && $id != 0) {
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_PLANS . "` WHERE `id` = :id");
$result = Database::pexecute_first($result_stmt, array(
'id' => $id
));
if ($result['name'] != '') {
$result['value'] = json_decode($result['value'], true);
$result = htmlentities_array($result);
foreach ($result['value'] as $index => $value) {
$result[$index] = $value;
}
$result['allowed_phpconfigs'] = json_encode($result['allowed_phpconfigs']);
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$name = validate($_POST['name'], 'name');
$description = validate(str_replace("\r\n", "\n", $_POST['description']), 'description', '/^[^\0]*$/');
$value_arr = array();
$value_arr['diskspace'] = intval_ressource($_POST['diskspace']);
if (isset($_POST['diskspace_ul'])) {
$value_arr['diskspace'] = - 1;
}
$value_arr['traffic'] = doubleval_ressource($_POST['traffic']);
if (isset($_POST['traffic_ul'])) {
$value_arr['traffic'] = - 1;
}
$value_arr['subdomains'] = intval_ressource($_POST['subdomains']);
if (isset($_POST['subdomains_ul'])) {
$value_arr['subdomains'] = - 1;
}
$value_arr['emails'] = intval_ressource($_POST['emails']);
if (isset($_POST['emails_ul'])) {
$value_arr['emails'] = - 1;
}
$value_arr['email_accounts'] = intval_ressource($_POST['email_accounts']);
if (isset($_POST['email_accounts_ul'])) {
$value_arr['email_accounts'] = - 1;
}
$value_arr['email_forwarders'] = intval_ressource($_POST['email_forwarders']);
if (isset($_POST['email_forwarders_ul'])) {
$value_arr['email_forwarders'] = - 1;
}
if (Settings::Get('system.mail_quota_enabled') == '1') {
$value_arr['email_quota'] = validate($_POST['email_quota'], 'email_quota', '/^\d+$/', 'vmailquotawrong', array(
'0',
''
));
if (isset($_POST['email_quota_ul'])) {
$value_arr['email_quota'] = - 1;
}
} else {
$value_arr['email_quota'] = - 1;
}
$value_arr['email_imap'] = 0;
if (isset($_POST['email_imap'])) {
$value_arr['email_imap'] = intval_ressource($_POST['email_imap']);
}
$value_arr['email_pop3'] = 0;
if (isset($_POST['email_pop3'])) {
$value_arr['email_pop3'] = intval_ressource($_POST['email_pop3']);
}
$value_arr['ftps'] = intval_ressource($_POST['ftps']);
if (isset($_POST['ftps_ul'])) {
$value_arr['ftps'] = - 1;
}
$value_arr['tickets'] = (Settings::Get('ticket.enabled') == 1 ? intval_ressource($_POST['tickets']) : 0);
if (isset($_POST['tickets_ul']) && Settings::Get('ticket.enabled') == '1') {
$value_arr['tickets'] = - 1;
}
$value_arr['mysqls'] = intval_ressource($_POST['mysqls']);
if (isset($_POST['mysqls_ul'])) {
$value_arr['mysqls'] = - 1;
}
$value_arr['phpenabled'] = 0;
if (isset($_POST['phpenabled'])) {
$value_arr['phpenabled'] = intval($_POST['phpenabled']);
}
$value_arr['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);
$value_arr['allowed_phpconfigs'][] = $allowed_phpconfig;
}
}
$value_arr['perlenabled'] = 0;
if (isset($_POST['perlenabled'])) {
$value_arr['perlenabled'] = intval($_POST['perlenabled']);
}
$value_arr['dnsenabled'] = 0;
if (isset($_POST['dnsenabled'])) {
$value_arr['dnsenabled'] = intval($_POST['dnsenabled']);
}
$ins_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_PLANS . "`
SET `name` = :name, `description` = :desc, `value` = :valuearr, `ts` = UNIX_TIMESTAMP()
WHERE `id` = :id
");
$ins_data = array(
'name' => $name,
'desc' => $description,
'valuearr' => json_encode($value_arr),
'id' => $id
);
Database::pexecute($ins_stmt, $ins_data);
$log->logAction(ADM_ACTION, LOG_WARNING, "updated plan '" . $name . "'");
redirectTo($filename, array(
'page' => $page,
's' => $s
));
} else {
$diskspace_ul = makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
if ($result['diskspace'] == '-1') {
$result['diskspace'] = '';
}
$traffic_ul = makecheckbox('traffic_ul', $lng['customer']['unlimited'], '-1', false, $result['traffic'], true, true);
if ($result['traffic'] == '-1') {
$result['traffic'] = '';
}
$subdomains_ul = makecheckbox('subdomains_ul', $lng['customer']['unlimited'], '-1', false, $result['subdomains'], true, true);
if ($result['subdomains'] == '-1') {
$result['subdomains'] = '';
}
$emails_ul = makecheckbox('emails_ul', $lng['customer']['unlimited'], '-1', false, $result['emails'], true, true);
if ($result['emails'] == '-1') {
$result['emails'] = '';
}
$email_accounts_ul = makecheckbox('email_accounts_ul', $lng['customer']['unlimited'], '-1', false, $result['email_accounts'], true, true);
if ($result['email_accounts'] == '-1') {
$result['email_accounts'] = '';
}
$email_forwarders_ul = makecheckbox('email_forwarders_ul', $lng['customer']['unlimited'], '-1', false, $result['email_forwarders'], true, true);
if ($result['email_forwarders'] == '-1') {
$result['email_forwarders'] = '';
}
$email_quota_ul = makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, $result['email_quota'], true, true);
if ($result['email_quota'] == '-1') {
$result['email_quota'] = '';
}
$ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true);
if ($result['ftps'] == '-1') {
$result['ftps'] = '';
}
$tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true);
if ($result['tickets'] == '-1') {
$result['tickets'] = '';
}
$mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true);
if ($result['mysqls'] == '-1') {
$result['mysqls'] = '';
}
$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']
);
}
}
$result['imap'] = $result['email_imap'];
$result['pop3'] = $result['email_pop3'];
// dummy to avoid unknown variables
$result['loginname'] = null;
$result['documentroot'] = null;
$result['standardsubdomain'] = null;
$result['deactivated'] = null;
$language_options = null;
$result['firstname'] = null;
$gender_options = null;
$result['company'] = null;
$result['street'] = null;
$result['zipcode'] = null;
$result['city'] = null;
$result['phone'] = null;
$result['fax'] = null;
$result['email'] = null;
$result['customernumber'] = null;
$result['custom_notes'] = null;
$result['custom_notes_show'] = null;
$hosting_plans = null;
$admin_select_cnt = null;
$admin_select = null;
$plans_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_edit.php';
$cust_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php';
// unset unneeded stuff
unset($cust_edit_data['customer_edit']['sections']['section_a']);
unset($cust_edit_data['customer_edit']['sections']['section_b']);
unset($cust_edit_data['customer_edit']['sections']['section_cpre']);
// merge
$plans_edit_data['plans_edit']['sections'] = array_merge($plans_edit_data['plans_edit']['sections'], $cust_edit_data['customer_edit']['sections']);
$plans_edit_form = htmlform::genHTMLForm($plans_edit_data);
$title = $plans_edit_data['plans_edit']['title'];
$image = $plans_edit_data['plans_edit']['image'];
eval("echo \"" . getTemplate("plans/plans_edit") . "\";");
}
}
} elseif ($action == 'jqGetPlanValues') {
$planid = isset($_POST['planid']) ? (int)$_POST['planid'] : 0;
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_PLANS . "` WHERE `id` = :id");
$result = Database::pexecute_first($result_stmt, array(
'id' => $planid
));
echo $result['value'];
exit;
}
}

View File

@@ -319,6 +319,12 @@ elseif ($page == 'importexport' && $userinfo['change_serversettings'] == '1')
} catch(Exception $e) {
dynamic_error($e->getMessage());
}
inserttask('1');
inserttask('10');
// Using nameserver, insert a task which rebuilds the server config
inserttask('4');
// cron.d file
inserttask('99');
standard_success('settingsimported', '', array('filename' => 'admin_settings.php'));
}
dynamic_error("Upload failed");

View File

@@ -773,7 +773,15 @@ if ($page == 'overview') {
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
} elseif ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
// or when wwwserveralias or letsencrypt was changed
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
if ($aliasdomain === 0) {
// in case the wwwserveralias is set on a main domain, $aliasdomain is 0
// --> the call just above to triggerLetsEncryptCSRForAliasDestinationDomain
// is a noop...let's repeat it with the domain id of the main domain
triggerLetsEncryptCSRForAliasDestinationDomain($id, $log);
}
}
// check whether LE has been disabled, so we remove the certificate

View File

@@ -563,7 +563,7 @@ if ($page == 'overview') {
$existing_backupJob = null;
while ($entry = $sel_stmt->fetch())
{
$data = unserialize($entry['data']);
$data = json_decode($entry['data'], true);
if ($data['customerid'] == $userinfo['customerid']) {
$existing_backupJob = $entry;
break;
@@ -579,6 +579,11 @@ if ($page == 'overview') {
$path = makeCorrectDir(validate($_POST['path'], 'path'));
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
// path cannot be the customers docroot
if ($path == makeCorrectDir($userinfo['documentroot'])) {
standard_error('backupfoldercannotbedocroot');
}
$backup_dbs = isset($_POST['backup_dbs']) ? intval($_POST['backup_dbs']) : 0;
$backup_mail = isset($_POST['backup_mail']) ? intval($_POST['backup_mail']) : 0;
$backup_web = isset($_POST['backup_web']) ? intval($_POST['backup_web']) : 0;
@@ -613,7 +618,7 @@ if ($page == 'overview') {
if (!empty($existing_backupJob)) {
$action = "abort";
$row = unserialize($entry['data']);
$row = json_decode($entry['data'], true);
$row['path'] = makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['destdir']));
$row['backup_web'] = ($row['backup_web'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no'];
$row['backup_mail'] = ($row['backup_mail'] == '1') ? $lng['panel']['yes'] : $lng['panel']['no'];

View File

@@ -238,7 +238,11 @@ if ($page == 'overview') {
}
} elseif ($action == 'answer' && $id != 0) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$replyticket = ticket::getInstanceOf($userinfo, -1);
try {
$replyticket = ticket::getInstanceOf($userinfo, -1);
} catch(Exception $e) {
standard_error($e->getMessage());
}
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
$replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
@@ -246,6 +250,11 @@ if ($page == 'overview') {
if ($replyticket->Get('message') == null) {
standard_error(array('stringisempty', 'mymessage'));
} else {
try {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
} catch(Exception $e) {
standard_error($e->getMessage());
}
$now = time();
$replyticket->Set('customer', (int)$userinfo['customerid'], true, true);
$replyticket->Set('lastchange', $now, true, true);
@@ -256,8 +265,6 @@ if ($page == 'overview') {
$replyticket->Insert();
// Update priority if changed
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
if ($replyticket->Get('priority') != $mainticket->Get('priority')) {
$mainticket->Set('priority', $replyticket->Get('priority'), true);
}
@@ -272,7 +279,11 @@ if ($page == 'overview') {
}
} else {
$ticket_replies = '';
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
try {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
} catch(Exception $e) {
standard_error($e->getMessage());
}
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
@@ -351,7 +362,11 @@ if ($page == 'overview') {
} elseif ($action == 'close' && $id != 0) {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$now = time();
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
try {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
} catch(Exception $e) {
standard_error($e->getMessage());
}
$mainticket->Set('lastchange', $now, true, true);
$mainticket->Set('lastreplier', '0', true, true);
$mainticket->Set('status', '3', true, true);
@@ -359,7 +374,11 @@ if ($page == 'overview') {
$log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'");
redirectTo($filename, array('page' => $page, 's' => $s));
} else {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
try {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
} catch(Exception $e) {
standard_error($e->getMessage());
}
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
}
} elseif ($action == 'reopen' && $id != 0) {
@@ -377,7 +396,11 @@ if ($page == 'overview') {
}
$now = time();
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
try {
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
} catch(Exception $e) {
standard_error($e->getMessage());
}
$mainticket->Set('lastchange', $now, true, true);
$mainticket->Set('lastreplier', '0', true, true);
$mainticket->Set('status', '0', true, true);

View File

@@ -208,7 +208,7 @@ if ($action == 'add_record' && ! empty($_POST)) {
// check for duplicate
foreach ($dom_entries as $existing_entry) {
// compare serialized string of array
// compare json-encoded string of array
$check_entry = $existing_entry;
// new entry has no ID yet
unset($check_entry['id']);
@@ -218,9 +218,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
$check_entry['prio'] = (int) $check_entry['prio'];
$check_entry['ttl'] = (int) $check_entry['ttl'];
$check_entry['domain_id'] = (int) $check_entry['domain_id'];
// serialize both
$check_entry = serialize($check_entry);
$new = serialize($new_entry);
// encode both
$check_entry = json_encode($check_entry);
$new = json_encode($new_entry);
// compare
if ($check_entry === $new) {
$errors[] = $lng['error']['dns_duplicate_entry'];

View File

@@ -198,6 +198,7 @@ CREATE TABLE `panel_customers` (
`lepublickey` mediumtext default NULL,
`leprivatekey` mediumtext default NULL,
`leregistered` tinyint(1) NOT NULL default '0',
`leaccount` varchar(255) default '',
`allowed_phpconfigs` varchar(500) NOT NULL default '',
PRIMARY KEY (`customerid`),
UNIQUE KEY `loginname` (`loginname`)
@@ -260,6 +261,7 @@ CREATE TABLE `panel_domains` (
`hsts_preload` tinyint(1) NOT NULL default '0',
`ocsp_stapling` tinyint(1) DEFAULT '0',
`http2` tinyint(1) DEFAULT '0',
`notryfiles` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `customerid` (`customerid`),
KEY `parentdomain` (`parentdomainid`),
@@ -279,11 +281,11 @@ CREATE TABLE `panel_ipsandports` (
`vhostcontainer_servername_statement` tinyint(1) NOT NULL default '0',
`specialsettings` text,
`ssl` tinyint(4) NOT NULL default '0',
`ssl_cert_file` varchar(255) NOT NULL,
`ssl_key_file` varchar(255) NOT NULL,
`ssl_ca_file` varchar(255) NOT NULL,
`ssl_cert_file` varchar(255) NOT NULL default '',
`ssl_key_file` varchar(255) NOT NULL default '',
`ssl_ca_file` varchar(255) NOT NULL default '',
`default_vhostconf_domain` text,
`ssl_cert_chainfile` varchar(255) NOT NULL,
`ssl_cert_chainfile` varchar(255) NOT NULL default '',
`docroot` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `ip_port` (`ip`,`port`)
@@ -404,21 +406,12 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
('login', 'maxloginattempts', '3'),
('login', 'deactivatetime', '900'),
('phpfpm', 'enabled', '0'),
('phpfpm', 'configdir', '/etc/php-fpm.d/'),
('phpfpm', 'reload', '/etc/init.d/php-fpm restart'),
('phpfpm', 'pm', 'static'),
('phpfpm', 'max_children', '1'),
('phpfpm', 'start_servers', '20'),
('phpfpm', 'min_spare_servers', '5'),
('phpfpm', 'max_spare_servers', '35'),
('phpfpm', 'max_requests', '0'),
('phpfpm', 'tmpdir', '/var/customers/tmp/'),
('phpfpm', 'peardir', '/usr/share/php/:/usr/share/php5/'),
('phpfpm', 'envpath', '/usr/local/bin:/usr/bin:/bin'),
('phpfpm', 'enabled_ownvhost', '0'),
('phpfpm', 'vhost_httpuser', 'froxlorlocal'),
('phpfpm', 'vhost_httpgroup', 'froxlorlocal'),
('phpfpm', 'idle_timeout', '30'),
('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'),
('phpfpm', 'defaultini', '1'),
('phpfpm', 'vhost_defaultini', '2'),
@@ -541,7 +534,7 @@ opcache.interned_strings_buffer'),
('system', 'defaultip', '1'),
('system', 'phpappendopenbasedir', '/tmp/'),
('system', 'deactivateddocroot', ''),
('system', 'mailpwcleartext', '1'),
('system', 'mailpwcleartext', '0'),
('system', 'last_tasks_run', '000000'),
('system', 'nameservers', ''),
('system', 'mxservers', ''),
@@ -652,9 +645,14 @@ opcache.interned_strings_buffer'),
('system', 'hsts_incsub', '0'),
('system', 'hsts_preload', '0'),
('system', 'leregistered', '0'),
('system', 'leaccount', ''),
('system', 'nssextrausers', '0'),
('system', 'disable_le_selfcheck', '0'),
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
('system', 'logfiles_format', ''),
('system', 'logfiles_type', '1'),
('system', 'logfiles_piped', '0'),
('system', 'logfiles_script', ''),
('panel', 'decimal_places', '4'),
('panel', 'adminmail', 'admin@SERVERNAME'),
('panel', 'phpmyadmin_url', ''),
@@ -686,8 +684,8 @@ opcache.interned_strings_buffer'),
('panel', 'password_special_char_required', '0'),
('panel', 'password_special_char', '!?<>§$%+#=@'),
('panel', 'customer_hide_options', ''),
('panel', 'version', '0.9.39.1'),
('panel', 'db_version', '201801260');
('panel', 'version', '0.9.40.1'),
('panel', 'db_version', '201809280');
DROP TABLE IF EXISTS `panel_tasks`;
@@ -895,6 +893,15 @@ CREATE TABLE `panel_phpconfigs` (
`phpsettings` text NOT NULL,
`fpmsettingid` int(11) NOT NULL DEFAULT '1',
`pass_authorizationheader` tinyint(1) NOT NULL default '0',
`override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0',
`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`),
KEY `fpmsettingid` (`fpmsettingid`)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
@@ -998,11 +1005,12 @@ DROP TABLE IF EXISTS `domain_ssl_settings`;
CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
`id` int(5) NOT NULL auto_increment,
`domainid` int(11) NOT NULL,
`ssl_cert_file` mediumtext NOT NULL,
`ssl_key_file` mediumtext NOT NULL,
`ssl_cert_file` mediumtext,
`ssl_key_file` mediumtext,
`ssl_ca_file` mediumtext,
`ssl_cert_chainfile` mediumtext,
`ssl_csr_file` mediumtext,
`ssl_fullchain_file` mediumtext,
`expirationdate` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
@@ -1028,3 +1036,16 @@ CREATE TABLE `domain_dns_entries` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
DROP TABLE IF EXISTS `panel_plans`;
CREATE TABLE `panel_plans` (
`id` int(11) NOT NULL auto_increment,
`adminid` int(11) NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`value` longtext NOT NULL,
`ts` int(15) NOT NULL default '0',
PRIMARY KEY (id),
KEY adminid (adminid)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;

View File

@@ -322,11 +322,12 @@ class FroxlorInstall
$userdata .= "?>";
// test if we can store the userdata.inc.php in ../lib
if ($fp = @fopen(dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php', 'w')) {
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
if ($fp = @fopen($userdata_file, 'w')) {
$result = @fputs($fp, $userdata, strlen($userdata));
@fclose($fp);
$content .= $this->_status_message('green', 'OK');
chmod('../lib/userdata.inc.php', 0440);
chmod($userdata_file, 0440);
} elseif ($fp = @fopen('/tmp/userdata.inc.php', 'w')) {
$result = @fputs($fp, $userdata, strlen($userdata));
@fclose($fp);
@@ -963,83 +964,39 @@ class FroxlorInstall
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for session-extension
$this->_requirementCheckFor($content, $_die, 'session', false, 'phpsession');
// check for ctype-extension
$this->_requirementCheckFor($content, $_die, 'ctype', false, 'phpctype');
// check for SimpleXML-extension
$this->_requirementCheckFor($content, $_die, 'simplexml', false, 'phpsimplexml');
// check for xml-extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpxml']);
if (! extension_loaded('xml')) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
$this->_requirementCheckFor($content, $_die, 'xml', false, 'phpxml');
// check for filter-extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpfilter']);
if (! extension_loaded('filter')) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
$this->_requirementCheckFor($content, $_die, 'filter', false, 'phpfilter');
// check for posix-extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpposix']);
if (! extension_loaded('posix')) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for bstring-extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
if (! extension_loaded('mbstring')) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
$this->_requirementCheckFor($content, $_die, 'posix', false, 'phpposix');
// check for mbstring-extension
$this->_requirementCheckFor($content, $_die, 'mbstring', false, 'phpmbstring');
// check for curl extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpcurl']);
if (! extension_loaded('curl')) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for bcmath extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
if (! extension_loaded('bcmath')) {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['bcmathdescription']);
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
// check for zip extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpzip']);
if (! extension_loaded('zip')) {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['zipdescription']);
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
$this->_requirementCheckFor($content, $_die, 'curl', false, 'phpcurl');
// check for json extension
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpjson']);
$this->_requirementCheckFor($content, $_die, 'json', false, 'phpjson');
// check for bcmath extension
$this->_requirementCheckFor($content, $_die, 'bcmath', true, 'phpbcmath', 'bcmathdescription');
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 zip extension
$this->_requirementCheckFor($content, $_die, 'zip', true, 'phpzip', 'zipdescription');
// check for open_basedir
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
@@ -1049,6 +1006,16 @@ class FroxlorInstall
} else {
$content .= $this->_status_message('green', 'off');
}
// check for mysqldump binary in order to backup existing database
$content .= $this->_status_message('begin', $this->_lng['requirements']['mysqldump']);
if (file_exists("/usr/bin/mysqldump") || file_exists("/usr/local/bin/mysqldump")) {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
} else {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['mysqldumpmissing']);
}
$content .= "</table>";
// check if we have unrecoverable errors
@@ -1071,6 +1038,22 @@ class FroxlorInstall
'pagenavigation' => $navigation
);
}
private function _requirementCheckFor(&$content, &$_die, $ext = '', $optional = false, $lng_txt = "", $lng_desc = "")
{
$content .= $this->_status_message('begin', $this->_lng['requirements'][$lng_txt]);
if (! extension_loaded($ext)) {
if (!$optional) {
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
$_die = true;
} else {
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements'][$lng_desc]);
}
} else {
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
}
}
/**
* send no-caching headers and set the default timezone
@@ -1139,12 +1122,24 @@ class FroxlorInstall
}
}
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
// require english base language as fallback
$lngfile = $this->_basepath . '/install/lng/' . $standardlanguage . '.lng.php';
if (file_exists($lngfile)) {
// includes file /lng/$language.lng.php if it exists
require $lngfile;
$this->_lng = $lng;
}
// require chosen language if not english
if ($this->_activelng != $standardlanguage)
{
$lngfile = $this->_basepath . '/install/lng/' . $this->_activelng . '.lng.php';
if (file_exists($lngfile)) {
// includes file /lng/$language.lng.php if it exists
require $lngfile;
$this->_lng = $lng;
}
}
}
/**

View File

@@ -28,6 +28,9 @@ $lng['requirements']['newerphpprefered'] = 'Good, but php-5.6 is prefered.';
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime...';
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'PHP setting "magic_quotes_runtime" must be set to "Off". We have disabled it temporary for now please fix the coresponding php.ini.';
$lng['requirements']['phppdo'] = 'PHP PDO extension and PDO-MySQL driver...';
$lng['requirements']['phpsession'] = 'PHP session-extension...';
$lng['requirements']['phpctype'] = 'PHP ctype-extension...';
$lng['requirements']['phpsimplexml'] = 'PHP SimpleXML-extension...';
$lng['requirements']['phpxml'] = 'PHP XML-extension...';
$lng['requirements']['phpfilter'] = 'PHP filter-extension...';
$lng['requirements']['phpposix'] = 'PHP posix-extension...';
@@ -38,9 +41,10 @@ $lng['requirements']['phpzip'] = 'PHP zip-extension...';
$lng['requirements']['phpjson'] = 'PHP json-extension...';
$lng['requirements']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
$lng['requirements']['zipdescription'] = 'The auto-update feature requires the zip extension.';
$lng['requirements']['jsondescription'] = 'The settings import/export feature requires the json extension.';
$lng['requirements']['openbasedir'] = 'open_basedir...';
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the coresponding php.ini';
$lng['requirements']['mysqldump'] = 'MySQL dump tool';
$lng['requirements']['mysqldumpmissing'] = 'Automatic backup of possible existing database is not possible. Please install mysql-client tools';
$lng['requirements']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Try to fix them and retry.';
$lng['requirements']['froxlor_succ_checks'] = 'All requirements are satisfied';

View File

@@ -28,6 +28,9 @@ $lng['requirements']['newerphpprefered'] = 'Passt, aber php-5.6 wird bevorzugt.'
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime';
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'Die PHP Einstellung "magic_quotes_runtime" muss deaktiviert sein ("Off"). Die Einstellung wurde temporär deaktiviert, bitte ändern Sie diese in der entsprechenden php.ini.';
$lng['requirements']['phppdo'] = 'PHP PDO Erweiterung und PDO-MySQL Treiber...';
$lng['requirements']['phpsession'] = 'PHP session-Erweiterung...';
$lng['requirements']['phpctype'] = 'PHP ctype-Erweiterung...';
$lng['requirements']['phpsimplexml'] = 'PHP SimpleXML-Erweiterung...';
$lng['requirements']['phpxml'] = 'PHP XML-Erweiterung...';
$lng['requirements']['phpfilter'] = 'PHP filter-Erweiterung...';
$lng['requirements']['phpposix'] = 'PHP posix-Erweiterung...';
@@ -38,9 +41,10 @@ $lng['requirements']['phpzip'] = 'PHP zip-Erweiterung...';
$lng['requirements']['phpjson'] = 'PHP json-Erweiterung...';
$lng['requirements']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
$lng['requirements']['zipdescription'] = 'Die Auto-Update Funktion benötigt die zip Erweiterung.';
$lng['requirements']['jsondescription'] = 'Die Einstellungen Import/Export Funktion benötigt die json Erweiterung.';
$lng['requirements']['openbasedir'] = 'open_basedir genutzt wird...';
$lng['requirements']['openbasedirenabled'] = 'Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor in der entsprechenden php.ini';
$lng['requirements']['mysqldump'] = 'MySQL dump Tool';
$lng['requirements']['mysqldumpmissing'] = 'Ein automatisches Backup einer möglicherweise schon existierenden Datenbank nicht möglich. Bitte mysql-client installieren';
$lng['requirements']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Beheben Sie die angezeigten Probleme und versuchen Sie es erneut.';
$lng['requirements']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erfüllt';

View File

@@ -0,0 +1,489 @@
#!/usr/bin/php
<?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 Froxlor team <team@froxlor.org> (2018-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*/
// Check if we're in the CLI
if (@php_sapi_name() !== 'cli') {
die('This script will only work in the shell.');
}
require dirname(dirname(__DIR__)) . '/lib/classes/output/class.CmdLineHandler.php';
class ConfigServicesCmd extends CmdLineHandler
{
/**
* list of valid switches
*
* @var array
*/
public static $switches = array(
'h'
);
/**
* list of valid parameters
*
* @var array
*/
public static $params = array(
'create',
'apply',
'import-settings',
'daemon',
'list-daemons',
'froxlor-dir',
'help'
);
public static $action_class = 'Action';
public static function printHelp()
{
self::println("");
self::println("Help / command line parameters:");
self::println("");
// commands
self::println("--create\t\tlets you create a services list configuration for the 'apply' command");
self::println("");
self::println("--apply\t\t\tconfigure your services by given configuration file. To create one run the --create command");
self::println("\t\t\tExample: --apply=/path/to/my-config.json or --apply=http://domain.tld/my-config.json");
self::println("");
self::println("--list-daemons\t\tOutput the services that are going to be configured using a given config file. No services will be configured.");
self::println("\t\t\tExample: --apply=/path/to/my-config.json --list-daemons");
self::println("");
self::println("--daemon\t\tWhen running --apply you can specify a daemon. This will be the only service that gets configured");
self::println("\t\t\tExample: --apply=/path/to/my-config.json --daemon=apache24");
self::println("");
self::println("--import-settings\tImport settings from another froxlor installation. This should be done prior to running --apply or alternatively in the same command together.");
self::println("\t\t\tExample: --import-settings=/path/to/Froxlor_settings-[version]-[dbversion]-[date].json or --import-settings=http://domain.tld/Froxlor_settings-[version]-[dbversion]-[date].json");
self::println("");
self::println("--froxlor-dir\t\tpath to froxlor installation");
self::println("\t\t\tExample: --froxlor-dir=/var/www/froxlor/");
self::println("");
self::println("--help\t\t\tshow help screen (this)");
self::println("");
// switches
// self::println("-d\t\t\tenable debug output");
self::println("-h\t\t\tsame as --help");
self::println("");
die(); // end of execution
}
}
class Action
{
private $_args = null;
private $_name = null;
private $_db = null;
public function __construct($args)
{
$this->_args = $args;
$this->_validate();
}
public function getActionName()
{
return $this->_name;
}
/**
* validates the parsed command line parameters
*
* @throws Exception
*/
private function _validate()
{
$this->_checkConfigParam(true);
$this->_parseConfig();
require FROXLOR_INSTALL_DIR . '/lib/tables.inc.php';
require FROXLOR_INSTALL_DIR . '/lib/functions.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/settings/class.Settings.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/settings/class.SImExporter.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/config/class.ConfigParser.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/config/class.ConfigService.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/config/class.ConfigDaemon.php';
if (array_key_exists("import-settings", $this->_args)) {
$this->_importSettings();
}
if (array_key_exists("create", $this->_args)) {
$this->_createConfig();
} elseif (array_key_exists("apply", $this->_args)) {
$this->_applyConfig();
} elseif (array_key_exists("list-daemons", $this->_args) || array_key_exists("daemon", $this->_args)) {
CmdLineHandler::printwarn("--list-daemons and --daemon only work together with --apply");
}
}
private function _importSettings()
{
if (strtoupper(substr($this->_args["import-settings"], 0, 4)) == 'HTTP') {
echo "Settings file seems to be an URL, trying to download" . PHP_EOL;
$target = "/tmp/froxlor-import-settings-" . time() . ".json";
if (@file_exists($target)) {
@unlink($target);
}
$this->downloadFile($this->_args["import-settings"], $target);
$this->_args["import-settings"] = $target;
}
if (! is_file($this->_args["import-settings"])) {
throw new Exception("Given settings file is not a file");
} elseif (! file_exists($this->_args["import-settings"])) {
throw new Exception("Given settings file cannot be found ('" . $this->_args["import-settings"] . "')");
} elseif (! is_readable($this->_args["import-settings"])) {
throw new Exception("Given settings file cannot be read ('" . $this->_args["import-settings"] . "')");
}
$imp_content = file_get_contents($this->_args["import-settings"]);
SImExporter::import($imp_content);
CmdLineHandler::printsucc("Successfully imported settings from '" . $this->_args["import-settings"] . "'");
}
private function _createConfig()
{
$_daemons_config = array(
'distro' => ""
);
$config_dir = FROXLOR_INSTALL_DIR . '/lib/configfiles/';
// show list of available distro's
$distros = glob($config_dir . '*.xml');
// tmp array
$distributions_select_data = array();
// read in all the distros
foreach ($distros as $_distribution) {
// get configparser object
$dist = new ConfigParser($_distribution);
// get distro-info
$dist_display = $this->getCompleteDistroName($dist);
// store in tmp array
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
}
// sort by distribution name
ksort($distributions_select_data);
// list all distributions
$mask = "|%-50.50s |%-50.50s |\n";
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
printf($mask, 'dist', 'name');
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
foreach ($distributions_select_data as $name => $filename) {
printf($mask, $filename, $name);
}
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
echo PHP_EOL;
while (! in_array($_daemons_config['distro'], $distributions_select_data)) {
$_daemons_config['distro'] = CmdLineHandler::getInput("choose distribution", "stretch");
}
// go through all services and let user check whether to include it or not
$configfiles = new ConfigParser($config_dir . '/' . $_daemons_config['distro'] . ".xml");
$services = $configfiles->getServices();
foreach ($services as $si => $service) {
echo PHP_EOL . "--- " . strtoupper($si) . " ---" . PHP_EOL . PHP_EOL;
$_daemons_config[$si] = "";
$daemons = $service->getDaemons();
$mask = "|%-50.50s |%-50.50s |\n";
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
printf($mask, 'value', 'name');
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
$default_daemon = "";
foreach ($daemons as $di => $dd) {
$title = $dd->title;
if ($dd->default) {
$default_daemon = $di;
$title = $title . " (default)";
}
printf($mask, $di, $title);
}
printf($mask, "x", "No " . $si);
$daemons['x'] = 'x';
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
echo PHP_EOL;
if ($si == 'system') {
$_daemons_config[$si] = array();
// for the system/other services we need a multiple choice possibility
CmdLineHandler::println("Select every service you need. Enter empty value when done");
$sysservice = "";
do {
$sysservice = CmdLineHandler::getInput("choose service");
if (! empty($sysservice)) {
$_daemons_config[$si][] = $sysservice;
}
} while (! empty($sysservice));
} else {
// for all others -> only one value
while (! array_key_exists($_daemons_config[$si], $daemons)) {
$_daemons_config[$si] = CmdLineHandler::getInput("choose service", $default_daemon);
}
}
}
echo PHP_EOL . PHP_EOL;
$daemons_config = json_encode($_daemons_config);
$output = CmdLineHandler::getInput("choose output-filename", "/tmp/froxlor-config-" . date('Ymd') . ".json");
file_put_contents($output, $daemons_config);
CmdLineHandler::printsucc("Successfully generated service-configfile '" . $output . "'");
}
private function getCompleteDistroName($cparser)
{
// get distro-info
$dist_display = $cparser->distributionName;
if ($cparser->distributionCodename != '') {
$dist_display .= " " . $cparser->distributionCodename;
}
if ($cparser->distributionVersion != '') {
$dist_display .= " (" . $cparser->distributionVersion . ")";
}
if ($cparser->deprecated) {
$dist_display .= " [deprecated]";
}
return $dist_display;
}
private function _applyConfig()
{
if (strtoupper(substr($this->_args["apply"], 0, 4)) == 'HTTP') {
echo "Config file seems to be an URL, trying to download" . PHP_EOL;
$target = "/tmp/froxlor-config-" . time() . ".json";
if (@file_exists($target)) {
@unlink($target);
}
$this->downloadFile($this->_args["apply"], $target);
$this->_args["apply"] = $target;
}
if (! is_file($this->_args["apply"])) {
throw new Exception("Given config file is not a file");
} elseif (! file_exists($this->_args["apply"])) {
throw new Exception("Given config file cannot be found ('" . $this->_args["apply"] . "')");
} elseif (! is_readable($this->_args["apply"])) {
throw new Exception("Given config file cannot be read ('" . $this->_args["apply"] . "')");
}
$config = file_get_contents($this->_args["apply"]);
$decoded_config = json_decode($config, true);
if (array_key_exists("list-daemons", $this->_args)) {
$mask = "|%-50.50s |%-50.50s |\n";
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
printf($mask, 'service', 'daemon');
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
foreach ($decoded_config as $service => $daemon) {
if (is_array($daemon) && count($daemon) > 0) {
foreach ($daemon as $sysdaemon) {
printf($mask, $service, $sysdaemon);
}
} else {
if ($daemon == 'x') {
$daemon = '--- skipped ---';
}
printf($mask, $service, $daemon);
}
}
printf($mask, str_repeat("-", 50), str_repeat("-", 50));
echo PHP_EOL;
exit();
}
$only_daemon = null;
if (array_key_exists("daemon", $this->_args)) {
$only_daemon = $this->_args['daemon'];
}
if (! empty($decoded_config)) {
$config_dir = FROXLOR_INSTALL_DIR . '/lib/configfiles/';
$configfiles = new ConfigParser($config_dir . '/' . $decoded_config['distro'] . ".xml");
$services = $configfiles->getServices();
$replace_arr = $this->_getReplacerArray();
foreach ($services as $si => $service) {
echo PHP_EOL . "--- Configuring: " . strtoupper($si) . " ---" . PHP_EOL . PHP_EOL;
if (! isset($decoded_config[$si]) || $decoded_config[$si] == 'x') {
CmdLineHandler::printwarn("Skipping " . strtoupper($si) . " configuration as desired");
continue;
}
$daemons = $service->getDaemons();
foreach ($daemons as $di => $dd) {
// check for desired service
if (($si != 'system' && $decoded_config[$si] != $di) || (is_array($decoded_config[$si]) && ! in_array($di, $decoded_config[$si]))) {
continue;
}
CmdLineHandler::println("Configuring '" . $di . "'");
if (! empty($only_daemon) && $only_daemon != $di) {
CmdLineHandler::printwarn("Skipping " . $di . " configuration as desired");
continue;
}
// run all cmds
$confarr = $dd->getConfig();
foreach ($confarr as $idx => $action) {
switch ($action['type']) {
case "install":
CmdLineHandler::println("Installing required packages");
passthru(strtr($action['content'], $replace_arr), $result);
if (strlen($result) > 1) {
echo $result;
}
break;
case "command":
exec(strtr($action['content'], $replace_arr));
break;
case "file":
if (array_key_exists('content', $action)) {
CmdLineHandler::printwarn("Creating file '" . $action['name'] . "'");
file_put_contents($action['name'], trim(strtr($action['content'], $replace_arr)));
} elseif (array_key_exists('subcommands', $action)) {
foreach ($action['subcommands'] as $fileaction) {
if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") {
exec(strtr($fileaction['content'], $replace_arr));
} elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") {
exec(strtr($fileaction['content'], $replace_arr));
} elseif ($fileaction['type'] == 'file') {
CmdLineHandler::printwarn("Creating file '" . $fileaction['name'] . "'");
file_put_contents($fileaction['name'], trim(strtr($fileaction['content'], $replace_arr)));
}
}
}
break;
}
}
}
}
// run cronjob at the end to ensure configs are all up to date
exec('php ' . FROXLOR_INSTALL_DIR . '/scripts/froxlor_master_cronjob.php --force');
// and done
CmdLineHandler::printsucc("All services have been configured");
} else {
CmdLineHandler::printerr("Unable to decode given JSON file");
}
}
private function _getReplacerArray()
{
$customer_tmpdir = '/tmp/';
if (Settings::Get('system.mod_fcgid') == '1' && Settings::Get('system.mod_fcgid_tmpdir') != '') {
$customer_tmpdir = Settings::Get('system.mod_fcgid_tmpdir');
} elseif (Settings::Get('phpfpm.enabled') == '1' && Settings::Get('phpfpm.tmpdir') != '') {
$customer_tmpdir = Settings::Get('phpfpm.tmpdir');
}
// try to convert namserver hosts to ip's
$ns_ips = "";
if (Settings::Get('system.nameservers') != '') {
$nameservers = explode(',', Settings::Get('system.nameservers'));
foreach ($nameservers as $nameserver) {
$nameserver = trim($nameserver);
$nameserver_ips = gethostbynamel($nameserver);
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) {
$ns_ips .= implode(",", $nameserver_ips);
}
}
}
Database::needSqlData();
$sql = Database::getSqlData();
$replace_arr = array(
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
'<SQL_UNPRIVILEGED_PASSWORD>' => $sql['passwd'],
'<SQL_DB>' => $sql['db'],
'<SQL_HOST>' => $sql['host'],
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
'<SERVERNAME>' => Settings::Get('system.hostname'),
'<SERVERIP>' => Settings::Get('system.ipaddress'),
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
'<NAMESERVERS_IP>' => $ns_ips,
'<AXFRSERVERS>' => Settings::Get('system.axfrservers'),
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),
'<SSLPROTOCOLS>' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '',
'<CUSTOMER_TMP>' => makeCorrectDir($customer_tmpdir),
'<BASE_PATH>' => makeCorrectDir(FROXLOR_INSTALL_DIR),
'<BIND_CONFIG_PATH>' => makeCorrectDir(Settings::Get('system.bindconf_directory')),
'<WEBSERVER_RELOAD_CMD>' => Settings::Get('system.apachereload_command'),
'<CUSTOMER_LOGS>' => makeCorrectDir(Settings::Get('system.logfiles_directory')),
'<FPM_IPCDIR>' => makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')),
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup')
);
return $replace_arr;
}
private function _parseConfig()
{
define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']);
if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/classes/database/class.Database.php')) {
throw new Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?");
}
if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) {
throw new Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system.");
}
require FROXLOR_INSTALL_DIR . '/lib/classes/database/class.Database.php';
}
private function _checkConfigParam($needed = false)
{
if ($needed) {
if (! isset($this->_args["froxlor-dir"])) {
throw new Exception("No configuration given (missing --froxlor-dir parameter?)");
} elseif (! is_dir($this->_args["froxlor-dir"])) {
throw new Exception("Given --froxlor-dir parameter is not a directory");
} elseif (! file_exists($this->_args["froxlor-dir"])) {
throw new Exception("Given froxlor directory cannot be found ('" . $this->_args["froxlor-dir"] . "')");
} elseif (! is_readable($this->_args["froxlor-dir"])) {
throw new Exception("Given froxlor direcotry cannot be read ('" . $this->_args["froxlor-dir"] . "')");
}
}
}
private function downloadFile($src, $dest)
{
set_time_limit(0);
// This is the file where we save the information
$fp = fopen($dest, 'w+');
// Here is the file we are downloading, replace spaces with %20
$ch = curl_init(str_replace(" ", "%20", $src));
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// write curl response to file
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// get curl response
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
}
// give control to command line handler
try {
ConfigServicesCmd::processParameters($argc, $argv);
} catch (Exception $e) {
ConfigServicesCmd::printerr($e->getMessage());
}

242
install/scripts/switch-server-ip.php Normal file → Executable file
View File

@@ -13,46 +13,33 @@
* @author Froxlor team <team@froxlor.org> (2016-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*
*/
// Check if we're in the CLI
if(@php_sapi_name() !== 'cli') {
if (@php_sapi_name() !== 'cli') {
die('This script will only work in the shell.');
}
// give control to command line handler
try {
CmdLineHandler::processParameters($argc, $argv);
} catch (Exception $e) {
CmdLineHandler::printerr($e->getMessage());
}
require dirname(dirname(__DIR__)) . '/lib/classes/output/class.CmdLineHandler.php';
class CmdLineHandler
class SwitchServerIp extends CmdLineHandler
{
/**
* internal variable for passed arguments
* list of valid switches
*
* @var array
*/
private static $args = null;
/**
* Action object read from commandline/config
*
* @var Action
*/
private $_action = null;
/**
* list of valid parameters/switches
*/
public static $switches = array(
/* 'd', // debug / output information for everything */
'h'
);
// same as --help
/**
* list of valid parameters
*
* @var array
*/
public static $params = array(
'switch',
'list',
@@ -60,131 +47,7 @@ class CmdLineHandler
'help'
);
/**
* Returns a CmdLineHandler object with given
* arguments from command line
*
* @param int $argc
* @param array $argv
*
* @return CmdLineHandler
*/
public static function processParameters($argc, $argv)
{
return new CmdLineHandler($argc, $argv);
}
/**
* returns the Action object generated in
* the class constructor
*
* @return Action
*/
public function getAction()
{
return $this->_action;
}
/**
* class constructor, validates the command line parameters
* and sets the Action-object if valid
*
* @param int $argc
* @param string[] $argv
*
* @return null
* @throws Exception
*/
private function __construct($argc, $argv)
{
self::$args = $this->_parseArgs($argv);
$this->_action = $this->_createAction();
}
/**
* Parses the arguments given via the command line;
* three types are supported:
* 1.
* --parm1 or --parm2=value
* 2. -xyz (multiple switches in one) or -a=value
* 3. parm1 parm2
*
* The 1. will be mapped as
* ["parm1"] => true, ["parm2"] => "value"
* The 2. as
* ["x"] => true, ["y"] => true, ["z"] => true, ["a"] => "value"
* And the 3. as
* [0] => "parm1", [1] => "parm2"
*
* @param array $argv
*
* @return array
*/
private function _parseArgs($argv)
{
array_shift($argv);
$o = array();
foreach ($argv as $a) {
if (substr($a, 0, 2) == '--') {
$eq = strpos($a, '=');
if ($eq !== false) {
$o[substr($a, 2, $eq - 2)] = substr($a, $eq + 1);
} else {
$k = substr($a, 2);
if (! isset($o[$k])) {
$o[$k] = true;
}
}
} else
if (substr($a, 0, 1) == '-') {
if (substr($a, 2, 1) == '=') {
$o[substr($a, 1, 1)] = substr($a, 3);
} else {
foreach (str_split(substr($a, 1)) as $k) {
if (! isset($o[$k])) {
$o[$k] = true;
}
}
}
} else {
$o[] = $a;
}
}
return $o;
}
/**
* Creates an Action-Object for the Action-Handler
*
* @return Action
* @throws Exception
*/
private function _createAction()
{
// Test for help-switch
if (empty(self::$args) || array_key_exists("help", self::$args) || array_key_exists("h", self::$args)) {
self::printHelp();
// end of execution
}
// check if no unknown parameters are present
foreach (self::$args as $arg => $value) {
if (is_numeric($arg)) {
throw new Exception("Unknown parameter '" . $value . "' in argument list");
} elseif (! in_array($arg, self::$params) && ! in_array($arg, self::$switches)) {
throw new Exception("Unknown parameter '" . $arg . "' in argument list");
}
}
// set debugger switch
if (isset(self::$args["d"]) && self::$args["d"] == true) {
// Debugger::getInstance()->setEnabled(true);
// Debugger::getInstance()->debug("debug output enabled");
}
return new Action(self::$args);
}
public static $action_class = 'Action';
public static function printHelp()
{
@@ -207,34 +70,9 @@ class CmdLineHandler
// self::println("-d\t\t\tenable debug output");
self::println("-h\t\t\tsame as --help");
self::println("");
die(); // end of execution
}
public static function println($msg = "")
{
print $msg . PHP_EOL;
}
private static function _printcolor($msg = "", $color = "0")
{
print "\033[" . $color . "m" . $msg . "\033[0m" . PHP_EOL;
}
public static function printerr($msg = "")
{
self::_printcolor($msg, "31");
}
public static function printsucc($msg = "")
{
self::_printcolor($msg, "32");
}
public static function printwarn($msg = "")
{
self::_printcolor($msg, "33");
}
}
class Action
@@ -268,11 +106,11 @@ class Action
if (array_key_exists("list", $this->_args) || array_key_exists("switch", $this->_args)) {
$need_config = true;
}
$this->_checkConfigParam($need_config);
$this->_parseConfig();
if (array_key_exists("list", $this->_args)) {
$this->_listIPs();
}
@@ -300,11 +138,11 @@ class Action
private function _switchIPs()
{
$ip_list = $this->_args['switch'];
if (empty($ip_list) || is_bool($ip_list)) {
throw new Exception("No paramters given for --switch action.");
}
$ips_to_switch = array();
$ip_list = explode(" ", $ip_list);
foreach ($ip_list as $ips_combo) {
@@ -324,34 +162,42 @@ class Action
}
$ips_to_switch[] = $ip_pair;
}
if (count($ips_to_switch) > 0) {
$check_stmt = Database::prepare("SELECT `id` FROM panel_ipsandports WHERE `ip` = :newip");
$upd_stmt = Database::prepare("UPDATE panel_ipsandports SET `ip` = :newip WHERE `ip` = :oldip");
// system.ipaddress
$check_sysip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'");
$check_sysip = Database::pexecute_first($check_sysip_stmt);
// system.mysql_access_host
$check_mysqlip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'mysql_access_host'");
$check_mysqlip = Database::pexecute_first($check_mysqlip_stmt);
// system.axfrservers
$check_axfrip_stmt = Database::prepare("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' and `varname` = 'axfrservers'");
$check_axfrip = Database::pexecute_first($check_axfrip_stmt);
foreach ($ips_to_switch as $ip_pair) {
echo "Switching IP \033[1m" . $ip_pair[0] . "\033[0m to IP \033[1m" . $ip_pair[1] . "\033[0m" . PHP_EOL;
$ip_check = Database::pexecute_first($check_stmt, array('newip' => $ip_pair[1]));
if ($ip_check) {
CmdLineHandler::printwarn("Note: " . $ip_pair[0] . " not updated to " . $ip_pair[1] . " - IP already exists in froxlor's database");
continue;
}
Database::pexecute($upd_stmt, array(
'newip' => $ip_pair[1],
'oldip' => $ip_pair[0]
));
$rows_updated = $upd_stmt->rowCount();
if ($rows_updated == 0) {
CmdLineHandler::printwarn("Note: " . $ip_pair[0] . " not updated to " . $ip_pair[1] . " (possibly no entry found in froxlor database. Use --list to see what IP addresses are added in froxlor");
}
// check whether the system.ipaddress needs updating
if ($check_sysip['value'] == $ip_pair[0]) {
$upd2_stmt = Database::prepare("UPDATE `panel_settings` SET `value` = :newip WHERE `settinggroup` = 'system' and `varname` = 'ipaddress'");
@@ -360,7 +206,7 @@ class Action
));
CmdLineHandler::printsucc("Updated system-ipaddress from '" . $ip_pair[0] . "' to '" . $ip_pair[1] . "'");
}
// check whether the system.mysql_access_host needs updating
if (strstr($check_mysqlip['value'], $ip_pair[0]) !== false) {
$new_mysqlip = str_replace($ip_pair[0], $ip_pair[1], $check_mysqlip['value']);
@@ -370,7 +216,7 @@ class Action
));
CmdLineHandler::printsucc("Updated mysql_access_host from '" . $check_mysqlip['value'] . "' to '" . $new_mysqlip . "'");
}
// check whether the system.axfrservers needs updating
if (strstr($check_axfrip['value'], $ip_pair[0]) !== false) {
$new_axfrip = str_replace($ip_pair[0], $ip_pair[1], $check_axfrip['value']);
@@ -382,7 +228,7 @@ class Action
}
}
}
echo PHP_EOL;
CmdLineHandler::printwarn("*** ATTENTION *** Remember to replace IP addresses in configuration files if used anywhere.");
CmdLineHandler::printsucc("IP addresses updated");
@@ -391,12 +237,15 @@ class Action
private function _parseConfig()
{
define('FROXLOR_INSTALL_DIR', $this->_args['froxlor-dir']);
if (!file_exists(FROXLOR_INSTALL_DIR . '/lib/classes/database/class.Database.php')) {
throw new Exception("Could not find froxlor's Database class. Is froxlor really installed to '".FROXLOR_INSTALL_DIR."'?");
if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/classes/database/class.Database.php')) {
throw new Exception("Could not find froxlor's Database class. Is froxlor really installed to '" . FROXLOR_INSTALL_DIR . "'?");
}
if (!file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) {
if (! file_exists(FROXLOR_INSTALL_DIR . '/lib/userdata.inc.php')) {
throw new Exception("Could not find froxlor's userdata.inc.php file. You should use this script only with a fully installed and setup froxlor system.");
}
require FROXLOR_INSTALL_DIR . '/lib/functions/filedir/function.makeSecurePath.php';
require FROXLOR_INSTALL_DIR . '/lib/functions/filedir/function.makeCorrectDir.php';
require FROXLOR_INSTALL_DIR . '/lib/functions/filedir/function.makeCorrectFile.php';
require FROXLOR_INSTALL_DIR . '/lib/classes/database/class.Database.php';
}
@@ -415,3 +264,10 @@ class Action
}
}
}
// give control to command line handler
try {
SwitchServerIp::processParameters($argc, $argv);
} catch (Exception $e) {
SwitchServerIp::printerr($e->getMessage());
}

View File

@@ -3886,3 +3886,189 @@ if (isFroxlorVersion('0.9.39')) {
showUpdateStep("Updating from 0.9.39 to 0.9.39.1", false);
updateToVersion('0.9.39.1');
}
if (isFroxlorVersion('0.9.39.1')) {
showUpdateStep("Updating from 0.9.39.1 to 0.9.39.2", false);
updateToVersion('0.9.39.2');
}
if (isDatabaseVersion('201801260')) {
showUpdateStep("Adding new plans table");
Database::query("DROP TABLE IF EXISTS `panel_plans`;");
$sql = "CREATE TABLE `panel_plans` (
`id` int(11) NOT NULL auto_increment,
`adminid` int(11) NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`value` longtext NOT NULL,
`ts` int(15) NOT NULL default '0',
PRIMARY KEY (id),
KEY adminid (adminid)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;";
Database::query($sql);
lastStepStatus(0);
updateToDbVersion('201802120');
}
if (isDatabaseVersion('201802120')) {
showUpdateStep("Adding domain field for try_files flag");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `notryfiles` tinyint(1) DEFAULT '0';");
lastStepStatus(0);
updateToDbVersion('201802130');
}
if (isFroxlorVersion('0.9.39.2')) {
showUpdateStep("Updating from 0.9.39.2 to 0.9.39.3", false);
updateToVersion('0.9.39.3');
}
if (isFroxlorVersion('0.9.39.3')) {
showUpdateStep("Updating from 0.9.39.3 to 0.9.39.4", false);
updateToVersion('0.9.39.4');
}
if (isFroxlorVersion('0.9.39.4')) {
showUpdateStep("Updating from 0.9.39.4 to 0.9.39.5", false);
updateToVersion('0.9.39.5');
}
if (isDatabaseVersion('201802130')) {
showUpdateStep("Adding fullchain field to ssl certificates");
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` ADD `ssl_fullchain_file` mediumtext AFTER `ssl_csr_file`;");
lastStepStatus(0);
updateToDbVersion('201802250');
}
if (isDatabaseVersion('201802250')) {
showUpdateStep("Adding webserver logfile settings");
Settings::AddNew("system.logfiles_format", '');
Settings::AddNew("system.logfiles_type", '1');
Settings::AddNew("system.logfiles_piped", '0');
lastStepStatus(0);
updateToDbVersion('201805240');
}
if (isDatabaseVersion('201805240')) {
showUpdateStep("Adding webserver logfile-script settings");
Settings::AddNew("system.logfiles_script", '');
lastStepStatus(0);
updateToDbVersion('201805241');
}
if (isDatabaseVersion('201805241')) {
$do_update = true;
showUpdateStep("Checking for required PHP json-extension");
if (! extension_loaded('json')) {
$do_update = false;
lastStepStatus(2, 'not installed');
} else {
lastStepStatus(0);
showUpdateStep("Checking for current cronjobs that need converting");
$result_tasks_stmt = Database::query("
SELECT * FROM `" . TABLE_PANEL_TASKS . "` ORDER BY `id` ASC
");
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_TASKS . "` SET `data` = :data WHERE `id` = :taskid");
while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
if (! empty($row['data'])) {
$data = unserialize($row['data']);
Database::pexecute($upd_stmt, array(
'data' => json_encode($data),
'taskid' => $row['id']
));
}
}
lastStepStatus(0);
updateToDbVersion('201805290');
}
}
if (isDatabaseVersion('201805290')) {
showUpdateStep("Adding leaccount field to panel customers");
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD COLUMN `leaccount` varchar(255) default '' AFTER `leregistered`;");
lastStepStatus(0);
showUpdateStep("Adding system setting for let's-encrypt account");
Settings::AddNew('system.leaccount', "");
lastStepStatus(0);
updateToDbVersion('201809180');
}
if (isDatabaseVersion('201809180')) {
showUpdateStep("Adding new fields for php configs");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `override_fpmconfig` tinyint(1) NOT NULL DEFAULT '0';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `pm` varchar(15) NOT NULL DEFAULT 'static';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_children` int(4) NOT NULL DEFAULT '1';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `start_servers` int(4) NOT NULL DEFAULT '20';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `min_spare_servers` int(4) NOT NULL DEFAULT '5';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_spare_servers` int(4) NOT NULL DEFAULT '35';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `max_requests` int(4) NOT NULL DEFAULT '0';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `idle_timeout` int(4) NOT NULL DEFAULT '30';");
Database::query("ALTER TABLE `" . TABLE_PANEL_PHPCONFIGS . "` ADD `limit_extensions` varchar(255) NOT NULL default '.php';");
lastStepStatus(0);
showUpdateStep("Synchronize fpm-daemon process manager settings with php-configs");
// get all fpm-daemons
$sel_stmt = Database::prepare("SELECT * FROM `panel_fpmdaemons`;");
Database::pexecute($sel_stmt);
$fpm_daemons = $sel_stmt->fetchAll(PDO::FETCH_ASSOC);
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
`pm` = :pm,
`max_children` = :maxc,
`start_servers` = :starts,
`min_spare_servers` = :minss,
`max_spare_servers` = :maxss,
`max_requests` = :maxr,
`idle_timeout` = :it,
`limit_extensions` = :le
WHERE `fpmsettingid` = :fpmid
");
// update all php-configs with the pm data from the fpm-daemon
foreach ($fpm_daemons as $fpm_daemon) {
Database::pexecute($upd_stmt, array(
'pm' => $fpm_daemon['pm'],
'maxc' => $fpm_daemon['max_children'],
'starts' => $fpm_daemon['start_servers'],
'minss' => $fpm_daemon['min_spare_servers'],
'maxss' => $fpm_daemon['max_spare_servers'],
'maxr' => $fpm_daemon['max_requests'],
'it' => $fpm_daemon['idle_timeout'],
'le' => $fpm_daemon['limit_extensions'],
'fpmid' => $fpm_daemon['id']
));
}
lastStepStatus(0);
updateToDbVersion('201809280');
}
if (isFroxlorVersion('0.9.39.5')) {
showUpdateStep("Updating from 0.9.39.5 to 0.9.40", false);
updateToVersion('0.9.40');
}
if (isFroxlorVersion('0.9.40')) {
showUpdateStep("Updating from 0.9.40 to 0.9.40.1", false);
updateToVersion('0.9.40.1');
}

View File

@@ -10,13 +10,15 @@ class HttpClient
*
* @return array
*/
public static function urlGet($url)
public static function urlGet($url, $follow_location = true)
{
include FROXLOR_INSTALL_DIR . '/lib/version.inc.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/' . $version);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if ($follow_location) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
if ($output === false) {

View File

@@ -28,6 +28,11 @@
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Classes
*
* @method static \PDOStatement prepare($statement, array $driver_options = null) Prepares a statement for execution and returns a statement object
* @method static \PDOStatement query ($statement) Executes an SQL statement, returning a result set as a PDOStatement object
* @method static string lastInsertId ($name = null) Returns the ID of the last inserted row or sequence value
* @method static string quote ($string, $parameter_type = null) Quotes a string for use in a query.
*/
class Database {

View File

@@ -43,9 +43,9 @@ class DnsEntry
{
$_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) {
if (Settings::Get('system.dns_server') != 'pdns' && $this->type == 'TXT' && strlen($_content) >= 255) {
// split string
$_contentlines = str_split($_content, 63);
$_contentlines = str_split($_content, 254);
// first line
$_l = array_shift($_contentlines);
// check for starting quote

View File

@@ -0,0 +1,196 @@
<?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 Froxlor team <team@froxlor.org> (2018-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Cron
*
*/
abstract class CmdLineHandler
{
/**
* internal variable for passed arguments
*
* @var array
*/
private static $args = null;
/**
* Action object read from commandline/config
*
* @var Action
*/
private $_action = null;
/**
* Returns a CmdLineHandler object with given
* arguments from command line
*
* @param int $argc
* @param array $argv
*
* @return CmdLineHandler
*/
public static function processParameters($argc, $argv)
{
$me = get_called_class();
return new $me($argc, $argv);
}
/**
* returns the Action object generated in
* the class constructor
*
* @return Action
*/
public function getAction()
{
return $this->_action;
}
/**
* class constructor, validates the command line parameters
* and sets the Action-object if valid
*
* @param int $argc
* @param string[] $argv
*
* @return null
* @throws Exception
*/
private function __construct($argc, $argv)
{
self::$args = $this->_parseArgs($argv);
$this->_action = $this->_createAction();
}
/**
* Parses the arguments given via the command line;
* three types are supported:
* 1.
* --parm1 or --parm2=value
* 2. -xyz (multiple switches in one) or -a=value
* 3. parm1 parm2
*
* The 1. will be mapped as
* ["parm1"] => true, ["parm2"] => "value"
* The 2. as
* ["x"] => true, ["y"] => true, ["z"] => true, ["a"] => "value"
* And the 3. as
* [0] => "parm1", [1] => "parm2"
*
* @param array $argv
*
* @return array
*/
private function _parseArgs($argv)
{
array_shift($argv);
$o = array();
foreach ($argv as $a) {
if (substr($a, 0, 2) == '--') {
$eq = strpos($a, '=');
if ($eq !== false) {
$o[substr($a, 2, $eq - 2)] = substr($a, $eq + 1);
} else {
$k = substr($a, 2);
if (! isset($o[$k])) {
$o[$k] = true;
}
}
} else if (substr($a, 0, 1) == '-') {
if (substr($a, 2, 1) == '=') {
$o[substr($a, 1, 1)] = substr($a, 3);
} else {
foreach (str_split(substr($a, 1)) as $k) {
if (! isset($o[$k])) {
$o[$k] = true;
}
}
}
} else {
$o[] = $a;
}
}
return $o;
}
/**
* Creates an Action-Object for the Action-Handler
*
* @return Action
* @throws Exception
*/
private function _createAction()
{
// Test for help-switch
if (empty(self::$args) || array_key_exists("help", self::$args) || array_key_exists("h", self::$args)) {
static::printHelp();
// end of execution
}
// check if no unknown parameters are present
foreach (self::$args as $arg => $value) {
if (is_numeric($arg)) {
throw new Exception("Unknown parameter '" . $value . "' in argument list");
} elseif (! in_array($arg, static::$params) && ! in_array($arg, static::$switches)) {
throw new Exception("Unknown parameter '" . $arg . "' in argument list");
}
}
// set debugger switch
if (isset(self::$args["d"]) && self::$args["d"] == true) {
// Debugger::getInstance()->setEnabled(true);
// Debugger::getInstance()->debug("debug output enabled");
}
return new static::$action_class(self::$args);
}
public static function getInput($prompt = "#", $default = "")
{
if (! empty($default)) {
$prompt .= " [" . $default . "]";
}
$result = readline($prompt . ":");
if (empty($result) && ! empty($default)) {
$result = $default;
}
return mb_strtolower($result);
}
public static function println($msg = "")
{
print $msg . PHP_EOL;
}
private static function _printcolor($msg = "", $color = "0")
{
print "\033[" . $color . "m" . $msg . "\033[0m" . PHP_EOL;
}
public static function printerr($msg = "")
{
self::_printcolor($msg, "31");
}
public static function printsucc($msg = "")
{
self::_printcolor($msg, "32");
}
public static function printwarn($msg = "")
{
self::_printcolor($msg, "33");
}
}

View File

@@ -114,7 +114,7 @@ class paging {
$this->userinfo = $userinfo;
if (!is_array($this->userinfo['lastpaging'])) {
$this->userinfo['lastpaging'] = unserialize($this->userinfo['lastpaging']);
$this->userinfo['lastpaging'] = json_decode($this->userinfo['lastpaging'], true);
}
$this->table = $table;
@@ -224,7 +224,7 @@ class paging {
AND `adminsession` = :adminsession
");
$upd_data = array(
'lastpaging' => serialize($this->userinfo['lastpaging']),
'lastpaging' => json_encode($this->userinfo['lastpaging']),
'hash' => $userinfo['hash'],
'userid' => $userinfo['userid'],
'ipaddr' => $userinfo['ipaddress'],

View File

@@ -91,6 +91,18 @@ class phpinterface_fpm
$fh = @fopen($this->getConfigFile(), 'w');
if ($fh) {
if ($phpconfig['override_fpmconfig'] == 1) {
$this->_fpm_cfg['pm'] = $phpconfig['pm'];
$this->_fpm_cfg['max_children'] = $phpconfig['max_children'];
$this->_fpm_cfg['start_servers'] = $phpconfig['start_servers'];
$this->_fpm_cfg['min_spare_servers'] = $phpconfig['min_spare_servers'];
$this->_fpm_cfg['max_spare_servers'] = $phpconfig['max_spare_servers'];
$this->_fpm_cfg['max_requests'] = $phpconfig['max_requests'];
$this->_fpm_cfg['idle_timeout'] = $phpconfig['idle_timeout'];
$this->_fpm_cfg['limit_extensions'] = $phpconfig['limit_extensions'];
}
$fpm_pm = $this->_fpm_cfg['pm'];
$fpm_children = (int) $this->_fpm_cfg['max_children'];
$fpm_start_servers = (int) $this->_fpm_cfg['start_servers'];

View File

@@ -98,14 +98,28 @@ class SImExporter
// when there were changes in the variable-name or similar
unset($_data['panel.version']);
unset($_data['panel.db_version']);
/*
// validate we got ssl enabled ips when ssl is enabled
// otherwise deactivate it
if ($_data['system.use_ssl'] == 1) {
$result_ssl_ipsandports_stmt = Database::prepare("
SELECT COUNT(*) as count_ssl_ip FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ssl`='1'
");
$result = Database::pexecute_first($result_ssl_ipsandports_stmt);
if ($result['count_ssl_ip'] <= 0) {
// no ssl-ip -> deactivate
$_data['system.use_ssl'] = 0;
// deactivate other ssl-related settings
$_data['system.leenabled'] = 0;
$_data['system.le_froxlor_enabled'] = 0;
$_data['system.le_froxlor_redirect'] = 0;
}
}
// store new data
foreach ($_data as $index => $value) {
Settings::Set($index, $value);
}
// save to DB
Settings::Flush();
*/
// all good
return true;
}

View File

@@ -82,7 +82,7 @@ class lescript
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;");
$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'],
@@ -216,7 +216,7 @@ class lescript
// simple self check
if (Settings::Get('system.disable_le_selfcheck') == '0')
{
$selfcheckpayload = HttpClient::urlGet($uri);
$selfcheckpayload = HttpClient::urlGet($uri, false);
if ($payload !== trim($selfcheckpayload)) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
@@ -342,7 +342,7 @@ class lescript
if ($this->isFroxlorVhost) {
Settings::Set('system.leregistered', $state);
} else {
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered WHERE `customerid` = :customerid;");
Database::pexecute($upd_stmt, array(
'registered' => $state,
'customerid' => $this->customerId

View File

@@ -76,6 +76,7 @@ class lescript_v2
$this->customerId = (! $isFroxlorVhost ? $certrow['customerid'] : null);
$this->isFroxlorVhost = $isFroxlorVhost;
$this->isLeProduction = (Settings::Get('system.letsencryptca') == 'production');
$this->_acc_location = $certrow['leaccount'];
$leregistered = $certrow['leregistered'];
@@ -93,7 +94,7 @@ class lescript_v2
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;");
$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'],
@@ -149,42 +150,55 @@ class lescript_v2
// start domains authentication
// ----------------------------
// Prepare order
$domains_in_order = array();
foreach ($domains as $domain) {
$domains_in_order []= array(
"type" => "dns",
"value" => $domain
);
}
// Send new-order request
$response = $this->signedRequest($this->_req_uris['newOrder'], array(
"identifiers" => $domains_in_order
), false);
if ($this->client->getLastCode() == 403) {
$this->log("Got status 403 - setting LE status to unregistered.");
$this->_acc_location = '';
$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&#32;&#35;179&#46;d8be1402&#46;1458059103&#46;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));
}
$authorizations = $response['authorizations'];
$finalizeLink = $response['finalize'];
$i = 0;
foreach ($authorizations as $authorization) {
// 1. getting available authentication options
// -------------------------------------------
$domain = $response['identifiers'][$i++]['value'];
$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&#32;&#35;179&#46;d8be1402&#46;1458059103&#46;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]);
$auth_response = $this->client->get($authorization);
if (! array_key_exists('challenges', $auth_response)) {
throw new RuntimeException("No challenges received for $domain. Whole response: " . json_encode($auth_response));
@@ -201,7 +215,6 @@ class lescript_v2
$this->log("Got challenge token for $domain");
$location = $challenge['url'];
$finalizeLink = $response['finalize'];
// 2. saving authentication token for web verification
// ---------------------------------------------------
@@ -233,7 +246,7 @@ class lescript_v2
// simple self check
if (Settings::Get('system.disable_le_selfcheck') == '0') {
$selfcheckpayload = HttpClient::urlGet($uri);
$selfcheckpayload = HttpClient::urlGet($uri, false);
if ($payload !== trim($selfcheckpayload)) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
@@ -336,10 +349,12 @@ class lescript_v2
if ($this->isLeProduction) {
if ($this->isFroxlorVhost) {
Settings::Set('system.leregistered', $state);
Settings::Set('system.leaccount', $this->_acc_location);
} else {
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered " . "WHERE `customerid` = :customerid;");
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `leregistered` = :registered, `leaccount` = :kid WHERE `customerid` = :customerid;");
Database::pexecute($upd_stmt, array(
'registered' => $state,
'kid' => $this->_acc_location,
'customerid' => $this->customerId
));
}
@@ -495,8 +510,8 @@ class Client
private function curl($method, $url, $data = null)
{
$headers = array(
'Accept: application/json',
'Content-Type: application/json'
'Accept: application/jose+json',
'Content-Type: application/jose+json'
);
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, preg_match('~^http~', $url) ? $url : $this->base . $url);
@@ -550,7 +565,7 @@ class Client
return trim($matches[1]);
}
$this->curl('GET', '/directory');
$this->curl('GET', '/acme/new-nonce');
return $this->getLastNonce();
}

View File

@@ -19,46 +19,53 @@
*
* Support Tickets - Tickets-Class
*/
class ticket {
class ticket
{
/**
* Userinfo
*
* @var array
*/
private $userinfo = array();
/**
* Ticket ID
* @var tid
*
* @var int
*/
private $tid = - 1;
/**
* Ticket Data Array
* @var t_data
*
* @var array
*/
private $t_data = array();
/**
* Ticket-Object-Array
* @var tickets
*
* @var ticket[]
*/
static private $tickets = array();
private static $tickets = array();
/**
* Class constructor.
*
* @param array userinfo
* @param int ticket id
* @param
* array userinfo
* @param
* int ticket id
*/
private function __construct($userinfo, $tid = - 1) {
private function __construct($userinfo, $tid = - 1)
{
$this->userinfo = $userinfo;
$this->tid = $tid;
// initialize data array
$this->initData();
// read data from database
$this->readData();
}
@@ -66,21 +73,24 @@ class ticket {
/**
* Singleton ftw ;-)
*
* @param array userinfo
* @param int ticket id
* @param
* array userinfo
* @param
* int ticket id
*/
static public function getInstanceOf($_usernfo, $_tid) {
if (!isset(self::$tickets[$_tid])) {
self::$tickets[$_tid] = new ticket($_usernfo, $_tid);
static public function getInstanceOf($_usernfo, $_tid)
{
if (! isset(self::$tickets[$_tid . '-' . $_usernfo['userid']])) {
self::$tickets[$_tid . '-' . $_usernfo['userid']] = new ticket($_usernfo, $_tid);
}
return self::$tickets[$_tid];
return self::$tickets[$_tid . '-' . $_usernfo['userid']];
}
/**
* Initialize data-array
*/
private function initData() {
private function initData()
{
$this->Set('customer', 0, true, true);
$this->Set('admin', 1, true, true);
$this->Set('subject', '', true, true);
@@ -100,16 +110,33 @@ class ticket {
/**
* Read ticket data from database.
*/
private function readData() {
if (isset($this->tid)
&& $this->tid != - 1
) {
$_ticket_stmt = Database::prepare('
SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid'
);
$_ticket = Database::pexecute_first($_ticket_stmt, array('tid' => $this->tid));
private function readData()
{
if (isset($this->tid) && $this->tid != - 1) {
if ($this->userinfo['customerid'] > 0) {
$_ticket_stmt = Database::prepare('
SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid AND `customerid` = :cid');
$tdata = array(
'tid' => $this->tid,
'cid' => $this->userinfo['customerid']
);
} else {
$_ticket_stmt = Database::prepare('
SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid' . ($this->userinfo['customers_see_all'] ? '' : ' AND `adminid` = :adminid'));
$tdata = array(
'tid' => $this->tid
);
if ($this->userinfo['customers_see_all'] != '1') {
$tdata['adminid'] = $this->userinfo['adminid'];
}
}
$_ticket = Database::pexecute_first($_ticket_stmt, $tdata);
if ($_ticket == false) {
throw new Exception("Invalid ticket id");
}
$this->Set('customer', $_ticket['customerid'], true, false);
$this->Set('admin', $_ticket['adminid'], true, false);
$this->Set('subject', $_ticket['subject'], true, false);
@@ -130,8 +157,8 @@ class ticket {
/**
* Insert data to database
*/
public function Insert() {
public function Insert()
{
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TICKETS . "` SET
`customerid` = :customerid,
@@ -146,8 +173,7 @@ class ticket {
`status` = :status,
`lastreplier` = :lastreplier,
`by` = :by,
`answerto` = :answerto"
);
`answerto` = :answerto");
$ins_data = array(
'customerid' => $this->Get('customer'),
'adminid' => $this->Get('admin'),
@@ -171,8 +197,9 @@ class ticket {
/**
* Update data in database
*/
public function Update() {
public function Update()
{
// Update "main" ticket
$upd_stmt = Database::prepare('
UPDATE `' . TABLE_PANEL_TICKETS . '` SET
@@ -180,8 +207,7 @@ class ticket {
`lastchange` = :lastchange,
`status` = :status,
`lastreplier` = :lastreplier
WHERE `id` = :tid'
);
WHERE `id` = :tid');
$upd_data = array(
'priority' => $this->Get('priority'),
'lastchange' => $this->Get('lastchange'),
@@ -196,38 +222,44 @@ class ticket {
/**
* Moves a ticket to the archive
*/
public function Archive() {
public function Archive()
{
// Update "main" ticket
$upd_stmt = Database::prepare('
UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `id` = :tid'
);
Database::pexecute($upd_stmt, array('tid' => $this->tid));
UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `id` = :tid');
Database::pexecute($upd_stmt, array(
'tid' => $this->tid
));
// Update "answers" to ticket
$upd_stmt = Database::prepare('
UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `answerto` = :tid'
);
Database::pexecute($upd_stmt, array('tid' => $this->tid));
UPDATE `' . TABLE_PANEL_TICKETS . '` SET `archived` = "1" WHERE `answerto` = :tid');
Database::pexecute($upd_stmt, array(
'tid' => $this->tid
));
return true;
}
/**
* Remove ticket from database
*/
public function Delete() {
public function Delete()
{
// Delete "main" ticket
$del_stmt = Database::prepare('
DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid'
);
Database::pexecute($del_stmt, array('tid' => $this->tid));
DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid');
Database::pexecute($del_stmt, array(
'tid' => $this->tid
));
// Delete "answers" to ticket"
$del_stmt = Database::prepare('
DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto` = :tid'
);
Database::pexecute($del_stmt, array('tid' => $this->tid));
DELETE FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto` = :tid');
Database::pexecute($del_stmt, array(
'tid' => $this->tid
));
return true;
}
@@ -237,16 +269,17 @@ class ticket {
public function sendMail($customerid = - 1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null)
{
global $mail, $theme;
// Some checks are to be made here in the future
if ($customerid != - 1) {
// Get e-mail message for customer
$usr_stmt = Database::prepare('
SELECT `name`, `firstname`, `company`, `email`
FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = :customerid'
);
$usr = Database::pexecute_first($usr_stmt, array('customerid' => $customerid));
FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = :customerid');
$usr = Database::pexecute_first($usr_stmt, array(
'customerid' => $customerid
));
$replace_arr = array(
'FIRSTNAME' => $usr['firstname'],
'NAME' => $usr['name'],
@@ -268,23 +301,21 @@ class ticket {
SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid`= :adminid
AND `language`= :lang
AND `templategroup`= 'mails' AND `varname`= :tplsubject"
);
AND `templategroup`= 'mails' AND `varname`= :tplsubject");
$result = Database::pexecute_first($result_stmt, $tpl_seldata);
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_subject), $replace_arr));
unset($tpl_seldata['tplsubject']);
$tpl_seldata['tplmailbody'] = $template_body;
$result_stmt = Database::prepare("
SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
WHERE `adminid`= :adminid
AND `language`= :lang
AND `templategroup`= 'mails' AND `varname`= :tplmailbody"
);
AND `templategroup`= 'mails' AND `varname`= :tplmailbody");
$result = Database::pexecute_first($result_stmt, $tpl_seldata);
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $default_body), $replace_arr));
if ($customerid != - 1) {
$_mailerror = false;
try {
@@ -294,28 +325,30 @@ class ticket {
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']);
$mail->Send();
} catch(phpmailerException $e) {
} catch (phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'));
$rstlog = FroxlorLogger::getInstanceOf(array(
'loginname' => 'ticket_class'
));
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $usr['email']);
}
$mail->ClearAddresses();
} else {
$admin_stmt = Database::prepare("
SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "`
WHERE `adminid` = :adminid"
);
$admin = Database::pexecute_first($admin_stmt, array('adminid' => $this->userinfo['adminid']));
WHERE `adminid` = :adminid");
$admin = Database::pexecute_first($admin_stmt, array(
'adminid' => $this->userinfo['adminid']
));
$_mailerror = false;
try {
$mail->SetFrom(Settings::Get('ticket.noreply_email'), Settings::Get('ticket.noreply_name'));
@@ -324,20 +357,22 @@ class ticket {
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
$mail->AddAddress($admin['email'], $admin['name']);
$mail->Send();
} catch(phpmailerException $e) {
} catch (phpmailerException $e) {
$mailerr_msg = $e->errorMessage();
$_mailerror = true;
} catch (Exception $e) {
$mailerr_msg = $e->getMessage();
$_mailerror = true;
}
if ($_mailerror) {
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'));
$rstlog = FroxlorLogger::getInstanceOf(array(
'loginname' => 'ticket_class'
));
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
standard_error('errorsendingmail', $admin['email']);
}
$mail->ClearAddresses();
}
}
@@ -345,21 +380,18 @@ class ticket {
/**
* Add a support-categories
*/
static public function addCategory($_category = null, $_admin = 1, $_order = 1) {
if ($_category != null
&& $_category != ''
) {
static public function addCategory($_category = null, $_admin = 1, $_order = 1)
{
if ($_category != null && $_category != '') {
if ($_order < 1) {
$_order = 1;
}
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TICKET_CATS . "` SET
`name` = :name,
`adminid` = :adminid,
`logicalorder` = :lo"
);
`logicalorder` = :lo");
$ins_data = array(
'name' => $_category,
'adminid' => $_admin,
@@ -374,23 +406,24 @@ class ticket {
/**
* Edit a support-categories
*/
static public function editCategory($_category = null, $_id = 0, $_order = 1) {
if ($_category != null
&& $_category != ''
&& $_id != 0
) {
static public function editCategory($_category = null, $_id = 0, $_order = 1)
{
if ($_category != null && $_category != '' && $_id != 0) {
if ($_order < 1) {
$_order = 1;
}
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_TICKET_CATS . "` SET
`name` = :name,
`logicalorder` = :lo
WHERE `id` = :id
");
Database::pexecute($upd_stmt, array('name' => $_category, 'lo' => $_order, 'id' => $_id));
Database::pexecute($upd_stmt, array(
'name' => $_category,
'lo' => $_order,
'id' => $_id
));
return true;
}
return false;
@@ -399,40 +432,43 @@ class ticket {
/**
* Delete a support-categories
*/
static public function deleteCategory($_id = 0) {
static public function deleteCategory($_id = 0)
{
if ($_id != 0) {
$result_stmt = Database::prepare("
SELECT COUNT(`id`) as `numtickets` FROM `" . TABLE_PANEL_TICKETS . "`
WHERE `category` = :cat"
);
$result = Database::pexecute_first($result_stmt, array('cat' => $_id));
WHERE `category` = :cat");
$result = Database::pexecute_first($result_stmt, array(
'cat' => $_id
));
if ($result['numtickets'] == "0") {
$del_stmt = Database::prepare("
DELETE FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id"
);
Database::pexecute($del_stmt, array('id' => $_id));
DELETE FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id");
Database::pexecute($del_stmt, array(
'id' => $_id
));
return true;
} else {
return false;
}
}
return false;
}
/**
* Return a support-category-name
*/
static public function getCategoryName($_id = 0) {
static public function getCategoryName($_id = 0)
{
if ($_id != 0) {
$stmt = Database::prepare("
SELECT `name` FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id"
);
$category = Database::pexecute_first($stmt, array('id' => $_id));
SELECT `name` FROM `" . TABLE_PANEL_TICKET_CATS . "` WHERE `id` = :id");
$category = Database::pexecute_first($stmt, array(
'id' => $_id
));
return $category['name'];
}
return null;
@@ -440,32 +476,33 @@ class ticket {
/**
* get the highest order number
*
* @param object $_uid admin-id (optional)
*
*
* @param object $_uid
* admin-id (optional)
*
* @return int highest order number
*/
static public function getHighestOrderNumber($_uid = 0) {
static public function getHighestOrderNumber($_uid = 0)
{
$where = '';
$sel_data = array();
if ($_uid > 0) {
$where = " WHERE `adminid` = :adminid";
$sel_data['adminid'] = $_uid;
}
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`".$where.";";
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`" . $where . ";";
$result_stmt = Database::prepare($sql);
$result = Database::pexecute_first($result_stmt, $sel_data);
return (isset($result['highestorder']) ? (int)$result['highestorder'] : 0);
return (isset($result['highestorder']) ? (int) $result['highestorder'] : 0);
}
/**
* returns the last x archived tickets
*/
static public function getLastArchived($_num = 10, $_admin = 1) {
static public function getLastArchived($_num = 10, $_admin = 1)
{
if ($_num > 0) {
$archived = array();
$counter = 0;
$result_stmt = Database::prepare("
@@ -477,12 +514,13 @@ class ticket {
FROM `" . TABLE_PANEL_TICKETS . "` `main`
WHERE `main`.`answerto` = '0' AND `main`.`archived` = '1'
AND `main`.`adminid` = :adminid
ORDER BY `main`.`lastchange` DESC LIMIT 0, ".(int)$_num
);
Database::pexecute($result_stmt, array('adminid' => $_admin));
ORDER BY `main`.`lastchange` DESC LIMIT 0, " . (int) $_num);
Database::pexecute($result_stmt, array(
'adminid' => $_admin
));
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$archived[$counter]['id'] = $row['id'];
$archived[$counter]['customerid'] = $row['customerid'];
$archived[$counter]['adminid'] = $row['adminid'];
@@ -496,9 +534,9 @@ class ticket {
$archived[$counter]['lastchange'] = $row['lastchange'];
$archived[$counter]['status'] = $row['status'];
$archived[$counter]['by'] = $row['by'];
$counter++;
$counter ++;
}
if (isset($archived[0]['id'])) {
return $archived;
} else {
@@ -516,129 +554,102 @@ class ticket {
static public function getArchiveSearchStatement($subject = null, $priority = null, $fromdate = null, $todate = null, $message = null, $customer = - 1, $admin = 1, $categories = null)
{
$search_params = array();
$query = "
SELECT `main`.*, (
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
WHERE `sub`.`answerto` = `main`.`id`
) as `ticket_answers`
FROM `" . TABLE_PANEL_TICKETS . "` `main`
WHERE `main`.`archived` = '1' AND `main`.`adminid` = :admin"
;
WHERE `main`.`archived` = '1' AND `main`.`adminid` = :admin";
$search_params['admin'] = $admin;
if ($subject != NULL
&& $subject != ''
) {
if ($subject != NULL && $subject != '') {
$query .= " AND `main`.`subject` LIKE :subject";
$search_params['subject'] = "%".$subject."%";
$search_params['subject'] = "%" . $subject . "%";
}
if ($priority != null
&& isset($priority[0])
&& $priority[0] != ''
) {
if (isset($priority[1])
&& $priority[1] != ''
) {
if (isset($priority[2])
&& $priority[2] != ''
) {
if ($priority != null && isset($priority[0]) && $priority[0] != '') {
if (isset($priority[1]) && $priority[1] != '') {
if (isset($priority[2]) && $priority[2] != '') {
$query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '2' OR `main`.`priority` = '3')";
} else {
$query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '1')";
}
} elseif (isset($priority[2])
&& $priority[2] != ''
) {
} elseif (isset($priority[2]) && $priority[2] != '') {
$query .= " AND (`main`.`priority` = '1' OR `main`.`priority` = '3')";
} else {
$query .= " AND `main`.`priority` = '1'";
}
} elseif($priority != null
&& isset($priority[1])
&& $priority[1] != ''
) {
if (isset($priority[2])
&& $priority[2] != ''
) {
} elseif ($priority != null && isset($priority[1]) && $priority[1] != '') {
if (isset($priority[2]) && $priority[2] != '') {
$query .= " AND (`main`.`priority` = '2' OR `main`.`priority` = '3')";
} else {
$query .= " AND `main`.`priority` = '2'";
}
} elseif($priority != null) {
if (isset($priority[3])
&& $priority[3] != ''
) {
} elseif ($priority != null) {
if (isset($priority[3]) && $priority[3] != '') {
$query .= " AND `main`.`priority` = '3'";
}
}
if ($fromdate != null
&& $fromdate > 0
) {
if ($fromdate != null && $fromdate > 0) {
$query .= " AND `main`.`lastchange` > :fromdate";
$search_params['fromdate'] = strtotime($fromdate);
}
if ($todate != null
&& $todate > 0
) {
if ($todate != null && $todate > 0) {
$query .= " AND `main`.`lastchange` < :todate";
$search_params['todate'] = strtotime($todate);
}
if ($message != null
&& $message != ''
) {
if ($message != null && $message != '') {
$query .= " AND `main`.`message` LIKE :message";
$search_params['message'] = "%".$message."%";
$search_params['message'] = "%" . $message . "%";
}
if ($customer != - 1) {
$query .= " AND `main`.`customerid` = :customer";
$search_params['customer'] = $customer;
}
if ($categories != null) {
$cats = array();
foreach ($categories as $index => $catid) {
if ($catid != "") {
$cats[] = $catid;
}
}
if (count($cats) > 0) {
$query .= " AND (";
}
foreach ($cats as $catid) {
if (isset($catid) && $catid > 0) {
$query .= "`main`.`category` = :catid_".$catid." OR ";
$search_params['catid_'.$catid] = $catid;
$query .= "`main`.`category` = :catid_" . $catid . " OR ";
$search_params['catid_' . $catid] = $catid;
}
}
if (count($cats) > 0) {
$query = substr($query, 0, strlen($query) - 3);
$query .= ") ";
}
}
return array('0' => $query, '1' => $search_params);
return array(
'0' => $query,
'1' => $search_params
);
}
/**
@@ -646,8 +657,7 @@ class ticket {
*/
static public function getStatusText($_lng, $_status = 0)
{
switch($_status)
{
switch ($_status) {
case 0:
return $_lng['ticket']['open'];
break;
@@ -668,8 +678,7 @@ class ticket {
*/
static public function getPriorityText($_lng, $_priority = 0)
{
switch($_priority)
{
switch ($_priority) {
case 1:
return $_lng['ticket']['high'];
break;
@@ -684,19 +693,19 @@ class ticket {
private function convertLatin1ToHtml($str)
{
$html_entities = array (
"Ä" => "&Auml;",
"ä" => "&auml;",
"Ö" => "&Ouml;",
"ö" => "&ouml;",
"Ü" => "&Uuml;",
"ü" => "&uuml;",
"ß" => "&szlig;"
/*
* @TODO continue this table for all the special-characters
*/
$html_entities = array(
"Ä" => "&Auml;",
"ä" => "&auml;",
"Ö" => "&Ouml;",
"ö" => "&ouml;",
"Ü" => "&Uuml;",
"ü" => "&uuml;",
"ß" => "&szlig;"
/*
* @TODO continue this table for all the special-characters
*/
);
foreach ($html_entities as $key => $value) {
$str = str_replace($key, $value, $str);
}
@@ -706,45 +715,47 @@ class ticket {
/**
* function customerHasTickets
*
* @param int customer-id
*
* @return array/bool array of ticket-ids if customer has any, else false
* @param
* int customer-id
*
* @return array/bool array of ticket-ids if customer has any, else false
*/
static public function customerHasTickets($_cid = 0) {
static public function customerHasTickets($_cid = 0)
{
if ($_cid != 0) {
$result_stmt = Database::prepare("
SELECT `id` FROM `" . TABLE_PANEL_TICKETS . "` WHERE `customerid` = :cid"
);
Database::pexecute($result_stmt, array('cid' => $_cid));
SELECT `id` FROM `" . TABLE_PANEL_TICKETS . "` WHERE `customerid` = :cid");
Database::pexecute($result_stmt, array(
'cid' => $_cid
));
$tickets = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$tickets[] = $row['id'];
}
return $tickets;
}
return false;
}
/**
* Get a data-var
*/
public function Get($_var = '', $_vartrusted = false) {
public function Get($_var = '', $_vartrusted = false)
{
if ($_var != '') {
if (!$_vartrusted) {
if (! $_vartrusted) {
$_var = htmlspecialchars($_var);
}
if (isset($this->t_data[$_var])) {
if (strtolower($_var) == 'message') {
// avoid double line-breaks, #1413
$this->t_data[$_var] = str_replace("<br />\n", "\n", $this->t_data[$_var]);
return nl2br($this->t_data[$_var]);
} elseif(strtolower($_var) == 'subject') {
} elseif (strtolower($_var) == 'subject') {
return nl2br($this->t_data[$_var]);
} else {
return $this->t_data[$_var];
@@ -758,25 +769,21 @@ class ticket {
/**
* Set a data-var
*/
public function Set($_var = '', $_value = '', $_vartrusted = false, $_valuetrusted = false) {
if ($_var != ''
&& $_value != ''
) {
if (!$_vartrusted) {
public function Set($_var = '', $_value = '', $_vartrusted = false, $_valuetrusted = false)
{
if ($_var != '' && $_value != '') {
if (! $_vartrusted) {
$_var = strip_tags($_var);
}
if (!$_valuetrusted) {
if (! $_valuetrusted) {
$_value = strip_tags($_value, '<br />');
}
if (strtolower($_var) == 'message'
|| strtolower($_var) == 'subject'
) {
if (strtolower($_var) == 'message' || strtolower($_var) == 'subject') {
$_value = $this->convertLatin1ToHtml($_value);
}
$this->t_data[$_var] = $_value;
}
}

View File

@@ -89,6 +89,10 @@ class DomainSSL {
$ssl_files['ssl_cert_chainfile'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_chain.pem');
}
}
// will only be generated to be used externally, froxlor does not need this
if ($dom_certs['ssl_fullchain_file'] != '') {
$ssl_files['ssl_fullchain_file'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_fullchain.pem');
}
// create them on the filesystem
foreach ($ssl_files as $type => $filename) {
if ($filename != '') {

View File

@@ -353,7 +353,7 @@ exit "$RETVAL"
<!--DNS -->
<service type="dns" title="{{lng.admin.configfiles.dns}}">
<!--Bind9 -->
<daemon name="bind" title="Bind9 nameserver">
<daemon name="bind" title="Bind9 nameserver" default="true">
<install><![CDATA[emerge net-dns/bind]]></install>
<file name="/etc/bind/default.zone">
<content><![CDATA[
@@ -2138,7 +2138,7 @@ protocol lda {
driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
default_pass_scheme = CRYPT
password_query = "SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')"
password_query = "SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))"
user_query = "SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('*:storage=', quota,'M') AS quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')"
iterate_query = "SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3 = 1)"
]]>
@@ -3422,10 +3422,17 @@ MAILDIRPATH=.maildir
<daemon name="proftpd" title="ProFTPd" default="true">
<command><![CDATA[echo "net-ftp/proftpd mysql" >> /etc/portage/package.use]]></command>
<install><![CDATA[emerge net-ftp/proftpd]]></install>
<commands>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key]]></command>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
]]>
</content>
</file>
<commands index="1">
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">

View File

@@ -48,6 +48,11 @@
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<command>
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
@@ -365,7 +370,7 @@ exit "$RETVAL"
<!--DNS -->
<service type="dns" title="{{lng.admin.configfiles.dns}}">
<!--Bind9 -->
<daemon name="bind" title="Bind9 nameserver">
<daemon name="bind" title="Bind9 nameserver" default="true">
<install><![CDATA[apt-get install bind9]]></install>
<command><![CDATA[echo "include \"{{settings.system.bindconf_directory}}froxlor_bind.conf\";" >> /etc/bind/named.conf.local]]></command>
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
@@ -2714,7 +2719,7 @@ user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir
# SELECT userid AS user, password, \
# home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
# FROM users WHERE userid = '%u'
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))
# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users
@@ -3814,10 +3819,17 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<commands>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key]]></command>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
]]>
</content>
</file>
<commands index="1">
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
@@ -4639,7 +4651,9 @@ aliases: files
<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>
<command><![CDATA[touch /var/lib/extrausers/passwd]]></command>
<command><![CDATA[touch /var/lib/extrausers/group]]></command>
<command><![CDATA[touch /var/lib/extrausers/shadow]]></command>
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
@@ -4746,6 +4760,11 @@ aliases: files
</visibility>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<froxlor>
<distribution name="Ubuntu" codename="Precise" version="12.04" defaulteditor="/usr/bin/nano">
<distribution name="Ubuntu" codename="Precise" version="12.04" defaulteditor="/usr/bin/nano" deprecated="true">
<services>
<!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}">
@@ -49,6 +49,11 @@
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
@@ -334,7 +339,7 @@ exit "$RETVAL"
<!--DNS -->
<service type="dns" title="{{lng.admin.configfiles.dns}}">
<!--Bind9 -->
<daemon name="bind" title="Bind9 nameserver">
<daemon name="bind" title="Bind9 nameserver" default="true">
<install><![CDATA[apt-get install bind9]]></install>
<command><![CDATA[echo "include \"{{settings.system.bindconf_directory}}froxlor_bind.conf\";" >> /etc/bind/named.conf]]></command>
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
@@ -726,7 +731,7 @@ smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
# Virtual delivery settings
virtual_mailbox_base = <VIRTUAL_MAILBOX_BASE>
virtual_mailbox_base = /
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf
@@ -1029,7 +1034,7 @@ userdb {
driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
default_pass_scheme = CRYPT
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('maildir:storage=', (quota*1024)) as quota FROM mail_users WHERE (username = '%u' OR email = '%u')
iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3 = 1)
]]>
@@ -1143,10 +1148,17 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<commands>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key]]></command>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
]]>
</content>
</file>
<commands index="1">
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
@@ -1638,7 +1650,9 @@ aliases: files
<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>
<command><![CDATA[touch /var/lib/extrausers/passwd]]></command>
<command><![CDATA[touch /var/lib/extrausers/group]]></command>
<command><![CDATA[touch /var/lib/extrausers/shadow]]></command>
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
@@ -1745,6 +1759,11 @@ aliases: files
</visibility>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -1774,7 +1774,7 @@ default_pass_scheme = CRYPT
#password_query = \
# SELECT username, domain, password \
# FROM users WHERE username = '%n' AND domain = '%d'
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))
#password_query = SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, 'maildir:/var/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 12 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
# userdb query to retrieve the user information. It can return fields:

View File

@@ -48,6 +48,11 @@
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<command>
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
@@ -354,7 +359,7 @@ exit "$RETVAL"
<!--DNS -->
<service type="dns" title="{{lng.admin.configfiles.dns}}">
<!--Bind9 -->
<daemon name="bind" title="Bind9 nameserver">
<daemon name="bind" title="Bind9 nameserver" default="true">
<install><![CDATA[apt-get install bind9]]></install>
<command><![CDATA[echo "include \"{{settings.system.bindconf_directory}}froxlor_bind.conf\";" >> /etc/bind/named.conf.local]]></command>
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
@@ -2723,7 +2728,7 @@ user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir
# SELECT userid AS user, password, \
# home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
# FROM users WHERE userid = '%u'
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))
# Query to get a list of all usernames.
#iterate_query = SELECT username AS user FROM users
@@ -3882,10 +3887,17 @@ plugin {
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<commands>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key]]></command>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
]]>
</content>
</file>
<commands index="1">
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
@@ -4539,7 +4551,9 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
<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>
<command><![CDATA[touch /var/lib/extrausers/passwd]]></command>
<command><![CDATA[touch /var/lib/extrausers/group]]></command>
<command><![CDATA[touch /var/lib/extrausers/shadow]]></command>
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
@@ -4640,6 +4654,11 @@ aliases: files
</visibility>
<command><![CDATA[a2dismod php7.0]]></command>
</commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

View File

@@ -49,6 +49,11 @@
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
@@ -85,6 +90,11 @@ Alias "/.well-known/acme-challenge" "{{settings.system.letsencryptchallengepath}
<include>//service[@type='http']/general/commands</include>
<command><![CDATA[a2dismod userdir]]></command>
<command><![CDATA[a2enmod headers]]></command>
<command>
<visibility mode="true">{{settings.system.use_ssl}}
</visibility>
<content><![CDATA[a2enmod ssl]]></content>
</command>
<file name="/etc/apache2/mods-enabled/fastcgi.conf">
<visibility mode="true">{{settings.phpfpm.enabled}}
</visibility>
@@ -367,7 +377,7 @@ exit "$RETVAL"
<!--DNS -->
<service type="dns" title="{{lng.admin.configfiles.dns}}">
<!--Bind9 -->
<daemon name="bind" title="Bind9 nameserver">
<daemon name="bind" title="Bind9 nameserver" default="true">
<install><![CDATA[apt-get install bind9]]></install>
<command><![CDATA[echo "include \"{{settings.system.bindconf_directory}}froxlor_bind.conf\";" >> /etc/bind/named.conf]]></command>
<command><![CDATA[touch {{settings.system.bindconf_directory}}froxlor_bind.conf]]></command>
@@ -761,7 +771,7 @@ smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
# Virtual delivery settings
virtual_mailbox_base = <VIRTUAL_MAILBOX_BASE>
virtual_mailbox_base = /
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf
@@ -1038,7 +1048,7 @@ auth_mechanisms = plain login
driver = mysql
connect = host=<SQL_HOST> dbname=<SQL_DB> user=<SQL_UNPRIVILEGED_USER> password=<SQL_UNPRIVILEGED_PASSWORD>
default_pass_scheme = CRYPT
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')
password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('*:storage=', quota, 'M') as userdb_quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR ((postfix = 'Y' AND '%Ls' = 'smtp') OR (postfix = 'Y' AND '%Ls' = 'sieve')))
user_query = SELECT CONCAT(homedir, maildir) AS home, CONCAT('maildir:', homedir, maildir) AS mail, uid, gid, CONCAT('*:storage=', quota, 'M') as quota_rule FROM mail_users WHERE (username = '%u' OR email = '%u')
iterate_query = SELECT username AS user FROM mail_users WHERE (imap = 1 OR pop3 = 1)
]]>
@@ -1152,10 +1162,17 @@ MYSQL_AUXOPTIONS_FIELD CONCAT("allowimap=",imap,",allowpop3=",pop3)
<!-- Proftpd -->
<daemon name="proftpd" title="ProFTPd" default="true">
<install><![CDATA[apt-get install proftpd-basic proftpd-mod-mysql]]></install>
<commands>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"]]></command>
<command><![CDATA[chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key]]></command>
<file name="/etc/proftpd/create-cert.sh" chown="root:0" chmod="0700">
<content><![CDATA[#!/bin/bash
[ -f /etc/ssl/certs/proftpd.crt ] || openssl req -new -x509 -newkey rsa:4096 -days 3650 -nodes -out /etc/ssl/certs/proftpd.crt -keyout /etc/ssl/private/proftpd.key -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
[ -f /etc/ssl/certs/proftpd_ec.crt ] || openssl req -new -x509 -nodes -newkey ec:<(openssl ecparam -name secp521r1) -keyout /etc/ssl/private/proftpd_ec.key -out /etc/ssl/certs/proftpd_ec.crt -days 3650 -subj "/C=US/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<SERVERNAME>"
chmod 0600 /etc/ssl/private/proftpd.key /etc/ssl/private/proftpd_ec.key
]]>
</content>
</file>
<commands index="1">
<command><![CDATA[/etc/proftpd/create-cert.sh]]></command>
<command><![CDATA[rm -f /etc/proftpd/create-cert.sh]]></command>
</commands>
<file name="/etc/proftpd/proftpd.conf" chown="root:0" chmod="0600"
backup="true">
@@ -1647,7 +1664,9 @@ aliases: files
<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>
<command><![CDATA[touch /var/lib/extrausers/passwd]]></command>
<command><![CDATA[touch /var/lib/extrausers/group]]></command>
<command><![CDATA[touch /var/lib/extrausers/shadow]]></command>
</commands>
<file name="/etc/nsswitch.conf" backup="true">
<content><![CDATA[
@@ -1754,6 +1773,11 @@ aliases: files
</visibility>
<command><![CDATA[a2dismod php5]]></command>
</commands>
<commands index="5">
<visibility mode="equals" value="apache2">{{settings.system.webserver}}
</visibility>
<command><![CDATA[/etc/init.d/apache2 restart]]></command>
</commands>
<!-- instead of just restarting apache, we let the cronjob do all the
dirty work -->
<command><![CDATA[php {{const.FROXLOR_INSTALL_DIR}}/scripts/froxlor_master_cronjob.php --force]]></command>

File diff suppressed because it is too large Load Diff

View File

@@ -158,6 +158,18 @@ return array(
)
)
),
'section_cpre' => array(
'visible' => !empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png',
'fields' => array(
'use_plan' => array(
'label' => $lng['admin']['plans']['use_plan'],
'type' => 'select',
'select_var' => $hosting_plans
)
)
),
'section_c' => array(
'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_add.png',
@@ -166,7 +178,7 @@ return array(
'label' => $lng['customer']['diskspace'],
'type' => 'textul',
'value' => 0,
'maxlength' => 6,
'maxlength' => 16,
'mandatory' => true,
'ul_field' => $diskspace_ul
),
@@ -174,7 +186,7 @@ return array(
'label' => $lng['customer']['traffic'],
'type' => 'textul',
'value' => 0,
'maxlength' => 4,
'maxlength' => 14,
'mandatory' => true,
'ul_field' => $traffic_ul
),
@@ -290,9 +302,9 @@ return array(
'values' => $phpconfigs,
'value' => ((int) Settings::Get('system.mod_fcgid') == 1 ? array(
Settings::Get('system.mod_fcgid_defaultini')
) : (int) Settings::Get('phpfpm.enabled') == 1) ? array(
) : (int) Settings::Get('phpfpm.enabled') == 1 ? array(
Settings::Get('phpfpm.defaultini')
) : array(),
) : array()),
'is_array' => 1
),
'perlenabled' => array(

View File

@@ -150,6 +150,18 @@ return array(
)
)
),
'section_cpre' => array(
'visible' => !empty($hosting_plans),
'title' => $lng['admin']['plans']['use_plan'],
'image' => 'icons/user_add.png',
'fields' => array(
'use_plan' => array(
'label' => $lng['admin']['plans']['use_plan'],
'type' => 'select',
'select_var' => $hosting_plans
)
)
),
'section_c' => array(
'title' => $lng['admin']['servicedata'],
'image' => 'icons/user_edit.png',
@@ -158,7 +170,7 @@ return array(
'label' => $lng['customer']['diskspace'],
'type' => 'textul',
'value' => $result['diskspace'],
'maxlength' => 6,
'maxlength' => 16,
'mandatory' => true,
'ul_field' => $diskspace_ul
),
@@ -166,7 +178,7 @@ return array(
'label' => $lng['customer']['traffic'],
'type' => 'textul',
'value' => $result['traffic'],
'maxlength' => 4,
'maxlength' => 14,
'mandatory' => true,
'ul_field' => $traffic_ul
),

View File

@@ -131,6 +131,19 @@ return array(
'type' => 'textarea',
'cols' => 60,
'rows' => 12
),
'notryfiles' => array(
'visible' => (Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
'label' => $lng['admin']['notryfiles']['title'],
'desc' => $lng['admin']['notryfiles']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
)
)
),

View File

@@ -161,6 +161,21 @@ return array(
'value' => array(
'1'
)
),
'notryfiles' => array(
'visible' => (Settings::Get('system.webserver') == 'nginx' && $userinfo['change_serversettings'] == '1'),
'label' => $lng['admin']['notryfiles']['title'],
'desc' => $lng['admin']['notryfiles']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['notryfiles']
)
)
)
),

View File

@@ -99,6 +99,70 @@ return array(
),
'value' => array()
),
'override_fpmconfig' => array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array()
),
'pm' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'select',
'select_var' => $pm_select
),
'max_children' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 1
),
'start_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 20
),
'min_spare_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 5
),
'max_spare_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 35
),
'max_requests' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 0
),
'idle_timeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => 30
),
'limit_extensions' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => '.php'
),
'phpsettings' => array(
'style' => 'align-top',
'label' => $lng['admin']['phpsettings']['phpinisettings'],

View File

@@ -102,6 +102,70 @@ return array(
),
'value' => array($result['pass_authorizationheader'])
),
'override_fpmconfig' => array(
'label' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig'],
'type' => 'checkbox',
'values' => array(
array ('label' => $lng['panel']['yes'], 'value' => '1')
),
'value' => array($result['override_fpmconfig'])
),
'pm' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
'desc' => $lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'select',
'select_var' => $pm_select
),
'max_children' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_children']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_children']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_children']
),
'start_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['start_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['start_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['start_servers']
),
'min_spare_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['min_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['min_spare_servers']
),
'max_spare_servers' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_spare_servers']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_spare_servers']
),
'max_requests' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['max_requests']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['max_requests']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['max_requests']
),
'idle_timeout' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['idle_timeout']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'int',
'value' => $result['idle_timeout']
),
'limit_extensions' => array(
'visible' => (Settings::Get('phpfpm.enabled') == 1 ? true : false),
'label' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['title'],
'desc' => $lng['serversettings']['phpfpm_settings']['limit_extensions']['description'].$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'],
'type' => 'text',
'value' => $result['limit_extensions']
),
'phpsettings' => array(
'style' => 'align-top',
'label' => $lng['admin']['phpsettings']['phpinisettings'],

View File

@@ -0,0 +1,41 @@
<?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(
'plans_add' => array(
'title' => $lng['admin']['plans']['add'],
'image' => 'icons/templates_add_big.png',
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['plans']['plan_details'],
'image' => 'icons/templates_add_big.png',
'fields' => array(
'name' => array(
'label' => $lng['admin']['plans']['name'],
'type' => 'text'
),
'description' => array(
'label' => $lng['admin']['plans']['description'],
'type' => 'textarea',
'cols' => 60,
'rows' => 12
)
)
)
)
)
);

View File

@@ -0,0 +1,43 @@
<?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(
'plans_edit' => array(
'title' => $lng['admin']['plans']['edit'],
'image' => 'icons/templates_edit_big.png',
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['plans']['plan_details'],
'image' => 'icons/templates_edit_big.png',
'fields' => array(
'name' => array(
'label' => $lng['admin']['plans']['name'],
'type' => 'text',
'value' => $result['name']
),
'description' => array(
'label' => $lng['admin']['plans']['description'],
'type' => 'textarea',
'cols' => 60,
'rows' => 12,
'value' => $result['description']
)
)
)
)
)
);

View File

@@ -24,8 +24,8 @@ return array(
'image' => 'icons/backup_big.png',
'fields' => array(
'path' => array(
'label' => $lng['panel']['path'],
'desc' => (Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'label' => $lng['panel']['backuppath']['title'],
'desc' => $lng['panel']['backuppath']['description'].'<br>'.(Settings::Get('panel.pathedit') != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
'type' => $pathSelect['type'],
'select_var' => $pathSelect['value'],
'value' => $pathSelect['value']

View File

@@ -29,7 +29,7 @@ function makeCorrectDir($dir) {
if (version_compare("5.4.6", PHP_VERSION, ">")) {
assert('is_string($dir) && strlen($dir) > 0 /* $dir does not look like an actual folder name */');
} else {
assert('is_string($dir) && strlen($dir) > 0', 'Value "' . $dir .'" does not look like an actual folder name');
assert((is_string($dir) && strlen($dir) > 0), 'Value "' . $dir .'" does not look like an actual folder name');
}
$dir = trim($dir);

View File

@@ -34,7 +34,7 @@ function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
$returnvalue = isset($fielddata['option_options'][$newfieldvalue]);
}
if($returnvalue === true)
if($returnvalue === true || $fielddata['visible'] == false)
{
return true;
}

View File

@@ -63,7 +63,7 @@ function getOutstandingTasks() {
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
if ($row['data'] != '') {
$row['data'] = unserialize($row['data']);
$row['data'] = json_decode($row['data'], true);
}
// rebuilding webserver-configuration

View File

@@ -70,7 +70,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
$data['uid'] = $param2;
$data['gid'] = $param3;
$data['store_defaultindex'] = $param4;
$data = serialize($data);
$data = json_encode($data);
Database::pexecute($ins_stmt, array('type' => '2', 'data' => $data));
} elseif ($type == '6'
@@ -78,7 +78,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
) {
$data = array();
$data['loginname'] = $param1;
$data = serialize($data);
$data = json_encode($data);
Database::pexecute($ins_stmt, array('type' => '6', 'data' => $data));
} elseif ($type == '7'
@@ -88,7 +88,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
$data = array();
$data['loginname'] = $param1;
$data['email'] = $param2;
$data = serialize($data);
$data = json_encode($data);
Database::pexecute($ins_stmt, array('type' => '7', 'data' => $data));
} elseif ($type == '8'
@@ -98,13 +98,13 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '
$data = array();
$data['loginname'] = $param1;
$data['homedir'] = $param2;
$data = serialize($data);
$data = json_encode($data);
Database::pexecute($ins_stmt, array('type' => '8', 'data' => $data));
} elseif ($type == '20'
&& is_array($param1)
) {
$data = serialize($param1);
$data = json_encode($param1);
Database::pexecute($ins_stmt, array('type' => '20', 'data' => $data));
}
}

View File

@@ -36,9 +36,11 @@ function getRedirectCodesArray() {
* return an array of all enabled redirect-codes
* for the settings form
*
* @param bool $add_desc optional, default true, add the code-description
*
* @return array array of enabled redirect-codes
*/
function getRedirectCodes() {
function getRedirectCodes($add_desc = true) {
global $lng;
@@ -47,7 +49,10 @@ function getRedirectCodes() {
$codes = array();
while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$codes[$rc['id']] = $rc['code']. ' ('.$lng['redirect_desc'][$rc['desc']].')';
$codes[$rc['id']] = $rc['code'];
if ($add_desc) {
$codes[$rc['id']] .= ' ('.$lng['redirect_desc'][$rc['desc']].')';
}
}
return $codes;
@@ -58,12 +63,18 @@ function getRedirectCodes() {
* domain-id
*
* @param integer $domainid id of the domain
* @param string $default
*
* @return string redirect-code
*/
function getDomainRedirectCode($domainid = 0, $default = '') {
function getDomainRedirectCode($domainid = 0) {
// get system default
$default = '301';
if (Settings::Get('customredirect.enabled') == '1') {
$all_codes = getRedirectCodes(false);
$_default = $all_codes[Settings::Get('customredirect.default')];
$default = ($_default == '---') ? $default : $_default;
}
$code = $default;
if ($domainid > 0) {

View File

@@ -24,12 +24,14 @@ function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldva
'system_mod_fcgid_enabled' => array(
'other_post_field' => 'system_phpfpm_enabled',
'other_enabled' => 'phpfpm.enabled',
'other_enabled_lng' => 'phpfpmstillenabled'
'other_enabled_lng' => 'phpfpmstillenabled',
'deactivate' => array('phpfpm.enabled_ownvhost' => 0)
),
'system_phpfpm_enabled' => array(
'other_post_field' => 'system_mod_fcgid_enabled',
'other_enabled' => 'system.mod_fcgid',
'other_enabled_lng' => 'fcgidstillenabled'
'other_enabled_lng' => 'fcgidstillenabled',
'deactivate' => array('system.mod_fcgid_ownvhost' => 0)
)
);
@@ -56,6 +58,13 @@ function checkFcgidPhpFpm($fieldname, $fielddata, $newfieldvalue, $allnewfieldva
}
}
}
if (in_array(FORMFIELDS_PLAUSIBILITY_CHECK_OK, $returnvalue)) {
// be sure to deactivate the other one for the froxlor-vhost
// to avoid having a settings-deadlock
foreach ($check_array[$fieldname]['deactivate'] as $setting => $value) {
Settings::Set($setting, $value, true);
}
}
}
return $returnvalue;

View File

@@ -214,6 +214,11 @@ return array(
'label' => $lng['admin']['ipsandports']['ipsandports'],
'required_resources' => 'change_serversettings'
),
array(
'url' => 'admin_plans.php?page=overview',
'label' => $lng['admin']['plans']['plans'],
'required_resources' => 'customers'
),
array(
'url' => 'admin_settings.php?page=updatecounters',
'label' => $lng['admin']['updatecounters'],
@@ -267,6 +272,12 @@ return array(
'label' => $lng['admin']['autoupdate'],
'required_resources' => 'change_serversettings',
'show_element' => extension_loaded('zip')
),
array(
'url' => 'admin_settings.php?page=wipecleartextmailpws',
'label' => $lng['admin']['wipecleartextmailpwd'],
'required_resources' => 'change_serversettings',
'show_element' => (Settings::Get('system.mailpwcleartext') == true)
)
)
),

View File

@@ -52,5 +52,6 @@ define('TABLE_PANEL_DOMAIN_SSL_SETTINGS', 'domain_ssl_settings');
define('TABLE_DOMAINTOIP', 'panel_domaintoip');
define('TABLE_DOMAIN_DNS', 'domain_dns_entries');
define('TABLE_PANEL_FPMDAEMONS', 'panel_fpmdaemons');
define('TABLE_PANEL_PLANS', 'panel_plans');
require dirname(__FILE__).'/version.inc.php';

View File

@@ -16,10 +16,10 @@
*/
// Main version variable
$version = '0.9.39.1';
$version = '0.9.40.1';
// Database version (YYYYMMDDC where C is a daily counter)
$dbversion = '201801260';
$dbversion = '201809280';
// Distribution branding-tag (used for Debian etc.)
$branding = '';

View File

@@ -229,6 +229,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'The forwarder to %s already ex
$lng['error']['destinationalreadyexist'] = 'You have already defined a forwarder to %s .';
$lng['error']['destinationiswrong'] = 'The forwarder %s contains invalid character(s) or is incomplete.';
$lng['error']['ticketnotaccessible'] = 'You cannot access this ticket.';
$lng['error']['backupfoldercannotbedocroot'] = 'The folder for backups cannot be your homedir, please chose a folder within your homedir, e.g. /backups';
/**
* Questions
@@ -337,6 +338,14 @@ $lng['serversettings']['documentroot_prefix']['title'] = 'Home directory';
$lng['serversettings']['documentroot_prefix']['description'] = 'Where should all home directories be stored?';
$lng['serversettings']['logfiles_directory']['title'] = 'Logfiles directory';
$lng['serversettings']['logfiles_directory']['description'] = 'Where should all log files be stored?';
$lng['serversettings']['logfiles_script']['title'] = 'Custom script to pipe log-files to';
$lng['serversettings']['logfiles_script']['description'] = 'You can specify a script here and use the placeholders <strong>{LOGFILE}, {DOMAIN} and {CUSTOMER}</strong> if needed. In case you want to use it you will need to activate the <strong>Pipe webserver logfiles</strong> option too. No prefixed pipe-character is needed.';
$lng['serversettings']['logfiles_format']['title'] = 'Access-log format';
$lng['serversettings']['logfiles_format']['description'] = 'Enter a custom log-format here according to your webservers specifications, leave empty for default';
$lng['serversettings']['logfiles_type']['title'] = 'Access-log type';
$lng['serversettings']['logfiles_type']['description'] = 'Chose between <strong>combined</strong> or <strong>vhost_combined</strong> here.';
$lng['serversettings']['logfiles_piped']['title'] = 'Pipe webserver logfiles to specified script (see above)';
$lng['serversettings']['logfiles_piped']['description'] = 'When using a custom script for the logfiles you need to activate this in order for it to be executed';
$lng['serversettings']['ipaddress']['title'] = 'IP-address';
$lng['serversettings']['ipaddress']['description'] = 'What\'s the main IP-address of this server?';
$lng['serversettings']['hostname']['title'] = 'Hostname';
@@ -508,8 +517,8 @@ $lng['changepassword']['also_change_webalizer'] = ' also change password for the
$lng['serversettings']['mailpwcleartext']['title'] = 'Also save passwords of mail accounts unencrypted in database';
$lng['serversettings']['mailpwcleartext']['description'] = 'If this is set to yes, all passwords will also be saved unencrypted (clear text, plain readable for everyone with database access) in the mail_users-table. Only activate this if you intend to use SASL!';
$lng['serversettings']['mailpwcleartext']['removelink'] = 'Click here to wipe all unencrypted passwords from the table.';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Do you really want to wipe all unencrypted mail account passwords from the table mail_users? This cannot be reverted!';
$lng['admin']['wipecleartextmailpwd'] = 'Clear plaintext passwords';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Do you really want to wipe all unencrypted mail account passwords from the table mail_users? This cannot be reverted! The setting to store email passwords unencrypted will also be set to OFF';
$lng['admin']['configfiles']['overview'] = 'Overview';
$lng['admin']['configfiles']['wizard'] = 'Wizard';
$lng['admin']['configfiles']['distribution'] = 'Distribution';
@@ -1648,7 +1657,7 @@ $lng['admin']['usedmax'] = 'Used / Max';
$lng['admin']['used'] = 'Used';
$lng['mysql']['size'] = 'Size';
$lng['error']['invalidhostname'] = 'Hostname can\'t be empty nor can it consist only of whitespaces';
$lng['error']['invalidhostname'] = 'Hostname needs to be avalid domain. It can\'t be empty nor can it consist only of whitespaces';
$lng['traffic']['http'] = 'HTTP (MiB)';
$lng['traffic']['ftp'] = 'FTP (MiB)';
@@ -2104,3 +2113,20 @@ $lng['serversettings']['phpfpm_settings']['envpath'] = 'Paths to add to the PATH
$lng['admin']['configfiles']['importexport'] = 'Import/Export';
$lng['success']['settingsimported'] = 'Settings imported successfully';
$lng['error']['jsonextensionnotfound'] = 'This feature requires the php json-extension.';
// added in froxlor 0.9.39
$lng['admin']['plans']['name'] = 'Plan name';
$lng['admin']['plans']['description'] = 'Description';
$lng['admin']['plans']['last_update'] = 'Last updated';
$lng['admin']['plans']['plans'] = 'Hosting plans';
$lng['admin']['plans']['plan_details'] = 'Plan details';
$lng['admin']['plans']['add'] = 'Add new plan';
$lng['admin']['plans']['edit'] = 'Edit plan';
$lng['admin']['plans']['use_plan'] = 'Apply plan';
$lng['question']['plan_reallydelete'] = 'Do you really want to delete the hosting plan %s?';
$lng['admin']['notryfiles']['title'] = 'No autogenerated try_files';
$lng['admin']['notryfiles']['description'] = 'Say yes here if you want to specify a custom try_files directive in specialsettings (needed for some wordpress plugins for example).';
$lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Override FPM-daemon settings (pm, max_children, etc.)';
$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '<br /><span class="red">Only used if "Override FPM-daemon settings" is set to "Yes"</span>';
$lng['panel']['backuppath']['title'] = 'Destination path for the backup';
$lng['panel']['backuppath']['description'] = 'This is the path where the backups will be stored. If backup of web-data is selected, all files from the homedir are stored excluding the backup-folder specified here.';

View File

@@ -227,6 +227,7 @@ $lng['error']['destinationalreadyexistasmail'] = 'Die Weiterleitung zu "%s" exis
$lng['error']['destinationalreadyexist'] = 'Es existiert bereits eine Weiterleitung nach "%s".';
$lng['error']['destinationiswrong'] = 'Die Weiterleitungsadresse "%s" enthält ungültige Zeichen oder ist nicht vollständig.';
$lng['error']['ticketnotaccessible'] = 'Sie können sich das Ticket nicht ansehen.';
$lng['error']['backupfoldercannotbedocroot'] = 'Der Ordner für Backups darf nicht das Heimatverzeichnis sein, wähle einen Ordner unterhalb des Heimatverzeichnisses, z.B. /backups';
/**
* Questions
@@ -333,6 +334,14 @@ $lng['serversettings']['documentroot_prefix']['title'] = 'Heimatverzeichnis';
$lng['serversettings']['documentroot_prefix']['description'] = 'Wo sollen die Heimatverzeichnisse der Kunden liegen?';
$lng['serversettings']['logfiles_directory']['title'] = 'Webserver-Logdateien-Verzeichnis';
$lng['serversettings']['logfiles_directory']['description'] = 'Wo sollen die Logdateien des Webservers liegen?';
$lng['serversettings']['logfiles_script']['title'] = 'Eigenes Script zu dem Log-Files übergeben werden';
$lng['serversettings']['logfiles_script']['description'] = 'Hier kann ein Script an das die Loginhalte übergeben werden hinterlegt und die Platzhalter <strong>{LOGFILE}, {DOMAIN} und {CUSTOMER}</strong> genutzt werden, sofern nötig. Falls ein Script angegeben wird, muss die Option <strong>Webserver Logdateien umleiten</strong> gesetzt werden';
$lng['serversettings']['logfiles_format']['title'] = 'Access-Log Format';
$lng['serversettings']['logfiles_format']['description'] = 'Hier kann ein angepasstes Log-format entsprechend der Webserver-Dokumentation angegeben werden, leer lassen für Standard';
$lng['serversettings']['logfiles_type']['title'] = 'Access-Log Typ';
$lng['serversettings']['logfiles_type']['description'] = 'Wähle zwischen <strong>combined</strong> oder <strong>vhost_combined</strong>.';
$lng['serversettings']['logfiles_piped']['title'] = 'Webserver Logdateien zu eigenem Script umleiten (siehe oben)';
$lng['serversettings']['logfiles_piped']['description'] = 'Wenn ein Script für die Logdateien verwendet wird, muss diese Option aktiviert werden, damit der Webserver die Ausgabe an das Script weitergibt.';
$lng['serversettings']['ipaddress']['title'] = 'IP-Adresse';
$lng['serversettings']['ipaddress']['description'] = 'Welche Haupt-IP-Adresse hat der Server?';
$lng['serversettings']['hostname']['title'] = 'Hostname';
@@ -503,8 +512,8 @@ $lng['changepassword']['also_change_webalizer'] = ' Auch Passwort der Statistiks
$lng['serversettings']['mailpwcleartext']['title'] = 'Passwörter der Mail-Konten auch im Klartext in der Datenbank speichern';
$lng['serversettings']['mailpwcleartext']['description'] = 'Wenn diese Einstellung auf Ja gesetzt wird, werden alle Passwörter auch unverschlüsselt (also im Klartext, für jeden mit Zugriff auf die Froxlor-Datenbank sofort lesbar) in der mail_users-Tabelle gespeichert. Aktivieren Sie diese Option nur dann, wenn Sie SASL nutzen!';
$lng['serversettings']['mailpwcleartext']['removelink'] = 'Klicken Sie hier, um alle unverschlüsselten Passwörter aus der Tabelle zu entfernen.';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Wollen Sie wirklich alle unverschlüsselten Passwörter aus der Tabelle mail_users entfernen? Dieser Schritt kann nicht rückgängig gemacht werden!';
$lng['admin']['wipecleartextmailpwd'] = 'Klartext-Passwörter leeren';
$lng['question']['admin_cleartextmailpws_reallywipe'] = 'Wollen Sie wirklich alle unverschlüsselten Passwörter aus der Tabelle mail_users entfernen? Dieser Schritt kann nicht rückgängig gemacht werden! Die Einstellung für das Speichern der E-Mail Konten Passwörter in Klartext wird hierbei ebenfalls deaktiviert.';
$lng['admin']['configfiles']['overview'] = 'Übersicht';
$lng['admin']['configfiles']['wizard'] = 'Assistent';
$lng['admin']['configfiles']['distribution'] = 'Distribution';
@@ -1375,7 +1384,7 @@ $lng['admin']['usedmax'] = 'Benutzt / Max.';
$lng['admin']['used'] = 'Benutzt';
$lng['mysql']['size'] = 'Datenbankgröße';
$lng['error']['invalidhostname'] = 'Hostname darf nicht leer sein oder nur aus Leerzeichen bestehen';
$lng['error']['invalidhostname'] = 'Hostname muss eine gültige Domain sein. Er darf weder leer sein noch nur aus Leerzeichen bestehen';
$lng['traffic']['http'] = 'HTTP (MiB)';
$lng['traffic']['ftp'] = 'FTP (MiB)';
@@ -1588,9 +1597,9 @@ $lng['integrity_check']['SubdomainLetsencrypt'] = 'Hauptdomains ohne zugewiesene
$lng['admin']['mod_fcgid_umask']['title'] = 'Umask (Standard: 022)';
// Added for let's encrypt
$lng['admin']['letsencrypt']['title'] = 'Benutze Let\'s Encrypt';
$lng['admin']['letsencrypt']['title'] = 'SSL Zertifikat erstellen (Let\'s Encrypt)';
$lng['admin']['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> Wenn Wildcards aktiviert sind, wird diese Option automatisch deaktiviert. Dieses Feature befindet sich noch im Test.';
$lng['customer']['letsencrypt']['title'] = 'Benutze Let\'s Encrypt';
$lng['customer']['letsencrypt']['title'] = 'SSL Zertifikat erstellen (Let\'s Encrypt)';
$lng['customer']['letsencrypt']['description'] = 'Holt ein kostenloses Zertifikat von <a href="https://letsencrypt.org">Let\'s Encrypt</a>. Das Zertifikat wird automatisch erstellt und verlängert.<br><strong class="red">ACHTUNG:</strong> Dieses Feature befindet sich noch im Test.';
$lng['error']['sslredirectonlypossiblewithsslipport'] = 'Die Nutzung von Let\'s Encrypt ist nur möglich, wenn die Domain mindestens eine IP/Port - Kombination mit aktiviertem SSL zugewiesen hat.';
$lng['error']['nowildcardwithletsencrypt'] = 'Let\'s Encrypt kann in ACME v1 nicht mit Wildcard-Domains umgehen. Bitte den ServerAlias auf WWW setzen oder deaktivieren';
@@ -1685,7 +1694,7 @@ $lng['serversettings']['panel_customer_hide_options']['description'] = 'Wählen
$lng['serversettings']['allow_allow_customer_shell']['title'] = 'Erlaube Kunden für FTP Benutzer eine Shell auszuwählen';
$lng['serversettings']['allow_allow_customer_shell']['description'] = '<strong class="red">Bitte beachten: Shell Zugriff gestattet dem Benutzer verschiedene Programme auf Ihrem System auszuführen. Mit großer Vorsicht verwenden. Bitte aktiviere dies nur wenn WIRKLICH bekannt ist, was das bedeutet!!!</strong>';
$lng['serversettings']['available_shells']['title'] = 'Liste der verfügbaren Shells';
$lng['serversettings']['available_shells']['description'] = 'Komme-getrennte Liste von Shells die der Kunde für seine FTP-Konten wählen kann.<br><br>Hinweis: Die Standard-Shell <strong>/bin/false</strong> wird immer eine Auswahlmöglichkeit sein (wenn aktiviert), auch wenn diese Einstellung leer ist. Sie ist in jedem Fall der Standardwert für alle FTP-Konten';
$lng['serversettings']['available_shells']['description'] = 'Komma-getrennte Liste von Shells die der Kunde für seine FTP-Konten wählen kann.<br><br>Hinweis: Die Standard-Shell <strong>/bin/false</strong> wird immer eine Auswahlmöglichkeit sein (wenn aktiviert), auch wenn diese Einstellung leer ist. Sie ist in jedem Fall der Standardwert für alle FTP-Konten';
$lng['serversettings']['le_froxlor_enabled']['title'] = "Let's Encrypt für den froxlor Vhost verwenden";
$lng['serversettings']['le_froxlor_enabled']['description'] = "Wenn dies aktiviert ist, erstellt froxlor für seinen vhost automatisch ein Let's Encrypt Zertifikat.";
$lng['serversettings']['le_froxlor_redirect']['title'] = "SSL-Weiterleitung für den froxlor Vhost aktivieren";
@@ -1754,3 +1763,20 @@ $lng['phpfpm']['ini_admin_values'] = 'Mögliche <strong>php_admin_value</strong>
$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.';
// added in froxlor 0.9.39
$lng['admin']['plans']['name'] = 'Plan Name';
$lng['admin']['plans']['description'] = 'Beschreibung';
$lng['admin']['plans']['last_update'] = 'Zuletzt aktualisiert';
$lng['admin']['plans']['plans'] = 'Hosting Pläne';
$lng['admin']['plans']['plan_details'] = 'Plan Details';
$lng['admin']['plans']['add'] = 'Neuen Plan anlegen';
$lng['admin']['plans']['edit'] = 'Plan editieren';
$lng['admin']['plans']['use_plan'] = 'Plan übernehmen';
$lng['question']['plan_reallydelete'] = 'Wollen Sie den Hosting-Plan "%s" wirklich löschen?';
$lng['admin']['notryfiles']['title'] = 'Keine generierte try_files Anweisung';
$lng['admin']['notryfiles']['description'] = 'Wähle "Ja", wenn eine eigene try_files Direktive in den "eigenen Vhost Einstellungen" angegeben werden soll (z.B. nötig für manche Wordpress Plugins).';
$lng['serversettings']['phpfpm_settings']['override_fpmconfig'] = 'Überschreibe FPM-Daemon Einstellungen (pm, max_children, etc.)';
$lng['serversettings']['phpfpm_settings']['override_fpmconfig_addinfo'] = '<br /><span class="red">Nur verwendet wenn "Überschreibe FPM-Daemon Einstellungen" auf "Ja" gestellt ist</span>';
$lng['panel']['backuppath']['title'] = 'Pfad zur Ablage der Backups';
$lng['panel']['backuppath']['description'] = 'In diesem Ordner werden die Backups abgelegt. Wenn das Sichern von Web-Daten aktiviert ist, werden alle Dateien aus dem Heimatverzeichnis gesichert, exklusive des hier angegebenen Backup-Ordners.';

View File

@@ -79,7 +79,7 @@ $all_jobs = $result_tasks_stmt->fetchAll();
foreach ($all_jobs as $row) {
if ($row['data'] != '') {
$row['data'] = unserialize($row['data']);
$row['data'] = json_decode($row['data'], true);
}
if (is_array($row['data'])) {
@@ -91,6 +91,7 @@ foreach ($all_jobs as $row) {
$row['data']['destdir'] = makeCorrectDir($row['data']['destdir']);
$customerdocroot = makeCorrectDir(Settings::Get('system.documentroot_prefix').'/'.$row['data']['loginname'].'/');
// create folder if not exists
if (!file_exists($row['data']['destdir'])
&& $row['data']['destdir'] != '/'
&& $row['data']['destdir'] != Settings::Get('system.documentroot_prefix')

View File

@@ -60,6 +60,7 @@ $certificates_stmt = Database::query("
dom.`id` = domssl.`domainid`
WHERE
dom.`customerid` = cust.`customerid`
AND cust.deactivated = 0
AND dom.`letsencrypt` = 1
AND dom.`aliasdomain` IS NULL
AND dom.`iswildcarddomain` = 0
@@ -92,6 +93,7 @@ $updcert_stmt = Database::prepare("
`ssl_ca_file` = :ca,
`ssl_cert_chainfile` = :chain,
`ssl_csr_file` = :csr,
`ssl_fullchain_file` = :fullchain,
`expirationdate` = :expirationdate
");
@@ -182,6 +184,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
'ca' => $return['chain'],
'chain' => $return['chain'],
'csr' => $return['csr'],
'fullchain' => $return['fullchain'],
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
));
@@ -257,6 +260,7 @@ foreach ($certrows as $certrow) {
'ca' => $return['chain'],
'chain' => $return['chain'],
'csr' => $return['csr'],
'fullchain' => $return['fullchain'],
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
));

View File

@@ -45,6 +45,7 @@ $certificates_stmt = Database::query("
cust.`leprivatekey`,
cust.`lepublickey`,
cust.`leregistered`,
cust.`leaccount`,
cust.`customerid`,
cust.`loginname`
FROM
@@ -55,6 +56,7 @@ $certificates_stmt = Database::query("
dom.`id` = domssl.`domainid`
WHERE
dom.`customerid` = cust.`customerid`
AND cust.deactivated = 0
AND dom.`letsencrypt` = 1
AND dom.`aliasdomain` IS NULL
AND dom.`iswildcarddomain` = 0
@@ -88,6 +90,7 @@ $updcert_stmt = Database::prepare("
`ssl_ca_file` = :ca,
`ssl_cert_chainfile` = :chain,
`ssl_csr_file` = :csr,
`ssl_fullchain_file` = :fullchain,
`expirationdate` = :expirationdate
");
@@ -107,6 +110,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
'leprivatekey' => Settings::Get('system.leprivatekey'),
'lepublickey' => Settings::Get('system.lepublickey'),
'leregistered' => Settings::Get('system.leregistered'),
'leaccount' => Settings::Get('system.leaccount'),
'ssl_redirect' => Settings::Get('system.le_froxlor_redirect'),
'expirationdate' => null,
'ssl_cert_file' => null,
@@ -178,6 +182,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
'ca' => $return['chain'],
'chain' => $return['chain'],
'csr' => $return['csr'],
'fullchain' => $return['fullchain'],
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
));
@@ -261,6 +266,7 @@ foreach ($certrows as $certrow) {
'ca' => $return['chain'],
'chain' => $return['chain'],
'csr' => $return['csr'],
'fullchain' => $return['fullchain'],
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
));

View File

@@ -66,8 +66,8 @@ class apache extends HttpConfigBase
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) {
$_conffiles = glob(makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
if ($_conffiles === false || empty($_conffiles)) {
$this->logger->logAction(CRON_ACTION, LOG_INFO, 'apache::reload: fpm config directory "' . $restart_cmd['config_dir'] . '" is empty. Creating dummy.');
phpinterface_fpm::createDummyPool($restart_cmd['config_dir']);
}
@@ -359,8 +359,8 @@ class apache extends HttpConfigBase
// start block, cut off last pipe and close block
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
$this->virtualhosts_data[$vhosts_filename] .= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php5-fastcgi .php' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' Action php5-fastcgi /fastcgiphp' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php-fastcgi .php' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' Action php-fastcgi /fastcgiphp' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' Options +ExecCGI' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled?
@@ -722,19 +722,44 @@ class apache extends HttpConfigBase
// The normal access/error - logging is enabled
$error_log = makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-error.log');
// Create the logfile if it does not exist (fixes #46)
touch($error_log);
chown($error_log, Settings::Get('system.httpuser'));
chgrp($error_log, Settings::Get('system.httpgroup'));
$access_log = makeCorrectFile(Settings::Get('system.logfiles_directory') . $domain['loginname'] . $speciallogfile . '-access.log');
// Create the logfile if it does not exist (fixes #46)
touch($access_log);
chown($access_log, Settings::Get('system.httpuser'));
chgrp($access_log, Settings::Get('system.httpgroup'));
$logfiles_text .= ' ErrorLog "' . $error_log . "\"\n";
$logfiles_text .= ' CustomLog "' . $access_log . '" combined' . "\n";
$logtype = 'combined';
if (Settings::Get('system.logfiles_format') != '') {
$logtype = 'frx_custom';
$logfiles_text .= ' LogFormat "' . Settings::Get('system.logfiles_format') . '" ' . $logtype . "\n";
}
if (Settings::Get('system.logfiles_type') == '2' && Settings::Get('system.logfiles_format') == '') {
$logtype = 'vhost_combined';
}
if (Settings::Get('system.logfiles_piped') == '1' && Settings::Get('system.logfiles_script') != '') {
// replace for error_log
$command = replace_variables(Settings::Get('system.logfiles_script'), array(
'LOGFILE' => $error_log,
'DOMAIN' => $domain['domain'],
'CUSTOMER' => $domain['loginname']
));
$logfiles_text .= ' ErrorLog "| ' . $command . "\"\n";
// replace for access_log
$command = replace_variables(Settings::Get('system.logfiles_script'), array(
'LOGFILE' => $access_log,
'DOMAIN' => $domain['domain'],
'CUSTOMER' => $domain['loginname']
));
$logfiles_text .= ' CustomLog "| ' . $command . '" ' . $logtype . "\n";
} else {
// Create the logfile if it does not exist (fixes #46)
touch($error_log);
chown($error_log, Settings::Get('system.httpuser'));
chgrp($error_log, Settings::Get('system.httpgroup'));
touch($access_log);
chown($access_log, Settings::Get('system.httpuser'));
chgrp($access_log, Settings::Get('system.httpgroup'));
$logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n";
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
}
if (Settings::Get('system.awstats_enabled') == '1') {
if ((int) $domain['parentdomainid'] == 0) {
@@ -963,7 +988,7 @@ class apache extends HttpConfigBase
$corrected_docroot = $domain['documentroot'];
// Get domain's redirect code
$code = getDomainRedirectCode($domain['id'], '301');
$code = getDomainRedirectCode($domain['id']);
$modrew_red = '';
if ($code != '') {
$modrew_red = ' [R=' . $code . ';L,NE]';

View File

@@ -91,8 +91,8 @@ class apache_fcgid extends apache
// 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.= ' Action php5-fastcgi /fastcgiphp' . "\n";
$php_options_text.= ' SetHandler php-fastcgi'. "\n";
$php_options_text.= ' Action php-fastcgi /fastcgiphp' . "\n";
$php_options_text.= ' Options +ExecCGI' . "\n";
$php_options_text.= ' </FilesMatch>' . "\n";
// >=apache-2.4 enabled?

View File

@@ -66,8 +66,8 @@ class lighttpd extends HttpConfigBase
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) {
$_conffiles = glob(makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
if ($_conffiles === false || empty($_conffiles)) {
$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']);
}
@@ -466,7 +466,7 @@ class lighttpd extends HttpConfigBase
$uri = $domain['documentroot'];
// Get domain's redirect code
$code = getDomainRedirectCode($domain['id'], '301');
$code = getDomainRedirectCode($domain['id']);
$vhost_content .= ' url.redirect-code = ' . $code. "\n";
$vhost_content .= ' url.redirect = (' . "\n";

View File

@@ -81,8 +81,8 @@ class nginx extends HttpConfigBase
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) {
$_conffiles = glob(makeCorrectFile($restart_cmd['config_dir'] . "/*.conf"));
if ($_conffiles === false || empty($_conffiles)) {
$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']);
}
@@ -238,7 +238,7 @@ class nginx extends HttpConfigBase
} else {
$_sslport = $this->checkAlternativeSslPort();
$mypath = 'https://' . Settings::Get('system.hostname') . $_sslport . '/';
$this->nginx_data[$vhost_filename] .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/\w+$) {' . "\n";
$this->nginx_data[$vhost_filename] .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/[-\w]+$) {' . "\n";
$this->nginx_data[$vhost_filename] .= "\t\t" . 'return 301 ' . $mypath . '$request_uri;' . "\n";
$this->nginx_data[$vhost_filename] .= "\t" . '}' . "\n";
}
@@ -485,9 +485,9 @@ class nginx extends HttpConfigBase
}
// Get domain's redirect code
$code = getDomainRedirectCode($domain['id'], '301');
$code = getDomainRedirectCode($domain['id']);
$vhost_content .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/\w+$) {' . "\n";
$vhost_content .= "\t" . 'if ($request_uri !~ ^/.well-known/acme-challenge/[-\w]+$) {' . "\n";
$vhost_content .= "\t\t" . 'return ' . $code .' ' . $uri . '$request_uri;' . "\n";
$vhost_content .= "\t" . '}' . "\n";
} else {
@@ -916,7 +916,9 @@ class nginx extends HttpConfigBase
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
$webroot_text .= "\t" . 'index index.php index.html index.htm;' . "\n";
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
if ($domain['notryfiles'] != 1) {
$webroot_text .= "\t\t" . 'try_files $uri $uri/ @rewrites;' . "\n";
}
} else {
$webroot_text .= "\t" . 'index index.html index.htm;' . "\n";
}
@@ -927,7 +929,7 @@ class nginx extends HttpConfigBase
}
$webroot_text .= "\t" . '}' . "\n\n";
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1') {
if ($domain['phpenabled_customer'] == 1 && $domain['phpenabled_vhost'] == '1' && $domain['notryfiles'] != 1) {
$webroot_text .= "\tlocation @rewrites {\n";
$webroot_text .= "\t\trewrite ^ /index.php last;\n";
$webroot_text .= "\t}\n\n";
@@ -1003,7 +1005,13 @@ class nginx extends HttpConfigBase
chown($access_log, Settings::Get('system.httpuser'));
chgrp($access_log, Settings::Get('system.httpgroup'));
$logfiles_text .= "\t" . 'access_log ' . $access_log . ' combined;' . "\n";
$logtype = 'combined';
if (Settings::Get('system.logfiles_format') != '') {
$logtype = 'frx_custom';
$logfiles_text .= "\t" . 'log_format ' . $logtype . ' "' . Settings::Get('system.logfiles_format') . '";' . "\n";
}
$logfiles_text .= "\t" . 'access_log ' . $access_log . ' ' . $logtype . ';' . "\n";
$logfiles_text .= "\t" . 'error_log ' . $error_log . ' error;' . "\n";
if (Settings::Get('system.awstats_enabled') == '1') {

View File

@@ -43,7 +43,7 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
$resultIDs[] = $row['id'];
if ($row['data'] != '') {
$row['data'] = unserialize($row['data']);
$row['data'] = json_decode($row['data'], true);
}
/**

View File

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

View File

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

View File

@@ -1,8 +1,8 @@
<if $row['termination_css'] != ''>
<tr class="{$row['termination_css']}">
<tr class="{$row['termination_css']}<if $row['deactivated'] == 1> disabled</if>">
</if>
<if $row['termination_css'] == ''>
<tr>
<tr <if $row['deactivated'] == 1>class="disabled"</if>>
</if>
<td>{$row['domain']}
<if (isset($row['standardsubdomain']) && $row['standardsubdomain'] == $row['id'])>

59
templates/Sparkle/admin/plans/plans.tpl vendored Normal file
View File

@@ -0,0 +1,59 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/icons/templates_big.png" alt="" />&nbsp;
{$lng['admin']['plans']['plans']}
</h2>
</header>
<section>
<form action="{$linker->getLink(array('section' => 'plans'))}" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="s" value="$s"/>
<input type="hidden" name="page" value="$page"/>
<div class="overviewsearch">
{$searchcode}
</div>
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'plans', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['plans']['add']}</a>
</div>
<table class="full hl">
<thead>
<tr>
<th>{$lng['admin']['plans']['name']}&nbsp;{$arrowcode['p.name']}</th>
<th>{$lng['admin']['plans']['description']}&nbsp;{$arrowcode['p.description']}</th>
<th>{$lng['admin']['admin']}&nbsp;{$arrowcode['adminname']}</th>
<th>{$lng['admin']['plans']['last_update']}&nbsp;{$arrowcode['p.ts']}</th>
<th>{$lng['panel']['options']}</th>
</tr>
</thead>
<if $pagingcode != ''>
<tfoot>
<tr>
<td colspan="5">{$pagingcode}</td>
</tr>
</tfoot>
</if>
<tbody>
$plans
</tbody>
</table>
</form>
<if 15 < $count>
<div class="overviewadd">
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />&nbsp;
<a href="{$linker->getLink(array('section' => 'plans', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['plans']['add']}</a>
</div>
</if>
</section>
</article>
$footer

View File

@@ -0,0 +1,26 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section>
<form action="{$linker->getLink(array('section' => 'plans'))}" 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">
{$plans_add_form}
</table>
</form>
</section>
</article>
$footer

View File

@@ -0,0 +1,27 @@
$header
<article>
<header>
<h2>
<img src="templates/{$theme}/assets/img/{$image}" alt="{$title}" />&nbsp;
{$title}
</h2>
</header>
<section>
<form action="{$linker->getLink(array('section' => 'plans'))}" 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="id" value="$id" />
<input type="hidden" name="send" value="send" />
<table class="full">
{$plans_edit_form}
</table>
</form>
</section>
</article>
$footer

View File

@@ -0,0 +1,14 @@
<tr>
<td>{$row['name']}</td>
<td>{$row['description']}</td>
<td>{$row['adminname']}</td>
<td>{$row['ts_format']}</td>
<td>
<a href="{$linker->getLink(array('section' => 'plans', '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>&nbsp;
<a href="{$linker->getLink(array('section' => 'plans', '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>
</td>
</tr>

View File

@@ -60,7 +60,7 @@ $header
<tr>
<td>{$lng['ticket']['lastchange']}:</td>
<td>
<label for="fromdate">{$lng['ticket']['lastchange_from']}<br /><input type="text" id="fromdate" name="fromdate" /></label>
<label for="fromdate">{$lng['ticket']['lastchange_from']}<br /><input type="text" id="fromdate" name="fromdate" /></label><br />
<label for="todate">{$lng['ticket']['lastchange_to']}<br /><input type="text" id="todate" name="todate" /></label>
</td>
</tr>

View File

@@ -75,7 +75,7 @@ $(document).ready(function() {
circularCircle(canvas, 42, 0, 270, 4, usedColor);
circularCircle(canvas, 38, 0, 270, 4, assiColor);
}
circularText(canvas, 60, 42, 26, "∞")
circularText(canvas, 60, 42, 26, "∞");
} else if (!isNaN(assigned)) {
// Limited ressources but assigned
available = parseFloat(available);
@@ -90,7 +90,7 @@ $(document).ready(function() {
circularText(canvas, 60, 42, 22, usedP + "%");
} else if (available == "∞") {
circularCircle(canvas, 40, 0, 270, 8, unliColor);
circularText(canvas, 60, 42, 26, "∞")
circularText(canvas, 60, 42, 26, "∞");
} else {
// Limited ressources
available = parseFloat(available);
@@ -111,7 +111,7 @@ $(document).ready(function() {
if (usedP > 100) {
circularText(canvas, 60, 42, 22, usedP + "%", overColor);
} else {
circularText(canvas, 60, 42, 22, usedP + "%")
circularText(canvas, 60, 42, 22, usedP + "%");
}

View File

@@ -0,0 +1,75 @@
$(document).ready(function() {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
/**
* disable unusable php-configuration by customer settings
*/
$('#use_plan').change(function() {
var pid = $(this).val();
if (pid > 0) {
var sid = getUrlParameter('s');
$.ajax({
url: "admin_plans.php?s="+sid+"&page=overview&action=jqGetPlanValues",
type: "POST",
data: {
planid: pid
},
dataType: "json",
success: function(json) {
for (var i in json) {
if (i == 'email_imap' || i == 'email_pop3' || i == 'perlenabled' || i == 'phpenabled' || i == 'dnsenabled') {
/** handle checkboxes **/
if (json[i] == 1) {
$("input[name='"+i+"']").prop('checked', true);
} else {
$("input[name='"+i+"']").prop('checked', false);
}
} else if (i == 'allowed_phpconfigs') {
/** handle array of values **/
$("input[name='allowed_phpconfigs[]']").each(function(index) {
$(this).prop('checked', false);
for (var j in json[i]) {
if ($(this).val() == json[i][j]) {
$(this).prop('checked', true);
break;
}
}
});
} else if (json[i] == -1) {
/** handle unlimited checkboxes **/
$("input[name='" + i + "_ul']").attr('checked', 'checked');
$("input[name='"+i+"']").prop({
readonly: true
});
} else {
/** handle normal value **/
$("input[name='"+i+"']").val(json[i]);
$("input[name='"+i+"']").prop({
readonly: false
});
$("input[name='" + i + "_ul']").prop('checked', false);
}
}
},
error: function(a, b) {
console.log(a, b);
}
});
}
});
});

View File

@@ -35,7 +35,7 @@ $(document).ready(function() {
$('#phpsettingid option').each(function() {
var pid = $(this).val();
$(this).attr("disabled", "disabled");
for (i in json) {
for (var i in json) {
if (pid == json[i]) {
$(this).removeAttr("disabled");
}

View File

@@ -1,6 +1,6 @@
<tr <if !$isValid>class="domain-expired"</if>>
<td>
<a href="http://{$row['domain']}" target="_blank">{$row['domain']}</a>
<a href="https://{$row['domain']}" target="_blank">{$row['domain']}</a>
{$adminCustomerLink}
</td>
<td>
@@ -8,7 +8,7 @@
<if !empty($san_list)><br>SAN: {$san_list}</if>
</td>
<td>
{$cert_data['issuer']['O']}
<if isset($cert_data['issuer']['O']) && !empty($cert_data['issuer']['O'])>{$cert_data['issuer']['O']}</if>
</td>
<td>
{$validFrom}

View File

@@ -57,7 +57,7 @@
<footer>
<span>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAAAQCAYAAAC1MDndAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAy1JREFUeNrs1muIVlUUBuBnvqZkoswudKErZFOG0kWt6WpN0wWCDMOsgX4UmVS/KovKhIKYLhRBJvV1o/5VlJCmYEmUFYijaBYhSRQVBVE0ZnRBJ/vzfnA4nDN+wTh/pgWHc/baa6+z97v3et/d0Ww24SQ8ij5MNL7tN6zBvdjWiZOxDpP8b3JA5qAXPQ0MtAnOm9jZBvqbsQHbsGsMFrQLv+KPUc47CQONlFXZPsNfJd/buBrDFfHDWIDDcAZmohsPjwFAD+EQnL8Xcl/WqOGc+/FJyXcxVuHJivjX8Hx2cwGeweO4fIxOkL10Wg9o1HSsxUcl30V5P1JxnFuxp+M53I67cQ5mYwZexj2YlnarJBdl3BE4FfPxdfofSOwNhX+uwgXxf1Uz/024DpNxFHrwRIEiPs74XnyIq3A8Xion6qxIvj0TX1vyb8x7CJ/jrELfjrx/zgmS0p2bCWzHzejAQTgmO35J+OpInIcv8GLKeROuzcI24lAsRH/yzcGJFfMfDIB/B/ipeD8bNojX8W1hPR+gCxPwTzsAdaGRgTeGrAZLJXd4zc59l1Jr2dzC91S8g+PSXhFwGgGxO4s6Bd9gaQRkAHdhSQHso/FCzRweS56ezLmB1bgCb+DBCg67rwaLSud+uDAAvVLRfw1OqCO18JEKbusvgNMqA/F153sCpgegT+O7Iwt8NwrZwKsh5irbUuDMFoXMquhv2eKRSKiOg54OUFXSt3SEfPvi4Dz77IEAW/8uH+vdpf6dkXGF+F9GyNtRkXe4or8tqwNoWrigbDeFTEfDZhbKckuBy9blu0XkC1Pi++PK+Objy5q80/NeXSDl9wrgnDkaAIlyzCj5zh1FCb00JL07Jd2LKfgBx+LWXE6XJP6pcMiUiMg8/FmRd3GEYHNiZ+H6wgZP/i+T7MzPJo5wkjYU2t01cWfjp6hH2WZn0adVbM7KALAS3weYftwZIVgTIHtxS8YtD6kOYX2Uqi8iIKCsD6CDhXnNi+iI+vXhwD3g83tHs9l8K5JZZbfh2UL7x0jyeLFljVzUhtoc0DWOwBnCoga25s6wrHDhG8+2I1j0YOu/AwBUU7aBHvM/ZwAAAABJRU5ErkJggg==" style="height: 13px; margin: 0 2px 3px 0; vertical-align:middle;"/>
&copy; 2009-2017 by <a href="http://www.froxlor.org">the Froxlor Team</a>
&copy; 2009-2018 by <a href="http://www.froxlor.org">the Froxlor Team</a>
</span>
</footer>
</body>