Compare commits
582 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6b34cc8f8 | ||
|
|
cfda35a36b | ||
|
|
57ae625d38 | ||
|
|
65ab064289 | ||
|
|
e6a6f6f9de | ||
|
|
a7b91eb1ed | ||
|
|
a2342ad1d2 | ||
|
|
add1818723 | ||
|
|
51c1d648b2 | ||
|
|
0fca98c652 | ||
|
|
3682116ba2 | ||
|
|
3b99070496 | ||
|
|
25f20e4a7d | ||
|
|
d46b2d1d80 | ||
|
|
4750dad9e2 | ||
|
|
c6830d8e7a | ||
|
|
10b4de4cf9 | ||
|
|
ae39a1759a | ||
|
|
989b4fee0e | ||
|
|
7f6810c5bd | ||
|
|
3fbc9815ea | ||
|
|
11533c2d75 | ||
|
|
652a998188 | ||
|
|
4546c00adb | ||
|
|
3c16fab92c | ||
|
|
c8c1f7e691 | ||
|
|
02d0194b9f | ||
|
|
54876efc8c | ||
|
|
a2f8d02b16 | ||
|
|
0d45e03f19 | ||
|
|
ae74cdda53 | ||
|
|
84f5de42a9 | ||
|
|
1d7d32130a | ||
|
|
9babcde3e5 | ||
|
|
9ec76c9fd6 | ||
|
|
61dfeb947f | ||
|
|
6fdf2636fc | ||
|
|
0a38d1ab5f | ||
|
|
7c80dc3d1d | ||
|
|
5ab49e3f50 | ||
|
|
06849133a8 | ||
|
|
4a912e3902 | ||
|
|
bcb95e9b7d | ||
|
|
c97f5f1e29 | ||
|
|
4d289e2a7f | ||
|
|
c491f2c03e | ||
|
|
5832346f75 | ||
|
|
4b4770ab36 | ||
|
|
8c998dd6f2 | ||
|
|
965359ec79 | ||
|
|
d1d42f2055 | ||
|
|
5f41b37770 | ||
|
|
61265778a5 | ||
|
|
8f0f890145 | ||
|
|
5ccae3f9bb | ||
|
|
f4d9e64804 | ||
|
|
149c0935fa | ||
|
|
cb0b537f6c | ||
|
|
b54c012579 | ||
|
|
389d83f5a3 | ||
|
|
00771381e8 | ||
|
|
46df429909 | ||
|
|
eb841da007 | ||
|
|
c4a2db03be | ||
|
|
e5838f00cf | ||
|
|
bcde7e93df | ||
|
|
bd8327afbe | ||
|
|
b961eba382 | ||
|
|
a552ea878e | ||
|
|
4ad2a1da1c | ||
|
|
37ae69f07a | ||
|
|
9870db2560 | ||
|
|
724a5e172a | ||
|
|
8e166cb842 | ||
|
|
5e281cf486 | ||
|
|
5d2f44ecd8 | ||
|
|
5009c625d8 | ||
|
|
eb592340b0 | ||
|
|
c6f556c8d9 | ||
|
|
db1df84ef1 | ||
|
|
52135a1d3a | ||
|
|
7f13bd09da | ||
|
|
7ccbb37c4e | ||
|
|
7feddf0aec | ||
|
|
e73523531a | ||
|
|
a47b790e19 | ||
|
|
319eec6124 | ||
|
|
21983f27b6 | ||
|
|
5d375b784d | ||
|
|
4b22470872 | ||
|
|
ec1c37aa06 | ||
|
|
67351ec3c2 | ||
|
|
f1887aaaf2 | ||
|
|
afd2d7b5e9 | ||
|
|
c967e585b5 | ||
|
|
73e364d4ba | ||
|
|
eb49331b21 | ||
|
|
0a1a3e023f | ||
|
|
bef5cedcd0 | ||
|
|
f8e2bc7bff | ||
|
|
09038ac7aa | ||
|
|
4c507232c7 | ||
|
|
86939a64da | ||
|
|
926ce427fc | ||
|
|
53401eebfb | ||
|
|
bef580929e | ||
|
|
c7b7c67ff4 | ||
|
|
ed42d4e3df | ||
|
|
69a2ebce36 | ||
|
|
15f08739fa | ||
|
|
571690c8c5 | ||
|
|
b2005d7f29 | ||
|
|
4354598c64 | ||
|
|
05d4bdc499 | ||
|
|
25c6a37df2 | ||
|
|
41a470fe36 | ||
|
|
8a4aa2a721 | ||
|
|
1d903770fc | ||
|
|
934be5a238 | ||
|
|
5608f0407f | ||
|
|
ce9d8dad7f | ||
|
|
d6fe263e68 | ||
|
|
156846a845 | ||
|
|
abe00b79a7 | ||
|
|
26ab659c6a | ||
|
|
b0273c68d2 | ||
|
|
720cf9d74f | ||
|
|
35cd567c48 | ||
|
|
2332d5be7b | ||
|
|
14cdc3801a | ||
|
|
d85efe480e | ||
|
|
4f2ceaa3ab | ||
|
|
3b6792d548 | ||
|
|
36de6e09d4 | ||
|
|
300c410b18 | ||
|
|
282d7d9101 | ||
|
|
48f6601003 | ||
|
|
c4c4279171 | ||
|
|
b88f9c1f18 | ||
|
|
0dac045dc9 | ||
|
|
80b5f97367 | ||
|
|
7a8b39fad0 | ||
|
|
9f5978e875 | ||
|
|
155fd757bf | ||
|
|
518ec202ab | ||
|
|
871083d613 | ||
|
|
79f0c8d28f | ||
|
|
dfbb4127e2 | ||
|
|
b9b2f00f30 | ||
|
|
6923f9d926 | ||
|
|
cacbf7fec7 | ||
|
|
73991e855c | ||
|
|
0208812013 | ||
|
|
48bd2561f7 | ||
|
|
af12c4102b | ||
|
|
d2efa3ecc4 | ||
|
|
acb04566f5 | ||
|
|
abb98ae960 | ||
|
|
0d202a7e4d | ||
|
|
c69ef20b17 | ||
|
|
5872d0682a | ||
|
|
c4fa8feb8c | ||
|
|
61a50cc657 | ||
|
|
3df3261ac0 | ||
|
|
f2636e14f0 | ||
|
|
a23f22f561 | ||
|
|
8cf3f4ee24 | ||
|
|
e83f7634f8 | ||
|
|
6eb6595a46 | ||
|
|
bd48fb7328 | ||
|
|
769525bb56 | ||
|
|
9195fb3c98 | ||
|
|
82922f7aea | ||
|
|
db1a39b6d9 | ||
|
|
7fbbc2ea0b | ||
|
|
91d4432108 | ||
|
|
c8914312aa | ||
|
|
3fd89c48e8 | ||
|
|
eceb144a77 | ||
|
|
1d9651b18a | ||
|
|
49db4e60cb | ||
|
|
53e8ccbccb | ||
|
|
6d8fc215f1 | ||
|
|
f94c303cb3 | ||
|
|
2be1873354 | ||
|
|
d1d36c32fe | ||
|
|
3b3527348f | ||
|
|
036d5f0713 | ||
|
|
a1b8807b0f | ||
|
|
356a087b6a | ||
|
|
0a77fd7150 | ||
|
|
67d67a287f | ||
|
|
1f792466bf | ||
|
|
5a6343b47c | ||
|
|
841c529107 | ||
|
|
41c3f21f0b | ||
|
|
b8c0688ba0 | ||
|
|
24e02e99fb | ||
|
|
97bb7b6227 | ||
|
|
5ceddc8c65 | ||
|
|
3a17d03796 | ||
|
|
57ae195930 | ||
|
|
9b86d576fa | ||
|
|
02a12eda13 | ||
|
|
a31da97d66 | ||
|
|
9f13aa9a12 | ||
|
|
2841051649 | ||
|
|
acfbf55d15 | ||
|
|
5848df28fd | ||
|
|
21925f48c3 | ||
|
|
17a64c58c2 | ||
|
|
0ca38cff31 | ||
|
|
5efc1849b4 | ||
|
|
f213d666e2 | ||
|
|
78495b6487 | ||
|
|
ab1c76e104 | ||
|
|
a671223823 | ||
|
|
3a99e10296 | ||
|
|
38031aaff9 | ||
|
|
65773bce57 | ||
|
|
ee5de56a94 | ||
|
|
aba97df9b2 | ||
|
|
79e670f797 | ||
|
|
8670cb6742 | ||
|
|
bde87950a5 | ||
|
|
aa1d2ab01d | ||
|
|
2a770a93b1 | ||
|
|
5b85a1c183 | ||
|
|
caf8893558 | ||
|
|
a280461cf6 | ||
|
|
455c655580 | ||
|
|
ecd707424f | ||
|
|
60fe330de1 | ||
|
|
cdb871b82b | ||
|
|
35c4e3d1b9 | ||
|
|
b3f82f0981 | ||
|
|
b1b68364be | ||
|
|
ea76ce8fcc | ||
|
|
16eca628dd | ||
|
|
6bf5eccc24 | ||
|
|
63d00cd453 | ||
|
|
c79cba26f3 | ||
|
|
36eb3cc1aa | ||
|
|
15a13a7783 | ||
|
|
816874872d | ||
|
|
0e8449f28d | ||
|
|
3dcbbb9e7b | ||
|
|
5ab9e6865d | ||
|
|
3a47b2050e | ||
|
|
907c475361 | ||
|
|
0dfb4bdcdb | ||
|
|
a5dc7b93a2 | ||
|
|
244d2823a6 | ||
|
|
2f0251bb19 | ||
|
|
a37d795ff3 | ||
|
|
d9331cca61 | ||
|
|
f169129e27 | ||
|
|
746548492b | ||
|
|
4ad8b62576 | ||
|
|
1eed3d1166 | ||
|
|
6a32720c9a | ||
|
|
e389ae4bf8 | ||
|
|
970ecb469e | ||
|
|
92b6914610 | ||
|
|
7e57352bc0 | ||
|
|
e3d42a3f62 | ||
|
|
456a287621 | ||
|
|
eff630da8d | ||
|
|
aa45a0302e | ||
|
|
aa14487995 | ||
|
|
10b52486b5 | ||
|
|
0af655f106 | ||
|
|
665c87cca7 | ||
|
|
1c50838d37 | ||
|
|
ac5bc78e12 | ||
|
|
a5e6ef674f | ||
|
|
03bc94e69c | ||
|
|
37176c94a1 | ||
|
|
a141c83ad4 | ||
|
|
7c3ff95d22 | ||
|
|
d653f6842f | ||
|
|
35a69fbfe0 | ||
|
|
e733701459 | ||
|
|
70677fced2 | ||
|
|
daa223ed42 | ||
|
|
0398f4cdba | ||
|
|
1a0953e77e | ||
|
|
490704f8e1 | ||
|
|
2748f1b633 | ||
|
|
8e60c6b201 | ||
|
|
d4716b2376 | ||
|
|
2c98fc4c2d | ||
|
|
65e1f633ef | ||
|
|
ed4dbba278 | ||
|
|
1a6082ca91 | ||
|
|
da1d94149a | ||
|
|
e7cfceb65d | ||
|
|
1f48ca4711 | ||
|
|
fe0fb8dd5f | ||
|
|
4a5ab7d95d | ||
|
|
0d44adf265 | ||
|
|
0b63b4e110 | ||
|
|
ba7e9688c5 | ||
|
|
443ae1df68 | ||
|
|
b59aa6f140 | ||
|
|
4e9df61fef | ||
|
|
b350815aa0 | ||
|
|
b672c722b9 | ||
|
|
db60606cfa | ||
|
|
2524491883 | ||
|
|
de061e7e36 | ||
|
|
9ecd182a91 | ||
|
|
a7934bcb7b | ||
|
|
9dc2c09da7 | ||
|
|
b23e4a4d85 | ||
|
|
394ec4cd4a | ||
|
|
6ccfb7efbb | ||
|
|
1454d8d40f | ||
|
|
0fde1ce7e9 | ||
|
|
86155f7a9c | ||
|
|
60578a5d31 | ||
|
|
7fcacb4637 | ||
|
|
fb35fb9a3a | ||
|
|
6128954231 | ||
|
|
f4d4490d08 | ||
|
|
27f0c4eb53 | ||
|
|
cb1df3a7e0 | ||
|
|
a572ac3914 | ||
|
|
498ff15e98 | ||
|
|
022ed1a9a8 | ||
|
|
814339cc73 | ||
|
|
0bb48a3cdf | ||
|
|
67d74406bd | ||
|
|
d73d8da2fd | ||
|
|
3c7bdcb5e0 | ||
|
|
c6ac73f74f | ||
|
|
fdcb294244 | ||
|
|
8898c7c165 | ||
|
|
d4c0acb353 | ||
|
|
9ea32b69cb | ||
|
|
0524c70d2b | ||
|
|
6ca7920147 | ||
|
|
65b2e4efa7 | ||
|
|
7000fd2c30 | ||
|
|
3b1ff03b33 | ||
|
|
ffa9205f95 | ||
|
|
bc73ed0c75 | ||
|
|
17fd350d33 | ||
|
|
c2e57dfd60 | ||
|
|
50f2047da3 | ||
|
|
ecb9470b65 | ||
|
|
6d90b5ba80 | ||
|
|
eb3590dc34 | ||
|
|
bddf9b496c | ||
|
|
edc702dafa | ||
|
|
85dfc1030a | ||
|
|
c0dd432916 | ||
|
|
b3db4dd887 | ||
|
|
14413a3e8d | ||
|
|
a02a081c6b | ||
|
|
43070e4808 | ||
|
|
98c636c282 | ||
|
|
8dace6eca5 | ||
|
|
78fc4f84b2 | ||
|
|
9018404faa | ||
|
|
8bdd843bd9 | ||
|
|
0d35f5cb29 | ||
|
|
6815c1c20b | ||
|
|
048e6c13ae | ||
|
|
aedb829a74 | ||
|
|
4745581720 | ||
|
|
489ccbe07a | ||
|
|
a46e7a3bc4 | ||
|
|
a4431e25d3 | ||
|
|
1fe9f1e9d6 | ||
|
|
13767df562 | ||
|
|
02c5f80854 | ||
|
|
d7550ae58a | ||
|
|
cf2c7fa31c | ||
|
|
32b6285589 | ||
|
|
7e361274c5 | ||
|
|
62ce21c9ec | ||
|
|
6b09720ef8 | ||
|
|
8807ae7dad | ||
|
|
5f3f208534 | ||
|
|
f11ceacf89 | ||
|
|
26e43077c2 | ||
|
|
d6c8b92523 | ||
|
|
03450dcfa2 | ||
|
|
f39aab6f32 | ||
|
|
7f999302fa | ||
|
|
8294985588 | ||
|
|
a7653551b2 | ||
|
|
734c02e33f | ||
|
|
ace18cb7c9 | ||
|
|
1270204cd9 | ||
|
|
2831923708 | ||
|
|
6b1ae648b4 | ||
|
|
6c43f1bc56 | ||
|
|
2e273a41b5 | ||
|
|
2004bbe38d | ||
|
|
e44e07784f | ||
|
|
8d6275e1aa | ||
|
|
f21d4f8770 | ||
|
|
fc97b4d4e9 | ||
|
|
05051309c7 | ||
|
|
0f025a6627 | ||
|
|
f6f5765b54 | ||
|
|
ac82aa80d2 | ||
|
|
57503d9c6e | ||
|
|
f55ad16d82 | ||
|
|
ea7834c1d1 | ||
|
|
b355711de9 | ||
|
|
a5287726a4 | ||
|
|
b393c7d6e6 | ||
|
|
dd2782771a | ||
|
|
25d0bbb766 | ||
|
|
b4dedca3db | ||
|
|
09aed61dbf | ||
|
|
ca39501530 | ||
|
|
28fd88e53e | ||
|
|
e01c2e02fb | ||
|
|
762bfae61a | ||
|
|
a4d4e16efc | ||
|
|
7f83ad31f4 | ||
|
|
e143ba4577 | ||
|
|
6799a56ba1 | ||
|
|
484fe8acbc | ||
|
|
550af5b943 | ||
|
|
7ae59477af | ||
|
|
acefa41806 | ||
|
|
b39c8029cd | ||
|
|
69ff416361 | ||
|
|
3eb1718fe0 | ||
|
|
37c434d4fc | ||
|
|
1eb14d7564 | ||
|
|
1c17df69d2 | ||
|
|
c61b3b73bd | ||
|
|
18c87baec8 | ||
|
|
631b2b59a5 | ||
|
|
1e0510a43d | ||
|
|
e62f675c4c | ||
|
|
fe389ab208 | ||
|
|
63d915804a | ||
|
|
466c09137b | ||
|
|
3a738b7070 | ||
|
|
5ee9d3064a | ||
|
|
adb5c6734a | ||
|
|
7dff46b63e | ||
|
|
12883bafd6 | ||
|
|
c2b88200f0 | ||
|
|
634199780b | ||
|
|
e0275840ab | ||
|
|
bae8c86901 | ||
|
|
e8be3ee643 | ||
|
|
35ecdfa2f5 | ||
|
|
3e4a3ef4b0 | ||
|
|
cdf02ceab6 | ||
|
|
d24056c925 | ||
|
|
d2852fbd5d | ||
|
|
d76ebc7c06 | ||
|
|
4fbaacb159 | ||
|
|
2d43a8714d | ||
|
|
620a22bf3e | ||
|
|
5e01018f30 | ||
|
|
c84732a0cd | ||
|
|
dfce1fea3c | ||
|
|
e6dad6c6d0 | ||
|
|
605d2340d1 | ||
|
|
d5df4dd7a4 | ||
|
|
57497bd03f | ||
|
|
1a3cc52188 | ||
|
|
21f6874a61 | ||
|
|
b34e66dfd6 | ||
|
|
a77f890462 | ||
|
|
3cc5352c01 | ||
|
|
d01d470119 | ||
|
|
a97ce74cc8 | ||
|
|
fe7bfcc7c2 | ||
|
|
cff0ac72d0 | ||
|
|
e8dcb29b69 | ||
|
|
2b3b68efa3 | ||
|
|
d937029bf7 | ||
|
|
1955b5dd32 | ||
|
|
c2a9880616 | ||
|
|
dfedc478f7 | ||
|
|
6efe500cee | ||
|
|
9c3549c604 | ||
|
|
50755f4399 | ||
|
|
ef11ad8da7 | ||
|
|
1b2c186c07 | ||
|
|
b162324ff0 | ||
|
|
6cd061d74c | ||
|
|
53b7420dc9 | ||
|
|
aa85c648a3 | ||
|
|
35e228ff09 | ||
|
|
62236da496 | ||
|
|
e1cc896b6c | ||
|
|
36595baa65 | ||
|
|
ec3fd1d105 | ||
|
|
e39dcfbfe2 | ||
|
|
ef6254b307 | ||
|
|
44bf211ab5 | ||
|
|
b0e920104f | ||
|
|
299e201142 | ||
|
|
46982ad2dc | ||
|
|
c0e07fd659 | ||
|
|
5c11eecbd7 | ||
|
|
9689afc759 | ||
|
|
d76f4108e5 | ||
|
|
9c4d619840 | ||
|
|
7774e7606d | ||
|
|
2ed0cad27b | ||
|
|
686c2ae534 | ||
|
|
faf3abe800 | ||
|
|
220b493a1b | ||
|
|
e8d67f9711 | ||
|
|
83e932b068 | ||
|
|
84d1be538e | ||
|
|
c97cdb1c0e | ||
|
|
ffefe85fb4 | ||
|
|
27341ca490 | ||
|
|
822bb2bd4d | ||
|
|
88ee76e4c9 | ||
|
|
90d921ebb5 | ||
|
|
7b162c4bd0 | ||
|
|
32e2d48aed | ||
|
|
1fdc524171 | ||
|
|
4704798379 | ||
|
|
e5c1e8350d | ||
|
|
f0b36c03ad | ||
|
|
79056f20ee | ||
|
|
5d6aa4d2bb | ||
|
|
f803276ca2 | ||
|
|
5cf2d32e8a | ||
|
|
9430f77c2e | ||
|
|
302fe994b7 | ||
|
|
9b122bc003 | ||
|
|
9410356bc7 | ||
|
|
5d5cc3dda3 | ||
|
|
a7ccb7007f | ||
|
|
5680c88da0 | ||
|
|
cf01a587c7 | ||
|
|
b6367e1be1 | ||
|
|
93aa8bff1e | ||
|
|
15fa035dc4 | ||
|
|
057f4aaa10 | ||
|
|
f588927bc5 | ||
|
|
03d2a76dd0 | ||
|
|
0d0e557715 | ||
|
|
fb54b887f2 | ||
|
|
9167608794 | ||
|
|
050af61082 | ||
|
|
2c23431daf | ||
|
|
4543c73b4f | ||
|
|
88d85fc02e | ||
|
|
6102fabcb6 | ||
|
|
d7a7412973 | ||
|
|
1b3029b826 | ||
|
|
26cb53c8fb | ||
|
|
b4999fcc83 | ||
|
|
05f602d457 | ||
|
|
89b95d61d2 | ||
|
|
9ec03bade7 | ||
|
|
20699a15a6 | ||
|
|
9b8a6e7e67 | ||
|
|
3a8d5a9517 | ||
|
|
557b28a69d | ||
|
|
0f1c5506e2 | ||
|
|
c6a93fa336 | ||
|
|
466ea0fa99 | ||
|
|
8f850ee7f3 | ||
|
|
55d21e475d | ||
|
|
fa3e3da7ac | ||
|
|
05d66c034e | ||
|
|
98f0839664 | ||
|
|
4d52c6b6d0 | ||
|
|
eb5ea51da1 | ||
|
|
836b6f2fdb | ||
|
|
f297058461 | ||
|
|
0f4d8d76ae | ||
|
|
12884c91a6 |
@@ -1,4 +0,0 @@
|
||||
codecov:
|
||||
notify:
|
||||
require_ci_to_pass: no
|
||||
|
||||
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -48,7 +48,7 @@ strings in
|
||||
|
||||
|
||||
|
||||
### New settings and database-layout changnes
|
||||
### New settings and database-layout changes
|
||||
If you add new settings or layout changes, please make sure you add these to
|
||||
|
||||
* `install/froxlor.sql`
|
||||
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1,3 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: d00p
|
||||
custom: ['https://paypal.me/Froxlor']
|
||||
|
||||
2
.github/ISSUE_TEMPLATE.md
vendored
2
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,6 +1,6 @@
|
||||
# Bug report vs. support request
|
||||
If you're unsure of whether your problem is a bug or a configuration error
|
||||
* contact us via IRC in #froxlor on freenode
|
||||
* contact us via IRC in #froxlor on irc.libera.chat
|
||||
* or post a thread in our forum at https://forum.froxlor.org
|
||||
|
||||
As a rule of thumb: before reporting an issue
|
||||
|
||||
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**As a rule of thumb: before reporting an issue**
|
||||
* see if it hasn't been [reported](https://github.com/Froxlor/froxlor/issues) (and possibly already been [fixed](https://github.com/Froxlor/froxlor/issues?utf8=✓&q=is:issue%20is:closed)) first
|
||||
* try with the git master
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**System information**
|
||||
* Froxlor version: $version/$gitSHA1
|
||||
* Web server: apache2/nginx/lighttpd
|
||||
* DNS server: Bind/PowerDNS (standalone)/PowerDNS (Bind-backend)
|
||||
* POP/IMAP server: Courier/Dovecot
|
||||
* SMTP server: postfix/exim
|
||||
* FTP server: proftpd/pureftpd
|
||||
* OS/Version: ...
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Logfiles**
|
||||
If applicable, add log-entries to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
14
.github/workflows/build-apidocs.yml
vendored
Normal file
14
.github/workflows/build-apidocs.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: build-docs
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build_docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- env:
|
||||
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh workflow run --repo Froxlor/Documentation build-docs -f ref=${{github.ref_name}}
|
||||
80
.github/workflows/build-mariadb.yml
vendored
Normal file
80
.github/workflows/build-mariadb.yml
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
name: Froxlor-CI-MariaDB
|
||||
on: ['push', 'pull_request', 'create']
|
||||
|
||||
jobs:
|
||||
froxlor:
|
||||
name: Froxlor (PHP ${{ matrix.php-versions }}, MariaDB ${{ matrix.mariadb-version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0']
|
||||
mariadb-version: [10.5, 10.4]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP, with composer and extensions
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer:v2
|
||||
extensions: mbstring, xml, ctype, pdo_mysql, mysql, curl, json, zip, session, filter, posix, openssl, fileinfo, bcmath
|
||||
|
||||
- name: Install tools
|
||||
run: sudo apt-get install -y ant
|
||||
|
||||
- name: Adjust firewall
|
||||
run: |
|
||||
sudo ufw allow out 3306/tcp
|
||||
sudo ufw allow in 3306/tcp
|
||||
|
||||
- name: Setup MariaDB
|
||||
uses: getong/mariadb-action@v1.1
|
||||
with:
|
||||
mariadb version: ${{ matrix.mariadb-version }}
|
||||
mysql database: 'froxlor010'
|
||||
mysql root password: 'fr0xl0r.TravisCI'
|
||||
|
||||
- name: Wait for database
|
||||
run: sleep 15
|
||||
|
||||
- name: Setup databases
|
||||
run: |
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "CREATE USER 'froxlor010'@'%' IDENTIFIED BY 'fr0xl0r.TravisCI';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'%';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
||||
|
||||
- name: Run testing
|
||||
run: ant quick-build
|
||||
|
||||
# - name: irc push
|
||||
# uses: rectalogic/notify-irc@v1
|
||||
# if: github.event_name == 'push'
|
||||
# with:
|
||||
# channel: "#froxlor"
|
||||
# server: "irc.libera.chat"
|
||||
# nickname: froxlor-ci
|
||||
# message: |
|
||||
# ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }}
|
||||
# ${{ join(github.event.commits.*.message) }}
|
||||
|
||||
# - name: irc pull request
|
||||
# uses: rectalogic/notify-irc@v1
|
||||
# if: github.event_name == 'pull_request'
|
||||
# with:
|
||||
# channel: "#froxlor"
|
||||
# server: "irc.libera.chat"
|
||||
# nickname: froxlor-ci
|
||||
# message: |
|
||||
# ${{ github.actor }} opened PR ${{ github.event.pull_request.html_url }}
|
||||
|
||||
# - name: irc tag created
|
||||
# uses: rectalogic/notify-irc@v1
|
||||
# if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||
# with:
|
||||
# channel: "#froxlor"
|
||||
# server: "irc.libera.chat"
|
||||
# nickname: froxlor-ci
|
||||
# message: |
|
||||
# ${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }}
|
||||
57
.github/workflows/build-mysql.yml
vendored
Normal file
57
.github/workflows/build-mysql.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Froxlor-CI-MySQL
|
||||
on: ['push', 'pull_request', 'create']
|
||||
|
||||
jobs:
|
||||
froxlor:
|
||||
name: Froxlor (PHP ${{ matrix.php-versions }}, MySQL ${{ matrix.mysql-version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.4', '8.0']
|
||||
mysql-version: [8.0, 5.7]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP, with composer and extensions
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
tools: composer:v2
|
||||
extensions: mbstring, xml, ctype, pdo_mysql, mysql, curl, json, zip, session, filter, posix, openssl, fileinfo, bcmath
|
||||
|
||||
- name: Install tools
|
||||
run: sudo apt-get install -y ant
|
||||
|
||||
- name: Adjust firewall
|
||||
run: |
|
||||
sudo ufw allow out 3306/tcp
|
||||
sudo ufw allow in 3306/tcp
|
||||
|
||||
- name: Setup MySQL
|
||||
uses: samin/mysql-action@v1.3
|
||||
with:
|
||||
mysql version: ${{ matrix.mysql-version }}
|
||||
mysql database: 'froxlor010'
|
||||
mysql root password: 'fr0xl0r.TravisCI'
|
||||
|
||||
- name: Wait for database
|
||||
run: sleep 15
|
||||
|
||||
- name: Setup database (8.0)
|
||||
if: matrix.mysql-version == '8.0'
|
||||
run: |
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "CREATE USER 'froxlor010'@'%' IDENTIFIED WITH mysql_native_password BY 'fr0xl0r.TravisCI';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'%';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
||||
|
||||
- name: Setup database (5.7)
|
||||
if: matrix.mysql-version == '5.7'
|
||||
run: |
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "CREATE USER 'froxlor010'@'%' IDENTIFIED BY 'fr0xl0r.TravisCI';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI -e "GRANT ALL ON froxlor010.* TO 'froxlor010'@'%';"
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
||||
|
||||
- name: Run testing
|
||||
run: ant quick-build
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,9 +12,10 @@ logs/*
|
||||
.well-known
|
||||
.idea
|
||||
*.iml
|
||||
img/
|
||||
|
||||
!templates/Froxlor/
|
||||
!templates/Sparkle/
|
||||
!templates/misc/
|
||||
templates/Froxlor/assets/img/logo_custom.png
|
||||
templates/Sparkle/assets/css/custom.css
|
||||
vendor/
|
||||
|
||||
@@ -52,13 +52,10 @@ install:
|
||||
- mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < install/froxlor.sql
|
||||
|
||||
script:
|
||||
- ant phpunit
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash) -f "build/logs/clover.xml"
|
||||
- ant phpunit-no-coverage
|
||||
|
||||
notifications:
|
||||
irc: "irc.freenode.org#froxlor"
|
||||
irc: "irc.libera.chat#froxlor"
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/bdf91d1c3f745e51f796
|
||||
|
||||
2
2fa.php
2
2fa.php
@@ -38,7 +38,7 @@ if (AREA == 'admin') {
|
||||
}
|
||||
$success_message = "";
|
||||
|
||||
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor');
|
||||
$tfa = new \Froxlor\FroxlorTwoFactorAuth('Froxlor ' . Settings::Get('system.hostname'));
|
||||
|
||||
// do the delete and then just show a success-message
|
||||
if ($action == 'delete') {
|
||||
|
||||
42
README.md
42
README.md
@@ -1,5 +1,6 @@
|
||||
[](https://travis-ci.com/Froxlor/Froxlor)
|
||||
[](https://gitter.im/Froxlor/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://github.com/Froxlor/Froxlor/actions/workflows/build-mariadb.yml)
|
||||
[](https://github.com/Froxlor/Froxlor/actions/workflows/build-mysql.yml)
|
||||
[](https://discord.froxlor.org)
|
||||
|
||||
# Froxlor
|
||||
|
||||
@@ -20,16 +21,20 @@ Developed by experienced server administrators, this panel simplifies the effort
|
||||
9. Have fun!
|
||||
|
||||
### Detailed installation
|
||||
https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-from-tarball
|
||||
https://docs.froxlor.org/general/installation/index.html
|
||||
|
||||
## Help
|
||||
|
||||
You may find help in the following places:
|
||||
|
||||
### Discord
|
||||
|
||||
The froxlor community discord server can be found here: https://discord.froxlor.org
|
||||
|
||||
### IRC
|
||||
|
||||
froxlor may be found on freenode.net, channel #froxlor:
|
||||
irc://chat.freenode.net/froxlor
|
||||
froxlor may be found on libera.chat, channel #froxlor:
|
||||
irc://irc.libera.chat/froxlor
|
||||
|
||||
### Forum
|
||||
|
||||
@@ -37,30 +42,37 @@ The community is located on https://forum.froxlor.org/
|
||||
|
||||
### Wiki
|
||||
|
||||
More documentation may be found in the froxlor - wiki:
|
||||
https://github.com/Froxlor/Froxlor/wiki
|
||||
More documentation may be found in the froxlor - documentation:
|
||||
https://docs.froxlor.org/
|
||||
|
||||
## License
|
||||
|
||||
May be found in COPYING
|
||||
May be found in [COPYING](COPYING)
|
||||
|
||||
## Downloads
|
||||
|
||||
### Tarball
|
||||
https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](https://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
|
||||
### Debian repository
|
||||
### Debian / Ubutnu repository
|
||||
|
||||
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-debian)
|
||||
[HowTo](https://docs.froxlor.org/general/installation/aptpackage.html)
|
||||
|
||||
/etc/apt/sources.list.d/froxlor.list
|
||||
> deb http://debian.froxlor.org {wheezy|jessie|stretch} main
|
||||
#### Debian
|
||||
|
||||
### Gentoo repository
|
||||
```
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates curl
|
||||
curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg
|
||||
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list'
|
||||
```
|
||||
|
||||
[HowTo](https://github.com/Froxlor/Froxlor/wiki/Install-froxlor-on-gentoo)
|
||||
#### Ubuntu
|
||||
|
||||
https://files.froxlor.org/gentoo/repositories.xml
|
||||
```
|
||||
apt-get -y install apt-transport-https lsb-release ca-certificates curl
|
||||
curl -sSLo /usr/share/keyrings/deb.froxlor.org-froxlor.gpg https://deb.froxlor.org/froxlor.gpg
|
||||
sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.froxlor.org-froxlor.gpg] https://deb.froxlor.org/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/froxlor.list'
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
14
SECURITY.md
Normal file
14
SECURITY.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Our main and active version is currently 0.10.x. It will receive maintenance and security updates periodically. The older version 0.9.x will not receive any kind of updates. Please update to [0.10.x](https://github.com/Froxlor/Froxlor/wiki/Updating-Froxlor)
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 0.10.x | :white_check_mark: |
|
||||
| 0.9.x | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you think you have found a vulnerability in froxlor, please send an email to [team@froxlor.org](mailto:team@froxlor.org) with as many information as possible. Also, please give us appropriate time to fix the issue and build update-packages before publishing anything into the wild.
|
||||
0
actions/admin/index.html
Normal file
0
actions/admin/index.html
Normal file
@@ -45,7 +45,7 @@ return array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'default_theme',
|
||||
'type' => 'option',
|
||||
'default' => 'Froxlor',
|
||||
'default' => 'Sparkle',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => array(
|
||||
'\\Froxlor\\UI\\Template',
|
||||
@@ -77,14 +77,6 @@ return array(
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_no_robots' => array(
|
||||
'label' => $lng['serversettings']['no_robots'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'no_robots',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_paging' => array(
|
||||
'label' => $lng['serversettings']['paging'],
|
||||
'settinggroup' => 'panel',
|
||||
@@ -257,7 +249,7 @@ return array(
|
||||
'extras' => $lng['menue']['extras']['extras'],
|
||||
'extras.directoryprotection' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['directoryprotection'],
|
||||
'extras.pathoptions' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['pathoptions'],
|
||||
'extras.logger' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['logger']['logger'],
|
||||
'extras.logger' => $lng['menue']['extras']['extras'] . " / " . $lng['admin']['loggersystem'],
|
||||
'extras.backup' => $lng['menue']['extras']['extras'] . " / " . $lng['menue']['extras']['backup'],
|
||||
'traffic' => $lng['menue']['traffic']['traffic'],
|
||||
'traffic.http' => $lng['menue']['traffic']['traffic'] . " / HTTP",
|
||||
@@ -265,7 +257,71 @@ return array(
|
||||
'traffic.mail' => $lng['menue']['traffic']['traffic'] . " / Mail"
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
),
|
||||
'panel_imprint_url' => array(
|
||||
'label' => $lng['serversettings']['imprint_url'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'imprint_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_terms_url' => array(
|
||||
'label' => $lng['serversettings']['terms_url'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'terms_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_privacy_url' => array(
|
||||
'label' => $lng['serversettings']['privacy_url'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'privacy_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_logo_overridetheme' => array(
|
||||
'label' => $lng['serversettings']['logo_overridetheme'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_overridetheme',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_logo_overridecustom' => array(
|
||||
'label' => $lng['serversettings']['logo_overridecustom'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_overridecustom',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_logo_image_header' => array(
|
||||
'label' => $lng['serversettings']['logo_image_header'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_image_header',
|
||||
'type' => 'image',
|
||||
'image_name' => 'logo_header',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingImage'
|
||||
),
|
||||
'panel_logo_image_login' => array(
|
||||
'label' => $lng['serversettings']['logo_image_login'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_image_login',
|
||||
'type' => 'image',
|
||||
'image_name' => 'logo_login',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingImage'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -205,9 +205,21 @@ return array(
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/backup',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
),
|
||||
'system_createstdsubdom_default' => array(
|
||||
'label' => $lng['serversettings']['createstdsubdom_default'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'createstdsubdom_default',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'0' => $lng['panel']['no'],
|
||||
'1' => $lng['panel']['yes']
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -253,7 +253,45 @@ return array(
|
||||
'type' => 'hiddenString',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
),
|
||||
'system_apply_specialsettings_default' => array(
|
||||
'label' => $lng['serversettings']['apply_specialsettings_default'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apply_specialsettings_default',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_apply_phpconfigs_default' => array(
|
||||
'label' => $lng['serversettings']['apply_phpconfigs_default'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apply_phpconfigs_default',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_domaindefaultalias' => array(
|
||||
'label' => $lng['admin']['domaindefaultalias'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'domaindefaultalias',
|
||||
'type' => 'option',
|
||||
'default' => '0',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'0' => $lng['domains']['serveraliasoption_wildcard'],
|
||||
'1' => $lng['domains']['serveraliasoption_www'],
|
||||
'2' => $lng['domains']['serveraliasoption_none']
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'hide_incompatible_settings' => array(
|
||||
'label' => $lng['serversettings']['hide_incompatible_settings'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hide_incompatible_settings',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -105,6 +105,30 @@ return array(
|
||||
'hasVhostContainerEnabled'
|
||||
), true)
|
||||
),
|
||||
'system_honorcipherorder' => array(
|
||||
'label' => $lng['admin']['domain_honorcipherorder'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'honorcipherorder',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array(
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
), true)
|
||||
),
|
||||
'system_sessiontickets' => array(
|
||||
'label' => $lng['admin']['domain_sessiontickets'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'sessiontickets',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') && call_user_func(array(
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
), true)
|
||||
),
|
||||
/**
|
||||
* FCGID
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,8 @@ return array(
|
||||
'websrv_avail' => array(
|
||||
'apache2',
|
||||
'nginx'
|
||||
)
|
||||
),
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
),
|
||||
'system_logfiles_type' => array(
|
||||
'label' => $lng['serversettings']['logfiles_type'],
|
||||
@@ -250,6 +251,23 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_default_sslvhostconf' => array(
|
||||
'label' => $lng['serversettings']['default_sslvhostconf'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'default_sslvhostconf',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') == 1
|
||||
),
|
||||
'system_include_default_vhostconf' => array(
|
||||
'label' => $lng['serversettings']['includedefault_sslvhostconf'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'include_default_vhostconf',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_apache_globaldiropt' => array(
|
||||
'label' => $lng['serversettings']['apache_globaldiropt'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -35,7 +35,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_protocols',
|
||||
'type' => 'option',
|
||||
'default' => 'TLSv1,TLSv1.2',
|
||||
'default' => 'TLSv1.2',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array(
|
||||
'TLSv1' => 'TLSv1',
|
||||
@@ -54,6 +54,16 @@ return array(
|
||||
'default' => 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_tlsv13_cipher_list' => array(
|
||||
'label' => $lng['serversettings']['ssl']['tlsv13_cipher_list'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'tlsv13_cipher_list',
|
||||
'type' => 'string',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_ssl_cert_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -105,6 +115,15 @@ return array(
|
||||
'visible' => \Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_sessionticketsenabled' => array(
|
||||
'label' => $lng['admin']['domain_sessionticketsenabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'sessionticketsenabled',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.use_ssl') && (\Froxlor\Settings::Get('system.webserver') == "nginx" || (\Froxlor\Settings::Get('system.webserver') == "apache2" && \Froxlor\Settings::Get('system.apache24') == 1))
|
||||
),
|
||||
'system_leenabled' => array(
|
||||
'label' => $lng['serversettings']['leenabled'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -114,6 +133,15 @@ return array(
|
||||
'cronmodule' => 'froxlor/letsencrypt',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_acmeshpath' => array(
|
||||
'label' => $lng['serversettings']['acmeshpath'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'acmeshpath',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/root/.acme.sh/acme.sh',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_letsencryptacmeconf' => array(
|
||||
'label' => $lng['serversettings']['letsencryptacmeconf'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -123,6 +151,9 @@ return array(
|
||||
'default' => '/etc/apache2/conf-enabled/acme.conf',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
/**
|
||||
* currently the only option anyway
|
||||
*
|
||||
'system_leapiversion' => array(
|
||||
'label' => $lng['serversettings']['leapiversion'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -131,21 +162,24 @@ return array(
|
||||
'default' => '2',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'1' => 'ACME v1',
|
||||
'2' => 'ACME v2'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
*/
|
||||
'system_letsencryptca' => array(
|
||||
'label' => $lng['serversettings']['letsencryptca'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptca',
|
||||
'type' => 'option',
|
||||
'default' => 'testing',
|
||||
'default' => 'letsencrypt',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'testing' => 'https://acme-staging' . (\Froxlor\Settings::Get('system.leapiversion') == '2' ? '-v02' : '') . '.api.letsencrypt.org (Test)',
|
||||
'production' => 'https://acme-v0' . \Froxlor\Settings::Get('system.leapiversion') . '.api.letsencrypt.org (Live)'
|
||||
'letsencrypt_test' => 'Let\'s Encrypt (Test / Staging)',
|
||||
'letsencrypt' => 'Let\'s Encrypt (Live)',
|
||||
'buypass_test' => 'Buypass (Test / Staging)',
|
||||
'buypass' => 'Buypass (Live)',
|
||||
'zerossl' => 'ZeroSSL (Live)'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
@@ -195,12 +229,12 @@ return array(
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_disable_le_selfcheck' => array(
|
||||
'label' => $lng['serversettings']['disable_le_selfcheck'],
|
||||
'system_le_domain_dnscheck' => array(
|
||||
'label' => $lng['serversettings']['le_domain_dnscheck'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'disable_le_selfcheck',
|
||||
'varname' => 'le_domain_dnscheck',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
)
|
||||
|
||||
@@ -33,7 +33,8 @@ return array(
|
||||
1 => $lng['admin']['webalizer']['quiet'],
|
||||
2 => $lng['admin']['webalizer']['veryquiet']
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 0
|
||||
),
|
||||
'system_awstats_enabled' => array(
|
||||
'label' => $lng['serversettings']['awstats_enabled'],
|
||||
@@ -50,7 +51,8 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/bin/',
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
),
|
||||
'system_awstats_awstatspath' => array(
|
||||
'label' => $lng['serversettings']['awstats_awstatspath'],
|
||||
@@ -59,7 +61,8 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/bin/',
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
),
|
||||
'system_awstats_conf' => array(
|
||||
'label' => $lng['serversettings']['awstats_conf'],
|
||||
@@ -68,7 +71,8 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/awstats/',
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
),
|
||||
'system_awstats_icons' => array(
|
||||
'label' => $lng['serversettings']['awstats_icons'],
|
||||
@@ -77,7 +81,17 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/awstats/icon/',
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
),
|
||||
'system_awstats_logformat' => array(
|
||||
'label' => $lng['serversettings']['awstats']['logformat'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_logformat',
|
||||
'type' => 'string',
|
||||
'default' => '1',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => \Froxlor\Settings::Get('system.awstats_enabled') == 1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -99,6 +99,19 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_powerdns_mode' => array(
|
||||
'label' => $lng['serversettings']['powerdns_mode'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'powerdns_mode',
|
||||
'type' => 'option',
|
||||
'default' => 'Native',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
'Native' => 'Native',
|
||||
'Master' => 'Master'
|
||||
),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_dns_createmailentry' => array(
|
||||
'label' => $lng['serversettings']['mail_also_with_mxservers'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -132,6 +145,16 @@ return array(
|
||||
'int_min' => 3600, /* 1 hour */
|
||||
'int_max' => 2147483647, /* integer max */
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_soaemail' => array(
|
||||
'label' => $lng['serversettings']['soaemail'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'soaemail',
|
||||
'type' => 'string',
|
||||
'string_type' => 'mail',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -39,6 +39,15 @@ return array(
|
||||
'default' => '/etc/postfix/dkim/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'dkim_privkeysuffix' => array(
|
||||
'label' => $lng['dkim']['privkeysuffix'],
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'privkeysuffix',
|
||||
'type' => 'string',
|
||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||
'default' => '.priv',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'dkim_domains' => array(
|
||||
'label' => $lng['dkim']['dkim_domains'],
|
||||
'settinggroup' => 'dkim',
|
||||
|
||||
@@ -82,7 +82,20 @@ return array(
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
),
|
||||
'system_froxlorusergroup' => array(
|
||||
'label' => $lng['serversettings']['froxlorusergroup'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxlorusergroup',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => array(
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkLocalGroup'
|
||||
),
|
||||
'visible' => \Froxlor\Settings::Get('system.nssextrausers')
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
0
actions/admin/settings/index.html
Normal file
0
actions/admin/settings/index.html
Normal file
0
actions/index.html
Normal file
0
actions/index.html
Normal file
102
admin_admins.php
102
admin_admins.php
@@ -43,67 +43,71 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'deactivated' => $lng['admin']['deactivated']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_ADMINS, $fields);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Admins::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Admins::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$admins = '';
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$numrows_admins = Database::num_rows();
|
||||
$paging->setEntries($numrows_admins);
|
||||
$sortcode = $paging->getHtmlSortCode($lng, true);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
foreach ($result['list'] as $row) {
|
||||
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places);
|
||||
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places);
|
||||
$row['diskspace'] = round($row['diskspace'] / 1024, $dec_places);
|
||||
|
||||
$row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places);
|
||||
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places);
|
||||
$row['diskspace'] = round($row['diskspace'] / 1024, $dec_places);
|
||||
|
||||
// percent-values for progressbar
|
||||
// For Disk usage
|
||||
if ($row['diskspace'] > 0) {
|
||||
$disk_percent = round(($row['diskspace_used'] * 100) / $row['diskspace'], 0);
|
||||
$disk_doublepercent = round($disk_percent * 2, 2);
|
||||
} else {
|
||||
$disk_percent = 0;
|
||||
$disk_doublepercent = 0;
|
||||
}
|
||||
// For Traffic usage
|
||||
if ($row['traffic'] > 0) {
|
||||
$traffic_percent = round(($row['traffic_used'] * 100) / $row['traffic'], 0);
|
||||
$traffic_doublepercent = round($traffic_percent * 2, 2);
|
||||
} else {
|
||||
$traffic_percent = 0;
|
||||
$traffic_doublepercent = 0;
|
||||
}
|
||||
|
||||
// fix progress-bars if value is >100%
|
||||
if ($disk_percent > 100) {
|
||||
$disk_percent = 100;
|
||||
}
|
||||
if ($traffic_percent > 100) {
|
||||
$traffic_percent = 100;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||
|
||||
eval("\$admins.=\"" . \Froxlor\UI\Template::getTemplate("admins/admins_admin") . "\";");
|
||||
$count ++;
|
||||
// percent-values for progressbar
|
||||
// For Disk usage
|
||||
if ($row['diskspace'] > 0) {
|
||||
$disk_percent = round(($row['diskspace_used'] * 100) / $row['diskspace'], 0);
|
||||
$disk_doublepercent = round($disk_percent * 2, 2);
|
||||
} else {
|
||||
$disk_percent = 0;
|
||||
$disk_doublepercent = 0;
|
||||
}
|
||||
$i ++;
|
||||
// For Traffic usage
|
||||
if ($row['traffic'] > 0) {
|
||||
$traffic_percent = round(($row['traffic_used'] * 100) / $row['traffic'], 0);
|
||||
$traffic_doublepercent = round($traffic_percent * 2, 2);
|
||||
} else {
|
||||
$traffic_percent = 0;
|
||||
$traffic_doublepercent = 0;
|
||||
}
|
||||
|
||||
// fix progress-bars if value is >100%
|
||||
if ($disk_percent > 100) {
|
||||
$disk_percent = 100;
|
||||
}
|
||||
if ($traffic_percent > 100) {
|
||||
$traffic_percent = 100;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||
|
||||
eval("\$admins.=\"" . \Froxlor\UI\Template::getTemplate("admins/admins_admin") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$admincount = $numrows_admins;
|
||||
$admincount = $result['count'] . " / " . $paging->getEntries();
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("admins/admins") . "\";");
|
||||
} elseif ($action == 'su') {
|
||||
|
||||
@@ -125,7 +129,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
'userid' => $userinfo['userid']
|
||||
));
|
||||
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
$s = \Froxlor\Froxlor::genSessionId();
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET
|
||||
`hash` = :hash, `userid` = :userid, `ipaddress` = :ip,
|
||||
@@ -256,7 +260,7 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
||||
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
||||
$result['email'] = $idna_convert->decode($result['email']);
|
||||
$result['email'] = $idna_convert->decode($result['email'] ?? '');
|
||||
|
||||
$customers_ul = \Froxlor\UI\HTML::makecheckbox('customers_ul', $lng['customer']['unlimited'], '-1', false, $result['customers'], true, true);
|
||||
if ($result['customers'] == '-1') {
|
||||
|
||||
@@ -67,6 +67,9 @@ if ($page == 'showinfo') {
|
||||
$uptime_duration = duration($cache['start_time']);
|
||||
$size_vars = bsize($cache['mem_size']);
|
||||
|
||||
$num_hits_and_misses = $cache['num_hits'] + $cache['num_misses'];
|
||||
$num_hits_and_misses = 0 >= $num_hits_and_misses ? 1 : $num_hits_and_misses;
|
||||
|
||||
// check for possible empty values that are used in the templates
|
||||
if (! isset($cache['file_upload_progress'])) {
|
||||
$cache['file_upload_progress'] = $lng['logger']['unknown'];
|
||||
@@ -84,10 +87,10 @@ if ($page == 'showinfo') {
|
||||
|
||||
$freemem = bsize($mem_avail) . sprintf(" (%.1f%%)", $mem_avail * 100 / $mem_size);
|
||||
$usedmem = bsize($mem_used) . sprintf(" (%.1f%%)", $mem_used * 100 / $mem_size);
|
||||
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
|
||||
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / ($cache['num_hits'] + $cache['num_misses']));
|
||||
$hits = $cache['num_hits'] . @sprintf(" (%.1f%%)", $cache['num_hits'] * 100 / $num_hits_and_misses);
|
||||
$misses = $cache['num_misses'] . @sprintf(" (%.1f%%)", $cache['num_misses'] * 100 / $num_hits_and_misses);
|
||||
|
||||
// Fragementation: (freeseg - 1) / total_seg
|
||||
// Fragmentation: (freeseg - 1) / total_seg
|
||||
$nseg = $freeseg = $fragsize = $freetotal = 0;
|
||||
for ($i = 0; $i < $mem['num_seg']; $i ++) {
|
||||
$ptr = 0;
|
||||
|
||||
@@ -36,6 +36,15 @@ if (! extension_loaded('zip')) {
|
||||
));
|
||||
}
|
||||
|
||||
// 0.10.x requires 7.0 at least
|
||||
if (version_compare("7.0.0", PHP_VERSION, ">=")) {
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
's' => $s,
|
||||
'page' => 'error',
|
||||
'errno' => 10
|
||||
));
|
||||
}
|
||||
|
||||
// display initial version check
|
||||
if ($page == 'overview') {
|
||||
|
||||
@@ -43,8 +52,11 @@ if ($page == 'overview') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "checking auto-update");
|
||||
|
||||
// check for new version
|
||||
$latestversion = HttpClient::urlGet(UPDATE_URI);
|
||||
|
||||
try {
|
||||
$latestversion = HttpClient::urlGet(UPDATE_URI, true, 3);
|
||||
} catch (\Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error("Version-check currently unavailable, please try again later");
|
||||
}
|
||||
$latestversion = explode('|', $latestversion);
|
||||
|
||||
if (is_array($latestversion) && count($latestversion) >= 1) {
|
||||
@@ -175,6 +187,8 @@ elseif ($page == 'extract') {
|
||||
$zip->close();
|
||||
// success - remove unused archive
|
||||
@unlink($localArchive);
|
||||
// wait a bit before we redirect to be sure
|
||||
sleep(2);
|
||||
} else {
|
||||
// error
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
@@ -216,5 +230,6 @@ elseif ($page == 'error') {
|
||||
// 7 = local archive does not exist
|
||||
// 8 = could not extract archive
|
||||
// 9 = checksum mismatch
|
||||
// 10 = <php-7.0
|
||||
\Froxlor\UI\Response::standard_error('autoupdate_' . $errno);
|
||||
}
|
||||
|
||||
@@ -38,13 +38,43 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
// try to convert namserver hosts to ip's
|
||||
$ns_ips = "";
|
||||
$known_ns_ips = [];
|
||||
if (Settings::Get('system.nameservers') != '') {
|
||||
$nameservers = explode(',', Settings::Get('system.nameservers'));
|
||||
foreach ($nameservers as $nameserver) {
|
||||
$nameserver = trim($nameserver);
|
||||
// DNS servers might be multi homed; allow transfer from all ip
|
||||
// addresses of the DNS server
|
||||
$nameserver_ips = \Froxlor\PhpHelper::gethostbynamel6($nameserver);
|
||||
if (is_array($nameserver_ips) && count($nameserver_ips) > 0) {
|
||||
$ns_ips .= implode(",", $nameserver_ips);
|
||||
// append dot to hostname
|
||||
if (substr($nameserver, - 1, 1) != '.') {
|
||||
$nameserver .= '.';
|
||||
}
|
||||
// ignore invalid responses
|
||||
if (! is_array($nameserver_ips)) {
|
||||
// act like \Froxlor\PhpHelper::gethostbynamel6() and return unmodified hostname on error
|
||||
$nameserver_ips = array(
|
||||
$nameserver
|
||||
);
|
||||
} else {
|
||||
$known_ns_ips = array_merge($known_ns_ips, $nameserver_ips);
|
||||
}
|
||||
if (!empty($ns_ips)) {
|
||||
$ns_ips .= ',';
|
||||
}
|
||||
$ns_ips .= implode(",", $nameserver_ips);
|
||||
}
|
||||
}
|
||||
|
||||
// AXFR server
|
||||
if (Settings::Get('system.axfrservers') != '') {
|
||||
$axfrservers = explode(',', Settings::Get('system.axfrservers'));
|
||||
foreach ($axfrservers as $axfrserver) {
|
||||
if (!in_array(trim($axfrserver), $known_ns_ips)) {
|
||||
if (!empty($ns_ips)) {
|
||||
$ns_ips .= ',';
|
||||
}
|
||||
$ns_ips .= trim($axfrserver);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,7 +89,6 @@ if ($userinfo['change_serversettings'] == '1') {
|
||||
'<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'),
|
||||
|
||||
@@ -17,8 +17,7 @@
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Api\Commands\Cronjobs as Cronjobs;
|
||||
use Froxlor\Api\Commands\Cronjobs;
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
@@ -31,45 +30,47 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs');
|
||||
|
||||
$fields = array(
|
||||
'c.module' => 'Module',
|
||||
'c.lastrun' => $lng['cron']['lastrun'],
|
||||
'c.interval' => $lng['cron']['interval'],
|
||||
'c.isactive' => $lng['cron']['isactive']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_CRONRUNS, $fields);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Cronjobs::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Cronjobs::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$crons = '';
|
||||
$result_stmt = Database::prepare("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `module` ASC, `cronfile` ASC");
|
||||
Database::pexecute($result_stmt);
|
||||
$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;
|
||||
$cmod = '';
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
foreach ($result['list'] as $row) {
|
||||
if ($cmod != $row['module']) {
|
||||
$_mod = explode("/", $row['module']);
|
||||
$module = ucfirst($_mod[1]);
|
||||
eval("\$crons.=\"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs_cronjobmodule') . "\";");
|
||||
$cmod = $row['module'];
|
||||
}
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['lastrun'] = date('d.m.Y H:i', $row['lastrun']);
|
||||
$row['isactive'] = ((int) $row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no'];
|
||||
$description = $lng['crondesc'][$row['desc_lng_key']];
|
||||
|
||||
$row['lastrun'] = date('d.m.Y H:i', $row['lastrun']);
|
||||
$row['isactive'] = ((int) $row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no'];
|
||||
|
||||
$description = $lng['crondesc'][$row['desc_lng_key']];
|
||||
|
||||
eval("\$crons.=\"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs_cronjob') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
eval("\$crons.=\"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs_cronjob') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs') . "\";");
|
||||
|
||||
@@ -35,6 +35,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
unset($_SESSION['requestData']);
|
||||
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_customers");
|
||||
|
||||
$fields = array(
|
||||
'c.loginname' => $lng['login']['username'],
|
||||
'a.loginname' => $lng['admin']['admin'],
|
||||
@@ -47,106 +48,109 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
'c.traffic' => $lng['customer']['traffic'],
|
||||
'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')'
|
||||
);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Customers::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Customers::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_CUSTOMERS, $fields);
|
||||
$customers = '';
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `c`.*, `a`.`loginname` AS `adminname`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` `c`, `" . TABLE_PANEL_ADMINS . "` `a`
|
||||
WHERE " . ($userinfo['customers_see_all'] ? '' : " `c`.`adminid` = :adminid AND ") . "
|
||||
`c`.`adminid` = `a`.`adminid` " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
'adminid' => $userinfo['adminid']
|
||||
));
|
||||
$num_rows = Database::num_rows();
|
||||
$paging->setEntries($num_rows);
|
||||
$sortcode = $paging->getHtmlSortCode($lng, true);
|
||||
$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)) {
|
||||
foreach ($result['list'] as $row) {
|
||||
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$domains_stmt = Database::prepare("
|
||||
SELECT COUNT(`id`) AS `domains`
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :cid
|
||||
AND `parentdomainid` = '0'
|
||||
AND `id`<> :stdd
|
||||
");
|
||||
Database::pexecute($domains_stmt, array(
|
||||
'cid' => $row['customerid'],
|
||||
'stdd' => $row['standardsubdomain']
|
||||
));
|
||||
$domains = $domains_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$row['domains'] = intval($domains['domains']);
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
|
||||
$domains_stmt = Database::prepare("
|
||||
SELECT COUNT(`id`) AS `domains`
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :cid
|
||||
AND `parentdomainid` = '0'
|
||||
AND `id`<> :stdd");
|
||||
Database::pexecute($domains_stmt, array(
|
||||
'cid' => $row['customerid'],
|
||||
'stdd' => $row['standardsubdomain']
|
||||
));
|
||||
$domains = $domains_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$row['domains'] = intval($domains['domains']);
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
|
||||
// get disk-space usages for web, mysql and mail
|
||||
$usages_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DISKSPACE . "` WHERE `customerid` = :cid ORDER BY `stamp` DESC LIMIT 1");
|
||||
$usages = Database::pexecute_first($usages_stmt, array(
|
||||
'cid' => $row['customerid']
|
||||
));
|
||||
// get disk-space usages for web, mysql and mail
|
||||
$usages_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_DISKSPACE . "`
|
||||
WHERE `customerid` = :cid
|
||||
ORDER BY `stamp` DESC LIMIT 1
|
||||
");
|
||||
$usages = Database::pexecute_first($usages_stmt, array(
|
||||
'cid' => $row['customerid']
|
||||
));
|
||||
|
||||
if ($usages) {
|
||||
$row['webspace_used'] = round($usages['webspace'] / 1024, $dec_places);
|
||||
$row['mailspace_used'] = round($usages['mail'] / 1024, $dec_places);
|
||||
$row['dbspace_used'] = round($usages['mysql'] / 1024, $dec_places);
|
||||
} else {
|
||||
$row['webspace_used'] = 0;
|
||||
$row['mailspace_used'] = 0;
|
||||
$row['dbspace_used'] = 0;
|
||||
}
|
||||
$row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places);
|
||||
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places);
|
||||
$row['diskspace'] = round($row['diskspace'] / 1024, $dec_places);
|
||||
$last_login = ((int) $row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
|
||||
|
||||
$row['traffic_used'] = round($row['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$row['traffic'] = round($row['traffic'] / (1024 * 1024), $dec_places);
|
||||
$row['diskspace_used'] = round($row['diskspace_used'] / 1024, $dec_places);
|
||||
$row['diskspace'] = round($row['diskspace'] / 1024, $dec_places);
|
||||
$last_login = ((int) $row['lastlogin_succ'] == 0) ? $lng['panel']['neverloggedin'] : date('d.m.Y', $row['lastlogin_succ']);
|
||||
|
||||
/**
|
||||
* percent-values for progressbar
|
||||
*/
|
||||
// For Disk usage
|
||||
if ($row['diskspace'] > 0) {
|
||||
$disk_percent = round(($row['diskspace_used'] * 100) / $row['diskspace'], 0);
|
||||
$disk_doublepercent = round($disk_percent * 2, 2);
|
||||
} else {
|
||||
$disk_percent = 0;
|
||||
$disk_doublepercent = 0;
|
||||
}
|
||||
|
||||
if ($row['traffic'] > 0) {
|
||||
$traffic_percent = round(($row['traffic_used'] * 100) / $row['traffic'], 0);
|
||||
$traffic_doublepercent = round($traffic_percent * 2, 2);
|
||||
} else {
|
||||
$traffic_percent = 0;
|
||||
$traffic_doublepercent = 0;
|
||||
}
|
||||
|
||||
$islocked = 0;
|
||||
if ($row['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $row['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
||||
$islocked = 1;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
// fix progress-bars if value is >100%
|
||||
if ($disk_percent > 100) {
|
||||
$disk_percent = 100;
|
||||
}
|
||||
if ($traffic_percent > 100) {
|
||||
$traffic_percent = 100;
|
||||
}
|
||||
|
||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||
|
||||
eval("\$customers.=\"" . \Froxlor\UI\Template::getTemplate("customers/customers_customer") . "\";");
|
||||
$count ++;
|
||||
/**
|
||||
* percent-values for progressbar
|
||||
*/
|
||||
if ($row['diskspace'] > 0) {
|
||||
$disk_percent = round(($row['diskspace_used'] * 100) / $row['diskspace'], 0);
|
||||
$disk_doublepercent = round($disk_percent * 2, 2);
|
||||
} else {
|
||||
$disk_percent = 0;
|
||||
$disk_doublepercent = 0;
|
||||
}
|
||||
if ($row['traffic'] > 0) {
|
||||
$traffic_percent = round(($row['traffic_used'] * 100) / $row['traffic'], 0);
|
||||
$traffic_doublepercent = round($traffic_percent * 2, 2);
|
||||
} else {
|
||||
$traffic_percent = 0;
|
||||
$traffic_doublepercent = 0;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$islocked = 0;
|
||||
if ($row['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $row['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
||||
$islocked = 1;
|
||||
}
|
||||
|
||||
$row = \Froxlor\PhpHelper::strReplaceArray('-1', 'UL', $row, 'diskspace traffic mysqls emails email_accounts email_forwarders ftps subdomains');
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
// fix progress-bars if value is >100%
|
||||
if ($disk_percent > 100) {
|
||||
$disk_percent = 100;
|
||||
}
|
||||
if ($traffic_percent > 100) {
|
||||
$traffic_percent = 100;
|
||||
}
|
||||
|
||||
$row['custom_notes'] = ($row['custom_notes'] != '') ? nl2br($row['custom_notes']) : '';
|
||||
|
||||
eval("\$customers.=\"" . \Froxlor\UI\Template::getTemplate("customers/customers_customer") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$customercount = $num_rows;
|
||||
$customercount = $result['count'] . " / " . $paging->getEntries();
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("customers/customers") . "\";");
|
||||
} elseif ($action == 'su' && $id != 0) {
|
||||
try {
|
||||
@@ -174,7 +178,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
'hash' => $s
|
||||
));
|
||||
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
$s = \Froxlor\Froxlor::genSessionId();
|
||||
$insert = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET
|
||||
`hash` = :hash,
|
||||
@@ -391,7 +395,7 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
||||
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
||||
$result['email'] = $idna_convert->decode($result['email']);
|
||||
$result['email'] = $idna_convert->decode($result['email'] ?? '');
|
||||
|
||||
$diskspace_ul = \Froxlor\UI\HTML::makecheckbox('diskspace_ul', $lng['customer']['unlimited'], '-1', false, $result['diskspace'], true, true);
|
||||
if ($result['diskspace'] == '-1') {
|
||||
|
||||
@@ -21,6 +21,7 @@ require './lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Api\Commands\Customers as Customers;
|
||||
use Froxlor\Api\Commands\Domains as Domains;
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
@@ -31,91 +32,55 @@ if (isset($_POST['id'])) {
|
||||
|
||||
if ($page == 'domains' || $page == 'overview') {
|
||||
// Let's see how many customers we have
|
||||
$stmt = Database::prepare("
|
||||
SELECT COUNT(`customerid`) as `countcustomers` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid"));
|
||||
$params = array();
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params['adminid'] = $userinfo['adminid'];
|
||||
}
|
||||
$countcustomers = Database::pexecute_first($stmt, $params);
|
||||
$countcustomers = (int) $countcustomers['countcustomers'];
|
||||
$json_result = Customers::getLocal($userinfo)->listingCount();
|
||||
$countcustomers = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
|
||||
$fields = array(
|
||||
'd.domain' => $lng['domains']['domainname'],
|
||||
'd.domain_ace' => $lng['domains']['domainname'],
|
||||
'c.name' => $lng['customer']['name'],
|
||||
'c.firstname' => $lng['customer']['firstname'],
|
||||
'c.company' => $lng['customer']['company'],
|
||||
'c.loginname' => $lng['login']['username'],
|
||||
'd.aliasdomain' => $lng['domains']['aliasdomain']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
|
||||
$domains = "";
|
||||
$result_stmt = Database::prepare("
|
||||
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`
|
||||
WHERE `d`.`parentdomainid`='0' " . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid ") . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$params = array();
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params['adminid'] = $userinfo['adminid'];
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Domains::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Domains::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
Database::pexecute($result_stmt, $params);
|
||||
$numrows_domains = Database::num_rows();
|
||||
$paging->setEntries($numrows_domains);
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$domains = '';
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$domain_array = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
formatDomainEntry($row, $idna_convert);
|
||||
|
||||
if (! isset($domain_array[$row['domain']])) {
|
||||
$domain_array[$row['domain']] = $row;
|
||||
} else {
|
||||
$domain_array[$row['domain']] = array_merge($row, $domain_array[$row['domain']]);
|
||||
}
|
||||
|
||||
if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
|
||||
if (! isset($domain_array[$row['aliasdomain']])) {
|
||||
$domain_array[$row['aliasdomain']] = array();
|
||||
}
|
||||
$domain_array[$row['aliasdomain']]['domainaliasid'] = $row['id'];
|
||||
$domain_array[$row['aliasdomain']]['domainalias'] = $row['domain'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need ksort/krsort here to make sure idna-domains are also sorted correctly
|
||||
*/
|
||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
|
||||
ksort($domain_array);
|
||||
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
||||
krsort($domain_array);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
foreach ($domain_array as $row) {
|
||||
|
||||
if (isset($row['domain']) && $row['domain'] != '' && $paging->checkDisplay($i)) {
|
||||
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
// display a nice list of IP's
|
||||
foreach ($result['list'] as $row) {
|
||||
formatDomainEntry($row, $idna_convert);
|
||||
$row['customername'] = \Froxlor\User::getCorrectFullUserDetails($row);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
// display a nice list of IP's if it's not an alias for another domain
|
||||
if (isset($row['aliasdomainid']) && $row['aliasdomainid'] != null && isset($row['aliasdomain']) && $row['aliasdomain'] != '') {
|
||||
$row['ipandport'] = sprintf($lng['domains']['isaliasdomainof'], $row['aliasdomain']);
|
||||
} else {
|
||||
$row['ipandport'] = str_replace("\n", "<br />", $row['ipandport']);
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
$i ++;
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$domainscount = $numrows_domains;
|
||||
$domainscount = $result['count'] . " / " . $paging->getEntries();
|
||||
|
||||
// Display the list
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domains") . "\";");
|
||||
@@ -183,7 +148,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true);
|
||||
$result_customers_stmt = Database::prepare("
|
||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC");
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid ") . " ORDER BY COALESCE(NULLIF(`name`,''), `company`) ASC");
|
||||
$params = array();
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params['adminid'] = $userinfo['adminid'];
|
||||
@@ -325,9 +290,9 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
// create serveralias options
|
||||
$serveraliasoptions = "";
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_wildcard'], '0', '0', true, true);
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_www'], '1', '0', true, true);
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_none'], '2', '0', true, true);
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_wildcard'], '0', Settings::Get('system.domaindefaultalias'), true, true);
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_www'], '1', Settings::Get('system.domaindefaultalias'), true, true);
|
||||
$serveraliasoptions .= \Froxlor\UI\HTML::makeoption($lng['domains']['serveraliasoption_none'], '2', Settings::Get('system.domaindefaultalias'), true, true);
|
||||
|
||||
$subcanemaildomain = \Froxlor\UI\HTML::makeoption($lng['admin']['subcanemaildomain']['never'], '0', '0', true, true);
|
||||
$subcanemaildomain .= \Froxlor\UI\HTML::makeoption($lng['admin']['subcanemaildomain']['choosableno'], '1', '0', true, true);
|
||||
@@ -416,6 +381,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
// remove ssl ip/ports if set is empty
|
||||
if (!isset($_POST['ssl_ipandport']) || empty($_POST['ssl_ipandport'])) {
|
||||
$_POST['remove_ssl_ipandport'] = true;
|
||||
}
|
||||
Domains::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
@@ -459,7 +428,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$customer = Database::pexecute_first($customer_stmt, array(
|
||||
'customerid' => $result['customerid']
|
||||
));
|
||||
$result['customername'] = \Froxlor\User::getCorrectFullUserDetails($customer) . ' (' . $customer['loginname'] . ')';
|
||||
$result['customername'] = \Froxlor\User::getCorrectFullUserDetails($customer);
|
||||
}
|
||||
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
@@ -625,6 +594,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
}
|
||||
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
if (Settings::Get('panel.allow_domain_change_customer') != '1') {
|
||||
$result['customername'] .= ' (<a href="' . $linker->getLink(array('section' => 'customers', 'page' => 'customers',
|
||||
'action' => 'su', 'id' => $customer['customerid'])) . '" rel="external">' . $customer['loginname'] . '</a>)';
|
||||
}
|
||||
|
||||
$domain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_edit.php';
|
||||
$domain_edit_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_edit_data);
|
||||
@@ -647,7 +620,6 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
|
||||
$customerid = intval($_POST['customerid']);
|
||||
$separator = \Froxlor\Validate\Validate::validate($_POST['separator'], 'separator');
|
||||
$offset = (int) \Froxlor\Validate\Validate::validate($_POST['offset'], 'offset', "/[0-9]/i");
|
||||
|
||||
@@ -656,7 +628,7 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
$result = array();
|
||||
|
||||
try {
|
||||
$bulk = new \Froxlor\Bulk\DomainBulkAction($file_name, $customerid);
|
||||
$bulk = new \Froxlor\Bulk\DomainBulkAction($file_name, $userinfo);
|
||||
$result = $bulk->doImport($separator, $offset);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::standard_error('domain_import_error', $e->getMessage());
|
||||
@@ -668,8 +640,8 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
|
||||
// update customer/admin counters
|
||||
\Froxlor\User::updateCounters(false);
|
||||
\Froxlor\System\Cronjob::inserttask('1');
|
||||
\Froxlor\System\Cronjob::inserttask('4');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
|
||||
|
||||
$result_str = $result['imported'] . ' / ' . $result['all'] . (! empty($result['note']) ? ' (' . $result['note'] . ')' : '');
|
||||
\Froxlor\UI\Response::standard_success('domain_import_successfully', $result_str, array(
|
||||
@@ -678,19 +650,6 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
'page' => 'domains'
|
||||
));
|
||||
} else {
|
||||
$customers = \Froxlor\UI\HTML::makeoption($lng['panel']['please_choose'], 0, 0, true);
|
||||
$result_customers_stmt = Database::prepare("
|
||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC");
|
||||
$params = array();
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params['adminid'] = $userinfo['adminid'];
|
||||
}
|
||||
Database::pexecute($result_customers_stmt, $params);
|
||||
|
||||
while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$customers .= \Froxlor\UI\HTML::makeoption(\Froxlor\User::getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||
}
|
||||
|
||||
$domain_import_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_import.php';
|
||||
$domain_import_form = \Froxlor\UI\HtmlForm::genHTMLForm($domain_import_data);
|
||||
@@ -715,20 +674,10 @@ if ($page == 'domains' || $page == 'overview') {
|
||||
function formatDomainEntry(&$row, &$idna_convert)
|
||||
{
|
||||
$row['domain'] = $idna_convert->decode($row['domain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
|
||||
|
||||
$resultips_stmt = Database::prepare("
|
||||
SELECT `ips`.* FROM `" . TABLE_DOMAINTOIP . "` AS `dti`, `" . TABLE_PANEL_IPSANDPORTS . "` AS `ips`
|
||||
WHERE `dti`.`id_ipandports` = `ips`.`id` AND `dti`.`id_domain` = :domainid
|
||||
");
|
||||
|
||||
Database::pexecute($resultips_stmt, array(
|
||||
'domainid' => $row['id']
|
||||
));
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
|
||||
|
||||
$row['ipandport'] = '';
|
||||
while ($rowip = $resultips_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
foreach ($row['ipsandports'] as $rowip) {
|
||||
if (filter_var($rowip['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ipandport'] .= '[' . $rowip['ip'] . ']:' . $rowip['port'] . "\n";
|
||||
} else {
|
||||
@@ -736,7 +685,7 @@ function formatDomainEntry(&$row, &$idna_convert)
|
||||
}
|
||||
}
|
||||
$row['ipandport'] = substr($row['ipandport'], 0, - 1);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
|
||||
|
||||
$row['termination_css'] = "";
|
||||
if ($row['termination_date'] != "") {
|
||||
|
||||
@@ -57,6 +57,12 @@ if (isset($_POST['id'])) {
|
||||
if ($page == 'overview') {
|
||||
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
||||
$params = [];
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params = [
|
||||
'adminid' => $userinfo['adminid']
|
||||
];
|
||||
}
|
||||
$overview_stmt = Database::prepare("SELECT COUNT(*) AS `number_customers`,
|
||||
SUM(`diskspace_used`) AS `diskspace_used`,
|
||||
SUM(`mysqls_used`) AS `mysqls_used`,
|
||||
@@ -68,20 +74,18 @@ if ($page == 'overview') {
|
||||
SUM(`subdomains_used`) AS `subdomains_used`,
|
||||
SUM(`traffic_used`) AS `traffic_used`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid "));
|
||||
$overview = Database::pexecute_first($overview_stmt, array(
|
||||
'adminid' => $userinfo['adminid']
|
||||
));
|
||||
$overview = Database::pexecute_first($overview_stmt, $params);
|
||||
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $dec_places);
|
||||
$overview['traffic_bytes_used'] = $overview['traffic_used'] * 1024;
|
||||
$overview['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($overview['traffic_used'] * 1024, null, 'bi');
|
||||
$overview['diskspace_bytes_used'] = $overview['diskspace_used'] * 1024;
|
||||
$overview['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($overview['diskspace_used'] * 1024, null, 'bi');
|
||||
|
||||
$number_domains_stmt = Database::prepare("
|
||||
SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid"));
|
||||
$number_domains = Database::pexecute_first($number_domains_stmt, array(
|
||||
'adminid' => $userinfo['adminid']
|
||||
));
|
||||
$number_domains = Database::pexecute_first($number_domains_stmt, $params);
|
||||
|
||||
$overview['number_domains'] = $number_domains['number_domains'];
|
||||
|
||||
@@ -111,11 +115,17 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $dec_places);
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $dec_places);
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $dec_places);
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $dec_places);
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
// get everything in bytes for the percentage calculation on the dashboard
|
||||
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
|
||||
$userinfo['diskspace_bytes_used'] = $userinfo['diskspace_used'] * 1024;
|
||||
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : - 1;
|
||||
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
|
||||
|
||||
$userinfo['diskspace'] = ($userinfo['diskspace'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace'] * 1024, null, 'bi') : - 1;
|
||||
$userinfo['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace_used'] * 1024, null, 'bi');
|
||||
$userinfo['traffic'] = ($userinfo['traffic'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['traffic'] * 1024, null, 'bi') : - 1;
|
||||
$userinfo['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['traffic_used'] * 1024, null, 'bi');
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace diskspace_bytes traffic traffic_bytes mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
@@ -183,8 +193,12 @@ if ($page == 'overview') {
|
||||
\Froxlor\UI\Response::standard_error('oldpasswordnotcorrect');
|
||||
}
|
||||
|
||||
$new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm');
|
||||
try {
|
||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
|
||||
if ($old_password == '') {
|
||||
\Froxlor\UI\Response::standard_error(array(
|
||||
@@ -387,8 +401,6 @@ if ($page == 'overview') {
|
||||
}
|
||||
} elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/api_keys.php';
|
||||
} elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/apihelp.php';
|
||||
} elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) {
|
||||
require_once __DIR__ . '/2fa.php';
|
||||
}
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Api\Commands\IpsAndPorts as IpsAndPorts;
|
||||
use Froxlor\Api\Commands\IpsAndPorts;
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
@@ -43,29 +42,33 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
||||
'ip' => $lng['admin']['ipsandports']['ip'],
|
||||
'port' => $lng['admin']['ipsandports']['port']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = IpsAndPorts::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = IpsAndPorts::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$ipsandports = '';
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt);
|
||||
$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 = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
eval("\$ipsandports.=\"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_ipandport") . "\";");
|
||||
$count ++;
|
||||
foreach ($result['list'] as $row) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
$i ++;
|
||||
eval("\$ipsandports.=\"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_ipandport") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports") . "\";");
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
@@ -157,5 +160,14 @@ if ($page == 'ipsandports' || $page == 'overview') {
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("ipsandports/ipsandports_edit") . "\";");
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'jqCheckIP') {
|
||||
$ip = $_POST['ip'] ?? "";
|
||||
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE) == false) {
|
||||
// returns notice if private network detected so we can display it
|
||||
echo json_encode($lng['admin']['ipsandports']['ipnote']);
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Api\Commands\SysLog;
|
||||
|
||||
if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
if ($action == '') {
|
||||
@@ -29,20 +29,25 @@ if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy();
|
||||
$result_stmt = Database::query($query . ' ' . $paging->getSqlLimit());
|
||||
$result_cnt_stmt = Database::query($query);
|
||||
$logs_count = $result_cnt_stmt->rowCount();
|
||||
$paging->setEntries($logs_count);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = SysLog::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = SysLog::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
foreach ($result['list'] as $row) {
|
||||
if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
|
||||
$clog[$row['action']] = array();
|
||||
}
|
||||
@@ -55,7 +60,6 @@ if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
$log = '';
|
||||
@@ -100,23 +104,20 @@ if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
|
||||
$count ++;
|
||||
$_action = $action;
|
||||
// }
|
||||
$i ++;
|
||||
}
|
||||
$i ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
|
||||
} elseif ($action == 'truncate') {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$truncatedate = time() - (60 * 10);
|
||||
$trunc_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < :trunc");
|
||||
Database::pexecute($trunc_stmt, array(
|
||||
'trunc' => $truncatedate
|
||||
));
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'truncated the system-log (mysql)');
|
||||
try {
|
||||
SysLog::getLocal($userinfo, array(
|
||||
'min_to_keep' => 10
|
||||
))->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
|
||||
@@ -32,10 +32,10 @@ if ($page == 'message') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
if ($_POST['receipient'] == 0 && $userinfo['customers_see_all'] == '1') {
|
||||
if ($_POST['recipient'] == 0 && $userinfo['customers_see_all'] == '1') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'sending messages to admins');
|
||||
$result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
||||
} elseif ($_POST['receipient'] == 1) {
|
||||
} elseif ($_POST['recipient'] == 1) {
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'sending messages to ALL customers');
|
||||
$result = Database::query('SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
||||
@@ -49,7 +49,7 @@ if ($page == 'message') {
|
||||
));
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('noreceipientsgiven');
|
||||
\Froxlor\UI\Response::standard_error('norecipientsgiven');
|
||||
}
|
||||
|
||||
$subject = $_POST['subject'];
|
||||
@@ -105,7 +105,7 @@ if ($page == 'message') {
|
||||
$sentitems = isset($_GET['sentitems']) ? (int) $_GET['sentitems'] : 0;
|
||||
|
||||
if ($sentitems == 0) {
|
||||
$successmessage = $lng['message']['noreceipients'];
|
||||
$successmessage = $lng['message']['norecipients'];
|
||||
} else {
|
||||
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
||||
}
|
||||
@@ -116,12 +116,12 @@ if ($page == 'message') {
|
||||
}
|
||||
|
||||
$action = '';
|
||||
$receipients = '';
|
||||
$recipients = '';
|
||||
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
$receipients .= \Froxlor\UI\HTML::makeoption($lng['panel']['reseller'], 0);
|
||||
$recipients .= \Froxlor\UI\HTML::makeoption($lng['panel']['reseller'], 0);
|
||||
}
|
||||
|
||||
$receipients .= \Froxlor\UI\HTML::makeoption($lng['panel']['customer'], 1);
|
||||
$recipients .= \Froxlor\UI\HTML::makeoption($lng['panel']['customer'], 1);
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('message/message') . "\";");
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ require './lib/init.php';
|
||||
|
||||
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
|
||||
opcache_reset();
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "reseted OPcache");
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
|
||||
header('Location: ' . $linker->getLink(array(
|
||||
'section' => 'opcacheinfo',
|
||||
'page' => 'showinfo'
|
||||
|
||||
@@ -52,7 +52,7 @@ if ($page == 'overview') {
|
||||
$domains = "";
|
||||
$subdomains_count = count($row['subdomains']);
|
||||
foreach ($row['domains'] as $configdomain) {
|
||||
$domains .= $configdomain . "<br>";
|
||||
$domains .= $idna_convert->decode($configdomain) . "<br>";
|
||||
}
|
||||
$count ++;
|
||||
if ($subdomains_count == 0 && empty($domains)) {
|
||||
@@ -81,8 +81,16 @@ if ($page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (file_exists(\Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
|
||||
require_once \Froxlor\Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
|
||||
$result = [
|
||||
'phpsettings' => DEFAULT_PHPINI
|
||||
];
|
||||
} else {
|
||||
// use first php-config as fallback
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
$fpmconfigs = '';
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
@@ -90,9 +98,9 @@ if ($page == 'overview') {
|
||||
$fpmconfigs .= \Froxlor\UI\HTML::makeoption($row['description'], $row['id'], 1, true, true);
|
||||
}
|
||||
|
||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
$phpconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($phpconfig_add_data);
|
||||
@@ -234,9 +242,9 @@ if ($page == 'overview') {
|
||||
));
|
||||
} else {
|
||||
|
||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'static', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'static', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'static', true, true);
|
||||
$pm_select = \Froxlor\UI\HTML::makeoption('static', 'static', 'dynamic', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('dynamic', 'dynamic', 'dynamic', true, true);
|
||||
$pm_select .= \Froxlor\UI\HTML::makeoption('ondemand', 'ondemand', 'dynamic', true, true);
|
||||
|
||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||
$fpmconfig_add_form = \Froxlor\UI\HtmlForm::genHTMLForm($fpmconfig_add_data);
|
||||
|
||||
@@ -38,33 +38,31 @@ if ($page == '' || $page == 'overview') {
|
||||
'adminname' => $lng['admin']['admin'],
|
||||
'p.ts' => $lng['admin']['plans']['last_update']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_PLANS, $fields);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = HostingPlans::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = HostingPlans::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$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 = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['ts_format'] = date("d.m.Y H:i", $row['ts']);
|
||||
eval("\$plans.=\"" . \Froxlor\UI\Template::getTemplate("plans/plans_plan") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
$i ++;
|
||||
foreach ($result['list'] as $row) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$row['ts_format'] = date("d.m.Y H:i", $row['ts']);
|
||||
eval("\$plans.=\"" . \Froxlor\UI\Template::getTemplate("plans/plans_plan") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("plans/plans") . "\";");
|
||||
@@ -191,9 +189,7 @@ if ($page == '' || $page == 'overview') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
|
||||
try {
|
||||
HostingPlans::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
))->update();
|
||||
HostingPlans::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
@@ -289,6 +285,7 @@ if ($page == '' || $page == 'overview') {
|
||||
$result['customernumber'] = null;
|
||||
$result['custom_notes'] = null;
|
||||
$result['custom_notes_show'] = null;
|
||||
$result['api_allowed'] = null;
|
||||
$hosting_plans = null;
|
||||
$admin_select_cnt = null;
|
||||
$admin_select = null;
|
||||
|
||||
@@ -66,11 +66,11 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
'page' => $page
|
||||
), $_part, $settings_all, $settings_part, $only_enabledisable)) {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles due to changed setting");
|
||||
\Froxlor\System\Cronjob::inserttask('1');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
\Froxlor\System\Cronjob::inserttask('4');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
|
||||
// cron.d file
|
||||
\Froxlor\System\Cronjob::inserttask('99');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
|
||||
|
||||
\Froxlor\UI\Response::standard_success('settingssaved', '', array(
|
||||
'filename' => $filename,
|
||||
@@ -146,12 +146,12 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
|
||||
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles");
|
||||
\Froxlor\System\Cronjob::inserttask('1');
|
||||
\Froxlor\System\Cronjob::inserttask('10');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::CREATE_QUOTA);
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
\Froxlor\System\Cronjob::inserttask('4');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
|
||||
// cron.d file
|
||||
\Froxlor\System\Cronjob::inserttask('99');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_CRON);
|
||||
|
||||
\Froxlor\UI\Response::standard_success('rebuildingconfigs', '', array(
|
||||
'filename' => 'admin_index.php'
|
||||
|
||||
@@ -56,6 +56,26 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
$maxyears = date("Y") - $minyear['year'];
|
||||
}
|
||||
|
||||
$params = [];
|
||||
if ($userinfo['customers_see_all'] == '0') {
|
||||
$params = [
|
||||
'id' => $userinfo['adminid']
|
||||
];
|
||||
}
|
||||
$customer_name_list_stmt = Database::prepare("
|
||||
SELECT `customerid`,`company`,`name`,`firstname`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . "
|
||||
ORDER BY name"
|
||||
);
|
||||
|
||||
$traffic_list_stmt = Database::prepare("
|
||||
SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic
|
||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||
WHERE year = :year AND `customerid` = :id
|
||||
GROUP BY month ORDER BY month"
|
||||
);
|
||||
|
||||
for ($years = 0; $years <= $maxyears; $years ++) {
|
||||
|
||||
$overview['year'] = date("Y") - $years;
|
||||
@@ -76,14 +96,7 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
'dec' => 0
|
||||
);
|
||||
|
||||
$customer_name_list_stmt = Database::prepare("
|
||||
SELECT `customerid`,`company`,`name`,`firstname`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :id") . "
|
||||
ORDER BY name");
|
||||
Database::pexecute($customer_name_list_stmt, array(
|
||||
'id' => $userinfo['adminid']
|
||||
));
|
||||
Database::pexecute($customer_name_list_stmt, $params);
|
||||
|
||||
while ($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
@@ -104,11 +117,6 @@ if ($page == 'overview' || $page == 'customers') {
|
||||
'dec' => '-'
|
||||
);
|
||||
|
||||
$traffic_list_stmt = Database::prepare("
|
||||
SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic
|
||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||
WHERE year = :year AND `customerid` = :id
|
||||
GROUP BY month ORDER BY month");
|
||||
Database::pexecute($traffic_list_stmt, array(
|
||||
'year' => (date("Y") - $years),
|
||||
'id' => $customer_name['customerid']
|
||||
|
||||
@@ -65,7 +65,7 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('update/update_end') . "\";");
|
||||
|
||||
\Froxlor\User::updateCounters();
|
||||
\Froxlor\System\Cronjob::inserttask('1');
|
||||
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
|
||||
@chmod(\Froxlor\Froxlor::getInstallDir() . '/lib/userdata.inc.php', 0440);
|
||||
|
||||
$successful_update = true;
|
||||
|
||||
16
api.php
16
api.php
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use voku\helper\AntiXSS;
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
require \Froxlor\Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
||||
@@ -23,15 +25,22 @@ if (empty($request)) {
|
||||
}
|
||||
|
||||
// decode json request
|
||||
$decoded_request = json_decode(stripslashes($request), true);
|
||||
$decoded_request = json_decode($request, true);
|
||||
|
||||
// is it valid?
|
||||
if (is_null($decoded_request)) {
|
||||
json_response(400, "Invalid JSON");
|
||||
}
|
||||
|
||||
/**
|
||||
* check for xss attempts and clean request
|
||||
*/
|
||||
$antiXss = new AntiXSS();
|
||||
$request = $antiXss->xss_clean($request);
|
||||
|
||||
// validate content
|
||||
try {
|
||||
$decoded_request = stripcslashes_deep($decoded_request);
|
||||
$request = \Froxlor\Api\FroxlorRPC::validateRequest($decoded_request);
|
||||
// now actually do it
|
||||
$cls = "\\Froxlor\\Api\\Commands\\" . $request['command']['class'];
|
||||
@@ -72,3 +81,8 @@ function json_response($status, $status_message = '', $data = null)
|
||||
echo $json_response;
|
||||
exit();
|
||||
}
|
||||
|
||||
function stripcslashes_deep($value)
|
||||
{
|
||||
return is_array($value) ? array_map('stripcslashes_deep', $value) : stripcslashes($value);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ if ($action == 'delete') {
|
||||
|
||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed api::api_keys");
|
||||
|
||||
// select all my (accessable) certificates
|
||||
// select all my (accessible) certificates
|
||||
$keys_stmt_query = "SELECT ak.*, c.loginname, a.loginname as adminname
|
||||
FROM `" . TABLE_API_KEYS . "` ak
|
||||
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` c ON `c`.`customerid` = `ak`.`customerid`
|
||||
|
||||
23
build.xml
23
build.xml
@@ -6,21 +6,20 @@
|
||||
<property name="pdepend" value="${basedir}/vendor/bin/pdepend" />
|
||||
<property name="phpcpd" value="${basedir}/vendor/bin/phpcpd" />
|
||||
<property name="phpcs" value="${basedir}/vendor/bin/phpcs" />
|
||||
<property name="phpdox" value="${basedir}/vendor/bin/phpdox" />
|
||||
<property name="phploc" value="${basedir}/vendor/bin/phploc" />
|
||||
<property name="phpmd" value="${basedir}/vendor/bin/phpmd" />
|
||||
<property name="phpunit" value="${basedir}/vendor/bin/phpunit" />
|
||||
|
||||
<target name="full-build"
|
||||
depends="prepare,composer,static-analysis,phpunit,phpdox,-check-failure"
|
||||
depends="prepare,composer,static-analysis,phpunit,-check-failure"
|
||||
description="Performs static analysis, runs the tests, and generates project documentation" />
|
||||
|
||||
<target name="full-build-parallel"
|
||||
depends="prepare,composer,static-analysis-parallel,phpunit,phpdox,-check-failure"
|
||||
depends="prepare,composer,static-analysis-parallel,phpunit,-check-failure"
|
||||
description="Performs static analysis (executing the tools in parallel), runs the tests, and generates project documentation" />
|
||||
|
||||
<target name="quick-build"
|
||||
depends="prepare,composer,lint,phpunit-no-coverage"
|
||||
depends="prepare,composer,lint,phpunit-no-coverage,-check-failure"
|
||||
description="Performs a lint check and runs the tests (without generating code coverage reports)" />
|
||||
|
||||
<target name="static-analysis"
|
||||
@@ -49,7 +48,6 @@
|
||||
<delete dir="${basedir}/build/coverage" />
|
||||
<delete dir="${basedir}/build/logs" />
|
||||
<delete dir="${basedir}/build/pdepend" />
|
||||
<delete dir="${basedir}/build/phpdox" />
|
||||
<property name="clean.done" value="true" />
|
||||
</target>
|
||||
|
||||
@@ -59,7 +57,6 @@
|
||||
<mkdir dir="${basedir}/build/coverage" />
|
||||
<mkdir dir="${basedir}/build/logs" />
|
||||
<mkdir dir="${basedir}/build/pdepend" />
|
||||
<mkdir dir="${basedir}/build/phpdox" />
|
||||
|
||||
<property name="prepare.done" value="true" />
|
||||
</target>
|
||||
@@ -257,7 +254,7 @@
|
||||
<target name="phpunit-no-coverage" unless="phpunit.done"
|
||||
depends="composer"
|
||||
description="Run unit tests with PHPUnit (without generating code coverage reports)">
|
||||
<exec executable="${phpunit}" failonerror="true"
|
||||
<exec executable="${phpunit}" failonerror="true" resultproperty="result.phpunit"
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
@@ -269,18 +266,6 @@
|
||||
<property name="phpunit.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpdox" unless="phpdox.done"
|
||||
depends="phploc-ci,phpcs-ci,phpcompat-ci,phpmd-ci"
|
||||
description="Generate project documentation using phpDox">
|
||||
<exec executable="${phpdox}" dir="${basedir}/build"
|
||||
taskname="phpdox">
|
||||
<arg value="--file" />
|
||||
<arg path="${basedir}/phpdox.xml" />
|
||||
</exec>
|
||||
|
||||
<property name="phpdox.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="-check-failure">
|
||||
<fail message="PHPUnit did not finish successfully">
|
||||
<condition>
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
"issues": "https://github.com/Froxlor/Froxlor/issues",
|
||||
"forum": "https://forum.froxlor.org/",
|
||||
"wiki": "https://github.com/Froxlor/Froxlor/wiki",
|
||||
"irc": "irc://chat.freenode.net/froxlor",
|
||||
"irc": "irc://irc.libera.chat/froxlor",
|
||||
"source": "https://github.com/Froxlor/Froxlor",
|
||||
"docs": "https://github.com/Froxlor/Froxlor/wiki"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"php": "^7.1 || ^8.0",
|
||||
"ext-session": "*",
|
||||
"ext-ctype": "*",
|
||||
"ext-pdo": "*",
|
||||
@@ -43,22 +43,23 @@
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"phpmailer/phpmailer": "~6.0",
|
||||
"monolog/monolog": "^1.24",
|
||||
"robthree/twofactorauth": "^1.6",
|
||||
"algo26-matthias/idna-convert": "^2.1"
|
||||
},
|
||||
"froxlor/idna-convert-legacy": "^2.1",
|
||||
"voku/anti-xss": "^4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8",
|
||||
"php": ">=7.3",
|
||||
"phpunit/phpunit": "^9",
|
||||
"ext-pcntl": "*",
|
||||
"phpcompatibility/php-compatibility": "*",
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"pdepend/pdepend": "^2.5",
|
||||
"sebastian/phpcpd": "^4.1",
|
||||
"theseer/phpdox": "^0.12.0",
|
||||
"phploc/phploc": "^5.0",
|
||||
"phpmd/phpmd": "^2.6"
|
||||
"pdepend/pdepend": "^2.9",
|
||||
"sebastian/phpcpd": "^6.0",
|
||||
"phploc/phploc": "^7.0",
|
||||
"phpmd/phpmd": "^2.10",
|
||||
"phpunit/php-timer" : "^5"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "*",
|
||||
|
||||
3255
composer.lock
generated
3255
composer.lock
generated
File diff suppressed because it is too large
Load Diff
0
css/images/index.html
Normal file
0
css/images/index.html
Normal file
0
css/index.html
Normal file
0
css/index.html
Normal file
@@ -42,146 +42,65 @@ if ($page == 'overview') {
|
||||
if ($action == '') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_domains::domains");
|
||||
$fields = array(
|
||||
'd.domain' => $lng['domains']['domainname']
|
||||
'd.domain_ace' => $lng['domains']['domainname'],
|
||||
'd.aliasdomain' => $lng['domains']['aliasdomain']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DOMAINS, $fields);
|
||||
$domains_stmt = Database::prepare("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isbinddomain`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`letsencrypt`, `d`.`registration_date`, `d`.`termination_date`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id`
|
||||
LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id`
|
||||
WHERE `d`.`customerid`= :customerid
|
||||
AND `d`.`email_only`='0'
|
||||
AND `d`.`id` <> :standardsubdomain " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($domains_stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"standardsubdomain" => $userinfo['standardsubdomain']
|
||||
));
|
||||
$paging->setEntries(Database::num_rows());
|
||||
try {
|
||||
// get total count
|
||||
$json_result = SubDomains::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = SubDomains::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$domains = '';
|
||||
$parentdomains_count = 0;
|
||||
$domains_count = 0;
|
||||
$domains_count = $paging->getEntries();
|
||||
$domain_array = array();
|
||||
|
||||
while ($row = $domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$row['domain'] = $idna_convert->decode($row['domain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain']);
|
||||
$row['domainalias'] = $idna_convert->decode($row['domainalias']);
|
||||
|
||||
foreach ($result['list'] as $row) {
|
||||
formatDomainEntry($row, $idna_convert);
|
||||
if ($row['parentdomainid'] == '0' && $row['caneditdomain'] == '1') {
|
||||
$parentdomains_count ++;
|
||||
}
|
||||
$domain_array[$row['parentdomainname']][] = $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for set ssl-certs to show different state-icons
|
||||
*/
|
||||
// nothing (ssl_global)
|
||||
$row['domain_hascert'] = 0;
|
||||
$ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
|
||||
Database::pexecute($ssl_stmt, array(
|
||||
"domainid" => $row['id']
|
||||
));
|
||||
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
|
||||
// own certificate (ssl_customer_green)
|
||||
$row['domain_hascert'] = 1;
|
||||
foreach ($domain_array as $parentdomain => $sdomains) {
|
||||
// PARENTDOMAIN
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$statsapp = 'awstats';
|
||||
} else {
|
||||
// check if it's parent has one set (shared)
|
||||
if ($row['parentdomainid'] != 0) {
|
||||
$ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
|
||||
Database::pexecute($ssl_stmt, array(
|
||||
"domainid" => $row['parentdomainid']
|
||||
));
|
||||
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
|
||||
// parent has a certificate (ssl_shared)
|
||||
$row['domain_hascert'] = 2;
|
||||
}
|
||||
}
|
||||
$statsapp = 'webalizer';
|
||||
}
|
||||
$row = [
|
||||
'domain' => $idna_convert->decode($parentdomain ?? '')
|
||||
];
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
|
||||
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
|
||||
if ($row['termination_date'] != "") {
|
||||
$cdate = strtotime($row['termination_date'] . " 23:59:59");
|
||||
$today = time();
|
||||
foreach ($sdomains as $domain) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($domain);
|
||||
|
||||
if ($cdate < $today) {
|
||||
$row['termination_css'] = 'domain-expired';
|
||||
} else {
|
||||
$row['termination_css'] = 'domain-canceled';
|
||||
// show docroot nicely
|
||||
if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot']));
|
||||
}
|
||||
// get ssl-ips if activated
|
||||
$show_ssledit = false;
|
||||
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
|
||||
$show_ssledit = true;
|
||||
}
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
}
|
||||
|
||||
$domains_count ++;
|
||||
$domain_array[$row['domain']] = $row;
|
||||
}
|
||||
|
||||
ksort($domain_array);
|
||||
$domain_id_array = array();
|
||||
foreach ($domain_array as $sortkey => $row) {
|
||||
$domain_id_array[$row['id']] = $sortkey;
|
||||
}
|
||||
|
||||
$domain_sort_array = array();
|
||||
foreach ($domain_array as $sortkey => $row) {
|
||||
if ($row['parentdomainid'] == 0) {
|
||||
$domain_sort_array[$sortkey][$sortkey] = $row;
|
||||
} else {
|
||||
// when searching and the results are subdomains only, we need to get
|
||||
// the parent domain to this subdomain
|
||||
if (! isset($domain_id_array[$row['parentdomainid']])) {
|
||||
$domain_id_array[$row['parentdomainid']] = "[parent-domain]";
|
||||
}
|
||||
$domain_sort_array[$domain_id_array[$row['parentdomainid']]][$sortkey] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$domain_array = array();
|
||||
|
||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
|
||||
ksort($domain_sort_array);
|
||||
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
||||
krsort($domain_sort_array);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($domain_sort_array as $sortkey => $domain_array) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
|
||||
if (isset($domain_array[$sortkey])) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($domain_array[$sortkey]);
|
||||
if (Settings::Get('system.awstats_enabled') == '1') {
|
||||
$statsapp = 'awstats';
|
||||
} else {
|
||||
$statsapp = 'webalizer';
|
||||
}
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_delimiter") . "\";");
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'asc') {
|
||||
ksort($domain_array);
|
||||
} elseif ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
||||
krsort($domain_array);
|
||||
}
|
||||
|
||||
foreach ($domain_array as $row) {
|
||||
if (strpos($row['documentroot'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir(str_replace($userinfo['documentroot'], "/", $row['documentroot']));
|
||||
}
|
||||
|
||||
// get ssl-ips if activated
|
||||
$show_ssledit = false;
|
||||
if (Settings::Get('system.use_ssl') == '1' && \Froxlor\Domain\Domain::domainHasSslIpPort($row['id']) && $row['caneditdomain'] == '1' && $row['letsencrypt'] == 0) {
|
||||
$show_ssledit = true;
|
||||
}
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$domains.=\"" . \Froxlor\UI\Template::getTemplate("domains/domains_domain") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
$i += count($domain_array);
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("domains/domainlist") . "\";");
|
||||
@@ -459,7 +378,9 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$alias_stmt = Database::prepare("SELECT COUNT(`id`) AS count FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `aliasdomain`= :aliasdomain");
|
||||
$alias_check = Database::pexecute_first($alias_stmt, array("aliasdomain" => $result['id']));
|
||||
$alias_check = Database::pexecute_first($alias_stmt, array(
|
||||
"aliasdomain" => $result['id']
|
||||
));
|
||||
$alias_check = $alias_check['count'];
|
||||
|
||||
$domainip = $result_ipandport['ip'];
|
||||
@@ -547,3 +468,53 @@ if ($page == 'overview') {
|
||||
|
||||
require_once __DIR__ . '/logfiles_viewer.php';
|
||||
}
|
||||
|
||||
function formatDomainEntry(&$row, &$idna_convert)
|
||||
{
|
||||
$row['domain'] = $idna_convert->decode($row['domain']);
|
||||
$row['aliasdomain'] = $idna_convert->decode($row['aliasdomain'] ?? '');
|
||||
$row['domainalias'] = $idna_convert->decode($row['domainalias'] ?? '');
|
||||
|
||||
/**
|
||||
* check for set ssl-certs to show different state-icons
|
||||
*/
|
||||
// nothing (ssl_global)
|
||||
$row['domain_hascert'] = 0;
|
||||
$ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
|
||||
Database::pexecute($ssl_stmt, array(
|
||||
"domainid" => $row['id']
|
||||
));
|
||||
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
|
||||
// own certificate (ssl_customer_green)
|
||||
$row['domain_hascert'] = 1;
|
||||
} else {
|
||||
// check if it's parent has one set (shared)
|
||||
if ($row['parentdomainid'] != 0) {
|
||||
$ssl_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :domainid");
|
||||
Database::pexecute($ssl_stmt, array(
|
||||
"domainid" => $row['parentdomainid']
|
||||
));
|
||||
$ssl_result = $ssl_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (is_array($ssl_result) && isset($ssl_result['ssl_cert_file']) && $ssl_result['ssl_cert_file'] != '') {
|
||||
// parent has a certificate (ssl_shared)
|
||||
$row['domain_hascert'] = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date'] ?? '');
|
||||
|
||||
$row['termination_css'] = "";
|
||||
if ($row['termination_date'] != "") {
|
||||
$cdate = strtotime($row['termination_date'] . " 23:59:59");
|
||||
$today = time();
|
||||
|
||||
if ($cdate < $today) {
|
||||
$row['termination_css'] = 'domain-expired';
|
||||
} else {
|
||||
$row['termination_css'] = 'domain-canceled';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,27 +43,31 @@ if ($page == 'overview') {
|
||||
if ($action == '') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
|
||||
$fields = array(
|
||||
'd.domain' => $lng['domains']['domainname'],
|
||||
'd.domain_ace' => $lng['domains']['domainname'],
|
||||
'm.email_full' => $lng['emails']['emailaddress'],
|
||||
'm.destination' => $lng['emails']['forwarders']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_MAIL_VIRTUAL, $fields);
|
||||
$result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
|
||||
LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
|
||||
LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
|
||||
WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$emailscount = Database::num_rows();
|
||||
$paging->setEntries($emailscount);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Emails::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Emails::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$emails = array();
|
||||
$emailscount = $paging->getEntries();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
foreach ($result['list'] as $row) {
|
||||
if (! isset($emails[$row['domain']]) || ! is_array($emails[$row['domain']])) {
|
||||
$emails[$row['domain']] = array();
|
||||
}
|
||||
@@ -71,13 +75,12 @@ if ($page == 'overview') {
|
||||
$emails[$row['domain']][$row['email_full']] = $row;
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'd.domain' && $paging->sortorder == 'desc') {
|
||||
if ($paging->sortfield == 'd.domain_ace' && $paging->sortorder == 'desc') {
|
||||
krsort($emails);
|
||||
} else {
|
||||
ksort($emails);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$accounts = '';
|
||||
$emails_count = 0;
|
||||
@@ -90,53 +93,50 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
foreach ($emailaddresses as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if ($domainname != $idna_convert->decode($row['domain'])) {
|
||||
$domainname = $idna_convert->decode($row['domain']);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_domain") . "\";");
|
||||
}
|
||||
|
||||
$emails_count ++;
|
||||
$row['email'] = $idna_convert->decode($row['email']);
|
||||
$row['email_full'] = $idna_convert->decode($row['email_full']);
|
||||
$row['destination'] = explode(' ', $row['destination']);
|
||||
uasort($row['destination'], 'strcasecmp');
|
||||
|
||||
$dest_list = $row['destination'];
|
||||
foreach ($dest_list as $dest_id => $destination) {
|
||||
$row['destination'][$dest_id] = $idna_convert->decode($row['destination'][$dest_id]);
|
||||
|
||||
if ($row['destination'][$dest_id] == $row['email_full']) {
|
||||
unset($row['destination'][$dest_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$destinations_count = count($row['destination']);
|
||||
$row['destination'] = implode(', ', $row['destination']);
|
||||
|
||||
if (strlen($row['destination']) > 35) {
|
||||
$row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')';
|
||||
}
|
||||
|
||||
$row['mboxsize'] = \Froxlor\PhpHelper::sizeReadable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";");
|
||||
$count ++;
|
||||
if ($domainname != $idna_convert->decode($row['domain'])) {
|
||||
$domainname = $idna_convert->decode($row['domain']);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_domain") . "\";");
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$emails_count ++;
|
||||
$row['email'] = $idna_convert->decode($row['email']);
|
||||
$row['email_full'] = $idna_convert->decode($row['email_full']);
|
||||
$row['destination'] = explode(' ', $row['destination']);
|
||||
uasort($row['destination'], 'strcasecmp');
|
||||
|
||||
$dest_list = $row['destination'];
|
||||
foreach ($dest_list as $dest_id => $destination) {
|
||||
$row['destination'][$dest_id] = $idna_convert->decode($row['destination'][$dest_id]);
|
||||
|
||||
if ($row['destination'][$dest_id] == $row['email_full']) {
|
||||
unset($row['destination'][$dest_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$destinations_count = count($row['destination']);
|
||||
$row['destination'] = implode(', ', $row['destination']);
|
||||
|
||||
if (strlen($row['destination']) > 35) {
|
||||
$row['destination'] = substr($row['destination'], 0, 32) . '... (' . $destinations_count . ')';
|
||||
}
|
||||
|
||||
$row['mboxsize'] = \Froxlor\PhpHelper::sizeReadable($row['mboxsize'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate("email/emails_email") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
}
|
||||
|
||||
$emaildomains_count_stmt = Database::prepare("SELECT COUNT(`id`) AS `count` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `isemaildomain`='1' ORDER BY `domain` ASC");
|
||||
Database::pexecute($emaildomains_count_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT COUNT(`id`) as emaildomains
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :cid AND `isemaildomain` = '1'
|
||||
");
|
||||
$result2 = Database::pexecute_first($result_stmt, array(
|
||||
"cid" => $userinfo['customerid']
|
||||
));
|
||||
$emaildomains_count = $emaildomains_count_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$emaildomains_count = $emaildomains_count['count'];
|
||||
$emaildomains_count = $result2['emaildomains'];
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("email/emails") . "\";");
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
@@ -153,7 +153,8 @@ if ($page == 'overview') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
Emails::getLocal($userinfo, array(
|
||||
'id' => $id
|
||||
'id' => $id,
|
||||
'delete_userfiles' => ($_POST['delete_userfiles'] ?? 0)
|
||||
))->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
@@ -194,7 +195,7 @@ if ($page == 'overview') {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :cid
|
||||
AND `isemaildomain`='1'
|
||||
ORDER BY `domain` ASC");
|
||||
ORDER BY `domain_ace` ASC");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"cid" => $userinfo['customerid']
|
||||
));
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Api\Commands\DirOptions as DirOptions;
|
||||
use Froxlor\Api\Commands\DirProtections as DirProtections;
|
||||
@@ -52,33 +51,34 @@ if ($page == 'overview') {
|
||||
'username' => $lng['login']['username'],
|
||||
'path' => $lng['panel']['path']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_HTPASSWDS, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$paging->setEntries(Database::num_rows());
|
||||
try {
|
||||
// get total count
|
||||
$json_result = DirProtections::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = DirProtections::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$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;
|
||||
$htpasswds = '';
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if (strpos($row['path'], $userinfo['documentroot']) === 0) {
|
||||
$row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']);
|
||||
}
|
||||
$row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htpasswds.=\"" . \Froxlor\UI\Template::getTemplate("extras/htpasswds_htpasswd") . "\";");
|
||||
$count ++;
|
||||
foreach ($result['list'] as $row) {
|
||||
if (strpos($row['path'], $userinfo['documentroot']) === 0) {
|
||||
$row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']);
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htpasswds.=\"" . \Froxlor\UI\Template::getTemplate("extras/htpasswds_htpasswd") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("extras/htpasswds") . "\";");
|
||||
@@ -192,39 +192,40 @@ if ($page == 'overview') {
|
||||
'error500path' => $lng['extras']['error500path'],
|
||||
'options_cgi' => $lng['extras']['execute_perl']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_HTACCESS, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$paging->setEntries(Database::num_rows());
|
||||
try {
|
||||
// get total count
|
||||
$json_result = DirOptions::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = DirOptions::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$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;
|
||||
$htaccess = '';
|
||||
|
||||
$cperlenabled = \Froxlor\Customer\Customer::customerHasPerlEnabled($userinfo['customerid']);
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if (strpos($row['path'], $userinfo['documentroot']) === 0) {
|
||||
$row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']);
|
||||
}
|
||||
$row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']);
|
||||
$row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
|
||||
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
|
||||
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
|
||||
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htaccess.=\"" . \Froxlor\UI\Template::getTemplate("extras/htaccess_htaccess") . "\";");
|
||||
$count ++;
|
||||
foreach ($result['list'] as $row) {
|
||||
if (strpos($row['path'], $userinfo['documentroot']) === 0) {
|
||||
$row['path'] = str_replace($userinfo['documentroot'], "/", $row['path']);
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$row['path'] = \Froxlor\FileDir::makeCorrectDir($row['path']);
|
||||
$row['options_indexes'] = str_replace('1', $lng['panel']['yes'], $row['options_indexes']);
|
||||
$row['options_indexes'] = str_replace('0', $lng['panel']['no'], $row['options_indexes']);
|
||||
$row['options_cgi'] = str_replace('1', $lng['panel']['yes'], $row['options_cgi']);
|
||||
$row['options_cgi'] = str_replace('0', $lng['panel']['no'], $row['options_cgi']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$htaccess.=\"" . \Froxlor\UI\Template::getTemplate("extras/htaccess_htaccess") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate("extras/htaccess") . "\";");
|
||||
|
||||
@@ -46,39 +46,36 @@ if ($page == 'overview') {
|
||||
'homedir' => $lng['panel']['path'],
|
||||
'description' => $lng['panel']['ftpdesc']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_FTP_USERS, $fields);
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `shell` FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$ftps_count = Database::num_rows();
|
||||
$paging->setEntries($ftps_count);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Ftps::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Ftps::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$ftps_count = $paging->getEntries();
|
||||
$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;
|
||||
$accounts = '';
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']);
|
||||
} else {
|
||||
$row['documentroot'] = $row['homedir'];
|
||||
}
|
||||
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir($row['documentroot']);
|
||||
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
|
||||
$count ++;
|
||||
foreach ($result['list'] as $row) {
|
||||
if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']);
|
||||
} else {
|
||||
$row['documentroot'] = $row['homedir'];
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$row['documentroot'] = \Froxlor\FileDir::makeCorrectDir($row['documentroot']);
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
eval("\$accounts.=\"" . \Froxlor\UI\Template::getTemplate('ftp/accounts_account') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('ftp/accounts') . "\";");
|
||||
|
||||
@@ -93,14 +93,30 @@ if ($page == 'overview') {
|
||||
'cid' => $userinfo['customerid']
|
||||
));
|
||||
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['diskspace_used'] = round($usages['webspace'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['mailspace_used'] = round($usages['mail'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['dbspace_used'] = round($usages['mysql'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
// get everything in bytes for the percentage calculation on the dashboard
|
||||
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
|
||||
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : - 1;
|
||||
$userinfo['traffic_bytes_used'] = $userinfo['traffic_used'] * 1024;
|
||||
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
if ($usages) {
|
||||
$userinfo['diskspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['webspace'] * 1024, null, 'bi');
|
||||
$userinfo['mailspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['mail'] * 1024, null, 'bi');
|
||||
$userinfo['dbspace_used'] = \Froxlor\PhpHelper::sizeReadable($usages['mysql'] * 1024, null, 'bi');
|
||||
$userinfo['total_used'] = \Froxlor\PhpHelper::sizeReadable(($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024, null, 'bi');
|
||||
$userinfo['diskspace_bytes_used'] = $usages['webspace'] * 1024;
|
||||
$userinfo['total_bytes_used'] = ($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024;
|
||||
} else {
|
||||
$userinfo['diskspace_used'] = 0;
|
||||
$userinfo['mailspace_used'] = 0;
|
||||
$userinfo['dbspace_used'] = 0;
|
||||
$userinfo['total_used'] = 0;
|
||||
$userinfo['diskspace_bytes_used'] = 0;
|
||||
$userinfo['total_bytes_used'] = 0;
|
||||
}
|
||||
$userinfo['diskspace'] = ($userinfo['diskspace'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['diskspace'] * 1024, null, 'bi') : - 1;
|
||||
$userinfo['traffic'] = ($userinfo['traffic'] > -1) ? \Froxlor\PhpHelper::sizeReadable($userinfo['traffic'] * 1024, null, 'bi') : - 1;
|
||||
$userinfo['traffic_used'] = \Froxlor\PhpHelper::sizeReadable($userinfo['traffic_used'] * 1024, null, 'bi');
|
||||
$userinfo = \Froxlor\PhpHelper::strReplaceArray('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace diskspace_bytes traffic traffic_bytes mysqls emails email_accounts email_forwarders email_quota ftps subdomains');
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
@@ -114,18 +130,26 @@ if ($page == 'overview') {
|
||||
$se[] = "PHP";
|
||||
if ($userinfo['perlenabled'] == '1')
|
||||
$se[] = "Perl/CGI";
|
||||
if ($userinfo['api_allowed'] == '1')
|
||||
$se[] = '<a href="customer_index.php?s=' . $s . '&page=apikeys">API</a>';
|
||||
$services_enabled = implode(", ", $se);
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('index/index') . "\";");
|
||||
} elseif ($page == 'change_password') {
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$old_password = \Froxlor\Validate\Validate::validate($_POST['old_password'], 'old password');
|
||||
|
||||
if (! \Froxlor\System\Crypt::validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) {
|
||||
\Froxlor\UI\Response::standard_error('oldpasswordnotcorrect');
|
||||
}
|
||||
|
||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
try {
|
||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
|
||||
if ($old_password == '') {
|
||||
\Froxlor\UI\Response::standard_error(array(
|
||||
@@ -353,8 +377,6 @@ if ($page == 'overview') {
|
||||
}
|
||||
} elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/api_keys.php';
|
||||
} elseif ($page == 'apihelp' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/apihelp.php';
|
||||
} elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) {
|
||||
require_once __DIR__ . '/2fa.php';
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\SysLog;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
|
||||
@@ -35,26 +36,25 @@ if ($page == 'log') {
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc', 30);
|
||||
$query = 'SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy();
|
||||
$result_stmt = Database::prepare($query . ' ' . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"loginname" => $userinfo['loginname']
|
||||
));
|
||||
$result_cnt_stmt = Database::prepare($query);
|
||||
Database::pexecute($result_cnt_stmt, array(
|
||||
"loginname" => $userinfo['loginname']
|
||||
));
|
||||
$res_cnt = $result_cnt_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$logs_count = $result_cnt_stmt->rowCount();
|
||||
$paging->setEntries($logs_count);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = SysLog::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = SysLog::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
foreach ($result['list'] as $row) {
|
||||
|
||||
if (! isset($clog[$row['action']]) || ! is_array($clog[$row['action']])) {
|
||||
$clog[$row['action']] = array();
|
||||
@@ -68,7 +68,6 @@ if ($page == 'log') {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
$log = '';
|
||||
@@ -113,10 +112,7 @@ if ($page == 'log') {
|
||||
eval("\$log.=\"" . \Froxlor\UI\Template::getTemplate('logger/logger_log') . "\";");
|
||||
$count ++;
|
||||
$_action = $action;
|
||||
// }
|
||||
$i ++;
|
||||
}
|
||||
$i ++;
|
||||
}
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('logger/logger') . "\";");
|
||||
|
||||
@@ -53,20 +53,24 @@ if ($page == 'overview') {
|
||||
'databasename' => $lng['mysql']['databasename'],
|
||||
'description' => $lng['mysql']['databasedescription']
|
||||
);
|
||||
$paging = new \Froxlor\UI\Paging($userinfo, TABLE_PANEL_DATABASES, $fields);
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_DATABASES . "`
|
||||
WHERE `customerid`= :customerid " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$mysqls_count = Database::num_rows();
|
||||
$paging->setEntries($mysqls_count);
|
||||
try {
|
||||
// get total count
|
||||
$json_result = Mysqls::getLocal($userinfo)->listingCount();
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
// initialize pagination and filtering
|
||||
$paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result);
|
||||
// get list
|
||||
$json_result = Mysqls::getLocal($userinfo, $paging->getApiCommandParams())->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$mysqls_count = $paging->getEntries();
|
||||
$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;
|
||||
$mysqls = '';
|
||||
|
||||
@@ -76,21 +80,20 @@ if ($page == 'overview') {
|
||||
|
||||
// Begin root-session
|
||||
Database::needRoot(true);
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
|
||||
foreach ($result['list'] as $row) {
|
||||
$row = \Froxlor\PhpHelper::htmlentitiesArray($row);
|
||||
$mbdata_stmt = Database::prepare("SELECT SUM(data_length + index_length) as MB FROM information_schema.TABLES
|
||||
WHERE table_schema = :table_schema
|
||||
GROUP BY table_schema");
|
||||
Database::pexecute($mbdata_stmt, array(
|
||||
"table_schema" => $row['databasename']
|
||||
));
|
||||
$mbdata = $mbdata_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$row['size'] = \Froxlor\PhpHelper::sizeReadable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count ++;
|
||||
$mbdata = Database::pexecute_first($mbdata_stmt, array(
|
||||
"table_schema" => $row['databasename']
|
||||
));
|
||||
if (!$mbdata) {
|
||||
$mbdata = array('MB' => 0);
|
||||
}
|
||||
$i ++;
|
||||
$row['size'] = \Froxlor\PhpHelper::sizeReadable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int) Settings::Get('panel.decimal_places') . 'f %s');
|
||||
eval("\$mysqls.=\"" . \Froxlor\UI\Template::getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count ++;
|
||||
}
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
|
||||
@@ -86,22 +86,18 @@ if (! is_null($month) && ! is_null($year)) {
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($row['ftp_down'], 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv($ftp, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024, Settings::Get('panel.decimal_places'));
|
||||
} else {
|
||||
$traf['ftptext'] = round($row['ftp_up'] / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($row['ftp_down'] / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['http'] = round($http, Settings::Get('panel.decimal_places'));
|
||||
$traf['ftp'] = round($ftp, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = round($mail, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = round($traf['byte'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['ftp'] = round($ftp / 1024, Settings::Get('panel.decimal_places'));
|
||||
}
|
||||
|
||||
getReadableTraffic($traf,'httptext', $http, 1024, "MiB (HTTP)");
|
||||
getReadableTraffic($traf,'http', $http, 1024);
|
||||
getReadableTraffic($traf,'mailtext', $mail, 1024, "MiB (Mail)");
|
||||
getReadableTraffic($traf,'mail', $mail, 1024);
|
||||
getReadableTraffic($traf,'byte', $traf['byte'], (1024 * 1024));
|
||||
|
||||
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_month') . "\";");
|
||||
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
||||
}
|
||||
@@ -112,11 +108,14 @@ if (! is_null($month) && ! is_null($year)) {
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_details') . "\";");
|
||||
} else {
|
||||
$result_stmt = Database::prepare("SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `month`, `year`, SUM(`http`) AS http, SUM(`ftp_up`) AS ftp_up, SUM(`ftp_down`) AS ftp_down, SUM(`mail`) AS mail
|
||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||
WHERE `customerid` = :customerid
|
||||
GROUP BY `year` DESC, `month` DESC
|
||||
LIMIT 12");
|
||||
GROUP BY `year`, `month`
|
||||
ORDER BY `year` DESC, `month` DESC
|
||||
LIMIT 12
|
||||
");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
@@ -139,22 +138,18 @@ if (! is_null($month) && ! is_null($year)) {
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($ftp_up, 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . bcdiv($ftp_down, 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = bcdiv($http, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = bcdiv($mail, 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, Settings::Get('panel.decimal_places'));
|
||||
} else {
|
||||
$traf['ftptext'] = round($ftp_up / 1024, Settings::Get('panel.decimal_places')) . " MiB up/ " . round($ftp_down / 1024, Settings::Get('panel.decimal_places')) . " MiB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, Settings::Get('panel.decimal_places')) . " MiB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, Settings::Get('panel.decimal_places')) . " MiB (Mail)";
|
||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['http'] = round($http / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['mail'] = round($mail / 1024, Settings::Get('panel.decimal_places'));
|
||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), Settings::Get('panel.decimal_places'));
|
||||
}
|
||||
|
||||
getReadableTraffic($traf,'httptext', $http, 1024, "MiB (HTTP)");
|
||||
getReadableTraffic($traf,'http', $http, 1024);
|
||||
getReadableTraffic($traf,'mailtext', $mail, 1024, "MiB (Mail)");
|
||||
getReadableTraffic($traf,'mail', $mail, 1024);
|
||||
getReadableTraffic($traf,'byte', $traf['byte'], (1024 * 1024));
|
||||
|
||||
eval("\$traffic.=\"" . \Froxlor\UI\Template::getTemplate('traffic/traffic_traffic') . "\";");
|
||||
}
|
||||
|
||||
@@ -164,3 +159,12 @@ if (! is_null($month) && ! is_null($year)) {
|
||||
|
||||
eval("echo \"" . \Froxlor\UI\Template::getTemplate('traffic/traffic') . "\";");
|
||||
}
|
||||
|
||||
function getReadableTraffic(&$traf, $index, $value, $divisor, $desc = "")
|
||||
{
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf[$index] = bcdiv($value, $divisor,Settings::Get('panel.decimal_places')).(!empty($desc) ? " ".$desc : "");
|
||||
} else {
|
||||
$traf[$index] = round($value / $divisor, Settings::Get('panel.decimal_places')).(!empty($desc) ? " ".$desc : "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ if (! defined('AREA')) {
|
||||
*
|
||||
*/
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Api\Commands\DomainZones as DomainZones;
|
||||
|
||||
// This file is being included in admin_domains and customer_domains
|
||||
@@ -36,13 +35,6 @@ $ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000;
|
||||
// get domain-name
|
||||
$domain = \Froxlor\Dns\Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo);
|
||||
|
||||
// select all entries
|
||||
$sel_stmt = Database::prepare("SELECT * FROM `" . TABLE_DOMAIN_DNS . "` WHERE domain_id = :did");
|
||||
Database::pexecute($sel_stmt, array(
|
||||
'did' => $domain_id
|
||||
));
|
||||
$dom_entries = $sel_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$errors = "";
|
||||
$success_message = "";
|
||||
|
||||
@@ -58,8 +50,9 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
||||
'ttl' => $ttl
|
||||
))->add();
|
||||
$success_message = $lng['success']['dns_record_added'];
|
||||
$record = $prio = $content = "";
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
$errors = str_replace("\n", "<br>", $e->getMessage());
|
||||
}
|
||||
} elseif ($action == 'delete') {
|
||||
// remove entry
|
||||
@@ -70,26 +63,26 @@ if ($action == 'add_record' && ! empty($_POST)) {
|
||||
'entry_id' => $entry_id,
|
||||
'id' => $domain_id
|
||||
))->delete();
|
||||
// success message (inline)
|
||||
$success_message = $lng['success']['dns_record_deleted'];
|
||||
} catch (Exception $e) {
|
||||
$errors = str_replace("\n", "<br>", $e->getMessage());
|
||||
}
|
||||
|
||||
if (empty($errors)) {
|
||||
// remove deleted entry from internal data array (no reread of DB necessary)
|
||||
$_t = $dom_entries;
|
||||
foreach ($_t as $idx => $entry) {
|
||||
if ($entry['id'] == $entry_id) {
|
||||
unset($dom_entries[$idx]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
unset($_t);
|
||||
// success message (inline)
|
||||
$success_message = $lng['success']['dns_record_deleted'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// select all entries
|
||||
try {
|
||||
// get list
|
||||
$json_result = DomainZones::getLocal($userinfo, [
|
||||
'id' => $domain_id
|
||||
])->listing();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$dom_entries = $result['list'];
|
||||
|
||||
// show editor
|
||||
$record_list = "";
|
||||
$existing_entries = "";
|
||||
@@ -117,7 +110,7 @@ $type_select_values = array(
|
||||
'RP',
|
||||
'SRV',
|
||||
'SSHFP',
|
||||
'TXT',
|
||||
'TXT'
|
||||
);
|
||||
asort($type_select_values);
|
||||
foreach ($type_select_values as $_type) {
|
||||
|
||||
@@ -148,6 +148,11 @@ class FroxlorAPI
|
||||
*/
|
||||
public function getLastResponse(): array
|
||||
{
|
||||
if (!empty($this->getLastError())) {
|
||||
// nothing is returned when the last call
|
||||
// was not successful
|
||||
return [];
|
||||
}
|
||||
return $this->last_body;
|
||||
}
|
||||
|
||||
|
||||
0
doc/example/index.html
Normal file
0
doc/example/index.html
Normal file
0
doc/index.html
Normal file
0
doc/index.html
Normal file
45
index.php
45
index.php
@@ -28,6 +28,12 @@ if ($action == '') {
|
||||
}
|
||||
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
ini_set("session.name", "s");
|
||||
ini_set("url_rewriter.tags", "");
|
||||
ini_set("session.use_cookies", false);
|
||||
ini_set("session.cookie_httponly", true);
|
||||
ini_set("session.cookie_secure", $is_ssl);
|
||||
session_id('login');
|
||||
session_start();
|
||||
}
|
||||
|
||||
@@ -114,7 +120,7 @@ if ($action == '2fa_entercode') {
|
||||
));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row['customer'] == $loginname) {
|
||||
if ($row && $row['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
$uid = 'customerid';
|
||||
$adminsession = '0';
|
||||
@@ -142,7 +148,7 @@ if ($action == '2fa_entercode') {
|
||||
"loginname" => $loginname
|
||||
));
|
||||
$row3 = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row3['customer'] == $loginname) {
|
||||
if ($row3 && $row3['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
$uid = 'customerid';
|
||||
$adminsession = '0';
|
||||
@@ -181,7 +187,7 @@ if ($action == '2fa_entercode') {
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
if ($row['admin'] == $loginname) {
|
||||
if ($row && $row['admin'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_ADMINS . "`";
|
||||
$uid = 'adminid';
|
||||
$adminsession = '1';
|
||||
@@ -372,6 +378,8 @@ if ($action == '2fa_entercode') {
|
||||
$lastscript = "";
|
||||
if (isset($_REQUEST['script']) && $_REQUEST['script'] != "") {
|
||||
$lastscript = $_REQUEST['script'];
|
||||
$lastscript = str_replace("..", "", $lastscript);
|
||||
$lastscript = htmlspecialchars($lastscript, ENT_QUOTES);
|
||||
|
||||
if (! file_exists(__DIR__ . "/" . $lastscript)) {
|
||||
$lastscript = "";
|
||||
@@ -393,7 +401,7 @@ if ($action == 'forgotpwd') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$loginname = \Froxlor\Validate\Validate::validate($_POST['loginname'], 'loginname');
|
||||
$email = \Froxlor\Validate\Validate::validateEmail($_POST['loginemail'], 'email');
|
||||
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `customernumber`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `loginname`= :loginname
|
||||
AND `email`= :email");
|
||||
Database::pexecute($result_stmt, array(
|
||||
@@ -481,6 +489,10 @@ if ($action == 'forgotpwd') {
|
||||
|
||||
$replace_arr = array(
|
||||
'SALUTATION' => \Froxlor\User::getCorrectUserSalutation($user),
|
||||
'NAME' => $user['name'],
|
||||
'FIRSTNAME' => $user['firstname'] ?? "",
|
||||
'COMPANY' => $user['company'] ?? "",
|
||||
'CUSTOMER_NO' => $user['customernumber'] ?? 0,
|
||||
'USERNAME' => $loginname,
|
||||
'LINK' => $activationlink
|
||||
);
|
||||
@@ -598,21 +610,18 @@ if ($action == 'resetpwd') {
|
||||
));
|
||||
|
||||
if ($result !== false) {
|
||||
if ($result['admin'] == 1) {
|
||||
$new_password = \Froxlor\Validate\Validate::validate($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\Validate\Validate::validate($_POST['new_password_confirm'], 'new password confirm');
|
||||
} else {
|
||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
try {
|
||||
$new_password = \Froxlor\System\Crypt::validatePassword($_POST['new_password'], true);
|
||||
$new_password_confirm = \Froxlor\System\Crypt::validatePassword($_POST['new_password_confirm'], true);
|
||||
} catch (Exception $e) {
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
if ($new_password == '') {
|
||||
$message = $new_password;
|
||||
} elseif ($new_password_confirm == '') {
|
||||
$message = $new_password_confirm;
|
||||
} elseif ($new_password != $new_password_confirm) {
|
||||
$message = $new_password . " != " . $new_password_confirm;
|
||||
} else {
|
||||
if (empty($message) && (empty($new_password) || $new_password != $new_password_confirm)) {
|
||||
$message = $lng['error']['newpasswordconfirmerror'];
|
||||
}
|
||||
|
||||
if (empty($message)) {
|
||||
// Update user password
|
||||
if ($result['admin'] == 1) {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
@@ -668,7 +677,7 @@ function finishLogin($userinfo)
|
||||
global $version, $dbversion, $remote_addr, $http_user_agent, $languages;
|
||||
|
||||
if (isset($userinfo['userid']) && $userinfo['userid'] != '') {
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
$s = \Froxlor\Froxlor::genSessionId();
|
||||
|
||||
if (isset($_POST['language'])) {
|
||||
$language = \Froxlor\Validate\Validate::validate($_POST['language'], 'language');
|
||||
|
||||
@@ -15,10 +15,10 @@ CREATE TABLE `ftp_groups` (
|
||||
DROP TABLE IF EXISTS `ftp_users`;
|
||||
CREATE TABLE `ftp_users` (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`username` varchar(255) NOT NULL default '',
|
||||
`username` varchar(255) NOT NULL,
|
||||
`uid` int(5) NOT NULL default '0',
|
||||
`gid` int(5) NOT NULL default '0',
|
||||
`password` varchar(128) NOT NULL default '',
|
||||
`password` varchar(128) NOT NULL,
|
||||
`homedir` varchar(255) NOT NULL default '',
|
||||
`shell` varchar(255) NOT NULL default '/bin/false',
|
||||
`login_enabled` enum('N','Y') NOT NULL default 'N',
|
||||
@@ -71,6 +71,7 @@ CREATE TABLE `mail_virtual` (
|
||||
`customerid` int(11) NOT NULL default '0',
|
||||
`popaccountid` int(11) NOT NULL default '0',
|
||||
`iscatchall` tinyint(1) unsigned NOT NULL default '0',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `email` (`email`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -84,17 +85,17 @@ CREATE TABLE `panel_activation` (
|
||||
`creation` int(11) unsigned NOT NULL default '0',
|
||||
`activationcode` varchar(50) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_admins`;
|
||||
CREATE TABLE `panel_admins` (
|
||||
`adminid` int(11) unsigned NOT NULL auto_increment,
|
||||
`loginname` varchar(50) NOT NULL default '',
|
||||
`password` varchar(255) NOT NULL default '',
|
||||
`loginname` varchar(50) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`def_language` varchar(255) NOT NULL default '',
|
||||
`def_language` varchar(100) NOT NULL default '',
|
||||
`ip` varchar(500) NOT NULL default '-1',
|
||||
`customers` int(15) NOT NULL default '0',
|
||||
`customers_used` int(15) NOT NULL default '0',
|
||||
@@ -127,11 +128,12 @@ CREATE TABLE `panel_admins` (
|
||||
`lastlogin_fail` int(11) unsigned NOT NULL default '0',
|
||||
`loginfail_count` int(11) unsigned NOT NULL default '0',
|
||||
`reportsent` tinyint(4) unsigned NOT NULL default '0',
|
||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||
`theme` varchar(50) NOT NULL default 'Sparkle',
|
||||
`custom_notes` text,
|
||||
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||
`type_2fa` tinyint(1) NOT NULL default '0',
|
||||
`data_2fa` varchar(500) NOT NULL default '',
|
||||
`data_2fa` varchar(25) NOT NULL default '',
|
||||
`api_allowed` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`adminid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -141,7 +143,7 @@ CREATE TABLE `panel_admins` (
|
||||
DROP TABLE IF EXISTS `panel_customers`;
|
||||
CREATE TABLE `panel_customers` (
|
||||
`customerid` int(11) unsigned NOT NULL auto_increment,
|
||||
`loginname` varchar(50) NOT NULL default '',
|
||||
`loginname` varchar(50) NOT NULL,
|
||||
`password` varchar(255) NOT NULL default '',
|
||||
`adminid` int(11) unsigned NOT NULL default '0',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
@@ -149,13 +151,13 @@ CREATE TABLE `panel_customers` (
|
||||
`gender` int(1) NOT NULL DEFAULT '0',
|
||||
`company` varchar(255) NOT NULL default '',
|
||||
`street` varchar(255) NOT NULL default '',
|
||||
`zipcode` varchar(255) NOT NULL default '',
|
||||
`zipcode` varchar(25) NOT NULL default '',
|
||||
`city` varchar(255) NOT NULL default '',
|
||||
`phone` varchar(255) NOT NULL default '',
|
||||
`fax` varchar(255) NOT NULL default '',
|
||||
`phone` varchar(50) NOT NULL default '',
|
||||
`fax` varchar(50) NOT NULL default '',
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`customernumber` varchar(255) NOT NULL default '',
|
||||
`def_language` varchar(255) NOT NULL default '',
|
||||
`def_language` varchar(100) NOT NULL default '',
|
||||
`diskspace` bigint(30) NOT NULL default '0',
|
||||
`diskspace_used` bigint(30) NOT NULL default '0',
|
||||
`mysqls` int(15) NOT NULL default '0',
|
||||
@@ -189,16 +191,16 @@ CREATE TABLE `panel_customers` (
|
||||
`imap` tinyint(1) NOT NULL default '1',
|
||||
`perlenabled` tinyint(1) NOT NULL default '0',
|
||||
`dnsenabled` tinyint(1) NOT NULL default '0',
|
||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||
`theme` varchar(50) NOT NULL default 'Sparkle',
|
||||
`custom_notes` text,
|
||||
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||
`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 '',
|
||||
`type_2fa` tinyint(1) NOT NULL default '0',
|
||||
`data_2fa` varchar(500) NOT NULL default '',
|
||||
`data_2fa` varchar(25) NOT NULL default '',
|
||||
`api_allowed` tinyint(1) NOT NULL default '1',
|
||||
`logviewenabled` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`customerid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
@@ -222,7 +224,8 @@ CREATE TABLE `panel_databases` (
|
||||
DROP TABLE IF EXISTS `panel_domains`;
|
||||
CREATE TABLE `panel_domains` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`domain` varchar(255) NOT NULL default '',
|
||||
`domain` varchar(255) NOT NULL,
|
||||
`domain_ace` varchar(255) NOT NULL default '',
|
||||
`adminid` int(11) unsigned NOT NULL default '0',
|
||||
`customerid` int(11) unsigned NOT NULL default '0',
|
||||
`aliasdomain` int(11) unsigned NULL,
|
||||
@@ -246,6 +249,8 @@ CREATE TABLE `panel_domains` (
|
||||
`speciallogfile` tinyint(1) NOT NULL default '0',
|
||||
`ssl_redirect` tinyint(4) NOT NULL default '0',
|
||||
`specialsettings` text,
|
||||
`ssl_specialsettings` text,
|
||||
`include_specialsettings` tinyint(1) NOT NULL default '0',
|
||||
`deactivated` tinyint(1) NOT NULL default '0',
|
||||
`bindserial` varchar(10) NOT NULL default '2000010100',
|
||||
`add_date` int( 11 ) NOT NULL default '0',
|
||||
@@ -264,6 +269,14 @@ CREATE TABLE `panel_domains` (
|
||||
`notryfiles` tinyint(1) DEFAULT '0',
|
||||
`writeaccesslog` tinyint(1) DEFAULT '1',
|
||||
`writeerrorlog` tinyint(1) DEFAULT '1',
|
||||
`override_tls` tinyint(1) DEFAULT '0',
|
||||
`ssl_protocols` varchar(255) NOT NULL DEFAULT '',
|
||||
`ssl_cipher_list` varchar(500) NOT NULL DEFAULT '',
|
||||
`tlsv13_cipher_list` varchar(500) NOT NULL DEFAULT '',
|
||||
`ssl_enabled` tinyint(1) DEFAULT '1',
|
||||
`ssl_honorcipherorder` tinyint(1) DEFAULT '0',
|
||||
`ssl_sessiontickets` tinyint(1) DEFAULT '1',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`),
|
||||
KEY `parentdomain` (`parentdomainid`),
|
||||
@@ -275,7 +288,7 @@ CREATE TABLE `panel_domains` (
|
||||
DROP TABLE IF EXISTS `panel_ipsandports`;
|
||||
CREATE TABLE `panel_ipsandports` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`ip` varchar(39) NOT NULL default '',
|
||||
`ip` varchar(39) NOT NULL,
|
||||
`port` int(5) NOT NULL default '80',
|
||||
`listen_statement` tinyint(1) NOT NULL default '0',
|
||||
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
||||
@@ -289,6 +302,10 @@ CREATE TABLE `panel_ipsandports` (
|
||||
`default_vhostconf_domain` text,
|
||||
`ssl_cert_chainfile` varchar(255) NOT NULL default '',
|
||||
`docroot` varchar(255) NOT NULL default '',
|
||||
`ssl_specialsettings` text,
|
||||
`include_specialsettings` tinyint(1) NOT NULL default '0',
|
||||
`ssl_default_vhostconf_domain` text,
|
||||
`include_default_vhostconf_domain` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `ip_port` (`ip`,`port`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -372,6 +389,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('dkim', 'dkim_domains', 'domains'),
|
||||
('dkim', 'dkim_dkimkeys', 'dkim-keys.conf'),
|
||||
('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'),
|
||||
('dkim', 'privkeysuffix', '.priv'),
|
||||
('admin', 'show_news_feed', '0'),
|
||||
('admin', 'show_version_login', '0'),
|
||||
('admin', 'show_version_footer', '0'),
|
||||
@@ -477,7 +495,6 @@ opcache.load_comments
|
||||
opcache.revalidate_path
|
||||
opcache.save_comments
|
||||
opcache.use_cwd
|
||||
opcache.validate_timestamps
|
||||
opcache.fast_shutdown'),
|
||||
('phpfpm', 'ini_admin_values', 'cgi.redirect_status_env
|
||||
date.timezone
|
||||
@@ -501,7 +518,8 @@ opcache.restrict_api
|
||||
opcache.revalidate_freq
|
||||
opcache.max_accelerated_files
|
||||
opcache.memory_consumption
|
||||
opcache.interned_strings_buffer'),
|
||||
opcache.interned_strings_buffer
|
||||
opcache.validate_timestamps'),
|
||||
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||
('system', 'lastaccountnumber', '0'),
|
||||
('system', 'lastguid', '9999'),
|
||||
@@ -514,7 +532,7 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'vmail_gid', '2000'),
|
||||
('system', 'vmail_homedir', '/var/customers/mail/'),
|
||||
('system', 'vmail_maildirname', 'Maildir'),
|
||||
('system', 'bind_enable', '1'),
|
||||
('system', 'bind_enable', '0'),
|
||||
('system', 'bindconf_directory', '/etc/bind/'),
|
||||
('system', 'bindreload_command', '/etc/init.d/bind9 reload'),
|
||||
('system', 'hostname', 'SERVERNAME'),
|
||||
@@ -539,6 +557,7 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
||||
('system', 'use_ssl', '0'),
|
||||
('system', 'default_vhostconf', ''),
|
||||
('system', 'default_sslvhostconf', ''),
|
||||
('system', 'mail_quota_enabled', '0'),
|
||||
('system', 'mail_quota', '100'),
|
||||
('system', 'webalizer_enabled', '1'),
|
||||
@@ -558,6 +577,7 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'stdsubdomain', ''),
|
||||
('system', 'awstats_path', '/usr/bin/'),
|
||||
('system', 'awstats_conf', '/etc/awstats/'),
|
||||
('system', 'awstats_logformat', '1'),
|
||||
('system', 'defaultttl', '604800'),
|
||||
('system', 'mod_fcgid_defaultini', '1'),
|
||||
('system', 'ftpserver', 'proftpd'),
|
||||
@@ -591,6 +611,7 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'documentroot_use_default_value', '0'),
|
||||
('system', 'passwordcryptfunc', '3'),
|
||||
('system', 'axfrservers', ''),
|
||||
('system', 'powerdns_mode', 'Native'),
|
||||
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
|
||||
('system', 'allow_error_report_admin', '1'),
|
||||
('system', 'allow_error_report_customer', '0'),
|
||||
@@ -608,7 +629,7 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'apacheitksupport', '0'),
|
||||
('system', 'leprivatekey', 'unset'),
|
||||
('system', 'lepublickey', 'unset'),
|
||||
('system', 'letsencryptca', 'production'),
|
||||
('system', 'letsencryptca', 'letsencrypt'),
|
||||
('system', 'letsencryptcountrycode', 'DE'),
|
||||
('system', 'letsencryptstate', 'Hessen'),
|
||||
('system', 'letsencryptchallengepath', '/var/www/froxlor'),
|
||||
@@ -638,8 +659,12 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'leregistered', '0'),
|
||||
('system', 'leaccount', ''),
|
||||
('system', 'nssextrausers', '0'),
|
||||
('system', 'disable_le_selfcheck', '0'),
|
||||
('system', 'ssl_protocols', 'TLSv1,TLSv1.2'),
|
||||
('system', 'le_domain_dnscheck', '1'),
|
||||
('system', 'ssl_protocols', 'TLSv1.2'),
|
||||
('system', 'tlsv13_cipher_list', ''),
|
||||
('system', 'honorcipherorder', '0'),
|
||||
('system', 'sessiontickets', '1'),
|
||||
('system', 'sessionticketsenabled', '1'),
|
||||
('system', 'logfiles_format', ''),
|
||||
('system', 'logfiles_type', '1'),
|
||||
('system', 'logfiles_piped', '0'),
|
||||
@@ -648,6 +673,16 @@ opcache.interned_strings_buffer'),
|
||||
('system', 'errorlog_level', 'warn'),
|
||||
('system', 'leecc', '0'),
|
||||
('system', 'froxloraliases', ''),
|
||||
('system', 'apply_specialsettings_default', '1'),
|
||||
('system', 'apply_phpconfigs_default', '1'),
|
||||
('system', 'hide_incompatible_settings', '0'),
|
||||
('system', 'include_default_vhostconf', '0'),
|
||||
('system', 'soaemail', ''),
|
||||
('system', 'domaindefaultalias', '0'),
|
||||
('system', 'createstdsubdom_default', '1'),
|
||||
('system', 'froxlorusergroup', ''),
|
||||
('system', 'froxlorusergroup_gid', ''),
|
||||
('system', 'acmeshpath', '/root/.acme.sh/acme.sh'),
|
||||
('api', 'enabled', '0'),
|
||||
('2fa', 'enabled', '1'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
@@ -660,7 +695,6 @@ opcache.interned_strings_buffer'),
|
||||
('panel', 'paging', '20'),
|
||||
('panel', 'natsorting', '1'),
|
||||
('panel', 'sendalternativemail', '0'),
|
||||
('panel', 'no_robots', '1'),
|
||||
('panel', 'allow_domain_change_admin', '0'),
|
||||
('panel', 'allow_domain_change_customer', '0'),
|
||||
('panel', 'frontend', 'froxlor'),
|
||||
@@ -682,8 +716,15 @@ opcache.interned_strings_buffer'),
|
||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||
('panel', 'customer_hide_options', ''),
|
||||
('panel', 'is_configured', '0'),
|
||||
('panel', 'version', '0.10.0'),
|
||||
('panel', 'db_version', '201909150');
|
||||
('panel', 'imprint_url', ''),
|
||||
('panel', 'terms_url', ''),
|
||||
('panel', 'privacy_url', ''),
|
||||
('panel', 'logo_image_header', ''),
|
||||
('panel', 'logo_image_login', ''),
|
||||
('panel', 'logo_overridetheme', '0'),
|
||||
('panel', 'logo_overridecustom', '0'),
|
||||
('panel', 'version', '0.10.37'),
|
||||
('panel', 'db_version', '202112310');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
@@ -764,23 +805,6 @@ CREATE TABLE `panel_diskspace` (
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_diskspace_admins`;
|
||||
CREATE TABLE `panel_diskspace_admins` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`adminid` int(11) unsigned NOT NULL default '0',
|
||||
`year` int(4) unsigned zerofill NOT NULL default '0000',
|
||||
`month` int(2) unsigned zerofill NOT NULL default '00',
|
||||
`day` int(2) unsigned zerofill NOT NULL default '00',
|
||||
`stamp` int(11) unsigned NOT NULL default '0',
|
||||
`webspace` bigint(30) unsigned NOT NULL default '0',
|
||||
`mail` bigint(30) unsigned NOT NULL default '0',
|
||||
`mysql` bigint(30) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `adminid` (`adminid`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_languages`;
|
||||
CREATE TABLE `panel_languages` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
@@ -799,7 +823,8 @@ INSERT INTO `panel_languages` (`id`, `language`, `iso`, `file`) VALUES
|
||||
(4, 'Português', 'pt', 'lng/portugues.lng.php'),
|
||||
(5, 'Italiano', 'it', 'lng/italian.lng.php'),
|
||||
(6, 'Nederlands', 'nl', 'lng/dutch.lng.php'),
|
||||
(7, 'Svenska', 'sv', 'lng/swedish.lng.php');
|
||||
(7, 'Svenska', 'sv', 'lng/swedish.lng.php'),
|
||||
(8, 'Česká republika', 'cs', 'lng/czech.lng.php');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_syslog`;
|
||||
@@ -821,14 +846,15 @@ CREATE TABLE `panel_fpmdaemons` (
|
||||
`description` varchar(50) NOT NULL,
|
||||
`reload_cmd` varchar(255) NOT NULL,
|
||||
`config_dir` varchar(255) NOT NULL,
|
||||
`pm` varchar(15) NOT NULL DEFAULT 'static',
|
||||
`max_children` int(4) NOT NULL DEFAULT '1',
|
||||
`start_servers` int(4) NOT NULL DEFAULT '20',
|
||||
`min_spare_servers` int(4) NOT NULL DEFAULT '5',
|
||||
`max_spare_servers` int(4) NOT NULL DEFAULT '35',
|
||||
`pm` varchar(15) NOT NULL DEFAULT 'dynamic',
|
||||
`max_children` int(4) NOT NULL DEFAULT '5',
|
||||
`start_servers` int(4) NOT NULL DEFAULT '2',
|
||||
`min_spare_servers` int(4) NOT NULL DEFAULT '1',
|
||||
`max_spare_servers` int(4) NOT NULL DEFAULT '3',
|
||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '10',
|
||||
`limit_extensions` varchar(255) NOT NULL default '.php',
|
||||
`custom_config` text,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `reload` (`reload_cmd`),
|
||||
UNIQUE KEY `config` (`config_dir`)
|
||||
@@ -837,7 +863,7 @@ CREATE TABLE `panel_fpmdaemons` (
|
||||
|
||||
|
||||
INSERT INTO `panel_fpmdaemons` (`id`, `description`, `reload_cmd`, `config_dir`) VALUES
|
||||
(1, 'System default', 'service php7.0-fpm restart', '/etc/php/7.0/fpm/pool.d/');
|
||||
(1, 'System default', 'service php7.3-fpm restart', '/etc/php/7.3/fpm/pool.d/');
|
||||
|
||||
|
||||
|
||||
@@ -857,13 +883,13 @@ CREATE TABLE `panel_phpconfigs` (
|
||||
`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',
|
||||
`pm` varchar(15) NOT NULL DEFAULT 'dynamic',
|
||||
`max_children` int(4) NOT NULL DEFAULT '5',
|
||||
`start_servers` int(4) NOT NULL DEFAULT '2',
|
||||
`min_spare_servers` int(4) NOT NULL DEFAULT '1',
|
||||
`max_spare_servers` int(4) NOT NULL DEFAULT '3',
|
||||
`max_requests` int(4) NOT NULL DEFAULT '0',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '30',
|
||||
`idle_timeout` int(4) NOT NULL DEFAULT '10',
|
||||
`limit_extensions` varchar(255) NOT NULL default '.php',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `fpmsettingid` (`fpmsettingid`)
|
||||
@@ -872,8 +898,8 @@ CREATE TABLE `panel_phpconfigs` (
|
||||
|
||||
|
||||
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
||||
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = ""\r\n');
|
||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = Off\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 30\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
||||
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_url_fopen = On\r\nallow_url_include = Off\r\nauto_append_file =\r\nauto_globals_jit = On\r\nauto_prepend_file =\r\nbcmath.scale = 0\r\ncli_server.color = On\r\ndefault_charset = "UTF-8"\r\ndefault_mimetype = "text/html"\r\ndefault_socket_timeout = 60\r\nasp_tags = Off\r\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,curl_multi_exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\ndoc_root =\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\nhtml_errors = On\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nimplicit_flush = Off\r\nldap.max_links = -1\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmail.add_x_header = Off\r\nmax_execution_time = 60\r\nmax_file_uploads = 20\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nreport_memleaks = On\r\nrequest_order = "GP"\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nserialize_precision = -1\r\nsession.auto_start = 0\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_httponly =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.cookie_samesite =\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 0\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.sid_bits_per_character = 5\r\nsession.sid_length = 26\r\nsession.trans_sid_tags = "a=href,area=href,frame=src,form="\r\nsession.use_cookies = 1\r\nsession.use_only_cookies = 1\r\nsession.use_strict_mode = 0\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\nopcache.restrict_api = ""\r\n');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||
@@ -916,7 +942,7 @@ CREATE TABLE IF NOT EXISTS `ftp_quotalimits` (
|
||||
|
||||
|
||||
|
||||
INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES
|
||||
INSERT INTO `ftp_quotalimits` (`name`, `quota_type`, `per_session`, `limit_type`, `bytes_in_avail`, `bytes_out_avail`, `bytes_xfer_avail`, `files_in_avail`, `files_out_avail`, `files_xfer_avail`) VALUES
|
||||
('froxlor', 'user', 'false', 'hard', 0, 0, 0, 0, 0, 0);
|
||||
|
||||
|
||||
@@ -974,7 +1000,8 @@ CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
||||
`ssl_csr_file` mediumtext,
|
||||
`ssl_fullchain_file` mediumtext,
|
||||
`expirationdate` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY (`domainid`)
|
||||
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
0
install/index.html
Normal file
0
install/index.html
Normal file
@@ -28,7 +28,7 @@
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
*
|
||||
*
|
||||
*/
|
||||
class FroxlorInstall
|
||||
{
|
||||
@@ -123,7 +123,7 @@ class FroxlorInstall
|
||||
if ((isset($_POST['installstep']) && $_POST['installstep'] == '1') || (isset($_GET['check']) && $_GET['check'] == '1')) {
|
||||
$pagetitle = $this->_lng['install']['title'];
|
||||
if ($this->_checkPostData()) {
|
||||
// ceck data and create userdata etc.etc.etc.
|
||||
// check data and create userdata etc.etc.etc.
|
||||
$result = $this->_doInstall();
|
||||
} elseif (isset($_GET['check']) && $_GET['check'] == '1') {
|
||||
// gather data
|
||||
@@ -159,13 +159,17 @@ class FroxlorInstall
|
||||
$this->_guessServerName();
|
||||
$this->_guessServerIP();
|
||||
$this->_guessWebserver();
|
||||
$this->_guessDistribution();
|
||||
|
||||
$this->_getPostField('mysql_host', '127.0.0.1');
|
||||
$this->_getPostField('mysql_database', 'froxlor');
|
||||
$this->_getPostField('mysql_forcecreate', '0');
|
||||
$this->_getPostField('mysql_unpriv_user', 'froxlor');
|
||||
$this->_getPostField('mysql_unpriv_pass');
|
||||
$this->_getPostField('mysql_root_user', 'root');
|
||||
$this->_getPostField('mysql_root_pass');
|
||||
$this->_getPostField('mysql_ssl_ca_file');
|
||||
$this->_getPostField('mysql_ssl_verify_server_certificate', 0);
|
||||
$this->_getPostField('admin_user', 'admin');
|
||||
$this->_getPostField('admin_pass1');
|
||||
$this->_getPostField('admin_pass2');
|
||||
@@ -211,6 +215,12 @@ class FroxlorInstall
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
||||
);
|
||||
|
||||
if (!empty($this->_data['mysql_ssl_ca_file'])) {
|
||||
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
|
||||
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
|
||||
}
|
||||
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";";
|
||||
$fatal_fail = false;
|
||||
try {
|
||||
@@ -245,15 +255,23 @@ class FroxlorInstall
|
||||
$content .= $this->_status_message('green', "OK");
|
||||
// check for existing db and create backup if so
|
||||
$content .= $this->_backupExistingDatabase($db_root);
|
||||
// create unprivileged user and the database itself
|
||||
$content .= $this->_createDatabaseAndUser($db_root);
|
||||
// importing data to new database
|
||||
$content .= $this->_importDatabaseData();
|
||||
if (!$this->_abort) {
|
||||
// create unprivileged user and the database itself
|
||||
$content .= $this->_createDatabaseAndUser($db_root);
|
||||
// importing data to new database
|
||||
$content .= $this->_importDatabaseData();
|
||||
}
|
||||
if (! $this->_abort) {
|
||||
// create DB object for new database
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
||||
);
|
||||
|
||||
if (!empty($this->_data['mysql_ssl_ca_file'])) {
|
||||
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
|
||||
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
|
||||
}
|
||||
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||
$another_fail = false;
|
||||
try {
|
||||
@@ -323,35 +341,70 @@ class FroxlorInstall
|
||||
$userdata .= "\$sql['user']='" . addcslashes($this->_data['mysql_unpriv_user'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql['password']='" . addcslashes($this->_data['mysql_unpriv_pass'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql['db']='" . addcslashes($this->_data['mysql_database'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql['ssl']['caFile']='" . addcslashes($this->_data['mysql_ssl_ca_file'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql['ssl']['verifyServerCertificate']='" . addcslashes($this->_data['mysql_ssl_verify_server_certificate'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql_root[0]['caption']='Default';\n";
|
||||
$userdata .= "\$sql_root[0]['host']='" . addcslashes($this->_data['mysql_host'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql_root[0]['user']='" . addcslashes($this->_data['mysql_root_user'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql_root[0]['password']='" . addcslashes($this->_data['mysql_root_pass'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql_root[0]['ssl']['caFile']='" . addcslashes($this->_data['mysql_ssl_ca_file'], "'\\") . "';\n";
|
||||
$userdata .= "\$sql_root[0]['ssl']['verifyServerCertificate']='" . addcslashes($this->_data['mysql_ssl_verify_server_certificate'], "'\\") . "';\n";
|
||||
$userdata .= "// enable debugging to browser in case of SQL errors\n";
|
||||
$userdata .= "\$sql['debug'] = false;\n";
|
||||
$userdata .= "?>";
|
||||
|
||||
// test if we can store the userdata.inc.php in ../lib
|
||||
$umask = @umask(077);
|
||||
$userdata_file = dirname(dirname(dirname(__FILE__))) . '/lib/userdata.inc.php';
|
||||
if ($fp = @fopen($userdata_file, 'w')) {
|
||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
||||
if (@touch($userdata_file) && @is_writable($userdata_file)) {
|
||||
$fp = @fopen($userdata_file, 'w');
|
||||
@fputs($fp, $userdata, strlen($userdata));
|
||||
@fclose($fp);
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
chmod($userdata_file, 0440);
|
||||
} elseif ($fp = @fopen('/tmp/userdata.inc.php', 'w')) {
|
||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
||||
@fclose($fp);
|
||||
$content .= $this->_status_message('orange', $this->_lng['install']['creating_configfile_temp']);
|
||||
chmod('/tmp/userdata.inc.php', 0440);
|
||||
} else {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']);
|
||||
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
||||
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
||||
@unlink($userdata_file);
|
||||
// try creating it in a temporary file
|
||||
$temp_file = @tempnam(sys_get_temp_dir(), 'fx');
|
||||
if ($temp_file) {
|
||||
$fp = @fopen($temp_file, 'w');
|
||||
@fputs($fp, $userdata, strlen($userdata));
|
||||
@fclose($fp);
|
||||
$content .= $this->_status_message('orange', sprintf($this->_lng['install']['creating_configfile_temp'], $temp_file));
|
||||
} else {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['creating_configfile_failed']);
|
||||
$escpduserdata = nl2br(htmlspecialchars($userdata));
|
||||
eval("\$content .= \"" . $this->_getTemplate("textarea") . "\";");
|
||||
}
|
||||
}
|
||||
@umask($umask);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate safe unique token
|
||||
*
|
||||
* @param int $length
|
||||
* @return string
|
||||
*/
|
||||
private function genUniqueToken(int $length = 16)
|
||||
{
|
||||
if(!isset($length) || intval($length) <= 8 ){
|
||||
$length = 16;
|
||||
}
|
||||
if (function_exists('random_bytes')) {
|
||||
return bin2hex(random_bytes($length));
|
||||
}
|
||||
if (function_exists('mcrypt_create_iv')) {
|
||||
return bin2hex(mcrypt_create_iv($length, MCRYPT_DEV_URANDOM));
|
||||
}
|
||||
if (function_exists('openssl_random_pseudo_bytes')) {
|
||||
return bin2hex(openssl_random_pseudo_bytes($length));
|
||||
}
|
||||
// if everything else fails, use unsafe fallback
|
||||
return md5(uniqid(microtime(), 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* create corresponding entries in froxlor database
|
||||
*
|
||||
@@ -395,8 +448,8 @@ class FroxlorInstall
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
|
||||
$ins_data = array(
|
||||
'loginname' => $this->_data['admin_user'],
|
||||
/* use SHA256 default crypt */
|
||||
'password' => crypt($this->_data['admin_pass1'], '$5$' . md5(uniqid(microtime(), 1)) . md5(uniqid(microtime(), 1))),
|
||||
/* use SHA256 default crypt */
|
||||
'password' => crypt($this->_data['admin_pass1'], '$5$' . $this->genUniqueToken() . $this->genUniqueToken()),
|
||||
'email' => 'admin@' . $this->_data['servername'],
|
||||
'deflang' => $this->_languages[$this->_activelng]
|
||||
);
|
||||
@@ -407,6 +460,7 @@ class FroxlorInstall
|
||||
`name` = 'Froxlor-Administrator',
|
||||
`email` = :email,
|
||||
`def_language` = :deflang,
|
||||
`api_allowed` = 1,
|
||||
`customers` = -1,
|
||||
`customers_see_all` = 1,
|
||||
`caneditphpsettings` = 1,
|
||||
@@ -496,12 +550,37 @@ class FroxlorInstall
|
||||
$this->_updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
||||
}
|
||||
|
||||
/*
|
||||
* not yet used in configfiles
|
||||
* -> 0.11.x
|
||||
*
|
||||
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||
foreach ($distros as $_distribution) {
|
||||
if ($this->_data['distribution'] == str_replace(".xml", "", strtolower(basename($_distribution)))) {
|
||||
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||
$defaults = $dist->getDefaults();
|
||||
if (!empty($defaults)) {
|
||||
foreach ($defaults as $property) {
|
||||
$this->_updateSetting($upd_stmt, $property->attributes()->value, $property->attributes()->settinggroup, $property->attributes()->varname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||
|
||||
// insert the lastcronrun to be the installation date
|
||||
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
||||
|
||||
// check currently used php version and set values of fpm/fcgid accordingly
|
||||
if (defined('PHP_MAJOR_VERSION') && defined('PHP_MINOR_VERSION')) {
|
||||
$reload = "service php" . PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION . "-fpm restart";
|
||||
$config_dir = "/etc/php/" . PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION . "/fpm/pool.d/";
|
||||
$db->query("UPDATE `" . TABLE_PANEL_FPMDAEMONS . "` SET `reload_cmd` = '" . $reload . "', `config_dir` = '" . $config_dir . "' WHERE `id` ='1';");
|
||||
}
|
||||
|
||||
// set specific times for some crons (traffic only at night, etc.)
|
||||
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = '" . $ts . "' WHERE `cronfile` ='cron_traffic';");
|
||||
@@ -528,6 +607,12 @@ class FroxlorInstall
|
||||
$options = array(
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
||||
);
|
||||
|
||||
if (!empty($this->_data['mysql_ssl_ca_file'])) {
|
||||
$options[\PDO::MYSQL_ATTR_SSL_CA] = $this->_data['mysql_ssl_ca_file'];
|
||||
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = (bool) $this->_data['mysql_ssl_verify_server_certificate'];
|
||||
}
|
||||
|
||||
$dsn = "mysql:host=" . $this->_data['mysql_host'] . ";dbname=" . $this->_data['mysql_database'] . ";";
|
||||
$fatal_fail = false;
|
||||
try {
|
||||
@@ -562,7 +647,7 @@ class FroxlorInstall
|
||||
for ($i = 0; $i < sizeof($sql_query); $i ++) {
|
||||
if (trim($sql_query[$i]) != '') {
|
||||
try {
|
||||
$result = $db->query($sql_query[$i]);
|
||||
$db->query($sql_query[$i]);
|
||||
} catch (\PDOException $e) {
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$fatal_fail = true;
|
||||
@@ -656,8 +741,8 @@ class FroxlorInstall
|
||||
|
||||
private function _grantDbPrivilegesTo(&$db_root, $database, $username, $password, $access_host)
|
||||
{
|
||||
// mysql8 compatibility
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// mariadb
|
||||
if (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '10.0.0', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED BY :password
|
||||
@@ -673,6 +758,24 @@ class FroxlorInstall
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
));
|
||||
}
|
||||
// mysql8 compatibility
|
||||
elseif (version_compare($db_root->getAttribute(\PDO::ATTR_SERVER_VERSION), '8.0.11', '>=')) {
|
||||
// create user
|
||||
$stmt = $db_root->prepare("
|
||||
CREATE USER '" . $username . "'@'" . $access_host . "' IDENTIFIED WITH mysql_native_password BY :password
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"password" => $password
|
||||
));
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("
|
||||
GRANT ALL ON `" . $database . "`.* TO :username@:host
|
||||
");
|
||||
$stmt->execute(array(
|
||||
"username" => $username,
|
||||
"host" => $access_host
|
||||
));
|
||||
} else {
|
||||
// grant privileges
|
||||
$stmt = $db_root->prepare("
|
||||
@@ -706,39 +809,59 @@ class FroxlorInstall
|
||||
));
|
||||
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['check_db_exists']);
|
||||
|
||||
// check result
|
||||
if ($result_stmt !== false && $rows > 0) {
|
||||
$tables_exist = true;
|
||||
}
|
||||
|
||||
if ($tables_exist) {
|
||||
// tell whats going on
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
|
||||
if ((int)$this->_data['mysql_forcecreate'] > 0) {
|
||||
// set status
|
||||
$content .= $this->_status_message('orange', 'exists (' . $this->_data['mysql_database'] . ')');
|
||||
// tell what's going on
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['backup_old_db']);
|
||||
|
||||
// create temporary backup-filename
|
||||
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
||||
// create temporary backup-filename
|
||||
$filename = "/tmp/froxlor_backup_" . date('YmdHi') . ".sql";
|
||||
|
||||
// look for mysqldump
|
||||
$do_backup = false;
|
||||
if (file_exists("/usr/bin/mysqldump")) {
|
||||
$do_backup = true;
|
||||
$mysql_dump = '/usr/bin/mysqldump';
|
||||
} elseif (file_exists("/usr/local/bin/mysqldump")) {
|
||||
$do_backup = true;
|
||||
$mysql_dump = '/usr/local/bin/mysqldump';
|
||||
}
|
||||
// look for mysqldump
|
||||
$do_backup = false;
|
||||
if (file_exists("/usr/bin/mysqldump")) {
|
||||
$do_backup = true;
|
||||
$mysql_dump = '/usr/bin/mysqldump';
|
||||
} elseif (file_exists("/usr/local/bin/mysqldump")) {
|
||||
$do_backup = true;
|
||||
$mysql_dump = '/usr/local/bin/mysqldump';
|
||||
}
|
||||
|
||||
if ($do_backup) {
|
||||
$command = $mysql_dump . " " . $this->_data['mysql_database'] . " -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
||||
$output = exec($command);
|
||||
if (stristr($output, "error")) {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
|
||||
// create temporary .cnf file
|
||||
$cnffilename = "/tmp/froxlor_dump.cnf";
|
||||
$dumpcnf = "[mysqldump]" . PHP_EOL . "password=\"" . $this->_data['mysql_root_pass'] . "\"" . PHP_EOL;
|
||||
file_put_contents($cnffilename, $dumpcnf);
|
||||
|
||||
if ($do_backup) {
|
||||
$command = $mysql_dump . " --defaults-extra-file=" . $cnffilename . " " . escapeshellarg($this->_data['mysql_database']) . " -u " . escapeshellarg($this->_data['mysql_root_user']) . " --result-file=" . $filename;
|
||||
$output = [];
|
||||
exec($command, $output);
|
||||
@unlink($cnffilename);
|
||||
if (stristr(implode(" ", $output), "error") || ! file_exists($filename)) {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
|
||||
$this->_abort = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', 'OK (' . $filename . ')');
|
||||
}
|
||||
} else {
|
||||
$content .= $this->_status_message('green', 'OK (' . $filename . ')');
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
|
||||
$this->_abort = true;
|
||||
}
|
||||
} else {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_binary_missing']);
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['db_exists']);
|
||||
$this->_abort = true;
|
||||
}
|
||||
} else {
|
||||
$content .= $content .= $this->_status_message('green', 'OK');
|
||||
}
|
||||
|
||||
return $content;
|
||||
@@ -757,7 +880,7 @@ class FroxlorInstall
|
||||
}
|
||||
// language selection
|
||||
$language_options = '';
|
||||
foreach ($this->_languages as $language_name => $language_file) {
|
||||
foreach ($this->_languages as $language_file => $language_name) {
|
||||
$language_options .= \Froxlor\UI\HTML::makeoption($language_name, $language_file, $this->_activelng, true, true);
|
||||
}
|
||||
// get language-form-template
|
||||
@@ -774,6 +897,8 @@ class FroxlorInstall
|
||||
$formdata .= $this->_getSectionItemString('mysql_host', true);
|
||||
// database
|
||||
$formdata .= $this->_getSectionItemString('mysql_database', true);
|
||||
// database overwrite if exists?
|
||||
$formdata .= $this->_getSectionItemYesNo('mysql_forcecreate', false);
|
||||
// unpriv-user has to be different from root
|
||||
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
||||
$style = 'blue';
|
||||
@@ -803,6 +928,9 @@ class FroxlorInstall
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
||||
|
||||
$formdata .= $this->_getSectionItemString('mysql_ssl_ca_file', false, $style);
|
||||
$formdata .= $this->_getSectionItemYesNo('mysql_ssl_verify_server_certificate', false, $style);
|
||||
|
||||
/**
|
||||
* admin data
|
||||
*/
|
||||
@@ -832,6 +960,37 @@ class FroxlorInstall
|
||||
*/
|
||||
$section = $this->_lng['install']['serversettings'];
|
||||
eval("\$formdata .= \"" . $this->_getTemplate("datasection") . "\";");
|
||||
// distribution
|
||||
if (! empty($_POST['installstep']) && $this->_data['distribution'] == '') {
|
||||
$diststyle = 'color:red;';
|
||||
} else {
|
||||
$diststyle = '';
|
||||
}
|
||||
|
||||
// show list of available distro's
|
||||
$distributions_select_data = [];
|
||||
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||
foreach ($distros as $_distribution) {
|
||||
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||
$dist_display = $dist->distributionName . " " . $dist->distributionCodename . " (" . $dist->distributionVersion . ")";
|
||||
if (!array_key_exists($dist_display, $distributions_select_data)) {
|
||||
$distributions_select_data[$dist_display] = '';
|
||||
}
|
||||
$distributions_select_data[$dist_display] .= str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||
}
|
||||
|
||||
// sort by distribution name
|
||||
ksort($distributions_select_data);
|
||||
|
||||
$distributions_select = '';
|
||||
foreach ($distributions_select_data as $dist_display => $dist_index) {
|
||||
// create select-box-option
|
||||
$distributions_select .= \Froxlor\UI\HTML::makeoption($dist_display, $dist_index, $this->_data['distribution'] ?? '');
|
||||
// $this->_data['distribution']
|
||||
}
|
||||
|
||||
$formdata .= $this->_getSectionItemSelectbox('distribution', $distributions_select, $diststyle);
|
||||
|
||||
// servername
|
||||
if (! empty($_POST['installstep']) && $this->_data['servername'] == '') {
|
||||
$style = 'color:red;';
|
||||
@@ -853,12 +1012,12 @@ class FroxlorInstall
|
||||
$websrvstyle = '';
|
||||
}
|
||||
// apache
|
||||
$formdata .= $this->_getSectionItemCheckbox('apache2', ($this->_data['webserver'] == 'apache2'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('apache24', ($this->_data['webserver'] == 'apache24'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('webserver', 'apache2', ($this->_data['webserver'] == 'apache2'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('webserver', 'apache24', ($this->_data['webserver'] == 'apache24'), $websrvstyle);
|
||||
// lighttpd
|
||||
$formdata .= $this->_getSectionItemCheckbox('lighttpd', ($this->_data['webserver'] == 'lighttpd'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('webserver', 'lighttpd', ($this->_data['webserver'] == 'lighttpd'), $websrvstyle);
|
||||
// nginx
|
||||
$formdata .= $this->_getSectionItemCheckbox('nginx', ($this->_data['webserver'] == 'nginx'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('webserver', 'nginx', ($this->_data['webserver'] == 'nginx'), $websrvstyle);
|
||||
// webserver-user
|
||||
if (! empty($_POST['installstep']) && $this->_data['httpuser'] == '') {
|
||||
$style = 'color:red;';
|
||||
@@ -894,7 +1053,7 @@ class FroxlorInstall
|
||||
* optional css
|
||||
* @param string $type
|
||||
* optional type of input-box (default: text)
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getSectionItemString($fieldname = null, $required = false, $style = "", $type = 'text')
|
||||
@@ -910,7 +1069,7 @@ class FroxlorInstall
|
||||
}
|
||||
|
||||
/**
|
||||
* generate form radio field for webserver-selection
|
||||
* generate form radio field
|
||||
*
|
||||
* @param string $fieldname
|
||||
* @param boolean $checked
|
||||
@@ -918,8 +1077,9 @@ class FroxlorInstall
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getSectionItemCheckbox($fieldname = null, $checked = false, $style = "")
|
||||
private function _getSectionItemCheckbox($groupname = null, $fieldname = null, $checked = false, $style = "")
|
||||
{
|
||||
$groupname = $this->_lng['install'][$groupname];
|
||||
$fieldlabel = $this->_lng['install'][$fieldname];
|
||||
if ($checked) {
|
||||
$checked = 'checked="checked"';
|
||||
@@ -929,6 +1089,24 @@ class FroxlorInstall
|
||||
return $sectionitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate form selectbox
|
||||
*
|
||||
* @param string $fieldname
|
||||
* @param boolean $options
|
||||
* @param string $style
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getSectionItemSelectbox($fieldname = null, $options = null, $style = "")
|
||||
{
|
||||
$fieldlabel = $this->_lng['install'][$fieldname];
|
||||
|
||||
$sectionitem = "";
|
||||
eval("\$sectionitem .= \"" . $this->_getTemplate("dataitemselect") . "\";");
|
||||
return $sectionitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate form checkbox field
|
||||
*
|
||||
@@ -963,11 +1141,11 @@ class FroxlorInstall
|
||||
// check for correct php version
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
||||
|
||||
if (version_compare("7.0.0", PHP_VERSION, ">=")) {
|
||||
if (version_compare("7.1.0", PHP_VERSION, ">=")) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'] . ' (' . PHP_VERSION . ')');
|
||||
$_die = true;
|
||||
} else {
|
||||
if (version_compare("7.1.0", PHP_VERSION, ">=")) {
|
||||
if (version_compare("7.4.0", PHP_VERSION, ">=")) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['newerphpprefered'] . ' (' . PHP_VERSION . ')');
|
||||
} else {
|
||||
$content .= $this->_status_message('green', PHP_VERSION);
|
||||
@@ -1166,7 +1344,7 @@ class FroxlorInstall
|
||||
*
|
||||
* @param string $template
|
||||
* name of the template including subdirectory
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getTemplate($template = null)
|
||||
@@ -1233,10 +1411,12 @@ class FroxlorInstall
|
||||
// from form
|
||||
if (! empty($_POST['serverip'])) {
|
||||
$this->_data['serverip'] = $_POST['serverip'];
|
||||
$this->_data['serverip'] = inet_ntop(inet_pton($this->_data['serverip']));
|
||||
return;
|
||||
// from $_SERVER
|
||||
} elseif (! empty($_SERVER['SERVER_ADDR'])) {
|
||||
$this->_data['serverip'] = $_SERVER['SERVER_ADDR'];
|
||||
$this->_data['serverip'] = inet_ntop(inet_pton($this->_data['serverip']));
|
||||
return;
|
||||
}
|
||||
// empty
|
||||
@@ -1265,6 +1445,49 @@ class FroxlorInstall
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get/guess linux distribution
|
||||
*/
|
||||
private function _guessDistribution()
|
||||
{
|
||||
// post
|
||||
if (! empty($_POST['distribution'])) {
|
||||
$this->_data['distribution'] = $_POST['distribution'];
|
||||
} else {
|
||||
// set default os.
|
||||
$os_dist = array(
|
||||
'ID' => 'buster'
|
||||
);
|
||||
$os_version = array(
|
||||
'0' => '10'
|
||||
);
|
||||
|
||||
// read os-release
|
||||
if (file_exists('/etc/os-release')) {
|
||||
$os_dist_content = file_get_contents('/etc/os-release');
|
||||
$os_dist_arr = explode("\n", $os_dist_content);
|
||||
$os_dist = [];
|
||||
foreach ($os_dist_arr as $os_dist_line) {
|
||||
if (empty(trim($os_dist_line))) continue;
|
||||
$tmp = explode("=", $os_dist_line);
|
||||
$os_dist[$tmp[0]] = str_replace('"', "", trim($tmp[1]));
|
||||
}
|
||||
if (is_array($os_dist) && array_key_exists('ID', $os_dist) && array_key_exists('VERSION_ID', $os_dist)) {
|
||||
$os_version = explode('.', $os_dist['VERSION_ID'])[0];
|
||||
}
|
||||
}
|
||||
|
||||
$distros = glob(\Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||
foreach ($distros as $_distribution) {
|
||||
$dist = new \Froxlor\Config\ConfigParser($_distribution);
|
||||
$ver = explode('.', $dist->distributionVersion)[0];
|
||||
if (strtolower($os_dist['ID']) == strtolower($dist->distributionName) && $os_version == $ver) {
|
||||
$this->_data['distribution'] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check if POST field is set and get value for the
|
||||
* internal data array, if not set use either '' or $default if != null
|
||||
|
||||
0
install/lib/index.html
Normal file
0
install/lib/index.html
Normal file
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
function showUpdateStep($task = null, $needs_status = true)
|
||||
{
|
||||
set_time_limit(30);
|
||||
if (! $needs_status)
|
||||
echo "<b>";
|
||||
|
||||
@@ -41,7 +42,6 @@ function showUpdateStep($task = null, $needs_status = true)
|
||||
}
|
||||
|
||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, $task);
|
||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, $task);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,6 @@ function lastStepStatus($status = -1, $message = '')
|
||||
|
||||
if ($status == - 1 || $status == 2) {
|
||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
||||
} elseif ($status == 0 || $status == 1) {
|
||||
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, 'Success');
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ $lng['requirements']['not_true'] = 'no';
|
||||
$lng['requirements']['notfound'] = 'not found';
|
||||
$lng['requirements']['notinstalled'] = 'not installed';
|
||||
$lng['requirements']['activated'] = 'enabled';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 7.0';
|
||||
$lng['requirements']['newerphpprefered'] = 'Good, but php-7.1 is prefered.';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 7.1';
|
||||
$lng['requirements']['newerphpprefered'] = 'Good, but php-7.4 is preferred.';
|
||||
$lng['requirements']['phppdo'] = 'PHP PDO extension and PDO-MySQL driver...';
|
||||
$lng['requirements']['phpsession'] = 'PHP session-extension...';
|
||||
$lng['requirements']['phpctype'] = 'PHP ctype-extension...';
|
||||
@@ -39,7 +39,7 @@ $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']['openbasedir'] = 'open_basedir...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the coresponding php.ini';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the corresponding 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.';
|
||||
@@ -53,16 +53,20 @@ $lng['install']['welcometext'] = 'Thank you for choosing Froxlor. Please fill ou
|
||||
$lng['install']['database'] = 'Database connection';
|
||||
$lng['install']['mysql_host'] = 'MySQL-Hostname';
|
||||
$lng['install']['mysql_database'] = 'Database name';
|
||||
$lng['install']['mysql_forcecreate'] = 'Backup and overwrite database if exists?';
|
||||
$lng['install']['mysql_unpriv_user'] = 'Username for the unprivileged MySQL-account';
|
||||
$lng['install']['mysql_unpriv_pass'] = 'Password for the unprivileged MySQL-account';
|
||||
$lng['install']['mysql_root_user'] = 'Username for the MySQL-root-account';
|
||||
$lng['install']['mysql_root_pass'] = 'Password for the MySQL-root-account';
|
||||
$lng['install']['mysql_ssl_ca_file'] = 'MySQL server certificate file path';
|
||||
$lng['install']['mysql_ssl_verify_server_certificate'] = 'Verify MySQL TLS certificate';
|
||||
$lng['install']['admin_account'] = 'Administrator Account';
|
||||
$lng['install']['admin_user'] = 'Administrator Username';
|
||||
$lng['install']['admin_pass1'] = 'Administrator Password';
|
||||
$lng['install']['admin_pass2'] = 'Administrator-Password (confirm)';
|
||||
$lng['install']['activate_newsfeed'] = 'Enable the official newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||
$lng['install']['serversettings'] = 'Server settings';
|
||||
$lng['install']['distribution'] = 'Distribution';
|
||||
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
|
||||
$lng['install']['serverip'] = 'Server IP';
|
||||
$lng['install']['webserver'] = 'Webserver';
|
||||
@@ -78,6 +82,8 @@ $lng['install']['testing_mysql_fail'] = 'There seems to be a problem with the da
|
||||
$lng['install']['backup_old_db'] = 'Creating backup of old database...';
|
||||
$lng['install']['backup_binary_missing'] = 'Could not find mysqldump';
|
||||
$lng['install']['backup_failed'] = 'Could not backup database';
|
||||
$lng['install']['check_db_exists'] = 'Checking database...';
|
||||
$lng['install']['db_exists'] = 'Unable to create database. A database with the same name exists and should not be overwritten';
|
||||
$lng['install']['prepare_db'] = 'Preparing database...';
|
||||
$lng['install']['create_mysqluser_and_db'] = 'Creating database and username...';
|
||||
$lng['install']['testing_new_db'] = 'Testing if database and user have been created correctly...';
|
||||
@@ -86,7 +92,7 @@ $lng['install']['changing_data'] = 'Adjusting settings...';
|
||||
$lng['install']['creating_entries'] = 'Inserting new values...';
|
||||
$lng['install']['adding_admin_user'] = 'Creating admin-account...';
|
||||
$lng['install']['creating_configfile'] = 'Creating configfile...';
|
||||
$lng['install']['creating_configfile_temp'] = 'File was saved in /tmp/userdata.inc.php, please move to ' . dirname(dirname(__DIR__)) . '/lib/.';
|
||||
$lng['install']['creating_configfile_temp'] = 'File was saved in %s, please move to ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
|
||||
$lng['install']['creating_configfile_failed'] = 'Could not create ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, please create it manually with the following content:';
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ $lng['requirements']['not_true'] = 'non';
|
||||
$lng['requirements']['notfound'] = 'introuvable';
|
||||
$lng['requirements']['notinstalled'] = 'non installé';
|
||||
$lng['requirements']['activated'] = 'activé';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 7.0';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 7.1';
|
||||
$lng['requirements']['phppdo'] = 'extension PHP PDO et pilote PDO-MySQL ...';
|
||||
$lng['requirements']['phpxml'] = 'extension PHP XML...';
|
||||
$lng['requirements']['phpfilter'] = 'extension PHP filter ...';
|
||||
@@ -53,6 +53,7 @@ $lng['install']['admin_user'] = 'Nom d\'utilisateur administrateur';
|
||||
$lng['install']['admin_pass1'] = 'Mot de passe administrateur';
|
||||
$lng['install']['admin_pass2'] = 'Mot de passe administrateur (confirmez)';
|
||||
$lng['install']['serversettings'] = 'Réglages serveur';
|
||||
$lng['install']['distribution'] = 'Distribution';
|
||||
$lng['install']['servername'] = 'Nom du serveur (FQDN, pas d\'adresse IP)';
|
||||
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
||||
$lng['install']['webserver'] = 'Serveur Web';
|
||||
@@ -76,7 +77,7 @@ $lng['install']['changing_data'] = 'Ajustement des paramètres...';
|
||||
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/.';
|
||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans %s, merci de le déplacer dans ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php';
|
||||
$lng['install']['creating_configfile_failed'] = 'Impossible de créer ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ $lng['requirements']['not_true'] = 'nein';
|
||||
$lng['requirements']['notfound'] = 'nicht gefunden';
|
||||
$lng['requirements']['notinstalled'] = 'nicht installiert';
|
||||
$lng['requirements']['activated'] = 'ist aktiviert.';
|
||||
$lng['requirements']['phpversion'] = 'PHP Version >= 7.0';
|
||||
$lng['requirements']['newerphpprefered'] = 'Passt, aber php-7.1 wird bevorzugt.';
|
||||
$lng['requirements']['phpversion'] = 'PHP Version >= 7.1';
|
||||
$lng['requirements']['newerphpprefered'] = 'Passt, aber php-7.4 wird bevorzugt.';
|
||||
$lng['requirements']['phppdo'] = 'PHP PDO Erweiterung und PDO-MySQL Treiber...';
|
||||
$lng['requirements']['phpsession'] = 'PHP session-Erweiterung...';
|
||||
$lng['requirements']['phpctype'] = 'PHP ctype-Erweiterung...';
|
||||
@@ -53,16 +53,20 @@ $lng['install']['welcometext'] = 'Vielen Dank dass Sie sich für Froxlor entschi
|
||||
$lng['install']['database'] = 'Datenbankverbindung';
|
||||
$lng['install']['mysql_host'] = 'MySQL-Hostname';
|
||||
$lng['install']['mysql_database'] = 'Datenbank Name';
|
||||
$lng['install']['mysql_forcecreate'] = 'Datenbank sichern und überschreiben wenn vorhanden?';
|
||||
$lng['install']['mysql_unpriv_user'] = 'Benutzername für den unprivilegierten MySQL-Account';
|
||||
$lng['install']['mysql_unpriv_pass'] = 'Passwort für den unprivilegierten MySQL-Account';
|
||||
$lng['install']['mysql_root_user'] = 'Benutzername für den MySQL-Root-Account';
|
||||
$lng['install']['mysql_root_pass'] = 'Passwort für den MySQL-Root-Account';
|
||||
$lng['install']['mysql_ssl_ca_file'] = 'MySQL-Server Zertifikatspfad';
|
||||
$lng['install']['mysql_ssl_verify_server_certificate'] = 'Validieren des MySQL-Server Zertifikats';
|
||||
$lng['install']['admin_account'] = 'Admin-Zugang';
|
||||
$lng['install']['admin_user'] = 'Administrator-Benutzername';
|
||||
$lng['install']['admin_pass1'] = 'Administrator-Passwort';
|
||||
$lng['install']['admin_pass2'] = 'Administrator-Passwort (Bestätigung)';
|
||||
$lng['install']['activate_newsfeed'] = 'Aktiviere das offizielle Newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||
$lng['install']['serversettings'] = 'Servereinstellungen';
|
||||
$lng['install']['distribution'] = 'Distribution';
|
||||
$lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)';
|
||||
$lng['install']['serverip'] = 'Server-IP';
|
||||
$lng['install']['webserver'] = 'Webserver';
|
||||
@@ -78,6 +82,8 @@ $lng['install']['testing_mysql_fail'] = 'Bei der Verwendung der Datenbank gibt e
|
||||
$lng['install']['backup_old_db'] = 'Sicherung vorheriger Datenbank...';
|
||||
$lng['install']['backup_binary_missing'] = 'Konnte mysqldump nicht finden';
|
||||
$lng['install']['backup_failed'] = 'Sicherung fehlgeschlagen';
|
||||
$lng['install']['check_db_exists'] = 'Databenbank wird geprüft...';
|
||||
$lng['install']['db_exists'] = 'Datenbank kann nicht erstellt werden. Eine Datenbank mit dem selben Namen existiert bereits und soll nicht überschrieben werden.';
|
||||
$lng['install']['prepare_db'] = 'Datenbank wird vorbereitet...';
|
||||
$lng['install']['create_mysqluser_and_db'] = 'Erstelle Datenbank und Benutzer...';
|
||||
$lng['install']['testing_new_db'] = 'Teste, ob Datenbank und Benutzer korrekt angelegt wurden...';
|
||||
@@ -86,7 +92,7 @@ $lng['install']['changing_data'] = 'Einstellungen anpassen...';
|
||||
$lng['install']['creating_entries'] = 'Trage neue Werte ein...';
|
||||
$lng['install']['adding_admin_user'] = 'Erstelle Admin-Benutzer...';
|
||||
$lng['install']['creating_configfile'] = 'Erstelle Konfigurationsdatei...';
|
||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in /tmp/userdata.inc.php gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/ verschieben.';
|
||||
$lng['install']['creating_configfile_temp'] = 'Datei wurde in %s gespeichert, bitte nach ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php verschieben.';
|
||||
$lng['install']['creating_configfile_failed'] = 'Konnte ' . dirname(dirname(__DIR__)) . '/lib/userdata.inc.php nicht erstellen, bitte manuell mit folgendem Inhalt anlegen:';
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
||||
|
||||
|
||||
0
install/lng/index.html
Normal file
0
install/lng/index.html
Normal file
@@ -28,4 +28,5 @@ try {
|
||||
\Froxlor\Cli\ConfigServicesCmd::processParameters($argc, $argv);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\Cli\ConfigServicesCmd::printerr($e->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
0
install/scripts/index.html
Normal file
0
install/scripts/index.html
Normal file
@@ -28,4 +28,5 @@ try {
|
||||
\Froxlor\Cli\SwitchServerIpCmd::processParameters($argc, $argv);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\Cli\SwitchServerIpCmd::printerr($e->getMessage());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
0
install/templates/assets/css/index.html
Normal file
0
install/templates/assets/css/index.html
Normal file
0
install/templates/assets/index.html
Normal file
0
install/templates/assets/index.html
Normal file
@@ -1,4 +1,4 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}</span>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$groupname} {$fieldlabel}:</label>
|
||||
<input type="radio" name="{$groupname}" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}</span>
|
||||
</p>
|
||||
|
||||
6
install/templates/dataitemselect.tpl
Normal file
6
install/templates/dataitemselect.tpl
Normal file
@@ -0,0 +1,6 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
|
||||
<select name="{$fieldname}" id="{$fieldname}" class="dropdown">
|
||||
{$options}
|
||||
</select>
|
||||
</p>
|
||||
0
install/templates/index.html
Normal file
0
install/templates/index.html
Normal file
0
install/updates/froxlor/0.10/index.html
Normal file
0
install/updates/froxlor/0.10/index.html
Normal file
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\Validate\Validate;
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
@@ -14,7 +15,7 @@ use Froxlor\Settings;
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Install
|
||||
*
|
||||
*
|
||||
*/
|
||||
if (! defined('_CRON_UPDATE')) {
|
||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||
@@ -265,6 +266,7 @@ if (\Froxlor\Froxlor::isDatabaseVersion('201904100')) {
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0-rc1')) {
|
||||
showUpdateStep("Updating from 0.10.0-rc1 to 0.10.0-rc2", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0-rc2');
|
||||
}
|
||||
|
||||
@@ -302,17 +304,700 @@ if (\Froxlor\Froxlor::isDatabaseVersion('201907270')) {
|
||||
"templates/Sparkle/admin/tickets",
|
||||
"templates/Sparkle/customer/tickets"
|
||||
);
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
$exec_allowed = ! in_array('exec', $disabled);
|
||||
$del_list = "";
|
||||
foreach ($to_clean as $filedir) {
|
||||
$complete_filedir = \Froxlor\Froxlor::getInstallDir() . $filedir;
|
||||
if (file_exists($complete_filedir)) {
|
||||
Froxlor\FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
|
||||
if ($exec_allowed) {
|
||||
Froxlor\FileDir::safe_exec("rm -rf " . escapeshellarg($complete_filedir));
|
||||
} else {
|
||||
$del_list .= "rm -rf " . escapeshellarg($complete_filedir) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($exec_allowed) {
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
if (empty($del_list)) {
|
||||
// none of the files existed
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
lastStepStatus(1, 'manual commands needed');
|
||||
echo '<span class="update-step update-step-err">Please run the following commands manually:</span><br><pre>' . $del_list . '</pre><br>';
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201909150');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0-rc2')) {
|
||||
showUpdateStep("Updating from 0.10.0-rc2 to 0.10.0 final", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.0');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201909150')) {
|
||||
|
||||
showUpdateStep("Adding TLSv1.3-cipherlist setting");
|
||||
Settings::AddNew("system.tlsv13_cipher_list", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910030');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910030')) {
|
||||
|
||||
showUpdateStep("Adding field api_allowed to admins and customers");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` ADD `api_allowed` tinyint(1) NOT NULL default '1';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `api_allowed` tinyint(1) NOT NULL default '1';");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910090');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.0')) {
|
||||
showUpdateStep("Updating from 0.10.0 to 0.10.1 final", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910090')) {
|
||||
|
||||
showUpdateStep("Adjusting Let's Encrypt API setting");
|
||||
Settings::Set("system.leapiversion", '2');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910110');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910110')) {
|
||||
|
||||
showUpdateStep("Adding new settings for ssl-vhost default content");
|
||||
Settings::AddNew("system.default_sslvhostconf", '');
|
||||
Settings::AddNew("system.include_default_vhostconf", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to ips and ports-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `ssl_specialsettings` text AFTER `docroot`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `include_specialsettings` tinyint(1) NOT NULL default '0' AFTER `ssl_specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `ssl_default_vhostconf_domain` text AFTER `include_specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_IPSANDPORTS . "` ADD `include_default_vhostconf_domain` tinyint(1) NOT NULL default '0' AFTER `ssl_default_vhostconf_domain`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new fields to domains-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_specialsettings` text AFTER `specialsettings`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `include_specialsettings` tinyint(1) NOT NULL default '0' AFTER `ssl_specialsettings`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
// select all ips/ports with specialsettings and SSL enabled to include the specialsettings in the ssl-vhost
|
||||
// because the former implementation included it and users might rely on that, see https://github.com/Froxlor/Froxlor/issues/727
|
||||
$sel_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `specialsettings` <> '' AND `ssl` = '1'");
|
||||
Database::pexecute($sel_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "` SET `include_specialsettings` = '1' WHERE `id` = :id");
|
||||
if ($sel_stmt->columnCount() > 0) {
|
||||
showUpdateStep("Adjusting IP/port settings for downward compatibility");
|
||||
while ($row = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'id' => $row['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
// select all domains with an ssl IP connected and specialsettings content to include these in the ssl-vhost
|
||||
// to maintain former behavior
|
||||
$sel_stmt = Database::prepare("
|
||||
SELECT d.id FROM `" . TABLE_PANEL_DOMAINS . "` d
|
||||
LEFT JOIN `" . TABLE_DOMAINTOIP . "` d2i ON d2i.id_domain = d.id
|
||||
LEFT JOIN `" . TABLE_PANEL_IPSANDPORTS . "` i ON i.id = d2i.id_ipandports
|
||||
WHERE d.specialsettings <> '' AND i.ssl = '1'
|
||||
");
|
||||
Database::pexecute($sel_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `include_specialsettings` = '1' WHERE `id` = :id");
|
||||
if ($sel_stmt->columnCount() > 0) {
|
||||
showUpdateStep("Adjusting domain settings for downward compatibility");
|
||||
while ($row = $sel_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'id' => $row['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910120');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.1')) {
|
||||
showUpdateStep("Updating from 0.10.1 to 0.10.2", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.2');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910120')) {
|
||||
|
||||
showUpdateStep("Adding new TLS options to domains-table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `override_tls` tinyint(1) DEFAULT '0' AFTER `writeerrorlog`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_protocols` text AFTER `override_tls`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_cipher_list` text AFTER `ssl_protocols`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `tlsv13_cipher_list` text AFTER `ssl_cipher_list`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201910200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.2')) {
|
||||
showUpdateStep("Updating from 0.10.2 to 0.10.3", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.3');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.3')) {
|
||||
showUpdateStep("Updating from 0.10.3 to 0.10.4", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.4');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.4')) {
|
||||
showUpdateStep("Updating from 0.10.4 to 0.10.5", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.5');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201910200')) {
|
||||
|
||||
showUpdateStep("Optimizing customer and admin table for size");
|
||||
// ALTER TABLE `panel_customers` CHANGE `name` `name` VARCHAR(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `zipcode` `zipcode` varchar(25) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `phone` `phone` varchar(50) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `fax` `fax` varchar(50) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `theme` `theme` varchar(50) NOT NULL default 'Sparkle';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `data_2fa` `data_2fa` varchar(25) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` DROP `leaccount`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `def_language` `def_language` varchar(100) NOT NULL default '';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `theme` `theme` varchar(50) NOT NULL default 'Sparkle';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "` CHANGE `data_2fa` `data_2fa` varchar(25) NOT NULL default '';");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('201911130');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.5')) {
|
||||
showUpdateStep("Updating from 0.10.5 to 0.10.6", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.6');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201911130')) {
|
||||
showUpdateStep("Adding new settings for domain edit form default values");
|
||||
Settings::AddNew("system.apply_specialsettings_default", '1');
|
||||
Settings::AddNew("system.apply_phpconfigs_default", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201911220');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.6')) {
|
||||
showUpdateStep("Updating from 0.10.6 to 0.10.7", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.7');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.7')) {
|
||||
showUpdateStep("Updating from 0.10.7 to 0.10.8", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.8');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.8')) {
|
||||
showUpdateStep("Updating from 0.10.8 to 0.10.9", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.9');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201911220')) {
|
||||
showUpdateStep("Adding enhanced SSL control over domains");
|
||||
// customer domains
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_enabled` tinyint(1) DEFAULT '1';");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_honorcipherorder` tinyint(1) DEFAULT '0' AFTER `ssl_enabled`;");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `ssl_sessiontickets` tinyint(1) DEFAULT '1' AFTER `ssl_honorcipherorder`;");
|
||||
// as setting for froxlor vhost
|
||||
Settings::AddNew("system.honorcipherorder", '0');
|
||||
Settings::AddNew("system.sessiontickets", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912100');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.9')) {
|
||||
showUpdateStep("Updating from 0.10.9 to 0.10.10", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.10');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912100')) {
|
||||
showUpdateStep("Adding option to disable SSL sessiontickets for older systems");
|
||||
Settings::AddNew("system.sessionticketsenabled", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912310');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912310')) {
|
||||
showUpdateStep("Adding custom phpfpm pool configuration field");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_FPMDAEMONS . "` ADD `custom_config` text AFTER `limit_extensions`;");
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912311');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.10')) {
|
||||
showUpdateStep("Updating from 0.10.10 to 0.10.11", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.11');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912311')) {
|
||||
showUpdateStep("Migrate logfiles_format setting");
|
||||
$current_format = Settings::Set('system.logfiles_format');
|
||||
if (! empty($current_format)) {
|
||||
Settings::Set('system.logfiles_format', '"' . Settings::Get('system.logfiles_format') . '"');
|
||||
lastStepStatus(0);
|
||||
} else {
|
||||
lastStepStatus(0, 'not needed');
|
||||
}
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912312');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912312')) {
|
||||
showUpdateStep("Adding option change awstats LogFormat");
|
||||
Settings::AddNew("system.awstats_logformat", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('201912313');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.11')) {
|
||||
showUpdateStep("Updating from 0.10.11 to 0.10.12", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.12');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.12')) {
|
||||
showUpdateStep("Updating from 0.10.12 to 0.10.13", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.13');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201912313')) {
|
||||
showUpdateStep("Adding new field to domains table");
|
||||
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `domain_ace` varchar(255) NOT NULL default '' AFTER `domain`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating domain entries");
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `domain_ace` = :ace WHERE `id` = :domainid");
|
||||
$sel_stmt = Database::prepare("SELECT id, domain FROM `" . TABLE_PANEL_DOMAINS . "` ORDER BY id ASC");
|
||||
Database::pexecute($sel_stmt);
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
while ($domain = $sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
Database::pexecute($upd_stmt, [
|
||||
'ace' => $idna_convert->decode($domain['domain']),
|
||||
'domainid' => $domain['id']
|
||||
]);
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202002290');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.13')) {
|
||||
showUpdateStep("Updating from 0.10.13 to 0.10.14", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.14');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.14')) {
|
||||
showUpdateStep("Updating from 0.10.14 to 0.10.15", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.15');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202002290')) {
|
||||
showUpdateStep("Adding new setting to validate DNS when using Let's Encrypt");
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'disable_le_selfcheck'");
|
||||
$le_domain_dnscheck = isset($_POST['system_le_domain_dnscheck']) ? (int) $_POST['system_le_domain_dnscheck'] : '1';
|
||||
Settings::AddNew("system.le_domain_dnscheck", $le_domain_dnscheck);
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202004140');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.15')) {
|
||||
showUpdateStep("Updating from 0.10.15 to 0.10.16", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.16');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202004140')) {
|
||||
|
||||
showUpdateStep("Adding unique key on domainid field in domain ssl table");
|
||||
// check for duplicate entries prior to set a unique key to avoid errors on update
|
||||
Database::query("
|
||||
DELETE a.* FROM domain_ssl_settings AS a
|
||||
LEFT JOIN domain_ssl_settings AS b ON
|
||||
((b.`domainid`=a.`domainid` AND UNIX_TIMESTAMP(b.`expirationdate`) > UNIX_TIMESTAMP(a.`expirationdate`))
|
||||
OR (UNIX_TIMESTAMP(b.`expirationdate`) = UNIX_TIMESTAMP(a.`expirationdate`) AND b.`id`>a.`id`))
|
||||
WHERE b.`id` IS NOT NULL
|
||||
");
|
||||
Database::query("ALTER TABLE `domain_ssl_settings` ADD UNIQUE(`domainid`)");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202005150');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.16')) {
|
||||
showUpdateStep("Updating from 0.10.16 to 0.10.17", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.17');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.17')) {
|
||||
showUpdateStep("Updating from 0.10.17 to 0.10.18", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.18');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.18')) {
|
||||
showUpdateStep("Updating from 0.10.18 to 0.10.19", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.19');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202005150')) {
|
||||
|
||||
showUpdateStep("Add new performance indexes", true);
|
||||
Database::query("ALTER TABLE panel_customers ADD INDEX guid (guid);");
|
||||
Database::query("ALTER TABLE panel_tasks ADD INDEX type (type);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX username (username);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX imap (imap);");
|
||||
Database::query("ALTER TABLE mail_users ADD INDEX pop3 (pop3);");
|
||||
Database::query("ALTER TABLE ftp_groups ADD INDEX gid (gid);");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202007240');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.19')) {
|
||||
showUpdateStep("Updating from 0.10.19 to 0.10.20", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.20');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202007240')) {
|
||||
|
||||
showUpdateStep("Removing old unused table", true);
|
||||
Database::query("DROP TABLE IF EXISTS `panel_diskspace_admins`;");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202009070');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.20')) {
|
||||
showUpdateStep("Updating from 0.10.20 to 0.10.21", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.21');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.21')) {
|
||||
|
||||
showUpdateStep("Adding settings for ssl-vhost default content if not updated from db-version 201910110", true);
|
||||
Settings::AddNew("system.default_sslvhostconf", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating from 0.10.21 to 0.10.22", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.22');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.22')) {
|
||||
showUpdateStep("Updating from 0.10.22 to 0.10.23", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.23');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23')) {
|
||||
showUpdateStep("Updating from 0.10.23 to 0.10.23.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.23.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202009070')) {
|
||||
|
||||
showUpdateStep("Adding setting to hide incompatible settings", true);
|
||||
Settings::AddNew("system.hide_incompatible_settings", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202012300');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202012300')) {
|
||||
|
||||
showUpdateStep("Adding setting for DKIM private key extension/suffix", true);
|
||||
Settings::AddNew("dkim.privkeysuffix", '.priv');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202101200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.23.1')) {
|
||||
showUpdateStep("Updating from 0.10.23.1 to 0.10.24", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.24');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202101200')) {
|
||||
|
||||
showUpdateStep("Adding setting for mail address used in SOA records", true);
|
||||
Settings::AddNew("system.soaemail", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202102200');
|
||||
}
|
||||
|
||||
/*
|
||||
* skip due to potential "1118 Row size too large" error
|
||||
*
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202102200')) {
|
||||
|
||||
showUpdateStep("Add new description fields to mail and domain table", true);
|
||||
Database::query("ALTER TABLE panel_domains ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `ssl_sessiontickets`;");
|
||||
Database::query("ALTER TABLE mail_virtual ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `iscatchall`");
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103030');
|
||||
}
|
||||
*/
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.24')) {
|
||||
showUpdateStep("Updating from 0.10.24 to 0.10.25", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.25');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202102200') || \Froxlor\Froxlor::isDatabaseVersion('202103030')) {
|
||||
|
||||
showUpdateStep("Refactoring columns from large tables", true);
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `ssl_protocols` `ssl_protocols` varchar(255) NOT NULL DEFAULT '';");
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `ssl_cipher_list` `ssl_cipher_list` varchar(500) NOT NULL DEFAULT '';");
|
||||
Database::query("ALTER TABLE panel_domains CHANGE `tlsv13_cipher_list` `tlsv13_cipher_list` varchar(500) NOT NULL DEFAULT '';");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Add new description fields to mail and domain table", true);
|
||||
$result = Database::query("DESCRIBE `panel_domains`");
|
||||
$columnfound = 0;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($row['Field'] == 'description') {
|
||||
$columnfound = 1;
|
||||
}
|
||||
}
|
||||
if (! $columnfound) {
|
||||
Database::query("ALTER TABLE panel_domains ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `ssl_sessiontickets`;");
|
||||
}
|
||||
$result = Database::query("DESCRIBE `mail_virtual`");
|
||||
$columnfound = 0;
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($row['Field'] == 'description') {
|
||||
$columnfound = 1;
|
||||
}
|
||||
}
|
||||
if (! $columnfound) {
|
||||
Database::query("ALTER TABLE mail_virtual ADD `description` varchar(255) NOT NULL DEFAULT '' AFTER `iscatchall`");
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103110');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202103110')) {
|
||||
|
||||
showUpdateStep("Adding settings for imprint, terms of use and privacy policy URLs", true);
|
||||
Settings::AddNew("panel.imprint_url", '');
|
||||
Settings::AddNew("panel.terms_url", '');
|
||||
Settings::AddNew("panel.privacy_url", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202103240');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.25')) {
|
||||
showUpdateStep("Updating from 0.10.25 to 0.10.26", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.26');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202103240')) {
|
||||
|
||||
showUpdateStep("Adding setting for default serveralias value for new domains", true);
|
||||
Settings::AddNew("system.domaindefaultalias", '0');
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202106160');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202106160')) {
|
||||
|
||||
showUpdateStep("Adjusting Let's Encrypt endpoint configuration to support ZeroSSL", true);
|
||||
if (Settings::Get('system.letsencryptca') == 'testing') {
|
||||
Settings::Set("system.letsencryptca", 'letsencrypt_test');
|
||||
} else {
|
||||
Settings::Set("system.letsencryptca", 'letsencrypt');
|
||||
}
|
||||
lastStepStatus(0);
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202106270');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202106270')) {
|
||||
showUpdateStep("Adding custom logo image settings", true);
|
||||
Settings::AddNew("panel.logo_image_header", '');
|
||||
Settings::AddNew("panel.logo_image_login", '');
|
||||
lastStepStatus(0);
|
||||
|
||||
// Migrating old custom logo over, if exists
|
||||
$custom_logo_file_old = \Froxlor\Froxlor::getInstallDir() . '/templates/Sparkle/assets/img/logo_custom.png';
|
||||
if (file_exists($custom_logo_file_old)) {
|
||||
showUpdateStep("Migrating existing custom logo to new settings", true);
|
||||
|
||||
$path = \Froxlor\Froxlor::getInstallDir().'/img/';
|
||||
if (!is_dir($path) && !mkdir($path, 0775)) {
|
||||
throw new \Exception("img directory does not exist and cannot be created");
|
||||
}
|
||||
if (!is_writable($path)) {
|
||||
if (!chmod($path, 0775)) {
|
||||
throw new \Exception("Cannot write to img directory");
|
||||
}
|
||||
}
|
||||
|
||||
// Save as new custom logo header
|
||||
$save_to = 'logo_header.png';
|
||||
copy($custom_logo_file_old, $path.$save_to);
|
||||
Settings::Set("panel.logo_image_header", "img/{$save_to}?v=".time());
|
||||
|
||||
// Save as new custom logo login
|
||||
$save_to = 'logo_login.png';
|
||||
copy($custom_logo_file_old, $path.$save_to);
|
||||
Settings::Set("panel.logo_image_login", "img/{$save_to}?v=".time());
|
||||
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107070');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.26')) {
|
||||
showUpdateStep("Updating from 0.10.26 to 0.10.27", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.27');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107070')) {
|
||||
showUpdateStep("Adding settings to overwrite theme- or custom theme-logo with the new logo settings", true);
|
||||
Settings::AddNew("panel.logo_overridetheme", '0');
|
||||
Settings::AddNew("panel.logo_overridecustom", '0');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107200');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107200')) {
|
||||
showUpdateStep("Adding settings to define default value of 'create std-subdomain' when creating a customer", true);
|
||||
Settings::AddNew("system.createstdsubdom_default", '1');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107210');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107210')) {
|
||||
showUpdateStep("Normalizing ipv6 for correct comparison", true);
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "`"
|
||||
);
|
||||
Database::pexecute($result_stmt);
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "` SET `ip` = :ip WHERE `id` = :id");
|
||||
while ($iprow = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
if (Validate::is_ipv6($iprow['ip'])) {
|
||||
$ip = inet_ntop(inet_pton($iprow['ip']));
|
||||
Database::pexecute($upd_stmt, [
|
||||
'ip' => $ip,
|
||||
'id' => $iprow['id']
|
||||
]);
|
||||
}
|
||||
}
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107260');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107260')) {
|
||||
showUpdateStep("Removing setting for search-engine allow yes/no", true);
|
||||
Database::query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'panel' AND `varname` = 'no_robots'");
|
||||
lastStepStatus(0);
|
||||
showUpdateStep("Adding setting to have all froxlor customers in a local group", true);
|
||||
Settings::AddNew("system.froxlorusergroup", '');
|
||||
Settings::AddNew("system.froxlorusergroup_gid", '');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202107300');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202107300')) {
|
||||
showUpdateStep("Adds the possibility to select the PowerDNS Operation Mode", true);
|
||||
Settings::AddNew("system.powerdns_mode", 'Native');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202108180');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.27')) {
|
||||
showUpdateStep("Updating from 0.10.27 to 0.10.28", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.28');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202108180')) {
|
||||
showUpdateStep("Adding czech language file", true);
|
||||
Database::query("INSERT INTO `" . TABLE_PANEL_LANGUAGE . "` SET `language` = 'Česká republika', `iso` = 'cs', `file` = 'lng/czech.lng.php'");
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202109040');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.28')) {
|
||||
showUpdateStep("Updating from 0.10.28 to 0.10.29", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.29');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29')) {
|
||||
showUpdateStep("Updating from 0.10.29 to 0.10.29.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.29.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.29.1')) {
|
||||
showUpdateStep("Updating from 0.10.29.1 to 0.10.30", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.30');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.30')) {
|
||||
showUpdateStep("Updating from 0.10.30 to 0.10.31", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.31');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('202109040')) {
|
||||
showUpdateStep("Add setting for acme.sh install location", true);
|
||||
Settings::AddNew("system.acmeshpath", '/root/.acme.sh/acme.sh');
|
||||
lastStepStatus(0);
|
||||
\Froxlor\Froxlor::updateToDbVersion('202112310');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.31')) {
|
||||
showUpdateStep("Updating from 0.10.31 to 0.10.32", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.32');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.32')) {
|
||||
showUpdateStep("Updating from 0.10.32 to 0.10.33", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.33');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.33')) {
|
||||
showUpdateStep("Updating from 0.10.33 to 0.10.34", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34')) {
|
||||
showUpdateStep("Updating from 0.10.34 to 0.10.34.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.34.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.34.1')) {
|
||||
showUpdateStep("Updating from 0.10.34.1 to 0.10.35", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.35');
|
||||
}
|
||||
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.35')) {
|
||||
showUpdateStep("Updating from 0.10.35 to 0.10.35.1", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.35.1');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.35.1')) {
|
||||
showUpdateStep("Updating from 0.10.35.1 to 0.10.36", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.36');
|
||||
}
|
||||
|
||||
if (\Froxlor\Froxlor::isFroxlorVersion('0.10.36')) {
|
||||
showUpdateStep("Updating from 0.10.36 to 0.10.37", false);
|
||||
\Froxlor\Froxlor::updateToVersion('0.10.37');
|
||||
}
|
||||
|
||||
0
install/updates/froxlor/0.9/index.html
Normal file
0
install/updates/froxlor/0.9/index.html
Normal file
@@ -2505,7 +2505,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.9.30')) {
|
||||
showUpdateStep("Updating from 0.9.30 to 0.9.31-dev1", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Removing unsused tables");
|
||||
showUpdateStep("Removing unused tables");
|
||||
Database::query("DROP TABLE IF EXISTS `ipsandports_docrootsettings`;");
|
||||
Database::query("DROP TABLE IF EXISTS `domain_docrootsettings`;");
|
||||
lastStepStatus(0);
|
||||
@@ -2856,7 +2856,7 @@ if (\Froxlor\Froxlor::isFroxlorVersion('0.9.32-rc1')) {
|
||||
Settings::AddNew("system.croncmdline", $croncmdline);
|
||||
// add task to generate cron.d-file
|
||||
\Froxlor\System\Cronjob::inserttask('99');
|
||||
// silenty add the auto-update setting - we do not want everybody to know and use this
|
||||
// silently add the auto-update setting - we do not want everybody to know and use this
|
||||
// as it is a very dangerous setting
|
||||
Settings::AddNew("system.cron_allowautoupdate", 0);
|
||||
lastStepStatus(0);
|
||||
@@ -3872,7 +3872,7 @@ opcache.interned_strings_buffer');
|
||||
|
||||
if (\Froxlor\Froxlor::isDatabaseVersion('201801110')) {
|
||||
|
||||
showUpdateStep("Adding php-fpm php PATH setting for envrironment");
|
||||
showUpdateStep("Adding php-fpm php PATH setting for environment");
|
||||
Settings::AddNew("phpfpm.envpath", '/usr/local/bin:/usr/bin:/bin');
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
0
install/updates/froxlor/index.html
Normal file
0
install/updates/froxlor/index.html
Normal file
0
install/updates/index.html
Normal file
0
install/updates/index.html
Normal file
@@ -19,7 +19,7 @@
|
||||
* Function getPreConfig
|
||||
*
|
||||
* outputs various content before the update process
|
||||
* can be continued (askes for agreement whatever is being asked)
|
||||
* can be continued (asks for agreement whatever is being asked)
|
||||
*
|
||||
* @param string $current_version
|
||||
* @param int $current_db_version
|
||||
@@ -34,6 +34,9 @@ function getPreConfig($current_version, $current_db_version)
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php');
|
||||
parseAndOutputPreconfig($has_preconfig, $return, $current_version, $current_db_version);
|
||||
|
||||
include_once \Froxlor\FileDir::makeCorrectFile(dirname(__FILE__) . '/preconfig/0.10/preconfig_0.10.inc.php');
|
||||
parseAndOutputPreconfig2($has_preconfig, $return, $current_version, $current_db_version);
|
||||
|
||||
$return .= '<br /><br />' . \Froxlor\UI\HTML::makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
|
||||
$return .= '</div>';
|
||||
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
|
||||
|
||||
0
install/updates/preconfig/0.10/index.html
Normal file
0
install/updates/preconfig/0.10/index.html
Normal file
42
install/updates/preconfig/0.10/preconfig_0.10.inc.php
Normal file
42
install/updates/preconfig/0.10/preconfig_0.10.inc.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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 Updater
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* checks if the new-version has some updating to do
|
||||
*
|
||||
* @param boolean $has_preconfig
|
||||
* pointer to check if any preconfig has to be output
|
||||
* @param string $return
|
||||
* pointer to output string
|
||||
* @param string $current_version
|
||||
* current froxlor version
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function parseAndOutputPreconfig2(&$has_preconfig, &$return, $current_version, $current_db_version)
|
||||
{
|
||||
global $lng;
|
||||
|
||||
if (versionInUpdate($current_db_version, '202004140')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor can now optionally validate the dns entries of domains that request Lets Encrypt certificates to reduce dns-related problems (e.g. freshly registered domain or updated a-record).<br />';
|
||||
$question = '<strong>Validate DNS of domains when using Lets Encrypt ';
|
||||
$question .= \Froxlor\UI\HTML::makeyesno('system_le_domain_dnscheck', '1', '0', '1');
|
||||
|
||||
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
0
install/updates/preconfig/0.9/index.html
Normal file
0
install/updates/preconfig/0.9/index.html
Normal file
@@ -414,7 +414,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
|
||||
|
||||
if (Settings::Get('system.webserver') == 'apache2') {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.<br />';
|
||||
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in order to use it.<br />';
|
||||
$description .= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
|
||||
LoadModule authz_host_module modules/mod_authz_host.so</pre><br />';
|
||||
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong> ';
|
||||
@@ -600,8 +600,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c
|
||||
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
|
||||
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
|
||||
$question .= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
|
||||
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php -q")<br />';
|
||||
$question .= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php -q" /><br />';
|
||||
eval("\$return.=\"" . \Froxlor\UI\Template::getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
|
||||
0
install/updates/preconfig/index.html
Normal file
0
install/updates/preconfig/index.html
Normal file
4
js/html5shiv.min.js
vendored
4
js/html5shiv.min.js
vendored
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
|
||||
0
js/index.html
Normal file
0
js/index.html
Normal file
4
js/jquery.min.js
vendored
4
js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
0
js/plugins/index.html
Normal file
0
js/plugins/index.html
Normal file
@@ -54,6 +54,13 @@ abstract class ApiCommand extends ApiParameter
|
||||
*/
|
||||
private $mail = null;
|
||||
|
||||
/**
|
||||
* whether the call is an internal one or not
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $internal_call = false;
|
||||
|
||||
/**
|
||||
* language strings array
|
||||
*
|
||||
@@ -90,10 +97,12 @@ abstract class ApiCommand extends ApiParameter
|
||||
* optional, array of parameters (var=>value) for the command
|
||||
* @param array $userinfo
|
||||
* optional, passed via WebInterface (instead of $header)
|
||||
* @param boolean $internal
|
||||
* optional whether called internally, default false
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($header = null, $params = null, $userinfo = null)
|
||||
public function __construct($header = null, $params = null, $userinfo = null, $internal = false)
|
||||
{
|
||||
parent::__construct($params);
|
||||
|
||||
@@ -127,6 +136,9 @@ abstract class ApiCommand extends ApiParameter
|
||||
if ($this->debug) {
|
||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::LOG_ERROR, LOG_DEBUG, "[API] " . get_called_class() . ": " . json_encode($params, JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
|
||||
// set internal call flag
|
||||
$this->internal_call = $internal;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,13 +203,15 @@ abstract class ApiCommand extends ApiParameter
|
||||
* array of user-data
|
||||
* @param array $params
|
||||
* array of parameters for the command
|
||||
* @param boolean $internal
|
||||
* optional whether called internally, default false
|
||||
*
|
||||
* @return ApiCommand
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getLocal($userinfo = null, $params = null)
|
||||
public static function getLocal($userinfo = null, $params = null, $internal = false)
|
||||
{
|
||||
return new static(null, $params, $userinfo);
|
||||
return new static(null, $params, $userinfo, $internal);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,6 +224,16 @@ abstract class ApiCommand extends ApiParameter
|
||||
return $this->is_admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* internal call flag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function isInternal()
|
||||
{
|
||||
return $this->internal_call;
|
||||
}
|
||||
|
||||
/**
|
||||
* return field from user-table
|
||||
*
|
||||
@@ -232,6 +256,190 @@ abstract class ApiCommand extends ApiParameter
|
||||
return $this->user_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* return SQL when parameter $sql_search is given via API
|
||||
*
|
||||
* @param array $sql_search
|
||||
* optional array with index = fieldname, and value = array with 'op' => operator (one of <, > or =), LIKE is used if left empty and 'value' => searchvalue
|
||||
* @param array $query_fields
|
||||
* optional array of placeholders mapped to the actual value which is used in the API commands when executing the statement [internal]
|
||||
* @param boolean $append
|
||||
* optional append to WHERE clause rather then create new one, default false [internal]
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getSearchWhere(&$query_fields = array(), $append = false)
|
||||
{
|
||||
$search = $this->getParam('sql_search', true, array());
|
||||
$condition = '';
|
||||
if (! empty($search)) {
|
||||
if ($append == true) {
|
||||
$condition = ' AND ';
|
||||
} else {
|
||||
$condition = ' WHERE ';
|
||||
}
|
||||
$ops = array(
|
||||
'<',
|
||||
'>',
|
||||
'='
|
||||
);
|
||||
$first = true;
|
||||
foreach ($search as $field => $valoper) {
|
||||
$cleanfield = str_replace(".", "", $field);
|
||||
$sortfield = explode('.', $field);
|
||||
foreach ($sortfield as $id => $sfield) {
|
||||
if (substr($sfield, - 1, 1) != '`') {
|
||||
$sfield .= '`';
|
||||
}
|
||||
if ($sfield[0] != '`') {
|
||||
$sfield = '`' . $sfield;
|
||||
}
|
||||
$sortfield[$id] = $sfield;
|
||||
}
|
||||
$field = implode('.', $sortfield);
|
||||
if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
if (! $first) {
|
||||
$condition .= ' AND ';
|
||||
}
|
||||
if (! is_array($valoper) || ! isset($valoper['op']) || empty($valoper['op'])) {
|
||||
$condition .= $field . ' LIKE :' . $cleanfield;
|
||||
if (! is_array($valoper)) {
|
||||
$query_fields[':' . $cleanfield] = '%' . $valoper . '%';
|
||||
} else {
|
||||
$query_fields[':' . $cleanfield] = '%' . $valoper['value'] . '%';
|
||||
}
|
||||
} elseif (in_array($valoper['op'], $ops)) {
|
||||
$condition .= $field . ' ' . $valoper['op'] . ':' . $cleanfield;
|
||||
$query_fields[':' . $cleanfield] = $valoper['value'] ?? '';
|
||||
} elseif (strtolower($valoper['op']) == 'in' && is_array($valoper['value']) && count($valoper['value']) > 0) {
|
||||
$condition .= $field . ' ' . $valoper['op'] . ' (';
|
||||
foreach ($valoper['value'] as $incnt => $invalue) {
|
||||
if (!is_numeric($incnt)) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
if (!empty($invalue) && preg_match('/^([a-z0-9\-\._`]+)$/i', $invalue) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
$condition .= ":" . $cleanfield . $incnt . ", ";
|
||||
$query_fields[':' . $cleanfield . $incnt] = $invalue ?? '';
|
||||
}
|
||||
$condition = substr($condition, 0, - 2) . ')';
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if ($first) {
|
||||
$first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $condition;
|
||||
}
|
||||
|
||||
/**
|
||||
* return LIMIT clause when at least $sql_limit parameter is given via API
|
||||
*
|
||||
* @param int $sql_limit
|
||||
* optional, limit resultset, default 0
|
||||
* @param int $sql_offset
|
||||
* optional, offset for limitation, default 0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getLimit()
|
||||
{
|
||||
$limit = $this->getParam('sql_limit', true, 0);
|
||||
$offset = $this->getParam('sql_offset', true, 0);
|
||||
|
||||
if (! is_numeric($limit)) {
|
||||
$limit = 0;
|
||||
}
|
||||
if (! is_numeric($offset)) {
|
||||
$offset = 0;
|
||||
}
|
||||
|
||||
if ($limit > 0) {
|
||||
return ' LIMIT ' . $offset . ',' . $limit;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* return ORDER BY clause if parameter $sql_orderby parameter is given via API
|
||||
*
|
||||
* @param array $sql_orderby
|
||||
* optional array with index = fieldname and value = ASC|DESC
|
||||
* @param boolean $append
|
||||
* optional append to ORDER BY clause rather then create new one, default false [internal]
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getOrderBy($append = false)
|
||||
{
|
||||
$orderby = $this->getParam('sql_orderby', true, array());
|
||||
$order = "";
|
||||
if (! empty($orderby)) {
|
||||
if ($append) {
|
||||
$order .= ", ";
|
||||
} else {
|
||||
$order .= " ORDER BY ";
|
||||
}
|
||||
|
||||
$nat_fields = [
|
||||
'`c`.`loginname`',
|
||||
'`a`.`loginname`',
|
||||
'`adminname`',
|
||||
'`databasename`',
|
||||
'`username`'
|
||||
];
|
||||
|
||||
foreach ($orderby as $field => $by) {
|
||||
$sortfield = explode('.', $field);
|
||||
foreach ($sortfield as $id => $sfield) {
|
||||
if (substr($sfield, - 1, 1) != '`') {
|
||||
$sfield .= '`';
|
||||
}
|
||||
if ($sfield[0] != '`') {
|
||||
$sfield = '`' . $sfield;
|
||||
}
|
||||
$sortfield[$id] = $sfield;
|
||||
}
|
||||
$field = implode('.', $sortfield);
|
||||
if (preg_match('/^([a-z0-9\-\._`]+)$/i', $field) == false) {
|
||||
// skip
|
||||
continue;
|
||||
}
|
||||
$by = strtoupper($by);
|
||||
if (! in_array($by, [
|
||||
'ASC',
|
||||
'DESC'
|
||||
])) {
|
||||
$by = 'ASC';
|
||||
}
|
||||
if (\Froxlor\Settings::Get('panel.natsorting') == 1 && in_array($field, $nat_fields)) {
|
||||
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
|
||||
$order .= "CONCAT( IF( ASCII( LEFT( " . $field . ", 5 ) ) > 57,
|
||||
LEFT( " . $field . ", 1 ), 0 ),
|
||||
IF( ASCII( RIGHT( " . $field . ", 1 ) ) > 57,
|
||||
LPAD( " . $field . ", 255, '0' ),
|
||||
LPAD( CONCAT( " . $field . ", '-' ), 255, '0' )
|
||||
)) " . $by . ", ";
|
||||
} else {
|
||||
$order .= $field . " " . $by . ", ";
|
||||
}
|
||||
}
|
||||
$order = substr($order, 0, - 2);
|
||||
}
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return logger instance
|
||||
*
|
||||
@@ -257,15 +465,18 @@ abstract class ApiCommand extends ApiParameter
|
||||
*
|
||||
* @param string $command
|
||||
* @param array|null $params
|
||||
*
|
||||
* @param boolean $internal
|
||||
* optional whether called internally, default false
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function apiCall($command = null, $params = null)
|
||||
protected function apiCall($command = null, $params = null, $internal = false)
|
||||
{
|
||||
$_command = explode(".", $command);
|
||||
$module = __NAMESPACE__ . "\Commands\\" . $_command[0];
|
||||
$function = $_command[1];
|
||||
$json_result = $module::getLocal($this->getUserData(), $params)->{$function}();
|
||||
$json_result = $module::getLocal($this->getUserData(), $params, $internal)->{$function}();
|
||||
return json_decode($json_result, true)['data'];
|
||||
}
|
||||
|
||||
@@ -331,7 +542,7 @@ abstract class ApiCommand extends ApiParameter
|
||||
$customer_ids[] = $customer['customerid'];
|
||||
}
|
||||
} else {
|
||||
if (! empty($customer_hide_option) && \Froxlor\Settings::IsInList('panel.customer_hide_options', $customer_hide_option)) {
|
||||
if (! $this->isInternal() && ! empty($customer_hide_option) && \Froxlor\Settings::IsInList('panel.customer_hide_options', $customer_hide_option)) {
|
||||
throw new \Exception("You cannot access this resource", 405);
|
||||
}
|
||||
$customer_ids = array(
|
||||
@@ -423,8 +634,12 @@ abstract class ApiCommand extends ApiParameter
|
||||
"group" => $group,
|
||||
"var" => $varname
|
||||
), true, true);
|
||||
$content = $default;
|
||||
if ($result) {
|
||||
$content = $result['value'] ?? $default;
|
||||
}
|
||||
// @fixme html_entity_decode
|
||||
$content = html_entity_decode(\Froxlor\PhpHelper::replaceVariables((($result['value'] != '') ? $result['value'] : $default), $replace_arr));
|
||||
$content = html_entity_decode(\Froxlor\PhpHelper::replaceVariables($content, $replace_arr));
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,12 +180,18 @@ abstract class ApiParameter
|
||||
*/
|
||||
private function trimArray($input)
|
||||
{
|
||||
if (! is_array($input)) {
|
||||
if ($input === '') {
|
||||
return "";
|
||||
}
|
||||
if (is_numeric($input) || is_null($input)) {
|
||||
return $input;
|
||||
}
|
||||
if (!is_array($input)) {
|
||||
return trim($input);
|
||||
}
|
||||
return array_map(array(
|
||||
return array_map([
|
||||
$this,
|
||||
'trimArray'
|
||||
), $input);
|
||||
], $input);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,15 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
/**
|
||||
* lists all admin entries
|
||||
*
|
||||
* @param array $sql_search
|
||||
* optional array with index = fieldname, and value = array with 'op' => operator (one of <, > or =), LIKE is used if left empty and 'value' => searchvalue
|
||||
* @param int $sql_limit
|
||||
* optional specify number of results to be returned
|
||||
* @param int $sql_offset
|
||||
* optional specify offset for resultset
|
||||
* @param array $sql_orderby
|
||||
* optional array with index = fieldname and value = ASC|DESC to order the resultset by one or more fields
|
||||
*
|
||||
* @access admin
|
||||
* @throws \Exception
|
||||
* @return string json-encoded array count|list
|
||||
@@ -33,17 +42,16 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
{
|
||||
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
|
||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] list admins");
|
||||
$query_fields = array();
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT *
|
||||
FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
ORDER BY `loginname` ASC
|
||||
");
|
||||
Database::pexecute($result_stmt, null, true, true);
|
||||
FROM `" . TABLE_PANEL_ADMINS . "`" . $this->getSearchWhere($query_fields) . $this->getOrderBy() . $this->getLimit());
|
||||
Database::pexecute($result_stmt, $query_fields, true, true);
|
||||
$result = array();
|
||||
while ($row = $result_stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
$result[] = $row;
|
||||
}
|
||||
return $this->response(200, "successfull", array(
|
||||
return $this->response(200, "successful", array(
|
||||
'count' => count($result),
|
||||
'list' => $result
|
||||
));
|
||||
@@ -51,6 +59,28 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
throw new \Exception("Not allowed to execute given command.", 403);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the total number of admins for the given admin
|
||||
*
|
||||
* @access admin
|
||||
* @throws \Exception
|
||||
* @return string json-encoded array
|
||||
*/
|
||||
public function listingCount()
|
||||
{
|
||||
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT COUNT(*) as num_admins
|
||||
FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, null, true, true);
|
||||
if ($result) {
|
||||
return $this->response(200, "successful", $result['num_admins']);
|
||||
}
|
||||
}
|
||||
throw new \Exception("Not allowed to execute given command.", 403);
|
||||
}
|
||||
|
||||
/**
|
||||
* return an admin entry by either id or loginname
|
||||
*
|
||||
@@ -79,7 +109,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$result = Database::pexecute_first($result_stmt, $params, true, true);
|
||||
if ($result) {
|
||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "[API] get admin '" . $result['loginname'] . "'");
|
||||
return $this->response(200, "successfull", $result);
|
||||
return $this->response(200, "successful", $result);
|
||||
}
|
||||
$key = ($id > 0 ? "id #" . $id : "loginname '" . $loginname . "'");
|
||||
throw new \Exception("Admin with " . $key . " could not be found", 404);
|
||||
@@ -97,6 +127,8 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
* optional, default auto-generated
|
||||
* @param string $def_language
|
||||
* optional, default is system-default language
|
||||
* @param bool $api_allowed
|
||||
* optional, default is true if system setting api.enabled is true, else false
|
||||
* @param string $custom_notes
|
||||
* optional, default empty
|
||||
* @param bool $custom_notes_show
|
||||
@@ -171,6 +203,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
|
||||
// parameters
|
||||
$def_language = $this->getParam('def_language', true, Settings::Get('panel.standardlanguage'));
|
||||
$api_allowed = $this->getBoolParam('api_allowed', true, Settings::Get('api.enabled'));
|
||||
$custom_notes = $this->getParam('custom_notes', true, '');
|
||||
$custom_notes_show = $this->getBoolParam('custom_notes_show', true, 0);
|
||||
$password = $this->getParam('admin_password', true, '');
|
||||
@@ -198,7 +231,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
|
||||
if (Settings::Get('system.mail_quota_enabled') != '1') {
|
||||
$email_quota = - 1;
|
||||
@@ -232,7 +265,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
'login' => $loginname
|
||||
), true, true);
|
||||
|
||||
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) {
|
||||
if (($loginname_check && strtolower($loginname_check['loginname']) == strtolower($loginname)) || ($loginname_check_admin && strtolower($loginname_check_admin['loginname']) == strtolower($loginname))) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
|
||||
} elseif (preg_match('/^' . preg_quote(Settings::Get('customer.accountprefix'), '/') . '([0-9]+)/', $loginname)) {
|
||||
// Accounts which match systemaccounts are not allowed, filtering them
|
||||
@@ -271,6 +304,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'lang' => $def_language,
|
||||
'api_allowed' => $api_allowed,
|
||||
'change_serversettings' => $change_serversettings,
|
||||
'customers' => $customers,
|
||||
'customers_see_all' => $customers_see_all,
|
||||
@@ -299,6 +333,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
`name` = :name,
|
||||
`email` = :email,
|
||||
`def_language` = :lang,
|
||||
`api_allowed` = :api_allowed,
|
||||
`change_serversettings` = :change_serversettings,
|
||||
`customers` = :customers,
|
||||
`customers_see_all` = :customers_see_all,
|
||||
@@ -329,7 +364,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$result = $this->apiCall('Admins.get', array(
|
||||
'id' => $adminid
|
||||
));
|
||||
return $this->response(200, "successfull", $result);
|
||||
return $this->response(200, "successful", $result);
|
||||
}
|
||||
}
|
||||
throw new \Exception("Not allowed to execute given command.", 403);
|
||||
@@ -350,6 +385,8 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
* optional, default auto-generated
|
||||
* @param string $def_language
|
||||
* optional, default is system-default language
|
||||
* @param bool $api_allowed
|
||||
* optional, default is true if system setting api.enabled is true, else false
|
||||
* @param string $custom_notes
|
||||
* optional, default empty
|
||||
* @param string $theme
|
||||
@@ -435,15 +472,16 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
// parameters
|
||||
$name = $this->getParam('name', true, $result['name']);
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email']));
|
||||
$email = $this->getParam('email', true, $idna_convert->decode($result['email'] ?? ''));
|
||||
$password = $this->getParam('admin_password', true, '');
|
||||
$def_language = $this->getParam('def_language', true, $result['def_language']);
|
||||
$custom_notes = $this->getParam('custom_notes', true, $result['custom_notes']);
|
||||
$custom_notes = $this->getParam('custom_notes', true, ($result['custom_notes'] ?? ""));
|
||||
$custom_notes_show = $this->getBoolParam('custom_notes_show', true, $result['custom_notes_show']);
|
||||
$theme = $this->getParam('theme', true, $result['theme']);
|
||||
|
||||
// you cannot edit some of the details of yourself
|
||||
if ($result['adminid'] == $this->getUserDetail('adminid')) {
|
||||
$api_allowed = $result['api_allowed'];
|
||||
$deactivated = $result['deactivated'];
|
||||
$customers = $result['customers'];
|
||||
$domains = $result['domains'];
|
||||
@@ -462,6 +500,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$traffic = $result['traffic'];
|
||||
$ipaddress = ($result['ip'] != - 1 ? json_decode($result['ip'], true) : - 1);
|
||||
} else {
|
||||
$api_allowed = $this->getBoolParam('api_allowed', true, $result['api_allowed']);
|
||||
$deactivated = $this->getBoolParam('deactivated', true, $result['deactivated']);
|
||||
|
||||
$dec_places = Settings::Get('panel.decimal_places');
|
||||
@@ -492,7 +531,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$idna_convert = new \Froxlor\Idna\IdnaWrapper();
|
||||
$email = $idna_convert->encode(\Froxlor\Validate\Validate::validate($email, 'email', '', '', array(), true));
|
||||
$def_language = \Froxlor\Validate\Validate::validate($def_language, 'default language', '', '', array(), true);
|
||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', '/^[^\0]*$/', '', array(), true);
|
||||
$custom_notes = \Froxlor\Validate\Validate::validate(str_replace("\r\n", "\n", $custom_notes), 'custom_notes', \Froxlor\Validate\Validate::REGEX_CONF_TEXT, '', array(), true);
|
||||
$theme = \Froxlor\Validate\Validate::validate($theme, 'theme', '', '', array(), true);
|
||||
$password = \Froxlor\Validate\Validate::validate($password, 'password', '', '', array(), true);
|
||||
|
||||
@@ -578,6 +617,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'lang' => $def_language,
|
||||
'api_allowed' => $api_allowed,
|
||||
'change_serversettings' => $change_serversettings,
|
||||
'customers' => $customers,
|
||||
'customers_see_all' => $customers_see_all,
|
||||
@@ -607,6 +647,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
`name` = :name,
|
||||
`email` = :email,
|
||||
`def_language` = :lang,
|
||||
`api_allowed` = :api_allowed,
|
||||
`change_serversettings` = :change_serversettings,
|
||||
`customers` = :customers,
|
||||
`customers_see_all` = :customers_see_all,
|
||||
@@ -636,7 +677,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$result = $this->apiCall('Admins.get', array(
|
||||
'id' => $result['adminid']
|
||||
));
|
||||
return $this->response(200, "successfull", $result);
|
||||
return $this->response(200, "successful", $result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -672,6 +713,10 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
if ($id == $this->getUserDetail('adminid')) {
|
||||
\Froxlor\UI\Response::standard_error('youcantdeleteyourself', '', true);
|
||||
}
|
||||
// can't delete the first superadmin
|
||||
if ($id == 1) {
|
||||
\Froxlor\UI\Response::standard_error('cannotdeletesuperadmin', '', true);
|
||||
}
|
||||
|
||||
// delete admin
|
||||
$del_stmt = Database::prepare("
|
||||
@@ -689,14 +734,6 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
'adminid' => $id
|
||||
), true, true);
|
||||
|
||||
// delete the diskspace usage
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_DISKSPACE_ADMINS . "` WHERE `adminid` = :adminid
|
||||
");
|
||||
Database::pexecute($del_stmt, array(
|
||||
'adminid' => $id
|
||||
), true, true);
|
||||
|
||||
// set admin-id of the old admin's customer to current admins
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||
@@ -738,7 +775,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
|
||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] deleted admin '" . $result['loginname'] . "'");
|
||||
\Froxlor\User::updateCounters();
|
||||
return $this->response(200, "successfull", $result);
|
||||
return $this->response(200, "successful", $result);
|
||||
}
|
||||
throw new \Exception("Not allowed to execute given command.", 403);
|
||||
}
|
||||
@@ -780,7 +817,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
$result['loginfail_count'] = 0;
|
||||
|
||||
$this->logger()->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_WARNING, "[API] unlocked admin '" . $result['loginname'] . "'");
|
||||
return $this->response(200, "successfull", $result);
|
||||
return $this->response(200, "successful", $result);
|
||||
}
|
||||
throw new \Exception("Not allowed to execute given command.", 403);
|
||||
}
|
||||
@@ -793,7 +830,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
* @param string $extra
|
||||
* optional, default empty
|
||||
* @param int $increase_by
|
||||
* optional, default 1
|
||||
* optional, default 1
|
||||
*/
|
||||
public static function increaseUsage($adminid = 0, $resource = null, $extra = '', $increase_by = 1)
|
||||
{
|
||||
@@ -808,7 +845,7 @@ class Admins extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEnt
|
||||
* @param string $extra
|
||||
* optional, default empty
|
||||
* @param int $decrease_by
|
||||
* optional, default 1
|
||||
* optional, default 1
|
||||
*/
|
||||
public static function decreaseUsage($adminid = 0, $resource = null, $extra = '', $decrease_by = 1)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user