Compare commits
2453 Commits
0.9.36
...
greylistin
| Author | SHA1 | Date | |
|---|---|---|---|
| 3630f82817 | |||
| 9ddd2e9154 | |||
| 53afe4ebd1 | |||
| 4f69e8ee0e | |||
| 32f5b0d5e9 | |||
| 53a6485a6e | |||
| f2643ac887 | |||
| e37687a85d | |||
| ccbc3286a5 | |||
| 929a562324 | |||
| 3704cf6621 | |||
| 10238a1466 | |||
| 9002ddf4a2 | |||
| 8a2de5a44a | |||
| 96c0af18dd | |||
| 5bb228ce78 | |||
| 804128280c | |||
| 5b8e918f75 | |||
| 0e3e83d184 | |||
| 8ced61c6aa | |||
| 29a2ab7567 | |||
|
|
166ec0575b | ||
|
|
215e749ba8 | ||
|
|
506cccd7c8 | ||
|
|
6d9014c29b | ||
|
|
10555bff76 | ||
|
|
37aa7af4da | ||
|
|
4b75369597 | ||
|
|
9d0e463906 | ||
|
|
a7198f58ce | ||
|
|
47be4b2847 | ||
|
|
b0fae4bd14 | ||
|
|
4711a41436 | ||
|
|
faa71ceaef | ||
|
|
2d30394150 | ||
|
|
99c1182af8 | ||
|
|
d9abe58dd2 | ||
|
|
23034b8ad2 | ||
|
|
1cae5638d3 | ||
|
|
ce9a5f97a3 | ||
|
|
c38b90deef | ||
|
|
13daa7d6fa | ||
|
|
b0e43d332d | ||
|
|
75c8754fb4 | ||
|
|
e0fa64f897 | ||
|
|
ed72fd1766 | ||
|
|
826ae36647 | ||
|
|
9ddf24539e | ||
|
|
3940c1429d | ||
|
|
c236d9eaab | ||
|
|
688994e40c | ||
|
|
9facaee809 | ||
|
|
a7dd5f4685 | ||
|
|
da810ea953 | ||
|
|
51b6e067e8 | ||
|
|
34cf6698bc | ||
|
|
4642160724 | ||
|
|
78a259ef3b | ||
|
|
68cf4ab69a | ||
|
|
d5661d492d | ||
|
|
6900898ae1 | ||
|
|
d90fb7fa68 | ||
|
|
4ea8629fcc | ||
|
|
9d4ff8698d | ||
|
|
b164038846 | ||
|
|
5c46960734 | ||
|
|
a7f4f0c737 | ||
|
|
b64dd501dd | ||
|
|
1679675aa1 | ||
|
|
640466f301 | ||
|
|
9c9771a371 | ||
|
|
1922b3ce65 | ||
|
|
83e819908a | ||
|
|
0924aa644b | ||
|
|
7711ce1d66 | ||
|
|
7dae63e586 | ||
|
|
1bcaa45492 | ||
|
|
66cb114f0d | ||
|
|
1c5d60dcfd | ||
|
|
b6da6356fc | ||
|
|
c09670cc45 | ||
|
|
464f5b7bed | ||
|
|
c799235c24 | ||
|
|
a2860e70a5 | ||
|
|
95a96d46a6 | ||
|
|
81f3dbda31 | ||
|
|
4eb4191843 | ||
|
|
ca433d8a61 | ||
|
|
8f4dfe1514 | ||
|
|
ee42f5168e | ||
|
|
fc8ca57f8c | ||
|
|
7e4bba2d55 | ||
|
|
7e635f9be4 | ||
|
|
e9406a20f2 | ||
|
|
de7729cec8 | ||
|
|
d60e48849b | ||
|
|
908df5a7bb | ||
|
|
c1952afb94 | ||
|
|
7a22e8f4dd | ||
|
|
3ac0da2cdd | ||
|
|
eb816c4cc6 | ||
|
|
64d8bf4fba | ||
|
|
ae6ee95973 | ||
|
|
e9051dc30a | ||
|
|
b6c7c53c3a | ||
|
|
f36bc61fc7 | ||
|
|
c56e0b9dac | ||
|
|
1deb08bf75 | ||
|
|
b30d7a8252 | ||
|
|
b03e11c18d | ||
|
|
bf7d22a794 | ||
|
|
fb57a8a3b5 | ||
|
|
0d625797b0 | ||
|
|
6777fbf229 | ||
|
|
23f1f79eff | ||
|
|
a5af104d53 | ||
|
|
38d94698ce | ||
|
|
5ba28ef599 | ||
|
|
a3486cc5b3 | ||
|
|
5ab322ab1d | ||
|
|
4f26bdd535 | ||
|
|
88f76e4355 | ||
|
|
a464d8cb19 | ||
|
|
0f596dce8b | ||
|
|
60270b20b3 | ||
|
|
4003a8d2b6 | ||
|
|
89843d6f37 | ||
|
|
256a52a5da | ||
|
|
c9b2bfe53c | ||
|
|
98cb36327e | ||
|
|
7d23e4882d | ||
|
|
1cc3a1d066 | ||
|
|
de0f7d2f01 | ||
|
|
aa48ffca2b | ||
|
|
802168cb5b | ||
|
|
6ace2e9f3d | ||
|
|
0bff360d22 | ||
|
|
e300acf109 | ||
|
|
14d8e12cdc | ||
|
|
d29411dba6 | ||
|
|
464663877c | ||
|
|
c3f769d48b | ||
|
|
f97536ed02 | ||
|
|
7686effc8c | ||
|
|
ee8385467b | ||
|
|
0a51d97684 | ||
|
|
67fc762eef | ||
|
|
8378795f5d | ||
|
|
98e6f1df4a | ||
|
|
674e35e5c5 | ||
|
|
b24ca44e6f | ||
|
|
e0f7fcd2ef | ||
|
|
c5bece64ce | ||
|
|
0034681412 | ||
|
|
bd5b99dc1c | ||
|
|
2feb802094 | ||
|
|
7b08a71c59 | ||
|
|
2a84e9c120 | ||
|
|
d854e8e991 | ||
|
|
0a363910d6 | ||
|
|
b23d5cd909 | ||
|
|
3b753aa69d | ||
|
|
492cd288bc | ||
|
|
47938c5082 | ||
|
|
97c4c9a366 | ||
|
|
d090e48544 | ||
|
|
314e4407a0 | ||
|
|
ed50e03957 | ||
|
|
dff7530cc5 | ||
|
|
19423c9644 | ||
|
|
42b3f1e59d | ||
|
|
1b77632fa8 | ||
|
|
867b7b1390 | ||
|
|
4c6ebde58c | ||
|
|
1e013d9e9a | ||
|
|
c56bc651b9 | ||
|
|
6cbdf45a7c | ||
|
|
715667e227 | ||
|
|
41de161555 | ||
|
|
1f1ea370c0 | ||
|
|
090cfc26f2 | ||
|
|
529890b5d2 | ||
|
|
d4a6ab146d | ||
|
|
e3f02879cf | ||
|
|
b52d6df777 | ||
|
|
9e671100ae | ||
|
|
7e801ea502 | ||
|
|
b68522f7d5 | ||
|
|
86852942e0 | ||
|
|
ea88d53e39 | ||
|
|
61f6a474e4 | ||
|
|
ec05c84f4d | ||
|
|
9e13c077e9 | ||
|
|
da8d315e77 | ||
|
|
82af9af1e1 | ||
|
|
cb67e3ae63 | ||
|
|
82d15c4dc2 | ||
|
|
6d048e2cee | ||
|
|
87bd80eea1 | ||
|
|
80e442e396 | ||
|
|
489ad375bd | ||
|
|
c420196e73 | ||
|
|
cc6d8d5f8b | ||
|
|
24f47bc58b | ||
|
|
c769c074e0 | ||
|
|
2ecb8eb034 | ||
|
|
6827c100c3 | ||
|
|
c402acd1bd | ||
|
|
c4ec2509fa | ||
|
|
0f382586ce | ||
|
|
9c2f12ecb1 | ||
|
|
12da117cab | ||
|
|
ef48f4b48e | ||
|
|
aae6db52b5 | ||
|
|
fb7d65d645 | ||
|
|
3b9c60e985 | ||
|
|
452df60866 | ||
|
|
7ce7123756 | ||
|
|
d42072e3ad | ||
|
|
d69a7eeb07 | ||
|
|
a8a112af49 | ||
|
|
46c696811d | ||
|
|
1d2f5a693c | ||
|
|
5688690eb8 | ||
|
|
f7f356e896 | ||
|
|
5a807e3dbe | ||
|
|
fede81700e | ||
|
|
b7264cdc5d | ||
|
|
0527f22dc9 | ||
|
|
d643e8c673 | ||
|
|
f2485ecd9a | ||
|
|
983d929460 | ||
|
|
37980060ea | ||
|
|
03a39ca69f | ||
|
|
1b63534563 | ||
|
|
07814f8e46 | ||
|
|
c696542cf5 | ||
|
|
15ed0521c5 | ||
|
|
ae4b961ac1 | ||
|
|
6ad78a4818 | ||
|
|
ddc95762eb | ||
|
|
6bf0396c76 | ||
|
|
746d30c65b | ||
|
|
9013fd63d7 | ||
|
|
7079e2f2bf | ||
|
|
03466158a7 | ||
|
|
ef8dabeb89 | ||
|
|
38fb3bc25a | ||
|
|
d2d3cec4f5 | ||
|
|
669072d996 | ||
|
|
a81065a1b0 | ||
|
|
4f89d7a9f0 | ||
|
|
996b2e4a78 | ||
|
|
4acd1d4ef6 | ||
|
|
795a3d846c | ||
|
|
2dd226c96c | ||
|
|
24fa1d39ed | ||
|
|
c19b7d02ab | ||
|
|
e5b6492804 | ||
|
|
f4f00352eb | ||
|
|
ebc44a737e | ||
|
|
4d908ff6ee | ||
|
|
34e3290497 | ||
|
|
fe37313b7b | ||
|
|
3d033262ed | ||
|
|
6135ba8468 | ||
|
|
d7a2ec35cc | ||
|
|
4501eb2723 | ||
|
|
609c15688c | ||
|
|
5b7a76b608 | ||
|
|
4eaf9d2c46 | ||
|
|
b3da3cf218 | ||
|
|
abf3328ea9 | ||
|
|
89f73f571e | ||
|
|
63f6d221cd | ||
|
|
40997762a4 | ||
|
|
fa547197e8 | ||
|
|
ae8cd3dc8a | ||
|
|
685b6076a0 | ||
|
|
137db0432e | ||
|
|
73fe533870 | ||
|
|
4b7ae46fd7 | ||
|
|
777991e0e3 | ||
|
|
eb13796976 | ||
|
|
51aafafd73 | ||
|
|
7084cd8c54 | ||
|
|
ed231f159f | ||
|
|
da6c1992fa | ||
|
|
5fa98811ab | ||
|
|
6904acc9ea | ||
|
|
cc1d427a69 | ||
|
|
1d938f2a43 | ||
|
|
f49fd5f0f7 | ||
|
|
2b12cde77e | ||
|
|
61dc40ec88 | ||
|
|
ec8338592d | ||
|
|
b6d850dac3 | ||
|
|
1b75863823 | ||
|
|
73aa2ec431 | ||
|
|
fc42b04537 | ||
|
|
da82403b55 | ||
|
|
c05245c891 | ||
|
|
1f70327112 | ||
|
|
78945768ec | ||
|
|
8eedf87ac3 | ||
|
|
4fc50fba1f | ||
|
|
4a4188a96b | ||
|
|
b0a66b687d | ||
|
|
6bb2036ebc | ||
|
|
d16608c94a | ||
|
|
338eca4eb6 | ||
|
|
0608713b6a | ||
|
|
6acd4f4df3 | ||
|
|
a14af67e2d | ||
|
|
a310df0704 | ||
|
|
ecd209b1d9 | ||
|
|
8aa857ea36 | ||
|
|
dbec714af8 | ||
|
|
5abe663cbe | ||
|
|
91c8fed5f4 | ||
|
|
1bf9b38cfb | ||
|
|
2698a730eb | ||
|
|
1ecbad497a | ||
|
|
a8dc576833 | ||
|
|
a052333296 | ||
|
|
0f218914a2 | ||
|
|
cc8814bf16 | ||
|
|
67ca368863 | ||
|
|
b6b0148495 | ||
|
|
ec0094e754 | ||
|
|
19284cad00 | ||
|
|
e86f093d31 | ||
|
|
5aa059bb24 | ||
|
|
1f43f5d514 | ||
|
|
85e3b6af0e | ||
|
|
7cb5135725 | ||
|
|
afde51ecf6 | ||
|
|
34d5583333 | ||
|
|
3acc5457b2 | ||
|
|
1f69ab7e3f | ||
|
|
a55cd86a4c | ||
|
|
996976d9f3 | ||
|
|
cc83099670 | ||
|
|
8e17dda79a | ||
|
|
861786f064 | ||
|
|
e30ad7ef9b | ||
|
|
8b87bd055e | ||
|
|
b9e9cb9377 | ||
|
|
f07bc950c6 | ||
|
|
3de0d7ae6e | ||
|
|
a2c8096b57 | ||
|
|
e7ccc7bf76 | ||
|
|
3e1ad050a8 | ||
|
|
60beaf8440 | ||
|
|
56f5c7b487 | ||
|
|
5b3db2f096 | ||
|
|
3e931443f7 | ||
|
|
afc821099a | ||
|
|
91cae70b5b | ||
|
|
c91047bb62 | ||
|
|
b4ba8f9225 | ||
|
|
28f6d59336 | ||
|
|
2987ae5a05 | ||
|
|
71274f8f08 | ||
|
|
1704875cea | ||
|
|
dd30ab8f93 | ||
|
|
68c93a17b3 | ||
|
|
64142d2158 | ||
|
|
21954505b2 | ||
|
|
d3ed765945 | ||
|
|
1c653c7cb1 | ||
|
|
4003c53dc4 | ||
|
|
7d55b94a91 | ||
|
|
f19f7ba936 | ||
|
|
6953d0f883 | ||
|
|
52857c208a | ||
|
|
a1b5f57f99 | ||
|
|
0757cc25ce | ||
|
|
fb163f8006 | ||
|
|
a37beef18e | ||
|
|
13c53b074c | ||
|
|
8bd133b488 | ||
|
|
e944a886b6 | ||
|
|
fa826aa87e | ||
|
|
4701f41e67 | ||
|
|
b1f7cf4bc7 | ||
|
|
fd596801e2 | ||
|
|
5591bc41b4 | ||
|
|
8f2fbe675a | ||
|
|
11b1688ae6 | ||
|
|
04a485ca77 | ||
|
|
7687b27e13 | ||
|
|
8660afc010 | ||
|
|
ddedce1671 | ||
|
|
15a1ff2f83 | ||
|
|
589f2b8124 | ||
|
|
2e8e09cb2c | ||
|
|
5f2f3bee0a | ||
|
|
9decb077d3 | ||
|
|
1290cbea15 | ||
|
|
bc7e4be47a | ||
|
|
21c0e27f2f | ||
|
|
6f2652f9dd | ||
|
|
5f95293e0d | ||
|
|
3fdc034f17 | ||
|
|
a7454b00b4 | ||
|
|
754b56aba0 | ||
|
|
5c7f5be5b9 | ||
|
|
05634adc66 | ||
|
|
f47d203215 | ||
|
|
546040541c | ||
|
|
7f6ea29e15 | ||
|
|
8f64460647 | ||
|
|
e5620b22e0 | ||
|
|
5525b927c1 | ||
|
|
402dc8cf42 | ||
|
|
b5f5c4f4b5 | ||
|
|
bcda1d51c4 | ||
|
|
f389226aae | ||
|
|
3ee04a6e75 | ||
|
|
07094f231a | ||
|
|
2c9b2c1d67 | ||
|
|
9dc95e086d | ||
|
|
94a19ee2b6 | ||
|
|
e82d7b5d8b | ||
|
|
16a9b18dad | ||
|
|
50e35e149c | ||
|
|
31500522ce | ||
|
|
293c0ceb9d | ||
|
|
5b3ea24725 | ||
|
|
fabc68d13f | ||
|
|
dfb2d625c9 | ||
|
|
4d1a6728f6 | ||
|
|
b6267e610a | ||
|
|
771d6c483a | ||
|
|
b48c135d6d | ||
|
|
6b36508388 | ||
|
|
d6b97399d4 | ||
|
|
8b930f7655 | ||
|
|
72d14770de | ||
|
|
cb3be2556b | ||
|
|
b5e613a794 | ||
|
|
faba5b0715 | ||
|
|
430aefe0f7 | ||
|
|
7c812df4e0 | ||
|
|
f1ad8b6cfd | ||
|
|
c8183fbbbf | ||
|
|
d4e94c0390 | ||
|
|
546a001092 | ||
|
|
7f546bb096 | ||
|
|
fca80de995 | ||
|
|
bbd754c198 | ||
|
|
d545e7e09d | ||
|
|
f3b277237e | ||
|
|
ceb621b9b5 | ||
|
|
75fedcb7e8 | ||
|
|
66c3694809 | ||
|
|
282e6f4cd7 | ||
|
|
ac143b2bbf | ||
|
|
3b1250f557 | ||
|
|
3e3ced946f | ||
|
|
2e72fa8445 | ||
|
|
dbd1fe3846 | ||
|
|
c087ac18d5 | ||
|
|
ab6a8fefd2 | ||
|
|
d8bcf52b3b | ||
|
|
7cbc14f4aa | ||
|
|
d3a8c8628e | ||
|
|
9b5d3aed97 | ||
|
|
e02164049e | ||
|
|
1de39ac39c | ||
|
|
309abc6150 | ||
|
|
f6c265dfa1 | ||
|
|
fef416ce84 | ||
|
|
0311ced7c3 | ||
|
|
8e85437b4b | ||
|
|
a68db7c80d | ||
|
|
e6916de532 | ||
|
|
14d5c9da6c | ||
|
|
b12d9abaf2 | ||
|
|
a5115414a8 | ||
|
|
dd896659ae | ||
|
|
ed7faae947 | ||
|
|
07a1ad8c58 | ||
|
|
4d5473ff14 | ||
|
|
616334284b | ||
|
|
fb38e0e21d | ||
|
|
7e14e9edd7 | ||
|
|
cc11e2de51 | ||
|
|
300db4602b | ||
|
|
cb3143e76d | ||
|
|
4c9b6adb1f | ||
|
|
5cab0e46bd | ||
|
|
da0136650e | ||
|
|
56e4739b98 | ||
|
|
3adc5dc119 | ||
|
|
ed73dbb5f3 | ||
|
|
7dd96ff6bd | ||
|
|
31b79d6471 | ||
|
|
d42e71fa9f | ||
|
|
2ae67c39fd | ||
|
|
008cbc964f | ||
|
|
ac638041fa | ||
|
|
b15d452981 | ||
|
|
d0eaf12b34 | ||
|
|
65eeab299d | ||
|
|
df6df4c5d3 | ||
|
|
ad49a63eae | ||
|
|
f67d596866 | ||
|
|
f8386062cf | ||
|
|
c4a2d87d70 | ||
|
|
00a3424f65 | ||
|
|
7b6d5f1642 | ||
|
|
82ea54863d | ||
|
|
fb8143991c | ||
|
|
86e01191d2 | ||
|
|
0535420334 | ||
|
|
54b467887b | ||
|
|
c59c5efc11 | ||
|
|
1557482d17 | ||
|
|
b9bb689796 | ||
|
|
e768d834c1 | ||
|
|
14c86d3d21 | ||
|
|
98c7c81fb8 | ||
|
|
4ea31c7124 | ||
|
|
c7226a16d2 | ||
|
|
422950d386 | ||
|
|
9b064cdcce | ||
|
|
3065b5fbf9 | ||
|
|
10313d9058 | ||
|
|
449897039c | ||
|
|
bff499caed | ||
|
|
9ab185a71c | ||
|
|
6116dda9bb | ||
|
|
0dc77997fe | ||
|
|
fe747b321c | ||
|
|
4f4c71d79b | ||
|
|
a2e95b960f | ||
|
|
373dfa7ad9 | ||
|
|
3d7d03b1f5 | ||
|
|
450c682e7f | ||
|
|
6cc8ab0fb4 | ||
|
|
da89315a10 | ||
|
|
5d08d5235d | ||
|
|
f2ea821948 | ||
|
|
0c647e0acb | ||
|
|
eb8b17efd7 | ||
|
|
57eeca5818 | ||
|
|
1adb095918 | ||
|
|
b5794e463f | ||
|
|
000cb93def | ||
|
|
91d41af44a | ||
|
|
6ca071a31f | ||
|
|
3f17e893b5 | ||
|
|
7178b49101 | ||
|
|
d267f408eb | ||
|
|
68fcfd2cf5 | ||
|
|
8c1621cced | ||
|
|
a615b04eb4 | ||
|
|
03df082cf2 | ||
|
|
b869c84f4d | ||
|
|
5752222baa | ||
|
|
d3ae4c5d72 | ||
|
|
e638511826 | ||
|
|
cb7f180d8d | ||
|
|
f82d78ad5d | ||
|
|
35a8fe7372 | ||
|
|
16c38b4066 | ||
|
|
8c942178d2 | ||
|
|
74021ae142 | ||
|
|
949f258f54 | ||
|
|
b1191917b8 | ||
|
|
ebceab96b4 | ||
|
|
b362c1f232 | ||
|
|
58c646f59e | ||
|
|
d1dda00a1c | ||
|
|
9f0253819b | ||
|
|
25d9c52c58 | ||
|
|
d90676a793 | ||
|
|
7a13e4a421 | ||
|
|
3fbf23cb47 | ||
|
|
90682b774a | ||
|
|
cf19331f75 | ||
|
|
e9d1f9d68f | ||
|
|
5081d6d916 | ||
|
|
f540ed4eb5 | ||
|
|
0f4325f68d | ||
|
|
7f0eb97f9b | ||
|
|
9272c15706 | ||
|
|
578b2811a5 | ||
|
|
01c6096998 | ||
|
|
2bb5c31a0f | ||
|
|
64994e6444 | ||
|
|
a4b780e7f7 | ||
|
|
7779ec376a | ||
|
|
07049909ef | ||
|
|
c7833beff4 | ||
|
|
d18fa771f4 | ||
|
|
1441ed9a99 | ||
|
|
0312548e88 | ||
|
|
ef04d6532a | ||
|
|
eacf383928 | ||
|
|
5f0429ef77 | ||
|
|
78a4c109e4 | ||
|
|
6ce2afa6a4 | ||
|
|
957f41ae87 | ||
|
|
4e8fddadff | ||
|
|
60433358f6 | ||
|
|
fb7091403c | ||
|
|
51ba6c757e | ||
|
|
943301e908 | ||
|
|
2a91dafe20 | ||
|
|
0b7443e875 | ||
|
|
1d455ec4fb | ||
|
|
439635d329 | ||
|
|
82fc148d8e | ||
|
|
9a9089cde3 | ||
|
|
2b53c4b918 | ||
|
|
04a08f9095 | ||
|
|
bf41c84c6a | ||
|
|
25b9e5b540 | ||
|
|
66f97738c2 | ||
|
|
59682ba620 | ||
|
|
860306b855 | ||
|
|
c1f4ee4e05 | ||
|
|
69895943bd | ||
|
|
ba0d33392c | ||
|
|
12bf7db481 | ||
|
|
406b9241ce | ||
|
|
974e02694e | ||
|
|
dc798c63c7 | ||
|
|
d30c9a2ff7 | ||
|
|
401eb60062 | ||
|
|
d25c5ec4dd | ||
|
|
6a9c2b8fdf | ||
|
|
0d282d29d8 | ||
|
|
af6b5f0ec5 | ||
|
|
164b46ece3 | ||
|
|
2972d95e8b | ||
|
|
2c5c0258bf | ||
|
|
31fbe434b4 | ||
|
|
21228b5359 | ||
|
|
05cc08c376 | ||
|
|
237476b30d | ||
|
|
7e9e89e1fd | ||
|
|
343339d510 | ||
|
|
9a524da5b4 | ||
|
|
b098dd1e15 | ||
|
|
e4144d8c6a | ||
|
|
9c60cf006f | ||
|
|
5def8c1635 | ||
|
|
f236896764 | ||
|
|
7e78bc6dd1 | ||
|
|
ba1a16b39e | ||
|
|
1a40c9ba17 | ||
|
|
218028de2b | ||
|
|
f758d0d943 | ||
|
|
3c20fe4202 | ||
|
|
958e783e77 | ||
|
|
bc64c82119 | ||
|
|
3da11ca7fb | ||
|
|
3f9769103b | ||
|
|
a3a33c0da4 | ||
|
|
54ce296018 | ||
|
|
8256f31374 | ||
|
|
30d64973c3 | ||
|
|
7b28a33aba | ||
|
|
0c93a5166b | ||
|
|
56f51703c7 | ||
|
|
7a26ade8de | ||
|
|
49b77f9ed0 | ||
|
|
289498296d | ||
|
|
bd1e5c83e6 | ||
|
|
8742c9302e | ||
|
|
95f2e63ac8 | ||
|
|
8f6f85ea8e | ||
|
|
8ff6e71729 | ||
|
|
5133d26f6f | ||
|
|
bebdb3a93f | ||
|
|
4fc84652c5 | ||
|
|
1c228c9ba9 | ||
|
|
5b961be0f8 | ||
|
|
2b771b11d6 | ||
|
|
fb9dccc94a | ||
|
|
639a262599 | ||
|
|
3186c2b37d | ||
|
|
f1e91af58a | ||
|
|
1a6b899c67 | ||
|
|
d9f909150d | ||
|
|
a73f6ffef5 | ||
|
|
ab5ffc7545 | ||
|
|
c48a22a58e | ||
|
|
fb6660b78a | ||
|
|
d48baf0cb5 | ||
|
|
7cfdf80a14 | ||
|
|
6b5cabb125 | ||
|
|
fc4725cd61 | ||
|
|
cdc4eccdd9 | ||
|
|
8c6452bb05 | ||
|
|
01798650fe | ||
|
|
5d7649a274 | ||
|
|
bbc3644e23 | ||
|
|
d933549646 | ||
|
|
1faa9f17ab | ||
|
|
038b6f9510 | ||
|
|
c7cc2d4357 | ||
|
|
5b675c25a3 | ||
|
|
c2ec309a01 | ||
|
|
5964c3b685 | ||
|
|
703e436b32 | ||
|
|
9b184a758e | ||
|
|
6c71bbbcb0 | ||
|
|
84f5de42a9 | ||
|
|
dcdc63679c | ||
|
|
92ba16aa7f | ||
|
|
c4940897a3 | ||
|
|
af50eb5462 | ||
|
|
511c219d19 | ||
|
|
8c2a4aeec4 | ||
|
|
04263cb69f | ||
|
|
4e4e4eca94 | ||
|
|
9177273484 | ||
|
|
b11f466a0a | ||
|
|
fca96864c6 | ||
|
|
56519b4072 | ||
|
|
2317930263 | ||
|
|
4af1dff6fd | ||
|
|
8f7876b850 | ||
|
|
855e220d14 | ||
|
|
5f2550e19c | ||
|
|
1974cb5217 | ||
|
|
51d441b4e9 | ||
|
|
60029ba1c3 | ||
|
|
ffe536a57f | ||
|
|
322719fec8 | ||
|
|
1e4da4850e | ||
|
|
e057314795 | ||
|
|
e0540ceb7c | ||
|
|
e6d12be7b3 | ||
|
|
23ecc40b1a | ||
|
|
ddc53e87fa | ||
|
|
424a00b39e | ||
|
|
d5e53cc7db | ||
|
|
90d2333eef | ||
|
|
0b61bd9a79 | ||
|
|
ef4feb07e6 | ||
|
|
357e97e1ca | ||
|
|
06f77b41fd | ||
|
|
36dbb3bdcc | ||
|
|
e1b09e49fd | ||
|
|
36b87971fb | ||
|
|
8b2ba97823 | ||
|
|
14008d1432 | ||
|
|
c1c09da18d | ||
|
|
0fd7b9a551 | ||
|
|
829b99bc06 | ||
|
|
28526b4544 | ||
|
|
9dce16e5c7 | ||
|
|
b4d9b1037d | ||
|
|
5d80c40b25 | ||
|
|
f836342ff2 | ||
|
|
402a91c841 | ||
|
|
181fa96431 | ||
|
|
96b2b2e065 | ||
|
|
f930565d45 | ||
|
|
14111583f1 | ||
|
|
a4d6d183ff | ||
|
|
0be8b9c313 | ||
|
|
91197bcff2 | ||
|
|
2a3262ef45 | ||
|
|
759d11d1a0 | ||
|
|
4fd6ebf5b7 | ||
|
|
f8a00a5f1e | ||
|
|
f7db5497af | ||
|
|
3ba196fec6 | ||
|
|
2ced9cdc2d | ||
|
|
407a1daebf | ||
|
|
f37d9d000c | ||
|
|
96cdb34d71 | ||
|
|
56a9a71248 | ||
|
|
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 | ||
|
|
4b555b4ef2 | ||
|
|
1657af8719 | ||
|
|
c9d30654e0 | ||
|
|
47ca350127 | ||
|
|
cc04e44031 | ||
|
|
eabad4917b | ||
|
|
6188e5b0e3 | ||
|
|
13ab7a598b | ||
|
|
bf2584da65 | ||
|
|
31cebccd5d | ||
|
|
3728e9b22c | ||
|
|
8a145eca92 | ||
|
|
14914fce44 | ||
|
|
6e3fdc1cf9 | ||
|
|
6ca68f6a2d | ||
|
|
fd4d3cbcfd | ||
|
|
75f49e2ee2 | ||
|
|
aca22a9c94 | ||
|
|
5a8ae0f75f | ||
|
|
6ef2be8c1a | ||
|
|
1b968c885b | ||
|
|
dc3f159c90 | ||
|
|
6ebb8dabc4 | ||
|
|
9e2dcf51d7 | ||
|
|
2d8b0181b3 | ||
|
|
accd6e7416 | ||
|
|
f5027695dd | ||
|
|
34696df700 | ||
|
|
8e9ddd3d50 | ||
|
|
eca941bdae | ||
|
|
bd6aba8875 | ||
|
|
58f6b558df | ||
|
|
7ba72269a4 | ||
|
|
76c4486d26 | ||
|
|
69d7889f02 | ||
|
|
04898c6114 | ||
|
|
7364dca53d | ||
|
|
90e7f7af0c | ||
|
|
878be08563 | ||
|
|
a98ae562b2 | ||
|
|
2aec6a10ed | ||
|
|
70ac914a86 | ||
|
|
169353c429 | ||
|
|
ede19946c2 | ||
|
|
dd488106af | ||
|
|
2489658353 | ||
|
|
61b12e3f25 | ||
|
|
c2ffb6d6bd | ||
|
|
4ef78df27f | ||
|
|
84d80d695a | ||
|
|
3cba61a8d8 | ||
|
|
16ccc273a9 | ||
|
|
95d47eb6c9 | ||
|
|
bfb3fb0a92 | ||
|
|
78ef2a4e23 | ||
|
|
a377c1e6c5 | ||
|
|
e67e2a85de | ||
|
|
be0470aec1 | ||
|
|
240178eba7 | ||
|
|
358ca61a26 | ||
|
|
b427212b00 | ||
|
|
5eef98fdfd | ||
|
|
57ac337ef7 | ||
|
|
64fe300e42 | ||
|
|
d4e5e32c14 | ||
|
|
d5e4182878 | ||
|
|
dd87a7374e | ||
|
|
7bc57ed269 | ||
|
|
5658717653 | ||
|
|
6c0fb007e4 | ||
|
|
0b898b9936 | ||
|
|
a261e84830 | ||
|
|
7e9b373a58 | ||
|
|
5698f8360e | ||
|
|
de7c438315 | ||
|
|
0669450676 | ||
|
|
507a62f52d | ||
|
|
77a7037072 | ||
|
|
577e9d3b70 | ||
|
|
2526512069 | ||
|
|
e91debcbb1 | ||
|
|
065fa0b58b | ||
|
|
db3c95ea10 | ||
|
|
8b417c044c | ||
|
|
5e3cfaf847 | ||
|
|
0f0dd91246 | ||
|
|
fd912dd161 | ||
|
|
98325a0f40 | ||
|
|
c43915c09d | ||
|
|
01bf814496 | ||
|
|
2ce517e84a | ||
|
|
e209989f2a | ||
|
|
5dfb74701c | ||
|
|
bdd583d251 | ||
|
|
fd8a1d8dc2 | ||
|
|
d2818f8020 | ||
|
|
80a0a34b46 | ||
|
|
6e41c0ad2c | ||
|
|
a07a9e6a88 | ||
|
|
7a94a43053 | ||
|
|
028524291e | ||
|
|
1ac304e5ac | ||
|
|
f266bb05c9 | ||
|
|
d8a8f76dc9 | ||
|
|
0afbe3d13b | ||
|
|
4917b9c057 | ||
|
|
13bfd62ac5 | ||
|
|
97703e7a0c | ||
|
|
13086d91d8 | ||
|
|
b7a10fdeda | ||
|
|
6806f896d6 | ||
|
|
87a2f86365 | ||
|
|
a647d48fbe | ||
|
|
6ea91f55e5 | ||
|
|
fb87129e29 | ||
|
|
79e5113e12 | ||
|
|
b75c9ddff6 | ||
|
|
35e14fde14 | ||
|
|
68f55f9596 | ||
|
|
3fec579f85 | ||
|
|
e2d69c664a | ||
|
|
836b6f2fdb | ||
|
|
72016a5735 | ||
|
|
f297058461 | ||
|
|
0f4d8d76ae | ||
|
|
12884c91a6 | ||
|
|
eba163fc4a | ||
|
|
8df6654ad0 | ||
|
|
1a5e43b6f7 | ||
|
|
c4c7f4b636 | ||
|
|
9aa0de16be | ||
|
|
cb636fe2c9 | ||
|
|
f93dc5643f | ||
|
|
974b151d02 | ||
|
|
8835dd0b65 | ||
|
|
626b791c67 | ||
|
|
82508587b3 | ||
|
|
0d7fa5728c | ||
|
|
29365838b3 | ||
|
|
13ac7ef66c | ||
|
|
6764747fa9 | ||
|
|
91df02916c | ||
|
|
bf400fc5f8 | ||
|
|
6cd73c9ebf | ||
|
|
ed9ab39c5e | ||
|
|
678bd1bcdc | ||
|
|
90fe548901 | ||
|
|
a158d4bfb9 | ||
|
|
4028e3ba5c | ||
|
|
f7d24e8870 | ||
|
|
b1bbb1847d | ||
|
|
fb6e231f77 | ||
|
|
5786644c76 | ||
|
|
51efba0a8d | ||
|
|
2f38de90e5 | ||
|
|
410bfe2c97 | ||
|
|
cfae5b7516 | ||
|
|
6e81c235d9 | ||
|
|
0257149316 | ||
|
|
ef331ccc81 | ||
|
|
b187114c50 | ||
|
|
fdefd4f1fe | ||
|
|
4ec32c0972 | ||
|
|
111e9bf64b | ||
|
|
7d3577d649 | ||
|
|
a8fb0a6d88 | ||
|
|
8d628daf83 | ||
|
|
010f30bc9e | ||
|
|
2273a11978 | ||
|
|
5c36b79277 | ||
|
|
f5127eccd1 | ||
|
|
e962f76b32 | ||
|
|
6d8521d8dc | ||
|
|
7b231bb755 | ||
|
|
459cbcc0dd | ||
|
|
44433ef86e | ||
|
|
cb8e83bdfa | ||
|
|
84eec155de | ||
|
|
73a059b318 | ||
|
|
39d38eea8d | ||
|
|
bfb7f28ff0 | ||
|
|
036ec68651 | ||
|
|
8cebcc8a5d | ||
|
|
fbcba3ef4e | ||
|
|
fca7b95579 | ||
|
|
73c05fb231 | ||
|
|
d0fb77f3e9 | ||
|
|
32cf6dfaef | ||
|
|
8ab86a05b2 | ||
|
|
79b913131e | ||
|
|
8fd910a92e | ||
|
|
2ce1a5abb5 | ||
|
|
8448a7141a | ||
|
|
21f9a24780 | ||
|
|
1b5e31e59d | ||
|
|
03afbc902d | ||
|
|
83b760a43b | ||
|
|
c0e67dc240 | ||
|
|
2166999fef | ||
|
|
7bb7cc6a00 | ||
|
|
8b96912ab4 | ||
|
|
de33ec509b | ||
|
|
5ecb43ba73 | ||
|
|
97ff3485b7 | ||
|
|
98daef7224 | ||
|
|
2983aa5737 | ||
|
|
9a906427e7 | ||
|
|
7841eebf08 | ||
|
|
b4597d54af | ||
|
|
19ffc9587a | ||
|
|
bbe0a0b3a5 | ||
|
|
0d30f71097 | ||
|
|
0cc5693180 | ||
|
|
045a62a9db | ||
|
|
725372b6ae | ||
|
|
9e77fecc29 | ||
|
|
44c47fa6eb | ||
|
|
448de78ea5 | ||
|
|
f3859052e5 | ||
|
|
2b4199e558 | ||
|
|
b7585585dc | ||
|
|
92b133b11d | ||
|
|
5dda57458a | ||
|
|
16efd1191a | ||
|
|
1c9d76725c | ||
|
|
4ee735a81f | ||
|
|
2ba8fa2785 | ||
|
|
e64e8cafa6 | ||
|
|
3949a6858b | ||
|
|
792d25fdd8 | ||
|
|
af5ef4b9dc | ||
|
|
bd79022475 | ||
|
|
684130871b | ||
|
|
7416a41a42 | ||
|
|
30f5902b88 | ||
|
|
35c631946d | ||
|
|
585d42f1b8 | ||
|
|
c3d44b4558 | ||
|
|
04e87cce98 | ||
|
|
4cd005051b | ||
|
|
e1987af34d | ||
|
|
17c6b11a1b | ||
|
|
7170fab884 | ||
|
|
7f82038255 | ||
|
|
c1cd0004bf | ||
|
|
b43a63d665 | ||
|
|
3794003e63 | ||
|
|
13aa19e5f4 | ||
|
|
28bb614489 | ||
|
|
085d25346d | ||
|
|
685267d6fc | ||
|
|
0401e6971a | ||
|
|
7e39a7bc60 | ||
|
|
c800e89414 | ||
|
|
e719731de0 | ||
|
|
fed9efff41 | ||
|
|
48ff2e6b6d | ||
|
|
370ccbdb74 | ||
|
|
c5a58e3f36 | ||
|
|
5fa0f4b87e | ||
|
|
7c68fa7bd0 | ||
|
|
7563907df5 | ||
|
|
def3d6d19e | ||
|
|
59453a47fa | ||
|
|
1b090377ee | ||
|
|
b0e11f5708 | ||
|
|
a819d81ef2 | ||
|
|
0a28ef2af6 | ||
|
|
1ba4164028 | ||
|
|
f9ad392e39 | ||
|
|
97b5439c0d | ||
|
|
1ff784198c | ||
|
|
05402a4a1c | ||
|
|
dd8fbf0900 | ||
|
|
c0e89bbd05 | ||
|
|
b0df4e46d6 | ||
|
|
5888927239 | ||
|
|
f263175802 | ||
|
|
bed069f269 | ||
|
|
8c896d60d6 | ||
|
|
adc627ca4e | ||
|
|
d654b18517 | ||
|
|
26510f0745 | ||
|
|
60f1db5caf | ||
|
|
549ccda166 | ||
|
|
c4024c8107 | ||
|
|
98f6ad183e | ||
|
|
8e84a4ff44 | ||
|
|
2c893fef25 | ||
|
|
e4a0cc73bd | ||
|
|
4c4b2a6df3 | ||
|
|
28f24fda72 | ||
|
|
3ff20e327f | ||
|
|
903b775f79 | ||
|
|
a25150babf | ||
|
|
a2f205bae3 | ||
|
|
a0125bb93e | ||
|
|
6329042d40 | ||
|
|
9d314aaa3f | ||
|
|
fc0a495f2d | ||
|
|
c9ee2ae7e0 | ||
|
|
4c27efa4ae | ||
|
|
c7e5df95e7 | ||
|
|
c3cc3d1f62 | ||
|
|
ba93265ac6 | ||
|
|
bf7df9a8d6 | ||
|
|
8b0966d332 | ||
|
|
aa90747089 | ||
|
|
efe54d8b56 | ||
|
|
1e816de8cf | ||
|
|
e3a78f0f84 | ||
|
|
d0c7706840 | ||
|
|
1a15cef76d | ||
|
|
dc44c67f86 | ||
|
|
ab819129dd | ||
|
|
8d966aebee | ||
|
|
4988600881 | ||
|
|
d381528c06 | ||
|
|
3d647a2c2e | ||
|
|
7e6180fed8 | ||
|
|
9e4ed645f7 | ||
|
|
9522e0cfb1 | ||
|
|
db36d57683 | ||
|
|
ddddbdfb18 | ||
|
|
df3ad9ed12 | ||
|
|
456875905d | ||
|
|
1707b5e7fd | ||
|
|
034d1b1c8e | ||
|
|
5dd915736b | ||
|
|
07d7908f6e | ||
|
|
cf53365007 | ||
|
|
1f2c1c1d2f | ||
|
|
51390d8add | ||
|
|
98120de7e1 | ||
|
|
88a2cb37c9 | ||
|
|
ec4d34d37a | ||
|
|
0b3d532028 | ||
|
|
4a0be40f92 | ||
|
|
2da59f1055 | ||
|
|
1ca1314ac4 | ||
|
|
426e46a2df | ||
|
|
212cb0140d | ||
|
|
8291c7d2ab | ||
|
|
1bd4c00631 | ||
|
|
69495b94af | ||
|
|
29c754e700 | ||
|
|
fd69fc22db | ||
|
|
c7bee4edf2 | ||
|
|
9756c792d7 | ||
|
|
a86f10a4b4 | ||
|
|
946c2507c5 | ||
|
|
56ac4b5c26 | ||
|
|
e4becfb1dd | ||
|
|
6129768711 | ||
|
|
72690e311f | ||
|
|
2ef067e12d | ||
|
|
ae71e3ad2a | ||
|
|
745621c416 | ||
|
|
069ccd24e6 | ||
|
|
76b5f813c5 | ||
|
|
9ad6616fa3 | ||
|
|
4dca2d6217 | ||
|
|
eab88abd54 | ||
|
|
ea3c49befe | ||
|
|
e1bfb2690d | ||
|
|
091f92400b | ||
|
|
18df961381 | ||
|
|
18c49e4c48 | ||
|
|
4da9d4c7c0 | ||
|
|
9a528532d2 | ||
|
|
96addebdf3 | ||
|
|
49adcb6886 | ||
|
|
ed86c2a892 | ||
|
|
7c7ef5be09 | ||
|
|
c269cd5c5c | ||
|
|
f6e0298d25 | ||
|
|
983e1ce6ad | ||
|
|
a87f1c5561 | ||
|
|
9d82f0d269 | ||
|
|
32b5bef221 | ||
|
|
50eec8d8a7 | ||
|
|
fc8373f6b6 | ||
|
|
1d3d8d0f28 | ||
|
|
b9e4adc634 | ||
|
|
3a3b35b2eb | ||
|
|
8a565532b2 | ||
|
|
02ba4b5f67 | ||
|
|
b032f5b2ba | ||
|
|
758111a7c1 | ||
|
|
ba124c99af | ||
|
|
776bb56b24 | ||
|
|
d2024e06ff | ||
|
|
8c8be45769 | ||
|
|
892d259805 | ||
|
|
13c624400e | ||
|
|
e184201327 | ||
|
|
059e36aa78 | ||
|
|
18aa8eb5d2 | ||
|
|
41acbc745c | ||
|
|
ab81004bf2 | ||
|
|
d80cf6525c | ||
|
|
247efb1c0a | ||
|
|
e1b62d3af4 | ||
|
|
b340221055 | ||
|
|
e16ea186dc | ||
|
|
ce2722d429 | ||
|
|
e0a195e3bc | ||
|
|
899a7ac189 | ||
|
|
fb4d379047 | ||
|
|
98c55435ae | ||
|
|
981f5840b3 | ||
|
|
4efdb0cd66 | ||
|
|
06dcaeacb5 | ||
|
|
14112bf5d7 | ||
|
|
c55ef54937 | ||
|
|
2e65de176b | ||
|
|
3b31cd8432 | ||
|
|
c1809fc084 | ||
|
|
090bdaaea8 | ||
|
|
611bec6849 | ||
|
|
8cf797374d | ||
|
|
20177e06fc | ||
|
|
d76df274f4 | ||
|
|
95b305b865 | ||
|
|
aa6f3d33eb | ||
|
|
b6e4dbd70a | ||
|
|
854986abcb | ||
|
|
c35407bc94 | ||
|
|
5752f7b64e | ||
|
|
23d4bee184 | ||
|
|
37988fa645 | ||
|
|
6c7ee0c222 | ||
|
|
108c4c25b3 | ||
|
|
095e54d88d | ||
|
|
70cb760862 | ||
|
|
738e629eec | ||
|
|
bd036a0fde | ||
|
|
f766c6f920 | ||
|
|
4588bc7f5c | ||
|
|
9e289a2380 | ||
|
|
f0edf97ac7 | ||
|
|
91195fda89 | ||
|
|
6161ad1bd3 | ||
|
|
f72d87228b | ||
|
|
4f0acd176a | ||
|
|
5f29b2cc4a | ||
|
|
164f1a921e | ||
|
|
94c4d52476 | ||
|
|
174739bc0c | ||
|
|
b777053133 | ||
|
|
d0c2888508 | ||
|
|
ff8afef614 | ||
|
|
a28b2e8115 | ||
|
|
b0e348a2c5 | ||
|
|
512abda38d | ||
|
|
963c7c4616 | ||
|
|
1690cadab9 | ||
|
|
9e7715430b | ||
|
|
4f69571e1c | ||
|
|
d4312fc481 | ||
|
|
f1d91dfef8 | ||
|
|
f198833f8c | ||
|
|
da99398561 | ||
|
|
436d141bd1 | ||
|
|
aa881560cc | ||
|
|
06ef81cc5b | ||
|
|
4a99e4ba57 | ||
|
|
2ba4137e7d | ||
|
|
72835c56ad | ||
|
|
d39cebc70e | ||
|
|
b80bdcbc4f | ||
|
|
c1e62e6be7 | ||
|
|
10330f8a7a | ||
|
|
18fb422a69 | ||
|
|
f8236dff7b | ||
|
|
8ccb898aa9 | ||
|
|
bad680cfdb | ||
|
|
5a070d6d91 | ||
|
|
07a3f76568 | ||
|
|
d07d63e240 | ||
|
|
67b95a301b | ||
|
|
926914788f | ||
|
|
6f9187d1bb | ||
|
|
84b8cda7ac | ||
|
|
75616cc727 | ||
|
|
b3d018c506 | ||
|
|
2508d855e3 | ||
|
|
a21f3c5a3f | ||
|
|
060115c5e9 | ||
|
|
697d972fba | ||
|
|
3f69c97874 | ||
|
|
85407abfb4 | ||
|
|
20d9be537a | ||
|
|
30d39d622d | ||
|
|
e58192edc2 | ||
|
|
d15e4a8270 | ||
|
|
45d7307a8f | ||
|
|
bf3ae3009f | ||
|
|
cb3d5f3488 | ||
|
|
efb416ae7c | ||
|
|
c98be3c04f | ||
|
|
6006b16c95 | ||
|
|
c149cbacf7 | ||
|
|
48d7110779 | ||
|
|
bd7f2c2654 | ||
|
|
5123b5fccd | ||
|
|
190c95baca | ||
|
|
975d46044d | ||
|
|
bf589cdec8 | ||
|
|
715e5f7a64 | ||
|
|
dfcb7160cb | ||
|
|
f5654d5931 | ||
|
|
2bf5fde0e5 | ||
|
|
be0099bf01 | ||
|
|
7a68dfc450 | ||
|
|
858a9ba6a4 | ||
|
|
f2809c47ac | ||
|
|
616fb77de5 | ||
|
|
b03d41087a | ||
|
|
724e88b94f | ||
|
|
3c802038f2 | ||
|
|
fe385b7800 | ||
|
|
38b57117e2 | ||
|
|
7e47383ee3 | ||
|
|
ae3d954766 | ||
|
|
52da7ad40f | ||
|
|
309e613c83 | ||
|
|
05857985f8 | ||
|
|
a7523bbdea | ||
|
|
54deec87d0 | ||
|
|
f0e084ef0e | ||
|
|
fa7bb53d58 | ||
|
|
6fc8cce8f5 | ||
|
|
2e597ef7d9 | ||
|
|
ff611fa8dc | ||
|
|
c920bf6a63 | ||
|
|
66ebfaf21b | ||
|
|
349fa7a761 | ||
|
|
81bd9d945d | ||
|
|
b205f8ea5d | ||
|
|
7b52c0c78c | ||
|
|
164650adc3 | ||
|
|
9e97e82990 | ||
|
|
cd5cef51e8 | ||
|
|
231159a6c6 | ||
|
|
a83031504f | ||
|
|
893fd0774c | ||
|
|
704188fe27 | ||
|
|
a621fd3b09 | ||
|
|
0c43c5d2b5 | ||
|
|
864331d371 | ||
|
|
f5ec759d99 | ||
|
|
b2e2590324 | ||
|
|
ae4a7ff943 | ||
|
|
a869bc58cd | ||
|
|
cfa07bab47 | ||
|
|
b664917147 | ||
|
|
b12392f0a9 | ||
|
|
b07d6ceeaa | ||
|
|
aff6d82321 | ||
|
|
91cecf8c1e | ||
|
|
702b52d13e | ||
|
|
bb3fddb08f | ||
|
|
7cc17b9ca5 | ||
|
|
f30887e3c0 | ||
|
|
0d7afc5c24 | ||
|
|
826f1378d2 | ||
|
|
6d8b22dccf | ||
|
|
26c3c8e6f0 | ||
|
|
0f6cc05089 | ||
|
|
08814f8c9a | ||
|
|
632eb98df9 | ||
|
|
909c983aec | ||
|
|
8642254175 | ||
|
|
7e81b0bb5a | ||
|
|
22a48cac33 | ||
|
|
20eaa7bc08 | ||
|
|
1605d2af07 | ||
|
|
abb94c9189 | ||
|
|
cadb6618ec | ||
|
|
594512404f | ||
|
|
aeb8655cc3 | ||
|
|
601d16b17c | ||
|
|
02616d3080 | ||
|
|
2bf5e90a77 | ||
|
|
75bc6d32ab | ||
|
|
3e0b551416 | ||
|
|
a038e35e45 | ||
|
|
6318e5514b | ||
|
|
392db944a2 | ||
|
|
b097c19c0a | ||
|
|
b46d3a3769 | ||
|
|
a2172329cd | ||
|
|
309b70c0f8 | ||
|
|
4b9ed8ee39 | ||
|
|
2599f61b32 | ||
|
|
9a4359e010 | ||
|
|
4d89f614e3 | ||
|
|
4fad0def1e | ||
|
|
c093783904 | ||
|
|
257855b43b | ||
|
|
55ec20be10 | ||
|
|
b0f355ba2f | ||
|
|
ceb8619552 | ||
|
|
6191ee6fba | ||
|
|
c9256c0020 | ||
|
|
592c9ed0b9 | ||
|
|
4a1decf359 | ||
|
|
ae42e87a64 | ||
|
|
5c330505ea | ||
|
|
c65d95c1ef | ||
|
|
2b366c8f23 | ||
|
|
e66dde2e64 | ||
|
|
f32a1921c5 | ||
|
|
0958d07f23 | ||
|
|
a222114d0a | ||
|
|
243b68cc37 | ||
|
|
2f30d85d32 | ||
|
|
ca07621de7 | ||
|
|
e5a1b504d7 | ||
|
|
20aac1ccd4 | ||
|
|
bda652f947 | ||
|
|
87912a9e07 | ||
|
|
0bf430e0c1 | ||
|
|
d2aaf84eff | ||
|
|
b5ebe48715 | ||
|
|
9a61a56732 | ||
|
|
81d6a856d9 | ||
|
|
344ca827e4 | ||
|
|
1c4ecdffbf | ||
|
|
831ee221f6 | ||
|
|
6409fb2dbe | ||
|
|
662f537a0d | ||
|
|
8e0bfe9d09 | ||
|
|
8930d2a1bf | ||
|
|
d9ec214e17 | ||
|
|
dfb5d33a56 | ||
|
|
b42a7b1b26 | ||
|
|
a468fe50df | ||
|
|
c1875132ef | ||
|
|
332e29be24 | ||
|
|
c93e2678f7 | ||
|
|
f8fe4be3ef | ||
|
|
689ca853c3 | ||
|
|
8310e8554b | ||
|
|
b56414ed0e | ||
|
|
5480fcbf5d | ||
|
|
26b9c030b5 | ||
|
|
aef528bea1 | ||
|
|
d5b9ad3452 | ||
|
|
5437fcdc89 | ||
|
|
b9653c5abd | ||
|
|
eabc78c84f | ||
|
|
033393880d | ||
|
|
6bcfb81c6c | ||
|
|
b2ac1fb593 | ||
|
|
8c6ae4f3a3 | ||
|
|
131efc544d | ||
|
|
5524ff7cae | ||
|
|
603e14913b | ||
|
|
160474f2b6 | ||
|
|
168738b23a | ||
|
|
133af365bd | ||
|
|
532551263d | ||
|
|
bdfd601dae | ||
|
|
9619abdad7 | ||
|
|
fd287e7be4 | ||
|
|
5afdbae83a | ||
|
|
7c96164770 | ||
|
|
60defd3cdf | ||
|
|
8978dd3a4b | ||
|
|
1e45da2410 | ||
|
|
2da2912c9c | ||
|
|
4d12a4f37b | ||
|
|
350e3d733a | ||
|
|
81602f17be | ||
|
|
df5fb963c1 | ||
|
|
0fc2fbaf09 | ||
|
|
a82d5cf764 | ||
|
|
2c1f76e6a4 | ||
|
|
d068477a93 | ||
|
|
4663f8c6ec | ||
|
|
dd371c72a2 | ||
|
|
6f91bece17 | ||
|
|
5c30961d3c | ||
|
|
edd5ef0ca0 | ||
|
|
6befe85656 | ||
|
|
27f8c8b438 | ||
|
|
fc0c796b68 | ||
|
|
482e8c9a11 | ||
|
|
7a664a9990 | ||
|
|
372ab5d9c8 | ||
|
|
de70dbb888 | ||
|
|
4d7ceb9efe | ||
|
|
bb792f228f | ||
|
|
017396197e | ||
|
|
216f013c96 | ||
|
|
05f1bf0a1f | ||
|
|
295fbae6f5 | ||
|
|
ca4c93ac92 | ||
|
|
13b1503bf2 | ||
|
|
2980397545 | ||
|
|
5612720342 | ||
|
|
4d3fa6eca5 | ||
|
|
05b4c58aa8 | ||
|
|
f290497b64 | ||
|
|
b4dd35eed2 | ||
|
|
ec21e28000 | ||
|
|
0aa707ebc9 | ||
|
|
f38a0fd8b6 | ||
|
|
a6b2daa77d | ||
|
|
7ae31496ac | ||
|
|
c62dd2ecf4 | ||
|
|
840b5ea229 | ||
|
|
d8a3015303 | ||
|
|
194b7863b8 | ||
|
|
f034695290 | ||
|
|
f896fe11a0 | ||
|
|
2603a9c869 | ||
|
|
fcd0dddfd5 | ||
|
|
3fb92259a8 | ||
|
|
54d7b01ac5 | ||
|
|
ca0ab1f97a | ||
|
|
f3733ca249 | ||
|
|
7442bf7347 | ||
|
|
6ac3cb2014 | ||
|
|
ca76e572a2 | ||
|
|
c3fb6f6a1c | ||
|
|
1796a8ff17 | ||
|
|
52c7839b9b | ||
|
|
d16a7b2089 | ||
|
|
9a00a67f71 | ||
|
|
6e651200ca | ||
|
|
29968e6026 | ||
|
|
8c61773280 | ||
|
|
29433ce963 | ||
|
|
eed3a91385 | ||
|
|
62006d584e | ||
|
|
bba872618a | ||
|
|
941dd14c72 | ||
|
|
f2a79d4d96 | ||
|
|
281b131c62 | ||
|
|
4bcdfc0786 | ||
|
|
9312e4967e | ||
|
|
6b44dfe9b2 | ||
|
|
ba58991d11 | ||
|
|
84abb33e54 | ||
|
|
07a4f045f1 | ||
|
|
f49cb81e49 | ||
|
|
b2b9d4e31a | ||
|
|
d40d1f30b6 | ||
|
|
9aaadb1f8b | ||
|
|
3969ef63c5 | ||
|
|
d8abe30c44 | ||
|
|
eaa10ce6a5 | ||
|
|
c434249616 | ||
|
|
b849a5f29a | ||
|
|
3dc6a64252 | ||
|
|
ebd636494a | ||
|
|
07caf55f79 | ||
|
|
73868b7947 | ||
|
|
af55fe5b82 | ||
|
|
de408347fc | ||
|
|
ea96039128 | ||
|
|
c49539258e | ||
|
|
64653a2bb1 | ||
|
|
732c6e3a78 | ||
|
|
66a4309fe5 | ||
|
|
57277eb1e3 | ||
|
|
148b2fc1be | ||
|
|
cf4f15a83c | ||
|
|
297f3f638c | ||
|
|
d2a9fa8632 | ||
|
|
a5251824ae | ||
|
|
cb31c5258d | ||
|
|
5540b02e35 | ||
|
|
e725b48c4c | ||
|
|
45c0915b59 | ||
|
|
1e03946df7 | ||
|
|
dd3e5e9c6b | ||
|
|
421c29c491 | ||
|
|
15b62aae04 | ||
|
|
181848290f | ||
|
|
b263b211a5 | ||
|
|
1753d2895b | ||
|
|
64ebb0ca38 | ||
|
|
bab982a0e6 | ||
|
|
c2c5178831 | ||
|
|
56e8e32965 | ||
|
|
47cd30a45e | ||
|
|
bd8f659272 | ||
|
|
82c719d786 | ||
|
|
dc22ff6aa3 | ||
|
|
c68682b084 | ||
|
|
aa8a7ee0a9 | ||
|
|
e95a917812 | ||
|
|
332e627007 | ||
|
|
a3201481f6 | ||
|
|
dae233dd05 | ||
|
|
9aa2cc269b | ||
|
|
434f202832 | ||
|
|
552d58848c | ||
|
|
bea1677d5d | ||
|
|
a2e0de23e1 | ||
|
|
ebb33c9cee | ||
|
|
22414096ad | ||
|
|
9db7434876 | ||
|
|
9fabfd539d | ||
|
|
54f6c3e019 | ||
|
|
5930ab1c9d | ||
|
|
3870cc1002 | ||
|
|
f880e1c9f1 | ||
|
|
9285a169dd | ||
|
|
95b7b57fc6 | ||
|
|
872928fb38 | ||
|
|
cb2f094e3d | ||
|
|
b11b423217 | ||
|
|
567827e2cb | ||
|
|
ec1bd6e19a | ||
|
|
d4cd827284 | ||
|
|
50f85fb6d0 | ||
|
|
9cc69e5b3d | ||
|
|
d9e8f43298 | ||
|
|
ad7cf52f21 | ||
|
|
398d45deae | ||
|
|
541ab1fe6e | ||
|
|
c0fddbce81 | ||
|
|
2284706e0c | ||
|
|
a4f72cbb40 | ||
|
|
d1c776b706 | ||
|
|
8ef315014c | ||
|
|
2d59e569df | ||
|
|
202eb0931f | ||
|
|
4cd1a8d656 | ||
|
|
01a363456e | ||
|
|
8f4da0638e | ||
|
|
3e6c3d725b | ||
|
|
95a18be5c5 | ||
|
|
8030aae37a | ||
|
|
0eaa81b503 | ||
|
|
c2b864a20f | ||
|
|
e00cb8926d | ||
|
|
afb2bce16d | ||
|
|
1033f502b1 | ||
|
|
ab18d94053 | ||
|
|
9afbe7fb71 | ||
|
|
5e0270e6a8 | ||
|
|
c6962b0992 | ||
|
|
9fdcd09089 | ||
|
|
338cf161d2 | ||
|
|
044ce6662a | ||
|
|
d574233f49 | ||
|
|
02c6545c94 | ||
|
|
c795cd3320 | ||
|
|
1ebde2e6a4 | ||
|
|
78ee141b26 | ||
|
|
d11ddd910f | ||
|
|
437446c49d | ||
|
|
7a603596c5 | ||
|
|
c2a91ed623 | ||
|
|
3dcd2b9a3e | ||
|
|
75622d4737 | ||
|
|
7a617d0aa4 | ||
|
|
ccca077df7 | ||
|
|
5c008adf16 | ||
|
|
4502f7ddf5 | ||
|
|
f9101f880b | ||
|
|
5ed0c3f2f3 | ||
|
|
9907775c0d | ||
|
|
ed9d4a5744 | ||
|
|
c1aea2795e | ||
|
|
3a8996aee2 | ||
|
|
e67aefe48b | ||
|
|
602c38dbeb | ||
|
|
f1c232cef9 | ||
|
|
3d4b56b233 | ||
|
|
d8994ca65b | ||
|
|
18514f0180 | ||
|
|
001786dd97 | ||
|
|
225539d2e7 | ||
|
|
1b18ec45be | ||
|
|
7b6bbcec48 | ||
|
|
56276a19d1 | ||
|
|
c00abc3b92 | ||
|
|
301dadaa02 | ||
|
|
559bd6d892 | ||
|
|
18b45c749d | ||
|
|
2c00f982d8 | ||
|
|
54200427ab | ||
|
|
f8996ad767 | ||
|
|
9838ff4da5 | ||
|
|
192e00c717 | ||
|
|
43ca4a28e4 | ||
|
|
16e9fd6bd9 | ||
|
|
16f547bce0 | ||
|
|
60a482dce6 | ||
|
|
9540cb158c | ||
|
|
1984aced9d | ||
|
|
ca2949da71 | ||
|
|
eb8449fd79 | ||
|
|
547140bafb | ||
|
|
d245bca445 | ||
|
|
5f899a5510 | ||
|
|
432645431c | ||
|
|
30087548b0 | ||
|
|
d93cfff172 | ||
|
|
e5053bad15 | ||
|
|
1519db1637 | ||
|
|
b0326c640c | ||
|
|
7e4164da26 | ||
|
|
fad607c6e8 | ||
|
|
d6b56262ce | ||
|
|
c409d8a6ba | ||
|
|
4274b8a737 | ||
|
|
60c1babd93 | ||
|
|
ec6ddd054d | ||
|
|
76c200a56c | ||
|
|
a44be363a6 | ||
|
|
304926260f | ||
|
|
462fca7328 | ||
|
|
884b2ed913 | ||
|
|
af77453bfe | ||
|
|
fa45de6586 | ||
|
|
b4e8458076 | ||
|
|
979b1b0ad8 | ||
|
|
2bee58166b | ||
|
|
3597a89da3 | ||
|
|
f406962dfd | ||
|
|
ce31a0b3fd | ||
|
|
fc2ae594cb | ||
|
|
58c14376d6 | ||
|
|
91c2d4efbe | ||
|
|
e4c12b2c77 | ||
|
|
75d8d0b397 | ||
|
|
f1f7d7dd14 | ||
|
|
06e44b6e2b | ||
|
|
41c07d5b71 | ||
|
|
d198729222 | ||
|
|
4a3e02c1f0 | ||
|
|
074d85b40f | ||
|
|
3ff85e167c | ||
|
|
2e198dbe5c | ||
|
|
dc428b7de2 | ||
|
|
06a55ef91e | ||
|
|
ed0ede645a | ||
|
|
79b839c024 | ||
|
|
02797d9abc | ||
|
|
97d035eee9 | ||
|
|
9799e05ce4 | ||
|
|
98c8f519a6 | ||
|
|
6197a97dc1 | ||
|
|
6a85c37b48 | ||
|
|
a1e4374ada | ||
|
|
58835ef81f | ||
|
|
16751d7446 | ||
|
|
e95710d599 | ||
|
|
b366f04743 | ||
|
|
f3c74bd718 | ||
|
|
8e1a1043a5 | ||
|
|
1664896062 | ||
|
|
ec474e2b4c | ||
|
|
84ee5a2192 | ||
|
|
a24db0ca6d | ||
|
|
56c8e90700 | ||
|
|
e9d438f8cf | ||
|
|
41e769d681 | ||
|
|
d8b6d87ade | ||
|
|
506c5ac27a | ||
|
|
c6ba9df18a | ||
|
|
4229d8dda4 | ||
|
|
3b157a8c66 | ||
|
|
b8c2047379 | ||
|
|
28461de7bc | ||
|
|
c51840e760 | ||
|
|
a21d19bdcd | ||
|
|
6c4d9ccbf7 | ||
|
|
d56afda274 | ||
|
|
b8bfd7ff4c | ||
|
|
d1a3defef0 | ||
|
|
08f36243e9 | ||
|
|
e4887362ec | ||
|
|
290d06e2c4 | ||
|
|
9260319ac1 | ||
|
|
78ab90f469 | ||
|
|
34767a14d5 | ||
|
|
d7388f20e6 | ||
|
|
8f488d7701 | ||
|
|
7f56e98009 | ||
|
|
a840905166 | ||
|
|
3757db28f4 | ||
|
|
d31589ba99 | ||
|
|
45b6d8d571 | ||
|
|
11b2d0e1d2 | ||
|
|
d7fc9cde57 | ||
|
|
b162fb6e99 | ||
|
|
2f6e34d878 | ||
|
|
a47ab55cdd | ||
|
|
dd4cfebe75 | ||
|
|
818268482e | ||
|
|
8431a82f2c | ||
|
|
2444158bbb | ||
|
|
003005f295 | ||
|
|
731427255e | ||
|
|
468d20ee57 | ||
|
|
d994379130 | ||
|
|
cd806b19f7 | ||
|
|
e17a2eff4a | ||
|
|
690b25a6f5 | ||
|
|
e31c828f35 | ||
|
|
cdd97b142f | ||
|
|
b2f815617c | ||
|
|
11d358133e | ||
|
|
0e77d5ab94 | ||
|
|
51152ef026 | ||
|
|
f5dc8aa1c9 | ||
|
|
ceaa0fcf5c | ||
|
|
cc372ba89b | ||
|
|
526eb84b71 | ||
|
|
14e54ff41a | ||
|
|
aa76ae4ddc | ||
|
|
f1b7d731bd | ||
|
|
e3587fb346 | ||
|
|
e5c649aba3 | ||
|
|
4a3b64b497 | ||
|
|
54e2f83b17 | ||
|
|
a95233041e | ||
|
|
5165cac4e2 | ||
|
|
d31c4fa37c | ||
|
|
084e72968a | ||
|
|
6ab8cb1d7c | ||
|
|
6589653667 | ||
|
|
c3753478f2 | ||
|
|
b63fc5b508 | ||
|
|
3d2cb879b0 | ||
|
|
8366e57512 | ||
|
|
1c369e5503 | ||
|
|
83f40401be | ||
|
|
19456e9b30 | ||
|
|
7d2c64ce63 | ||
|
|
3f790bc334 | ||
|
|
164e1108e5 | ||
|
|
8fe20251f3 | ||
|
|
a121363dd2 | ||
|
|
7ec777c9dd | ||
|
|
77aa58a0a3 | ||
|
|
1e8bc553b8 | ||
|
|
6df08f6b9a | ||
|
|
5e9e2996d7 | ||
|
|
6f8aa1cbc0 | ||
|
|
b22e70804b | ||
|
|
5789e9a8a4 | ||
|
|
6c55a40606 | ||
|
|
b4f90730cc | ||
|
|
50317da185 | ||
|
|
631e36f4d5 | ||
|
|
a400fc9c65 | ||
|
|
5f9962b6ba | ||
|
|
d6dc71436a | ||
|
|
b6f99958fd | ||
|
|
9a89f06bf0 | ||
|
|
843845a825 | ||
|
|
0b93ba3dde | ||
|
|
bd36145ad6 | ||
|
|
88ccf5b869 | ||
|
|
5866293a25 | ||
|
|
d2711889de | ||
|
|
82af43f598 | ||
|
|
7a36f5edac | ||
|
|
480d21f555 | ||
|
|
2e7133d619 | ||
|
|
85f707af8a | ||
|
|
970a119f23 | ||
|
|
7faebbb197 | ||
|
|
08d505b308 | ||
|
|
1b0649d0cf | ||
|
|
e5c16439e1 | ||
|
|
151d8f8c5c | ||
|
|
08563e9298 | ||
|
|
b51f0821cb | ||
|
|
339d84736e | ||
|
|
7ea1de2a92 | ||
|
|
be373e278f | ||
|
|
61eab6fd93 | ||
|
|
c2b0714b4a | ||
|
|
5c1079e04b | ||
|
|
257f65bd1b | ||
|
|
96ff346e54 | ||
|
|
076b6143ce | ||
|
|
1e3262d691 | ||
|
|
94af32fb82 | ||
|
|
1f63ea10a0 | ||
|
|
fa60c17dbc | ||
|
|
b4c7fb574c | ||
|
|
83fa0059de | ||
|
|
d97957e558 | ||
|
|
b14ab6b1c1 | ||
|
|
b029fe113e | ||
|
|
477c99b4de | ||
|
|
1ce5cf6c00 | ||
|
|
f7441df895 | ||
|
|
69443d95d5 | ||
|
|
11e923453e | ||
|
|
28115e6b1d | ||
|
|
68fa0e6576 | ||
|
|
8d8da0986a | ||
|
|
e0e748a0bc | ||
|
|
02654a256d | ||
|
|
552c6e6cf9 | ||
|
|
86dc57c2cc | ||
|
|
11eb08e031 | ||
|
|
4a4acc5c01 | ||
|
|
899663350d | ||
|
|
689a1fdbd2 | ||
|
|
cec5f33870 | ||
|
|
bd9ef50e94 | ||
|
|
68d579b629 | ||
|
|
0404618c24 | ||
|
|
9b5ce83e8b | ||
|
|
7379398d22 | ||
|
|
d1106dd984 | ||
|
|
b775c2f60e | ||
|
|
407a7c01aa | ||
|
|
64d068659f | ||
|
|
e33d7b756f | ||
|
|
283e272b99 | ||
|
|
31d08d532c | ||
|
|
5acd51fdd3 |
53
.drone.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
kind: pipeline
|
||||
name: deploy-froxlor
|
||||
type: docker
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: arm64
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- upgrade-2.0
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
|
||||
environment:
|
||||
DEPLOY_HOST: rechner.maketank.net
|
||||
DEPLOY_DIR: ~/froxlor-test
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
image: cr.wks/drone/drone-rsync:latest
|
||||
settings:
|
||||
hosts: ["rechner02.maketank.net"]
|
||||
source: ./
|
||||
target: ~/froxlor-test
|
||||
user: www-data
|
||||
exclude: ['vendor', '.git*', '*drone.yml', '.settings', '.buildpath', '.editorconfig', '.project', '.travis.yml', 'node_modules']
|
||||
args: '-v --delete'
|
||||
log_level: quiet
|
||||
key:
|
||||
from_secret: ssh-www-data-maketank-rsa
|
||||
command_timeout: 10m
|
||||
- name: compose
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
- rechner02.maketank.net
|
||||
username: www-data
|
||||
key:
|
||||
from_secret: ssh-www-data-maketank-rsa
|
||||
script:
|
||||
- cd ~/froxlor-test && composer install --no-dev
|
||||
- name: npm
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
- rechner02.maketank.net
|
||||
username: www-data
|
||||
key:
|
||||
from_secret: ssh-www-data-maketank-rsa
|
||||
script:
|
||||
- cd ~/froxlor-test && npm install && npm run build
|
||||
19
.editorconfig
Normal file
@@ -0,0 +1,19 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
31
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# Contribution
|
||||
|
||||
Before you start working on a PR, contact us via [Discord](https://discord.froxlor.org) or the forum at [https://forum.froxlor.org](https://forum.froxlor.org) to get a clue whether someone else isn't already working on it or if we don not want/need this certain change. Of course, bugfixes are always welcome.
|
||||
|
||||
Please always focus on the **main** branch of our [Github repository](https://github.com/Froxlor/Froxlor).
|
||||
|
||||
## Checklist
|
||||
|
||||
General rules for PRs are:
|
||||
|
||||
* Please save us all some trouble and unnecessary round-trips by _testing_ your changes.
|
||||
* Re-write your commit history to provide a CLEAN history!
|
||||
* i.e. do not provide PRs which contain a commit that changes something, the next changes it back, a third one changes it again, only a little differently...
|
||||
|
||||
Thanks!
|
||||
|
||||
### Service changes
|
||||
|
||||
If you make changes to the functionality of service configurations, please make sure your implementation covers all supported services and distributions.
|
||||
|
||||
### l10n
|
||||
|
||||
If you add new language strings, please make sure you add the english fallback strings in `lng/en.php`.
|
||||
|
||||
### New settings and database-layout changes
|
||||
|
||||
If you add new settings or implement database-changes, please make sure you add these to
|
||||
|
||||
* `install/froxlor.sql.php`
|
||||
* handle the update (see [`install/updates/froxlor/update_2.x.inc.php`](https://github.com/Froxlor/Froxlor/blob/main/install/updates/froxlor/update_2.x.inc.php))
|
||||
* if you have any question on how update-process works, please contact us
|
||||
4
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: d00p
|
||||
custom: ['https://paypal.me/Froxlor']
|
||||
49
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# 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 irc.libera.chat
|
||||
* or post a thread in our forum at https://forum.froxlor.org
|
||||
|
||||
As a rule of thumb: before reporting an issue
|
||||
|
||||
* see if it hasn't been [reported](https://github.com/Froxlor/froxlor/issues) (and possibly already been [fixed](https://github.com/Froxlor/froxlor/issues?utf8=✓&q=is:issue%20is:closed)) first
|
||||
* try with the git master
|
||||
|
||||
# Summary
|
||||
|
||||
Please provide a concise summary of the problem you're experiencing...
|
||||
|
||||
# System information
|
||||
|
||||
* Froxlor version: $version/$gitSHA1
|
||||
* Web server: apache2/nginx/lighttpd
|
||||
* DNS server: Bind/PowerDNS (standalone)/PowerDNS (Bind-backend)
|
||||
* POP/IMAP server: Courier/Dovecot
|
||||
* SMTP server: postfix/exim
|
||||
* FTP server: proftpd/pureftpd
|
||||
* OS/Version: ...
|
||||
|
||||
# Steps to reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Expected behavior
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Actual behavior
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
# Log files/log entries
|
||||
|
||||
syslog:
|
||||
<pre>
|
||||
example
|
||||
</pre>
|
||||
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
@@ -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.
|
||||
22
.github/LICENSE_HEADER
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
37
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Description
|
||||
|
||||
Please include a summary of the change and which issue is fixed if any. Please also include relevant motivation and context. List any dependencies that are required for this change.
|
||||
|
||||
Fixes # (issue)
|
||||
|
||||
## Type of change
|
||||
|
||||
Please delete options that are not relevant.
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] This change requires a documentation update
|
||||
|
||||
# How Has This Been Tested?
|
||||
|
||||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
|
||||
|
||||
- [ ] Test A
|
||||
- [ ] Test B
|
||||
|
||||
**Test Configuration**:
|
||||
|
||||
* Distribution:
|
||||
* Webserver:
|
||||
* PHP:
|
||||
* etc.etc.:
|
||||
|
||||
# Checklist:
|
||||
|
||||
- [ ] I have performed a self-review of my own code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] I have made corresponding changes to the documentation
|
||||
- [ ] My changes generate no new warnings
|
||||
- [ ] I have added tests that prove my fix is effective or that my feature works
|
||||
- [ ] New and existing unit tests pass locally with my changes
|
||||
14
.github/workflows/build-docs.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: build-documentation
|
||||
|
||||
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-and-deploy.yml -f type=tags ref=${{github.ref_name}}
|
||||
81
.github/workflows/build-mariadb.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
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.1']
|
||||
mariadb-version: [10.5, 10.4]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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, gmp
|
||||
|
||||
- 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'@'%';"
|
||||
php -r "echo include('install/froxlor.sql.php');" > /tmp/froxlor.sql
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < /tmp/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 }}
|
||||
59
.github/workflows/build-mysql.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
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.1']
|
||||
mysql-version: [8.0, 5.7]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- 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, gmp
|
||||
|
||||
- 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'@'%';"
|
||||
php -r "echo include('install/froxlor.sql.php');" > /tmp/froxlor.sql
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < /tmp/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'@'%';"
|
||||
php -r "echo include('install/froxlor.sql.php');" > /tmp/froxlor.sql
|
||||
mysql -h 127.0.0.1 --protocol=TCP -u root -pfr0xl0r.TravisCI froxlor010 < /tmp/froxlor.sql
|
||||
|
||||
- name: Run testing
|
||||
run: ant quick-build
|
||||
22
.gitignore
vendored
@@ -1,11 +1,27 @@
|
||||
templates/*
|
||||
logs/*
|
||||
install/update.log
|
||||
install/*.json
|
||||
lib/userdata.inc.php
|
||||
lib/userdata.inc.php.bak
|
||||
lib/config.inc.php
|
||||
logs/*
|
||||
!logs/index.html
|
||||
.buildpath
|
||||
.project
|
||||
.settings/
|
||||
.test/
|
||||
*.diff
|
||||
*~
|
||||
.well-known
|
||||
.idea
|
||||
*.iml
|
||||
*.iml
|
||||
img/
|
||||
vendor/
|
||||
node_modules/
|
||||
fonts/
|
||||
!templates/index.html
|
||||
!templates/Froxlor/
|
||||
templates/Froxlor/assets/mix-manifest.json
|
||||
templates/Froxlor/assets/css/
|
||||
templates/Froxlor/assets/js/
|
||||
templates/Froxlor/assets/webfonts/
|
||||
!templates/misc/
|
||||
|
||||
154
2fa.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
if (!defined('AREA')) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\FroxlorTwoFactorAuth;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\User;
|
||||
|
||||
if (Settings::Get('2fa.enabled') != '1') {
|
||||
Response::dynamicError('2fa.2fa_not_activated');
|
||||
}
|
||||
|
||||
// This file is being included in admin_index and customer_index
|
||||
// and therefore does not need to require lib/init.php
|
||||
if (AREA == 'admin') {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `type_2fa` = :t2fa, `data_2fa` = :d2fa WHERE adminid = :id");
|
||||
$uid = $userinfo['adminid'];
|
||||
} elseif (AREA == 'customer') {
|
||||
$upd_stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `type_2fa` = :t2fa, `data_2fa` = :d2fa WHERE customerid = :id");
|
||||
$uid = $userinfo['customerid'];
|
||||
}
|
||||
$success_message = "";
|
||||
|
||||
$tfa = new FroxlorTwoFactorAuth('Froxlor ' . Settings::Get('system.hostname'));
|
||||
|
||||
// do the delete and then just show a success-message
|
||||
if ($action == 'delete') {
|
||||
Database::pexecute($upd_stmt, [
|
||||
't2fa' => 0,
|
||||
'd2fa' => "",
|
||||
'id' => $uid
|
||||
]);
|
||||
Response::standardSuccess('2fa.2fa_removed');
|
||||
} elseif ($action == 'preadd') {
|
||||
$type = isset($_POST['type_2fa']) ? $_POST['type_2fa'] : '0';
|
||||
|
||||
$data = "";
|
||||
if ($type > 0) {
|
||||
// generate secret for TOTP
|
||||
$data = $tfa->createSecret();
|
||||
|
||||
$userinfo['type_2fa'] = $type;
|
||||
$userinfo['data_2fa'] = $data;
|
||||
$userinfo['2fa_unsaved'] = true;
|
||||
|
||||
// if type = email, send a code there for confirmation
|
||||
if ($type == 1) {
|
||||
$code = $tfa->getCode($data);
|
||||
$_mailerror = false;
|
||||
$mailerr_msg = "";
|
||||
$replace_arr = [
|
||||
'CODE' => $code
|
||||
];
|
||||
$mail_body = html_entity_decode(PhpHelper::replaceVariables(lng('mails.2fa.mailbody'), $replace_arr));
|
||||
|
||||
try {
|
||||
$mail->Subject = lng('mails.2fa.subject');
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($userinfo['email'], User::getCorrectUserSalutation($userinfo));
|
||||
$mail->Send();
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
Response::dynamicError($mailerr_msg);
|
||||
}
|
||||
}
|
||||
UI::twig()->addGlobal('userinfo', $userinfo);
|
||||
} else {
|
||||
Response::dynamicError('Select one of the possible values for 2FA');
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
$type = isset($_POST['type_2fa']) ? $_POST['type_2fa'] : '0';
|
||||
$data = isset($_POST['data_2fa']) ? $_POST['data_2fa'] : '';
|
||||
$code = isset($_POST['codevalidation']) ? $_POST['codevalidation'] : '';
|
||||
|
||||
// validate
|
||||
$result = $tfa->verifyCode($data, $code, 3);
|
||||
|
||||
if ($result) {
|
||||
if ($type == 0 || $type == 1) {
|
||||
// no fixed secret for email validation, the validation code will be set on the fly
|
||||
$data = "";
|
||||
}
|
||||
Database::pexecute($upd_stmt, [
|
||||
't2fa' => $type,
|
||||
'd2fa' => $data,
|
||||
'id' => $uid
|
||||
]);
|
||||
Response::standardSuccess('2fa.2fa_added', $filename);
|
||||
}
|
||||
Response::dynamicError('Invalid/wrong code');
|
||||
}
|
||||
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed 2fa::overview");
|
||||
|
||||
$type_select_values = [];
|
||||
$ga_qrcode = '';
|
||||
if ($userinfo['type_2fa'] == '0') {
|
||||
// available types
|
||||
$type_select_values = [
|
||||
0 => '-',
|
||||
1 => 'E-Mail',
|
||||
2 => 'Authenticator'
|
||||
];
|
||||
asort($type_select_values);
|
||||
} elseif ($userinfo['type_2fa'] == '1') {
|
||||
// email 2fa enabled
|
||||
} elseif ($userinfo['type_2fa'] == '2') {
|
||||
// authenticator 2fa enabled
|
||||
$ga_qrcode = $tfa->getQRCodeImageAsDataUri($userinfo['loginname'], $userinfo['data_2fa']);
|
||||
}
|
||||
|
||||
UI::view('user/2fa.html.twig', [
|
||||
'type_select_values' => $type_select_values,
|
||||
'ga_qrcode' => $ga_qrcode
|
||||
]);
|
||||
74
README.md
@@ -1,3 +1,7 @@
|
||||
[](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
|
||||
|
||||
The server administration software for your needs.
|
||||
@@ -6,69 +10,73 @@ Developed by experienced server administrators, this panel simplifies the effort
|
||||
## Installation
|
||||
|
||||
### Fast install
|
||||
1. Ensure that your webserver serves /var/www
|
||||
2. Extract froxlor into /var/www
|
||||
1. Ensure that your webserver serves /var/www/html
|
||||
2. Extract froxlor into /var/www/html
|
||||
3. Point your browser to http://[ip-of-webserver]/froxlor
|
||||
4. Follow the installer
|
||||
5. Login as administrator
|
||||
6. Adjust "Server > Settings" according to your needs
|
||||
7. Choose your distribution under "Server > Configuration"
|
||||
8. Follow the steps for your services
|
||||
9. Have fun!
|
||||
6. Have fun!
|
||||
|
||||
If you have chosen to do the configuration by hand during the installation, you have to complete some more steps:
|
||||
|
||||
1. Adjust "System > Settings" according to your needs
|
||||
2. Choose your distribution under "System > Configuration"
|
||||
3. Follow the steps for your services
|
||||
|
||||
### Detailed installation
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki/Installationtarball
|
||||
https://docs.froxlor.org/latest/general/installation/
|
||||
|
||||
## 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
|
||||
|
||||
The community is located on http://forum.froxlor.org
|
||||
The community is located on https://forum.froxlor.org/
|
||||
|
||||
### Wiki
|
||||
|
||||
More documentation may be found in the froxlor - wiki:
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki
|
||||
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
|
||||
http://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](http://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](http://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
https://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](https://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](https://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
|
||||
### Debian repository
|
||||
### Debian / Ubuntu repository
|
||||
|
||||
[HowTo](http://redmine.froxlor.org/projects/froxlor/wiki/Installationdebian)
|
||||
[HowTo](https://docs.froxlor.org/latest/general/installation/apt-package.html)
|
||||
|
||||
/etc/apt/sources.list.d/froxlor.list
|
||||
> deb http://debian.froxlor.org {wheezy|jessie} 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
|
||||
echo sh -c '"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](http://redmine.froxlor.org/projects/froxlor/wiki/Installationgentoo)
|
||||
#### Ubuntu
|
||||
|
||||
http://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
|
||||
echo sh -c '"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'
|
||||
```
|
||||
|
||||
## Let's Encrypt support
|
||||
|
||||
This version of Froxlor contains a test implementation of support for [Let's Encrypt](https://letsencrypt.org). This is (as Let's Encrypt is in itself)
|
||||
still a beta version and may break your system. The way it currently works is by creating a (sub-)domain with the default system - certificate,
|
||||
after which the Let's Encrypt cronjob orders the certificate for this (sub-)domain and inserts the certificates in the database. With the next run
|
||||
of the default cronjob, the certificates will be updated on the disk and the webserver reloaded.
|
||||
|
||||
This has 2 known side-effects at the moment:
|
||||
* The basic ip/port combinations don't work with the Froxlor - integration of Let's Encrypt, since it needs a certificate for the very first creation
|
||||
* After creating a domain, it will have the default certificate for a short time (by default 5 minutes until the cronjob runs the next time)
|
||||
|
||||
It may be possible to fix these issues, but they are not a priority at the moment
|
||||
## Contributing
|
||||
|
||||
[see here](.github/CONTRIBUTING.md)
|
||||
|
||||
47
SECURITY.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# froxlor's Security Policy
|
||||
|
||||
Welcome and thanks for taking interest in [froxlor](https://www.froxlor.org)!
|
||||
|
||||
We are mostly interested in reports by actual froxlor users but all high quality contributions are welcome.
|
||||
|
||||
Please try your best to describe a clear and realistic impact for your report and please don't open any public issues on GitHub or social media, we're doing our best to respond through huntr as quickly as we can.
|
||||
|
||||
With that, good luck hacking us ;)
|
||||
|
||||
## Supported versions
|
||||
|
||||
- ️✅ **2.x** (`main` git-branch)
|
||||
- ❌ 0.10.x (`0.10.x` git-branch)
|
||||
- ❌ 0.9.x (`0.9.x`git-branch)
|
||||
|
||||
## Qualifying Vulnerabilities
|
||||
|
||||
### Vulnerabilities we really care about
|
||||
- SQL injection bugs
|
||||
- server-side code execution bugs
|
||||
- cross-site scripting vulnerabilities
|
||||
- cross-site request forgery vulnerabilities
|
||||
- authentication and authorization flaws
|
||||
- sensitive information disclosure
|
||||
|
||||
### Vulnerabilities we accept
|
||||
|
||||
Only reproducable issues on a default/clean setup from the latest stable release of a supported version will be accepted.
|
||||
|
||||
## Non-Qualifying Vulnerabilities
|
||||
|
||||
- Reports from automated tools or scanners
|
||||
- Theoretical attacks without proof of exploitability
|
||||
- Attacks that are the result of a third party library should be reported to the library maintainers
|
||||
- Social engineering
|
||||
- Reflected file download
|
||||
- Physical attacks
|
||||
- Weak SSL/TLS/SSH algorithms or protocols
|
||||
- Attacks involving physical access to a user’s device, or involving a device or network that’s already seriously compromised (eg man-in-the-middle).
|
||||
- The user attacks themselves
|
||||
- anything in `/doc`
|
||||
- anything in `/tests`
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you think you have found a vulnerability in froxlor, please head over to [https://huntr.dev/repos/froxlor/froxlor](https://huntr.dev/repos/froxlor/froxlor) and use the reporting possibilities there as we are funding the prize-pot for froxlor on this platform. Also, please give us appropriate time to fix the issue and build update-packages before publishing anything into the wild. Alternatively you can send us an email to [team@froxlor.org](team@froxlor.org).
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'version' => array(
|
||||
'fields' => array(
|
||||
'panel_version' => array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'version',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'panel_frontend' => array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'frontend',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'system_last_tasks_run' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'last_tasks_run',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_last_traffic_run' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'last_traffic_run',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'system_lastcronrun' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'lastcronrun',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'system_lastguid' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'lastguid',
|
||||
'type' => 'hidden',
|
||||
'default' => 9999,
|
||||
),
|
||||
'system_lastaccountnumber' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'lastaccountnumber',
|
||||
'type' => 'hidden',
|
||||
'default' => 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -2,234 +2,343 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Language
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'panel' => array(
|
||||
'title' => $lng['admin']['panelsettings'],
|
||||
'fields' => array(
|
||||
'panel_standardlanguage' => array(
|
||||
'label' => array('title' => $lng['login']['language'], 'description' => $lng['serversettings']['language']['description']),
|
||||
return [
|
||||
'groups' => [
|
||||
'panel' => [
|
||||
'title' => lng('admin.panelsettings'),
|
||||
'icon' => 'fa-solid fa-chalkboard-user',
|
||||
'fields' => [
|
||||
'panel_standardlanguage' => [
|
||||
'label' => [
|
||||
'title' => lng('login.language'),
|
||||
'description' => lng('serversettings.language.description')
|
||||
],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'standardlanguage',
|
||||
'type' => 'option',
|
||||
'default' => 'English',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getLanguages',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_default_theme' => array(
|
||||
'label' => array('title' => $lng['panel']['theme'], 'description' => $lng['serversettings']['default_theme']),
|
||||
'type' => 'select',
|
||||
'default' => 'en',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Language',
|
||||
'getLanguages'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_default_theme' => [
|
||||
'label' => [
|
||||
'title' => lng('panel.theme'),
|
||||
'description' => lng('serversettings.default_theme')
|
||||
],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'default_theme',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'Froxlor',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getThemes',
|
||||
'save_method' => 'storeSettingDefaultTheme',
|
||||
),
|
||||
'panel_allow_theme_change_customer' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_theme_change_customer'],
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\UI\\Panel\\UI',
|
||||
'getThemes'
|
||||
],
|
||||
'save_method' => 'storeSettingDefaultTheme'
|
||||
],
|
||||
'panel_allow_theme_change_customer' => [
|
||||
'label' => lng('serversettings.panel_allow_theme_change_customer'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_theme_change_customer',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_theme_change_admin' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_theme_change_admin'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_theme_change_admin',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_natsorting' => array(
|
||||
'label' => $lng['serversettings']['natsorting'],
|
||||
],
|
||||
'panel_allow_theme_change_admin' => [
|
||||
'label' => lng('serversettings.panel_allow_theme_change_admin'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_theme_change_admin',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_natsorting' => [
|
||||
'label' => lng('serversettings.natsorting'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'natsorting',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_no_robots' => array(
|
||||
'label' => $lng['serversettings']['no_robots'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'no_robots',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_paging' => array(
|
||||
'label' => $lng['serversettings']['paging'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_paging' => [
|
||||
'label' => lng('serversettings.paging'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'paging',
|
||||
'type' => 'int',
|
||||
'int_min' => 0,
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_pathedit' => array(
|
||||
'label' => $lng['serversettings']['pathedit'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_pathedit' => [
|
||||
'label' => lng('serversettings.pathedit'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'pathedit',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'Manual',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_adminmail' => array(
|
||||
'label' => $lng['serversettings']['adminmail'],
|
||||
'select_var' => [
|
||||
'Manual' => lng('serversettings.manual'),
|
||||
'Dropdown' => lng('serversettings.dropdown')
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_adminmail' => [
|
||||
'label' => lng('serversettings.adminmail'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'adminmail',
|
||||
'type' => 'string',
|
||||
'string_type' => 'mail',
|
||||
'string_emptyallowed' => false,
|
||||
'type' => 'email',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_adminmail_defname' => array(
|
||||
'label' => $lng['serversettings']['adminmail_defname'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_adminmail_defname' => [
|
||||
'label' => lng('serversettings.adminmail_defname'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'adminmail_defname',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => 'Froxlor Administrator',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_adminmail_return' => array(
|
||||
'label' => $lng['serversettings']['adminmail_return'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_adminmail_return' => [
|
||||
'label' => lng('serversettings.adminmail_return'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'adminmail_return',
|
||||
'type' => 'string',
|
||||
'string_type' => 'mail',
|
||||
'type' => 'email',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_decimal_places' => array(
|
||||
'label' => $lng['serversettings']['decimal_places'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_decimal_places' => [
|
||||
'label' => lng('serversettings.decimal_places'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'decimal_places',
|
||||
'type' => 'int',
|
||||
'int_min' => 0,
|
||||
'int_max' => 15,
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 15,
|
||||
'default' => 4,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_phpmyadmin_url' => array(
|
||||
'label' => $lng['serversettings']['phpmyadmin_url'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_phpmyadmin_url' => [
|
||||
'label' => lng('serversettings.phpmyadmin_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'phpmyadmin_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_webmail_url' => array(
|
||||
'label' => $lng['serversettings']['webmail_url'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_webmail_url' => [
|
||||
'label' => lng('serversettings.webmail_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'webmail_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_webftp_url' => array(
|
||||
'label' => $lng['serversettings']['webftp_url'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_webftp_url' => [
|
||||
'label' => lng('serversettings.webftp_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'webftp_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'admin_show_version_login' => array(
|
||||
'label' => $lng['admin']['show_version_login'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'admin_show_version_login' => [
|
||||
'label' => lng('admin.show_version_login'),
|
||||
'settinggroup' => 'admin',
|
||||
'varname' => 'show_version_login',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'admin_show_version_footer' => array(
|
||||
'label' => $lng['admin']['show_version_footer'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'admin_show_version_footer' => [
|
||||
'label' => lng('admin.show_version_footer'),
|
||||
'settinggroup' => 'admin',
|
||||
'varname' => 'show_version_footer',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'admin_show_news_feed' => array(
|
||||
'label' => $lng['admin']['show_news_feed'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'admin_show_news_feed' => [
|
||||
'label' => lng('admin.show_news_feed'),
|
||||
'settinggroup' => 'admin',
|
||||
'varname' => 'show_news_feed',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_show_news_feed' => array(
|
||||
'label' => $lng['admin']['customer_show_news_feed'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customer_show_news_feed' => [
|
||||
'label' => lng('admin.customer_show_news_feed'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'show_news_feed',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_news_feed_url' => array(
|
||||
'label' => $lng['admin']['customer_news_feed_url'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customer_news_feed_url' => [
|
||||
'label' => lng('admin.customer_news_feed_url'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'news_feed_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_domain_change_admin' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_allow_domain_change_admin' => [
|
||||
'label' => lng('serversettings.panel_allow_domain_change_admin'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_domain_change_admin',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_domain_change_customer' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_domain_change_customer'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_allow_domain_change_customer' => [
|
||||
'label' => lng('serversettings.panel_allow_domain_change_customer'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_domain_change_customer',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_phpconfigs_hidestdsubdomain' => array(
|
||||
'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_phpconfigs_hidesubdomains' => [
|
||||
'label' => lng('serversettings.panel_phpconfigs_hidesubdomains'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'phpconfigs_hidesubdomains',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_phpconfigs_hidestdsubdomain' => [
|
||||
'label' => lng('serversettings.panel_phpconfigs_hidestdsubdomain'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'phpconfigs_hidestdsubdomain',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_customer_hide_options' => [
|
||||
'label' => lng('serversettings.panel_customer_hide_options'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'customer_hide_options',
|
||||
'type' => 'select',
|
||||
'default' => '',
|
||||
'select_mode' => 'multiple',
|
||||
'option_emptyallowed' => true,
|
||||
'select_var' => [
|
||||
'email' => lng('menue.email.email'),
|
||||
'mysql' => lng('menue.mysql.mysql'),
|
||||
'domains' => lng('menue.domains.domains'),
|
||||
'ftp' => lng('menue.ftp.ftp'),
|
||||
'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.backup' => lng('menue.extras.extras') . " / " . lng('menue.extras.backup'),
|
||||
'traffic' => lng('menue.traffic.traffic'),
|
||||
'traffic.http' => lng('menue.traffic.traffic') . " / HTTP",
|
||||
'traffic.ftp' => lng('menue.traffic.traffic') . " / FTP",
|
||||
'traffic.mail' => lng('menue.traffic.traffic') . " / Mail",
|
||||
'misc.documentation' => lng('admin.documentation'),
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_imprint_url' => [
|
||||
'label' => lng('serversettings.imprint_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'imprint_url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_terms_url' => [
|
||||
'label' => lng('serversettings.terms_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'terms_url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_privacy_url' => [
|
||||
'label' => lng('serversettings.privacy_url'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'privacy_url',
|
||||
'type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_logo_overridetheme' => [
|
||||
'label' => lng('serversettings.logo_overridetheme'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_overridetheme',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_logo_overridecustom' => [
|
||||
'label' => lng('serversettings.logo_overridecustom'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_overridecustom',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_logo_image_header' => [
|
||||
'label' => lng('serversettings.logo_image_header'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_image_header',
|
||||
'type' => 'image',
|
||||
'accept' => 'image/jpeg, image/jpg, image/png, image/gif',
|
||||
'image_name' => 'logo_header',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingImage'
|
||||
],
|
||||
'panel_logo_image_login' => [
|
||||
'label' => lng('serversettings.logo_image_login'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'logo_image_login',
|
||||
'type' => 'image',
|
||||
'accept' => 'image/jpeg, image/jpg, image/png, image/gif',
|
||||
'image_name' => 'logo_login',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingImage'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,200 +2,256 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'accounts' => array(
|
||||
'title' => $lng['admin']['accountsettings'],
|
||||
'fields' => array(
|
||||
'session_sessiontimeout' => array(
|
||||
'label' => $lng['serversettings']['session_timeout'],
|
||||
return [
|
||||
'groups' => [
|
||||
'accounts' => [
|
||||
'title' => lng('admin.accountsettings'),
|
||||
'icon' => 'fa-solid fa-users-gear',
|
||||
'fields' => [
|
||||
'session_sessiontimeout' => [
|
||||
'label' => lng('serversettings.session_timeout'),
|
||||
'settinggroup' => 'session',
|
||||
'varname' => 'sessiontimeout',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'min' => 60,
|
||||
'default' => 600,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'session_allow_multiple_login' => array(
|
||||
'label' => $lng['serversettings']['session_allow_multiple_login'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'session_allow_multiple_login' => [
|
||||
'label' => lng('serversettings.session_allow_multiple_login'),
|
||||
'settinggroup' => 'session',
|
||||
'varname' => 'allow_multiple_login',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'login_domain_login' => array(
|
||||
'label' => $lng['serversettings']['login_domain_login'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'login_domain_login' => [
|
||||
'label' => lng('serversettings.login_domain_login'),
|
||||
'settinggroup' => 'login',
|
||||
'varname' => 'domain_login',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'login_maxloginattempts' => array(
|
||||
'label' => $lng['serversettings']['maxloginattempts'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'login_maxloginattempts' => [
|
||||
'label' => lng('serversettings.maxloginattempts'),
|
||||
'settinggroup' => 'login',
|
||||
'varname' => 'maxloginattempts',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'min' => 1,
|
||||
'default' => 3,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'login_deactivatetime' => array(
|
||||
'label' => $lng['serversettings']['deactivatetime'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'login_deactivatetime' => [
|
||||
'label' => lng('serversettings.deactivatetime'),
|
||||
'settinggroup' => 'login',
|
||||
'varname' => 'deactivatetime',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'default' => 900,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_min_length' => array(
|
||||
'label' => $lng['serversettings']['panel_password_min_length'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'2fa_enabled' => [
|
||||
'label' => lng('2fa.2fa_enabled'),
|
||||
'settinggroup' => '2fa',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_min_length' => [
|
||||
'label' => lng('serversettings.panel_password_min_length'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_min_length',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_alpha_lower' => array(
|
||||
'label' => $lng['serversettings']['panel_password_alpha_lower'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_alpha_lower' => [
|
||||
'label' => lng('serversettings.panel_password_alpha_lower'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_alpha_lower',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_alpha_upper' => array(
|
||||
'label' => $lng['serversettings']['panel_password_alpha_upper'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_alpha_upper' => [
|
||||
'label' => lng('serversettings.panel_password_alpha_upper'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_alpha_upper',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_numeric' => array(
|
||||
'label' => $lng['serversettings']['panel_password_numeric'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_numeric' => [
|
||||
'label' => lng('serversettings.panel_password_numeric'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_numeric',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_special_char_required' => array(
|
||||
'label' => $lng['serversettings']['panel_password_special_char_required'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_special_char_required' => [
|
||||
'label' => lng('serversettings.panel_password_special_char_required'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_special_char_required',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_special_char' => array(
|
||||
'label' => $lng['serversettings']['panel_password_special_char'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_special_char' => [
|
||||
'label' => lng('serversettings.panel_password_special_char'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_special_char',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '!?<>§$%+#=@',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_regex' => array(
|
||||
'label' => $lng['serversettings']['panel_password_regex'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_password_regex' => [
|
||||
'label' => lng('serversettings.panel_password_regex'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_regex',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
/* 'plausibility_check_method' => 'checkValidRegEx', */
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_accountprefix' => array(
|
||||
'label' => $lng['serversettings']['accountprefix'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_req_limit_per_interval' => [
|
||||
'label' => lng('serversettings.req_limit_per_interval'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'req_limit_per_interval',
|
||||
'type' => 'number',
|
||||
'min' => 30,
|
||||
'default' => 60,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_req_limit_interval' => [
|
||||
'label' => lng('serversettings.req_limit_interval'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'req_limit_interval',
|
||||
'type' => 'number',
|
||||
'min' => 5,
|
||||
'default' => 60,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'customer_accountprefix' => [
|
||||
'label' => lng('serversettings.accountprefix'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'accountprefix',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'plausibility_check_method' => 'checkUsername',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_mysqlprefix' => array(
|
||||
'label' => $lng['serversettings']['mysqlprefix'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkUsername'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customer_mysqlprefix' => [
|
||||
'label' => lng('serversettings.mysqlprefix'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'mysqlprefix',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'plausibility_check_method' => 'checkUsername',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_ftpprefix' => array(
|
||||
'label' => $lng['serversettings']['ftpprefix'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkUsername'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customer_ftpprefix' => [
|
||||
'label' => lng('serversettings.ftpprefix'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'ftpprefix',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_ftpatdomain' => array(
|
||||
'label' => $lng['serversettings']['ftpdomain'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customer_ftpatdomain' => [
|
||||
'label' => lng('serversettings.ftpdomain'),
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'ftpatdomain',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_preset' => array(
|
||||
'label' => $lng['serversettings']['allow_password_reset'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'panel_allow_preset' => [
|
||||
'label' => lng('serversettings.allow_password_reset'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'dependency' => array(
|
||||
'fieldname' => 'panel_allow_preset_admin',
|
||||
'fielddata' => array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset_admin',
|
||||
),
|
||||
'onlyif' => 0
|
||||
)
|
||||
),
|
||||
'panel_allow_preset_admin' => array(
|
||||
'label' => $lng['serversettings']['allow_password_reset_admin'],
|
||||
'dependency' => [
|
||||
'fieldname' => 'panel_allow_preset_admin',
|
||||
'fielddata' => [
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset_admin'
|
||||
],
|
||||
'onlyif' => 0
|
||||
]
|
||||
],
|
||||
'panel_allow_preset_admin' => [
|
||||
'label' => lng('serversettings.allow_password_reset_admin'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset_admin',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'dependency' => array(
|
||||
'fieldname' => 'panel_allow_preset',
|
||||
'fielddata' => array(
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset',
|
||||
),
|
||||
'onlyif' => 1
|
||||
)
|
||||
),
|
||||
'system_backupenabled' => array(
|
||||
'label' => $lng['serversettings']['backupenabled'],
|
||||
'dependency' => [
|
||||
'fieldname' => 'panel_allow_preset',
|
||||
'fielddata' => [
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_preset'
|
||||
],
|
||||
'onlyif' => 1
|
||||
]
|
||||
],
|
||||
'system_backupenabled' => [
|
||||
'label' => lng('serversettings.backupenabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backupenabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/backup',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
],
|
||||
'system_createstdsubdom_default' => [
|
||||
'label' => lng('serversettings.createstdsubdom_default'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'createstdsubdom_default',
|
||||
'type' => 'select',
|
||||
'default' => '1',
|
||||
'select_var' => [
|
||||
'0' => lng('panel.no'),
|
||||
'1' => lng('panel.yes')
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,165 +2,333 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'system' => array(
|
||||
'title' => $lng['admin']['systemsettings'],
|
||||
'fields' => array(
|
||||
'system_documentroot_prefix' => array(
|
||||
'label' => $lng['serversettings']['documentroot_prefix'],
|
||||
return [
|
||||
'groups' => [
|
||||
'system' => [
|
||||
'title' => lng('admin.systemsettings'),
|
||||
'icon' => 'fa-solid fa-gears',
|
||||
'fields' => [
|
||||
'system_documentroot_prefix' => [
|
||||
'label' => lng('serversettings.documentroot_prefix'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'documentroot_prefix',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/webs/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkPathConflicts'
|
||||
),
|
||||
'system_documentroot_use_default_value' => array(
|
||||
'label' => $lng['serversettings']['documentroot_use_default_value'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkPathConflicts'
|
||||
],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_documentroot_use_default_value' => [
|
||||
'label' => lng('serversettings.documentroot_use_default_value'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'documentroot_use_default_value',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ipaddress' => array(
|
||||
'label' => $lng['serversettings']['ipaddress'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_ipaddress' => [
|
||||
'label' => lng('serversettings.ipaddress'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ipaddress',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getIpAddresses',
|
||||
'type' => 'select',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Domain\\IpAddr',
|
||||
'getIpAddresses'
|
||||
],
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingIpAddress',
|
||||
),
|
||||
'system_defaultip' => array(
|
||||
'label' => $lng['serversettings']['defaultip'],
|
||||
'save_method' => 'storeSettingIpAddress'
|
||||
],
|
||||
'system_defaultip' => [
|
||||
'label' => lng('serversettings.defaultip'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'defaultip',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options_method' => 'getIpPortCombinations',
|
||||
'type' => 'select',
|
||||
'select_mode' => 'multiple',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Domain\\IpAddr',
|
||||
'getIpPortCombinations'
|
||||
],
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingDefaultIp',
|
||||
),
|
||||
'system_hostname' => array(
|
||||
'label' => $lng['serversettings']['hostname'],
|
||||
'save_method' => 'storeSettingDefaultIp'
|
||||
],
|
||||
'system_defaultsslip' => [
|
||||
'label' => lng('serversettings.defaultsslip'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'defaultsslip',
|
||||
'type' => 'select',
|
||||
'select_mode' => 'multiple',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Domain\\IpAddr',
|
||||
'getSslIpPortCombinations'
|
||||
],
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingDefaultSslIp'
|
||||
],
|
||||
'system_hostname' => [
|
||||
'label' => lng('serversettings.hostname'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hostname',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingHostname',
|
||||
'plausibility_check_method' => 'checkHostname',
|
||||
),
|
||||
'system_froxlordirectlyviahostname' => array(
|
||||
'label' => $lng['serversettings']['froxlordirectlyviahostname'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxlordirectlyviahostname',
|
||||
'type' => 'bool',
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkHostname'
|
||||
]
|
||||
],
|
||||
'api_enabled' => [
|
||||
'label' => lng('serversettings.enable_api'),
|
||||
'settinggroup' => 'api',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'api_customer_default' => [
|
||||
'label' => lng('serversettings.api_customer_default'),
|
||||
'settinggroup' => 'api',
|
||||
'varname' => 'customer_default',
|
||||
'type' => 'select',
|
||||
'default' => 1,
|
||||
'select_var' => [
|
||||
1 => lng('panel.yes'),
|
||||
0 => lng('panel.no')
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_update_channel' => [
|
||||
'label' => lng('serversettings.update_channel'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'update_channel',
|
||||
'type' => 'select',
|
||||
'default' => 'stable',
|
||||
'select_var' => [
|
||||
'stable' => lng('serversettings.uc_stable'),
|
||||
'testing' => lng('serversettings.uc_testing')
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_validatedomain' => array(
|
||||
'label' => $lng['serversettings']['validate_domain'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_validate_domain' => [
|
||||
'label' => lng('serversettings.validate_domain'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'validate_domain',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_stdsubdomain' => array(
|
||||
'label' => $lng['serversettings']['stdsubdomainhost'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_stdsubdomain' => [
|
||||
'label' => lng('serversettings.stdsubdomainhost'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'stdsubdomain',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingHostname',
|
||||
),
|
||||
'system_mysql_access_host' => array(
|
||||
'label' => $lng['serversettings']['mysql_access_host'],
|
||||
'save_method' => 'storeSettingHostname'
|
||||
],
|
||||
'system_mysql_access_host' => [
|
||||
'label' => lng('serversettings.mysql_access_host'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mysql_access_host',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '127.0.0.1,localhost',
|
||||
'plausibility_check_method' => 'checkMysqlAccessHost',
|
||||
'save_method' => 'storeSettingMysqlAccessHost',
|
||||
),
|
||||
'system_index_file_extension' => array(
|
||||
'label' => $lng['serversettings']['index_file_extension'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkMysqlAccessHost'
|
||||
],
|
||||
'save_method' => 'storeSettingMysqlAccessHost'
|
||||
],
|
||||
'system_nssextrausers' => [
|
||||
'label' => lng('serversettings.nssextrausers'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nssextrausers',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_index_file_extension' => [
|
||||
'label' => lng('serversettings.index_file_extension'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'index_file_extension',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-zA-Z0-9]{1,6}$/',
|
||||
'default' => 'html',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_store_index_file_subs' => array(
|
||||
'label' => $lng['serversettings']['system_store_index_file_subs'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_store_index_file_subs' => [
|
||||
'label' => lng('serversettings.system_store_index_file_subs'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'store_index_file_subs',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_httpuser' => array(
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_httpuser' => [
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'httpuser',
|
||||
'type' => 'hidden',
|
||||
'default' => 'www-data',
|
||||
),
|
||||
'system_httpgroup' => array(
|
||||
'default' => 'www-data'
|
||||
],
|
||||
'system_httpgroup' => [
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'httpgroup',
|
||||
'type' => 'hidden',
|
||||
'default' => 'www-data',
|
||||
),
|
||||
'system_report_enable' => array(
|
||||
'label' => $lng['serversettings']['report']['report'],
|
||||
'default' => 'www-data'
|
||||
],
|
||||
'system_report_enable' => [
|
||||
'label' => lng('serversettings.report.report'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'report_enable',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'cronmodule' => 'froxlor/reports',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_report_webmax' => array(
|
||||
'label' => $lng['serversettings']['report']['webmax'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_report_webmax' => [
|
||||
'label' => lng('serversettings.report.webmax'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'report_webmax',
|
||||
'type' => 'int',
|
||||
'int_min' => 1,
|
||||
'int_max' => 150,
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 150,
|
||||
'default' => 90,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_report_trafficmax' => array(
|
||||
'label' => $lng['serversettings']['report']['trafficmax'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_report_trafficmax' => [
|
||||
'label' => lng('serversettings.report.trafficmax'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'report_trafficmax',
|
||||
'type' => 'int',
|
||||
'int_min' => 1,
|
||||
'int_max' => 150,
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 150,
|
||||
'default' => 90,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_use_smtp' => [
|
||||
'label' => lng('serversettings.mail_use_smtp'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_use_smtp',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_host' => [
|
||||
'label' => lng('serversettings.mail_smtp_host'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_host',
|
||||
'type' => 'text',
|
||||
'default' => 'localhost',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_port' => [
|
||||
'label' => lng('serversettings.mail_smtp_port'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_port',
|
||||
'type' => 'number',
|
||||
'min' => 1,
|
||||
'max' => 65535,
|
||||
'default' => 25,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_usetls' => [
|
||||
'label' => lng('serversettings.mail_smtp_usetls'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_usetls',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_auth' => [
|
||||
'label' => lng('serversettings.mail_smtp_auth'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_auth',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_user' => [
|
||||
'label' => lng('serversettings.mail_smtp_user'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_user',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_smtp_passwd' => [
|
||||
'label' => lng('serversettings.mail_smtp_passwd'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_smtp_passwd',
|
||||
'type' => 'password',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_apply_specialsettings_default' => [
|
||||
'label' => lng('serversettings.apply_specialsettings_default'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apply_specialsettings_default',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_apply_phpconfigs_default' => [
|
||||
'label' => lng('serversettings.apply_phpconfigs_default'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apply_phpconfigs_default',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_domaindefaultalias' => [
|
||||
'label' => lng('admin.domaindefaultalias'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'domaindefaultalias',
|
||||
'type' => 'select',
|
||||
'default' => '0',
|
||||
'select_var' => [
|
||||
'0' => lng('domains.serveraliasoption_wildcard'),
|
||||
'1' => lng('domains.serveraliasoption_www'),
|
||||
'2' => lng('domains.serveraliasoption_none')
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_hide_incompatible_settings' => [
|
||||
'label' => lng('serversettings.hide_incompatible_settings'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hide_incompatible_settings',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
297
actions/admin/settings/122.froxlorvhost.php
Normal file
@@ -0,0 +1,297 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'froxlorvhost' => [
|
||||
'title' => lng('admin.froxlorvhost') . (call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]) == false ? lng('admin.novhostcontainer') : ''),
|
||||
'icon' => 'fa-solid fa-wrench',
|
||||
'fields' => [
|
||||
/**
|
||||
* Webserver-Vhost
|
||||
*/
|
||||
'system_froxlordirectlyviahostname' => [
|
||||
'label' => lng('serversettings.froxlordirectlyviahostname'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxlordirectlyviahostname',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_froxloraliases' => [
|
||||
'label' => lng('serversettings.froxloraliases'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxloraliases',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingClearCertificates',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
/**
|
||||
* SSL / Let's Encrypt
|
||||
*/
|
||||
'system_le_froxlor_enabled' => [
|
||||
'label' => lng('serversettings.le_froxlor_enabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_froxlor_enabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingClearCertificates',
|
||||
'visible' => Settings::Get('system.leenabled') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_le_froxlor_redirect' => [
|
||||
'label' => lng('serversettings.le_froxlor_redirect'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_froxlor_redirect',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true)
|
||||
],
|
||||
'system_hsts_maxage' => [
|
||||
'label' => lng('admin.domain_hsts_maxage'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_maxage',
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 94608000, // 3-years
|
||||
'default' => 10368000,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_hsts_incsub' => [
|
||||
'label' => lng('admin.domain_hsts_incsub'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_incsub',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_hsts_preload' => [
|
||||
'label' => lng('admin.domain_hsts_preload'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'hsts_preload',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_honorcipherorder' => [
|
||||
'label' => lng('admin.domain_honorcipherorder'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'honorcipherorder',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_sessiontickets' => [
|
||||
'label' => lng('admin.domain_sessiontickets'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'sessiontickets',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
], true),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
/**
|
||||
* FCGID
|
||||
*/
|
||||
'system_mod_fcgid_ownvhost' => [
|
||||
'label' => lng('serversettings.mod_fcgid_ownvhost'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_ownvhost',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:fcgid']
|
||||
],
|
||||
'system_mod_fcgid_httpuser' => [
|
||||
'label' => lng('admin.mod_fcgid_user'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_httpuser',
|
||||
'type' => 'text',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:fcgid']
|
||||
],
|
||||
'system_mod_fcgid_httpgroup' => [
|
||||
'label' => lng('admin.mod_fcgid_group'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_httpgroup',
|
||||
'type' => 'text',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:fcgid']
|
||||
],
|
||||
'system_mod_fcgid_defaultini_ownvhost' => [
|
||||
'label' => lng('serversettings.mod_fcgid.defaultini_ownvhost'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_defaultini_ownvhost',
|
||||
'type' => 'select',
|
||||
'default' => '2',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Http\\PhpConfig',
|
||||
'getPhpConfigs'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'visible' => Settings::Get('system.mod_fcgid') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
])
|
||||
],
|
||||
/**
|
||||
* php-fpm
|
||||
*/
|
||||
'phpfpm_enabled_ownvhost' => [
|
||||
'label' => lng('phpfpm.ownvhost'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled_ownvhost',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:php-fpm']
|
||||
],
|
||||
'phpfpm_vhost_httpuser' => [
|
||||
'label' => lng('phpfpm.vhost_httpuser'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpuser',
|
||||
'type' => 'text',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:php-fpm']
|
||||
],
|
||||
'phpfpm_vhost_httpgroup' => [
|
||||
'label' => lng('phpfpm.vhost_httpgroup'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpgroup',
|
||||
'type' => 'text',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
]),
|
||||
'requires_reconf' => ['system:php-fpm']
|
||||
],
|
||||
'phpfpm_vhost_defaultini' => [
|
||||
'label' => lng('serversettings.mod_fcgid.defaultini_ownvhost'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_defaultini',
|
||||
'type' => 'select',
|
||||
'default' => '2',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Http\\PhpConfig',
|
||||
'getPhpConfigs'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('phpfpm.enabled') && call_user_func([
|
||||
'\Froxlor\Settings\FroxlorVhostSettings',
|
||||
'hasVhostContainerEnabled'
|
||||
])
|
||||
],
|
||||
/**
|
||||
* DNS
|
||||
*/
|
||||
'system_dns_createhostnameentry' => [
|
||||
'label' => lng('serversettings.dns_createhostnameentry'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dns_createhostnameentry',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.bind_enable')
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -2,66 +2,70 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2014 the Froxlor Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'crond' => array(
|
||||
'title' => $lng['admin']['cronsettings'],
|
||||
'fields' => array(
|
||||
'system_cronconfig' => array(
|
||||
'label' => $lng['serversettings']['system_cronconfig'],
|
||||
return [
|
||||
'groups' => [
|
||||
'crond' => [
|
||||
'title' => lng('admin.cronsettings'),
|
||||
'icon' => 'fa-solid fa-clock-rotate-left',
|
||||
'advanced_mode' => true,
|
||||
'fields' => [
|
||||
'system_cronconfig' => [
|
||||
'label' => lng('serversettings.system_cronconfig'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'cronconfig',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/cron.d/froxlor',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_croncmdline' => array(
|
||||
'label' => $lng['serversettings']['system_croncmdline'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_croncmdline' => [
|
||||
'label' => lng('serversettings.system_croncmdline'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'croncmdline',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '/usr/bin/nice -n 5 /usr/bin/php -q',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_crondreload' => array(
|
||||
'label' => $lng['serversettings']['system_crondreload'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_crondreload' => [
|
||||
'label' => lng('serversettings.system_crondreload'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'crondreload',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '/etc/init.d/cron reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_cron_allowautoupdate' => array(
|
||||
'label' => $lng['serversettings']['system_cron_allowautoupdate'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_cron_allowautoupdate' => [
|
||||
'label' => lng('serversettings.system_cron_allowautoupdate'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'cron_allowautoupdate',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_debug_cron' => array(
|
||||
'label' => $lng['serversettings']['cron']['debug'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'debug_cron',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,245 +2,423 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'webserver' => array(
|
||||
'title' => $lng['admin']['webserversettings'],
|
||||
'fields' => array(
|
||||
'system_webserver' => array(
|
||||
'label' => $lng['admin']['webserver'],
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'webserver' => [
|
||||
'title' => lng('admin.webserversettings'),
|
||||
'icon' => 'fa-solid fa-server',
|
||||
'fields' => [
|
||||
'system_webserver' => [
|
||||
'label' => lng('admin.webserver'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'webserver',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'apache2',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd', 'nginx' => 'Nginx'),
|
||||
'select_var' => [
|
||||
'apache2' => 'Apache 2',
|
||||
'lighttpd' => 'ligHTTPd',
|
||||
'nginx' => 'Nginx'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkPhpInterfaceSetting',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_apache_24' => array(
|
||||
'label' => $lng['serversettings']['apache_24'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkPhpInterfaceSetting'
|
||||
],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_apache_24' => [
|
||||
'label' => lng('serversettings.apache_24'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apache24',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_apache_itksupport' => array(
|
||||
'label' => $lng['serversettings']['apache_itksupport'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheitksupport',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 0 && Settings::Get('phpfpm.enabled') == 0),
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_httpuser' => array(
|
||||
'label' => $lng['admin']['webserver_user'],
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
]
|
||||
],
|
||||
'system_apacheitksupport' => [
|
||||
'label' => lng('serversettings.apache_itksupport'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheitksupport',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 0 && Settings::Get('phpfpm.enabled') == 0),
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_http2_support' => [
|
||||
'label' => lng('serversettings.http2_support'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'http2_support',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
],
|
||||
'visible' => Settings::Get('system.use_ssl')
|
||||
],
|
||||
'system_dhparams_file' => [
|
||||
'label' => lng('serversettings.dhparams_file'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dhparams_file',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl'),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_httpuser' => [
|
||||
'label' => lng('admin.webserver_user'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'httpuser',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => 'www-data',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
),
|
||||
'system_httpgroup' => array(
|
||||
'label' => $lng['admin']['webserver_group'],
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser'
|
||||
],
|
||||
'system_httpgroup' => [
|
||||
'label' => lng('admin.webserver_group'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'httpgroup',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => 'www-data',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apacheconf_vhost' => array(
|
||||
'label' => $lng['serversettings']['apacheconf_vhost'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_apacheconf_vhost' => [
|
||||
'label' => lng('serversettings.apacheconf_vhost'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheconf_vhost',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'filedir',
|
||||
'default' => '/etc/apache2/sites-enabled/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apacheconf_diroptions' => array(
|
||||
'label' => $lng['serversettings']['apacheconf_diroptions'],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_apacheconf_diroptions' => [
|
||||
'label' => lng('serversettings.apacheconf_diroptions'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheconf_diroptions',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'filedir',
|
||||
'default' => '/etc/apache2/sites-enabled/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apacheconf_htpasswddir' => array(
|
||||
'label' => $lng['serversettings']['apacheconf_htpasswddir'],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_apacheconf_htpasswddir' => [
|
||||
'label' => lng('serversettings.apacheconf_htpasswddir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheconf_htpasswddir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/apache2/htpasswd/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_logfiles_directory' => array(
|
||||
'label' => $lng['serversettings']['logfiles_directory'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_logfiles_directory' => [
|
||||
'label' => lng('serversettings.logfiles_directory'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_directory',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/logs/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_customersslpath' => array(
|
||||
'label' => $lng['serversettings']['customerssl_directory'],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_logfiles_script' => [
|
||||
'label' => lng('serversettings.logfiles_script'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_script',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_logfiles_piped' => [
|
||||
'label' => lng('serversettings.logfiles_piped'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_piped',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_logfiles_format' => [
|
||||
'label' => lng('serversettings.logfiles_format'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_format',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
],
|
||||
'visible' => Settings::Get('system.traffictool') != 'webalizer',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_logfiles_type' => [
|
||||
'label' => lng('serversettings.logfiles_type'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_type',
|
||||
'type' => 'select',
|
||||
'default' => '1',
|
||||
'select_var' => [
|
||||
'1' => 'combined',
|
||||
'2' => 'vhost_combined'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
]
|
||||
],
|
||||
'system_errorlog_level' => [
|
||||
'label' => lng('serversettings.errorlog_level'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'errorlog_level',
|
||||
'type' => 'select',
|
||||
'default' => (Settings::Get('system.webserver') == 'nginx' ? 'error' : 'warn'),
|
||||
'select_var' => [
|
||||
'emerg' => 'emerg',
|
||||
'alert' => 'alert',
|
||||
'crit' => 'crit',
|
||||
'error' => 'error',
|
||||
'warn' => 'warn',
|
||||
'notice' => 'notice',
|
||||
'info' => 'info',
|
||||
'debug' => 'debug'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
]
|
||||
],
|
||||
'system_customer_ssl_path' => [
|
||||
'label' => lng('serversettings.customerssl_directory'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'customer_ssl_path',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/ssl/froxlor-custom/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpappendopenbasedir' => array(
|
||||
'label' => $lng['serversettings']['phpappendopenbasedir'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_phpappendopenbasedir' => [
|
||||
'label' => lng('serversettings.phpappendopenbasedir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'phpappendopenbasedir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_deactivateddocroot' => array(
|
||||
'label' => $lng['serversettings']['deactivateddocroot'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_deactivateddocroot' => [
|
||||
'label' => lng('serversettings.deactivateddocroot'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'deactivateddocroot',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_default_vhostconf' => array(
|
||||
'label' => $lng['serversettings']['default_vhostconf'],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_default_vhostconf' => [
|
||||
'label' => lng('serversettings.default_vhostconf'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'default_vhostconf',
|
||||
'type' => 'text',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_apachereload_command' => array(
|
||||
'label' => $lng['serversettings']['apachereload_command'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_default_sslvhostconf' => [
|
||||
'label' => lng('serversettings.default_sslvhostconf'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'default_sslvhostconf',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') == 1,
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_include_default_vhostconf' => [
|
||||
'label' => lng('serversettings.includedefault_sslvhostconf'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'include_default_vhostconf',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_apacheglobaldiropt' => [
|
||||
'label' => lng('serversettings.apache_globaldiropt'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheglobaldiropt',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => (Settings::Get('system.mod_fcgid') == 0 && Settings::Get('phpfpm.enabled') == 0),
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_apachereload_command' => [
|
||||
'label' => lng('serversettings.apachereload_command'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apachereload_command',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '/etc/init.d/apache2 reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpreload_command' => array(
|
||||
'label' => $lng['serversettings']['phpreload_command'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_phpreload_command' => [
|
||||
'label' => lng('serversettings.phpreload_command'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'phpreload_command',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'system_nginx_php_backend' => array(
|
||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||
'websrv_avail' => [
|
||||
'nginx'
|
||||
]
|
||||
],
|
||||
'system_nginx_php_backend' => [
|
||||
'label' => lng('serversettings.nginx_php_backend'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nginx_php_backend',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '127.0.0.1:8888',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'nginx_fastcgiparams' => array(
|
||||
'label' => $lng['serversettings']['nginx_fastcgiparams'],
|
||||
'websrv_avail' => [
|
||||
'nginx'
|
||||
]
|
||||
],
|
||||
'nginx_fastcgiparams' => [
|
||||
'label' => lng('serversettings.nginx_fastcgiparams'),
|
||||
'settinggroup' => 'nginx',
|
||||
'varname' => 'fastcgiparams',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/nginx/fastcgi_params',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_enabled' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_enabled'],
|
||||
'websrv_avail' => [
|
||||
'nginx'
|
||||
]
|
||||
],
|
||||
'defaultwebsrverrhandler_enabled' => [
|
||||
'label' => lng('serversettings.defaultwebsrverrhandler_enabled'),
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'defaultwebsrverrhandler_err401' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err401'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'defaultwebsrverrhandler_err401' => [
|
||||
'label' => lng('serversettings.defaultwebsrverrhandler_err401'),
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
'varname' => 'err401',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_err403' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err403'],
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'defaultwebsrverrhandler_err403' => [
|
||||
'label' => lng('serversettings.defaultwebsrverrhandler_err403'),
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
'varname' => 'err403',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_err404' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err404'],
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'defaultwebsrverrhandler_err404' => [
|
||||
'label' => lng('serversettings.defaultwebsrverrhandler_err404'),
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
'varname' => 'err404',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'defaultwebsrverrhandler_err500' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_err500'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'defaultwebsrverrhandler_err500' => [
|
||||
'label' => lng('serversettings.defaultwebsrverrhandler_err500'),
|
||||
'settinggroup' => 'defaultwebsrverrhandler',
|
||||
'varname' => 'err500',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'nginx')
|
||||
),
|
||||
'customredirect_enabled' => array(
|
||||
'label' => $lng['serversettings']['customredirect_enabled'],
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'nginx'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'customredirect_enabled' => [
|
||||
'label' => lng('serversettings.customredirect_enabled'),
|
||||
'settinggroup' => 'customredirect',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'lighttpd')
|
||||
),
|
||||
'customredirect_default' => array(
|
||||
'label' => $lng['serversettings']['customredirect_default'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'customredirect_default' => [
|
||||
'label' => lng('serversettings.customredirect_default'),
|
||||
'settinggroup' => 'customredirect',
|
||||
'varname' => 'default',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getRedirectCodes',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'lighttpd')
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
'option_options_method' => ['\\Froxlor\\Domain\\Domain', 'getRedirectCodes'],
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,148 +2,257 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'ssl' => array(
|
||||
'title' => $lng['admin']['sslsettings'],
|
||||
'fields' => array(
|
||||
'system_ssl_enabled' => array(
|
||||
'label' => $lng['serversettings']['ssl']['use_ssl'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'use_ssl',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_ssl_cipher_list' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cipher_list'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cipher_list',
|
||||
'type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_cert_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.pem',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_key_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_key_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_key_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.key',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_cert_chainfile' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_chainfile',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_ca_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_ca_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_ca_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_leenabled' => array(
|
||||
'label' => $lng['serversettings']['leenabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'leenabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/letsencrypt',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_letsencryptca' => array(
|
||||
'label' => $lng['serversettings']['letsencryptca'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptca',
|
||||
'type' => 'option',
|
||||
'default' => 'testing',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('testing' => 'https://acme-staging.api.letsencrypt.org (Test)', 'production' => 'https://acme-v01.api.letsencrypt.org (Live)'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_letsencryptcountrycode' => array(
|
||||
'label' => $lng['serversettings']['letsencryptcountrycode'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptcountrycode',
|
||||
'type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'DE',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_letsencryptstate' => array(
|
||||
'label' => $lng['serversettings']['letsencryptstate'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptstate',
|
||||
'type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'Germany',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_letsencryptchallengepath' => array(
|
||||
'label' => $lng['serversettings']['letsencryptchallengepath'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptchallengepath',
|
||||
'type' => 'string',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => FROXLOR_INSTALL_DIR,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_letsencryptkeysize' => array(
|
||||
'label' => $lng['serversettings']['letsencryptkeysize'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptkeysize',
|
||||
'type' => 'int',
|
||||
'int_min' => 2048,
|
||||
'default' => 4096,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_letsencryptreuseold' => array(
|
||||
'label' => $lng['serversettings']['letsencryptreuseold'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptreuseold',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'ssl' => [
|
||||
'title' => lng('admin.sslsettings'),
|
||||
'icon' => 'fa-solid fa-shield',
|
||||
'fields' => [
|
||||
'system_use_ssl' => [
|
||||
'label' => lng('serversettings.ssl.use_ssl'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'use_ssl',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true,
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_ssl_protocols' => [
|
||||
'label' => lng('serversettings.ssl.ssl_protocols'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_protocols',
|
||||
'type' => 'select',
|
||||
'default' => 'TLSv1.2',
|
||||
'select_mode' => 'multiple',
|
||||
'select_var' => [
|
||||
'TLSv1' => 'TLSv1',
|
||||
'TLSv1.1' => 'TLSv1.1',
|
||||
'TLSv1.2' => 'TLSv1.2',
|
||||
'TLSv1.3' => 'TLSv1.3'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_ssl_cipher_list' => [
|
||||
'label' => lng('serversettings.ssl.ssl_cipher_list'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cipher_list',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_tlsv13_cipher_list' => [
|
||||
'label' => lng('serversettings.ssl.tlsv13_cipher_list'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'tlsv13_cipher_list',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'visible' => Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_ssl_cert_file' => [
|
||||
'label' => lng('serversettings.ssl.ssl_cert_file'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_file',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/ssl/froxlor_selfsigned.pem',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_ssl_key_file' => [
|
||||
'label' => lng('serversettings.ssl.ssl_key_file'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_key_file',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/ssl/froxlor_selfsigned.key',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_ssl_cert_chainfile' => [
|
||||
'label' => lng('admin.ipsandports.ssl_cert_chainfile'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_chainfile',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_ssl_ca_file' => [
|
||||
'label' => lng('serversettings.ssl.ssl_ca_file'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_ca_file',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_apache24_ocsp_cache_path' => [
|
||||
'label' => lng('serversettings.ssl.apache24_ocsp_cache_path'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apache24_ocsp_cache_path',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => 'shmcb:/var/run/apache2/ocsp-stapling.cache(131072)',
|
||||
'visible' => Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_sessionticketsenabled' => [
|
||||
'label' => lng('admin.domain_sessionticketsenabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'sessionticketsenabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.use_ssl') && (Settings::Get('system.webserver') == "nginx" || (Settings::Get('system.webserver') == "apache2" && Settings::Get('system.apache24') == 1)),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_leenabled' => [
|
||||
'label' => lng('serversettings.leenabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'leenabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/letsencrypt',
|
||||
'save_method' => 'storeSettingField',
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_acmeshpath' => [
|
||||
'label' => lng('serversettings.acmeshpath'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'acmeshpath',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/root/.acme.sh/acme.sh',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_letsencryptacmeconf' => [
|
||||
'label' => lng('serversettings.letsencryptacmeconf'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptacmeconf',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/apache2/conf-enabled/acme.conf',
|
||||
'save_method' => 'storeSettingField',
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_letsencryptca' => [
|
||||
'label' => lng('serversettings.letsencryptca'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptca',
|
||||
'type' => 'select',
|
||||
'default' => 'letsencrypt',
|
||||
'select_var' => [
|
||||
'letsencrypt_test' => 'Let\'s Encrypt (Test / Staging)',
|
||||
'letsencrypt' => 'Let\'s Encrypt (Live)',
|
||||
'buypass_test' => 'Buypass (Test / Staging)',
|
||||
'buypass' => 'Buypass (Live)',
|
||||
'zerossl' => 'ZeroSSL (Live)',
|
||||
'google' => 'Google (Live)',
|
||||
'google_test' => 'Google (Test / Staging)',
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_letsencryptchallengepath' => [
|
||||
'label' => lng('serversettings.letsencryptchallengepath'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptchallengepath',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => false,
|
||||
'default' => Froxlor::getInstallDir(),
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true,
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_letsencryptkeysize' => [
|
||||
'label' => lng('serversettings.letsencryptkeysize'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptkeysize',
|
||||
'type' => 'select',
|
||||
'default' => '2048',
|
||||
'select_var' => [
|
||||
'2048' => '2048',
|
||||
'3072' => '3072',
|
||||
'4096' => '4096',
|
||||
'8192' => '8192'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_leecc' => [
|
||||
'label' => lng('serversettings.letsencryptecc'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'leecc',
|
||||
'type' => 'select',
|
||||
'default' => '0',
|
||||
'select_var' => [
|
||||
'0' => '-',
|
||||
'256' => 'ec-256',
|
||||
'384' => 'ec-384'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_letsencryptreuseold' => [
|
||||
'label' => lng('serversettings.letsencryptreuseold'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'letsencryptreuseold',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_le_domain_dnscheck' => [
|
||||
'label' => lng('serversettings.le_domain_dnscheck'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_domain_dnscheck',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_le_domain_dnscheck_resolver' => [
|
||||
'label' => lng('serversettings.le_domain_dnscheck_resolver'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'le_domain_dnscheck_resolver',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -4,148 +4,142 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'fcgid' => array(
|
||||
'title' => $lng['admin']['fcgid_settings'],
|
||||
'websrv_avail' => array('apache2', 'lighttpd'),
|
||||
'fields' => array(
|
||||
'system_mod_fcgid_enabled' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid'],
|
||||
return [
|
||||
'groups' => [
|
||||
'fcgid' => [
|
||||
'title' => lng('admin.fcgid_settings'),
|
||||
'icon' => 'fa-brands fa-php',
|
||||
'websrv_avail' => [
|
||||
'apache2',
|
||||
'lighttpd'
|
||||
],
|
||||
'fields' => [
|
||||
'system_mod_fcgid' => [
|
||||
'label' => lng('serversettings.mod_fcgid'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_mod_fcgid_configdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkFcgidPhpFpm'
|
||||
],
|
||||
'overview_option' => true,
|
||||
'requires_reconf' => ['http', 'system:fcgid']
|
||||
],
|
||||
'system_mod_fcgid_configdir' => [
|
||||
'label' => lng('serversettings.mod_fcgid.configdir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_configdir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/var/www/php-fcgi-scripts/',
|
||||
'plausibility_check_method' => 'checkPathConflicts',
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkPathConflicts'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
'requires_reconf' => ['system:fcgid']
|
||||
],
|
||||
'system_mod_fcgid_tmpdir' => [
|
||||
'label' => lng('serversettings.mod_fcgid.tmpdir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_tmpdir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/tmp/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_peardir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
||||
'requires_reconf' => ['http']
|
||||
],
|
||||
'system_mod_fcgid_peardir' => [
|
||||
'label' => lng('serversettings.mod_fcgid.peardir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_peardir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'string_delimiter' => ':',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_wrapper' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['wrapper'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mod_fcgid_wrapper' => [
|
||||
'label' => lng('serversettings.mod_fcgid.wrapper'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_wrapper',
|
||||
'type' => 'option',
|
||||
'option_options' => array(0 => 'ScriptAlias', 1=> 'FcgidWrapper'),
|
||||
'type' => 'select',
|
||||
'select_var' => [
|
||||
0 => 'ScriptAlias',
|
||||
1 => 'FcgidWrapper'
|
||||
],
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_starter' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['starter'],
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mod_fcgid_starter' => [
|
||||
'label' => lng('serversettings.mod_fcgid.starter'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_starter',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_maxrequests' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['maxrequests'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mod_fcgid_maxrequests' => [
|
||||
'label' => lng('serversettings.mod_fcgid.maxrequests'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_maxrequests',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 250,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_defaultini' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mod_fcgid_defaultini' => [
|
||||
'label' => lng('serversettings.mod_fcgid.defaultini'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_defaultini',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mod_fcgid_enabled_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid_ownvhost'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_ownvhost',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_httpuser' => array(
|
||||
'label' => $lng['admin']['mod_fcgid_user'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_httpgroup' => array(
|
||||
'label' => $lng['admin']['mod_fcgid_group'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_httpgroup',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_defaultini_ownvhost',
|
||||
'type' => 'option',
|
||||
'default' => '2',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['idle_timeout'],
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Http\\PhpConfig',
|
||||
'getPhpConfigs'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mod_fcgid_idle_timeout' => [
|
||||
'label' => lng('serversettings.mod_fcgid.idle_timeout'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_idle_timeout',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 30,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -1,200 +1,161 @@
|
||||
<?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 Settings
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'phpfpm' => array(
|
||||
'title' => $lng['admin']['phpfpm_settings'],
|
||||
'fields' => array(
|
||||
'system_phpfpm_enabled' => array(
|
||||
'label' => $lng['serversettings']['phpfpm'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_phpfpm_enabled_ownvhost' => array(
|
||||
'label' => $lng['phpfpm']['ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled_ownvhost',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_httpuser' => array(
|
||||
'label' => $lng['phpfpm']['vhost_httpuser'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser'
|
||||
),
|
||||
'system_phpfpm_httpgroup' => array(
|
||||
'label' => $lng['phpfpm']['vhost_httpgroup'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_httpgroup',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_defaultini' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'phpfpm' => [
|
||||
'title' => lng('admin.phpfpm_settings'),
|
||||
'icon' => 'fa-brands fa-php',
|
||||
'fields' => [
|
||||
'phpfpm_enabled' => [
|
||||
'label' => lng('serversettings.phpfpm'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkFcgidPhpFpm'
|
||||
],
|
||||
'overview_option' => true,
|
||||
'requires_reconf' => ['http', 'system:php-fpm']
|
||||
],
|
||||
'phpfpm_defaultini' => [
|
||||
'label' => lng('serversettings.mod_fcgid.defaultini'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'defaultini',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\Http\\PhpConfig',
|
||||
'getPhpConfigs'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_defaultini',
|
||||
'type' => 'option',
|
||||
'default' => '2',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_configdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'configdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_aliasconfigdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'aliasconfigdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/var/www/php-fpm/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'tmpdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/tmp/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_peardir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'peardir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_fastcgi_ipcdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['ipcdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'fastcgi_ipcdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/lib/apache2/fastcgi/',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_reload' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['reload'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'reload',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/php-fpm restart',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'pm',
|
||||
'type' => 'option',
|
||||
'default' => 'static',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand'),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_children',
|
||||
'type' => 'int',
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'start_servers',
|
||||
'type' => 'int',
|
||||
'default' => 20,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'min_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 35,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'max_requests',
|
||||
'type' => 'int',
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'idle_timeout',
|
||||
'type' => 'int',
|
||||
'default' => 30,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_use_mod_proxy' => array(
|
||||
'label' => $lng['phpfpm']['use_mod_proxy'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'use_mod_proxy',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'visible' => Settings::Get('system.apache24'),
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
],
|
||||
'phpfpm_aliasconfigdir' => [
|
||||
'label' => lng('serversettings.phpfpm_settings.aliasconfigdir'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'aliasconfigdir',
|
||||
'type' => 'text',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/var/www/php-fpm/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_tmpdir' => [
|
||||
'label' => lng('serversettings.mod_fcgid.tmpdir'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'tmpdir',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/tmp/',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'phpfpm_peardir' => [
|
||||
'label' => lng('serversettings.mod_fcgid.peardir'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'peardir',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'string_delimiter' => ':',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_envpath' => [
|
||||
'label' => lng('serversettings.phpfpm_settings.envpath'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'envpath',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'string_delimiter' => ':',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/usr/local/bin:/usr/bin:/bin',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_fastcgi_ipcdir' => [
|
||||
'label' => lng('serversettings.phpfpm_settings.ipcdir'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'fastcgi_ipcdir',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/lib/apache2/fastcgi/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_use_mod_proxy' => [
|
||||
'label' => lng('phpfpm.use_mod_proxy'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'use_mod_proxy',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'visible' => Settings::Get('system.apache24'),
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'phpfpm_ini_flags' => [
|
||||
'label' => lng('phpfpm.ini_flags'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_flags',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_ini_values' => [
|
||||
'label' => lng('phpfpm.ini_values'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_values',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_ini_admin_flags' => [
|
||||
'label' => lng('phpfpm.ini_admin_flags'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_admin_flags',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'phpfpm_ini_admin_values' => [
|
||||
'label' => lng('phpfpm.ini_admin_values'),
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'ini_admin_values',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -4,62 +4,77 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'perl' => array(
|
||||
'title' => $lng['admin']['perl_settings'],
|
||||
'fields' => array(
|
||||
'perl_path' => array(
|
||||
'label' => $lng['serversettings']['perl_path'],
|
||||
return [
|
||||
'groups' => [
|
||||
'perl' => [
|
||||
'title' => lng('admin.perl_settings'),
|
||||
'icon' => 'fa-solid fa-code',
|
||||
'fields' => [
|
||||
'system_perl_path' => [
|
||||
'label' => lng('serversettings.perl_path'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'perl_path',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '/usr/bin/perl',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('lighttpd')
|
||||
),
|
||||
'system_perl_suexecworkaround' => array(
|
||||
'label' => $lng['serversettings']['perl']['suexecworkaround'],
|
||||
'websrv_avail' => [
|
||||
'lighttpd'
|
||||
]
|
||||
],
|
||||
'perl_suexecworkaround' => [
|
||||
'label' => lng('serversettings.perl.suexecworkaround'),
|
||||
'settinggroup' => 'perl',
|
||||
'varname' => 'suexecworkaround',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_perl_suexeccgipath' => array(
|
||||
'label' => $lng['serversettings']['perl']['suexeccgipath'],
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
]
|
||||
],
|
||||
'perl_suexecpath' => [
|
||||
'label' => lng('serversettings.perl.suexeccgipath'),
|
||||
'settinggroup' => 'perl',
|
||||
'varname' => 'suexecpath',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/www/cgi-bin/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'perl_server' => array(
|
||||
'label' => $lng['serversettings']['perl_server'],
|
||||
'websrv_avail' => [
|
||||
'apache2'
|
||||
]
|
||||
],
|
||||
'serversettings_perl_server' => [
|
||||
'label' => lng('serversettings.perl_server'),
|
||||
'settinggroup' => 'serversettings',
|
||||
'varname' => 'perl_server',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => 'unix:/var/run/nginx/cgiwrap-dispatch.sock',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'websrv_avail' => [
|
||||
'nginx'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,83 +2,115 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'statistics' => array(
|
||||
'title' => $lng['admin']['statisticsettings'],
|
||||
'fields' => array(
|
||||
'system_webalizer_quiet' => array(
|
||||
'label' => $lng['serversettings']['webalizer_quiet'],
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'statistics' => [
|
||||
'title' => lng('admin.statisticsettings'),
|
||||
'icon' => 'fa-solid fa-chart-area',
|
||||
'fields' => [
|
||||
'system_traffictool' => [
|
||||
'label' => lng('serversettings.traffictool.toolselect'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'traffictool',
|
||||
'type' => 'select',
|
||||
'default' => 'goaccess',
|
||||
'select_var' => [
|
||||
'webalizer' => lng('serversettings.traffictool.webalizer'),
|
||||
'awstats' => lng('serversettings.traffictool.awstats'),
|
||||
'goaccess' => lng('serversettings.traffictool.goaccess')
|
||||
],
|
||||
'save_method' => 'storeSettingUpdateTrafficTool',
|
||||
'requires_reconf' => ['system']
|
||||
],
|
||||
'system_webalizer_quiet' => [
|
||||
'label' => lng('serversettings.webalizer_quiet'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'webalizer_quiet',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 2,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(0 => $lng['admin']['webalizer']['normal'], 1 => $lng['admin']['webalizer']['quiet'], 2 => $lng['admin']['webalizer']['veryquiet']),
|
||||
'select_var' => [
|
||||
0 => lng('admin.webalizer.normal'),
|
||||
1 => lng('admin.webalizer.quiet'),
|
||||
2 => lng('admin.webalizer.veryquiet')
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_awstats_enabled' => array(
|
||||
'label' => $lng['serversettings']['awstats_enabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_awstats_path' => array(
|
||||
'label' => $lng['serversettings']['awstats_path'],
|
||||
'visible' => Settings::Get('system.traffictool') == 'webalizer'
|
||||
],
|
||||
'system_awstats_path' => [
|
||||
'label' => lng('serversettings.awstats_path'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_path',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/bin/',
|
||||
'default' => '/usr/share/awstats/tools/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_awstats_awstatspath' => array(
|
||||
'label' => $lng['serversettings']['awstats_awstatspath'],
|
||||
'visible' => Settings::Get('system.traffictool') == 'awstats'
|
||||
],
|
||||
'system_awstats_awstatspath' => [
|
||||
'label' => lng('serversettings.awstats_awstatspath'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_awstatspath',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/bin/',
|
||||
'default' => '/usr/lib/cgi-bin/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_awstats_conf' => array(
|
||||
'label' => $lng['serversettings']['awstats_conf'],
|
||||
'visible' => Settings::Get('system.traffictool') == 'awstats'
|
||||
],
|
||||
'system_awstats_conf' => [
|
||||
'label' => lng('serversettings.awstats_conf'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_conf',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/awstats/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_awstats_icons' => array(
|
||||
'label' => $lng['serversettings']['awstats_icons'],
|
||||
'visible' => Settings::Get('system.traffictool') == 'awstats',
|
||||
'requires_reconf' => ['system:awstats']
|
||||
],
|
||||
'system_awstats_icons' => [
|
||||
'label' => lng('serversettings.awstats_icons'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_icons',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/awstats/icon/',
|
||||
'save_method' => 'storeSettingField',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
'visible' => Settings::Get('system.traffictool') == 'awstats'
|
||||
],
|
||||
'system_awstats_logformat' => [
|
||||
'label' => lng('serversettings.awstats.logformat'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'awstats_logformat',
|
||||
'type' => 'text',
|
||||
'default' => '1',
|
||||
'save_method' => 'storeSettingField',
|
||||
'visible' => Settings::Get('system.traffictool') == 'awstats',
|
||||
'advanced_mode' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,148 +2,168 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'mail' => array(
|
||||
'title' => $lng['admin']['mailserversettings'],
|
||||
'fields' => array(
|
||||
'system_vmail_uid' => array(
|
||||
'label' => $lng['serversettings']['vmail_uid'],
|
||||
return [
|
||||
'groups' => [
|
||||
'mail' => [
|
||||
'title' => lng('admin.mailserversettings'),
|
||||
'icon' => 'fa-solid fa-envelope',
|
||||
'fields' => [
|
||||
'system_vmail_uid' => [
|
||||
'label' => lng('serversettings.vmail_uid'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'vmail_uid',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 2000,
|
||||
'int_min' => 1,
|
||||
'int_max' => 65535,
|
||||
'min' => 2,
|
||||
'max' => 65535,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_vmail_gid' => array(
|
||||
'label' => $lng['serversettings']['vmail_gid'],
|
||||
'advanced_mode' => true,
|
||||
'requires_reconf' => ['smtp']
|
||||
],
|
||||
'system_vmail_gid' => [
|
||||
'label' => lng('serversettings.vmail_gid'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'vmail_gid',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 2000,
|
||||
'int_min' => 1,
|
||||
'int_max' => 65535,
|
||||
'min' => 2,
|
||||
'max' => 65535,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_vmail_homedir' => array(
|
||||
'label' => $lng['serversettings']['vmail_homedir'],
|
||||
'advanced_mode' => true,
|
||||
'requires_reconf' => ['smtp']
|
||||
],
|
||||
'system_vmail_homedir' => [
|
||||
'label' => lng('serversettings.vmail_homedir'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'vmail_homedir',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/mail/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_vmail_maildirname' => array(
|
||||
'label' => $lng['serversettings']['vmail_maildirname'],
|
||||
'requires_reconf' => ['smtp']
|
||||
],
|
||||
'system_vmail_maildirname' => [
|
||||
'label' => lng('serversettings.vmail_maildirname'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'vmail_maildirname',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => 'Maildir',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_sendalternativemail' => array(
|
||||
'label' => $lng['serversettings']['sendalternativemail'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'panel_sendalternativemail' => [
|
||||
'label' => lng('serversettings.sendalternativemail'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'sendalternativemail',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mail_quota_enabled' => array(
|
||||
'label' => $lng['serversettings']['mail_quota_enabled'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_quota_enabled' => [
|
||||
'label' => lng('serversettings.mail_quota_enabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_quota_enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mail_quota' => array(
|
||||
'label' => $lng['serversettings']['mail_quota'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mail_quota' => [
|
||||
'label' => lng('serversettings.mail_quota'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mail_quota',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 100,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_catchall_enabled' => array(
|
||||
'label' => $lng['serversettings']['catchall_enabled'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'catchall_catchall_enabled' => [
|
||||
'label' => lng('serversettings.catchall_enabled'),
|
||||
'settinggroup' => 'catchall',
|
||||
'varname' => 'catchall_enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingResetCatchall',
|
||||
),
|
||||
'system_mailtraffic_enabled' => array(
|
||||
'label' => $lng['serversettings']['mailtraffic_enabled'],
|
||||
'save_method' => 'storeSettingResetCatchall'
|
||||
],
|
||||
'system_mailtraffic_enabled' => [
|
||||
'label' => lng('serversettings.mailtraffic_enabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mailtraffic_enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mdaserver' => array(
|
||||
'label' => $lng['serversettings']['mdaserver'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mdaserver' => [
|
||||
'label' => lng('serversettings.mdaserver'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mdaserver',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'type' => 'select',
|
||||
'default' => 'dovecot',
|
||||
'option_options' => array('courier' => 'Courier', 'dovecot' => 'Dovecot'),
|
||||
'select_var' => [
|
||||
'courier' => 'Courier',
|
||||
'dovecot' => 'Dovecot'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mdalog' => array(
|
||||
'label' => $lng['serversettings']['mdalog'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mdalog' => [
|
||||
'label' => lng('serversettings.mdalog'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mdalog',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/var/log/mail.log',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mtaserver' => array(
|
||||
'label' => $lng['serversettings']['mtaserver'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mtaserver' => [
|
||||
'label' => lng('serversettings.mtaserver'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mtaserver',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'type' => 'select',
|
||||
'default' => 'postfix',
|
||||
'option_options' => array('exim4' => 'Exim4', 'postfix' => 'Postfix'),
|
||||
'select_var' => [
|
||||
'exim4' => 'Exim4',
|
||||
'postfix' => 'Postfix'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mtalog' => array(
|
||||
'label' => $lng['serversettings']['mtalog'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_mtalog' => [
|
||||
'label' => lng('serversettings.mtalog'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mtalog',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'default' => '/var/log/mail.log',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'advanced_mode' => true
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,39 +2,46 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'ftpserver' => array(
|
||||
'title' => $lng['admin']['ftpserversettings'],
|
||||
'fields' => array(
|
||||
'ftpserver' => array(
|
||||
'label' => $lng['admin']['ftpserver'],
|
||||
return [
|
||||
'groups' => [
|
||||
'ftpserver' => [
|
||||
'title' => lng('admin.ftpserversettings'),
|
||||
'icon' => 'fa-solid fa-arrow-right-arrow-left',
|
||||
'fields' => [
|
||||
'system_ftpserver' => [
|
||||
'label' => lng('admin.ftpserver'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ftpserver',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'proftpd',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('proftpd' => 'Proftpd', 'pureftpd' => 'Pureftpd'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
'select_var' => [
|
||||
'proftpd' => 'Proftpd',
|
||||
'pureftpd' => 'Pureftpd'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,112 +2,177 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'nameserver' => array(
|
||||
'title' => $lng['admin']['nameserversettings'],
|
||||
'fields' => array(
|
||||
'nameserver_enable' => array(
|
||||
'label' => $lng['serversettings']['bindenable'],
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'nameserver' => [
|
||||
'title' => lng('admin.nameserversettings'),
|
||||
'icon' => 'fa-solid fa-globe',
|
||||
'fields' => [
|
||||
'system_bind_enable' => [
|
||||
'label' => lng('serversettings.bindenable'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'bind_enable',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_bindconf_directory' => array(
|
||||
'label' => $lng['serversettings']['bindconf_directory'],
|
||||
'overview_option' => true,
|
||||
'requires_reconf' => ['dns']
|
||||
],
|
||||
'system_dnsenabled' => [
|
||||
'label' => lng('serversettings.dnseditorenable'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dnsenabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_dns_server' => [
|
||||
'label' => lng('serversettings.dns_server'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dns_server',
|
||||
'type' => 'select',
|
||||
'default' => 'Bind',
|
||||
'select_var' => [
|
||||
'Bind' => 'Bind9',
|
||||
'PowerDNS' => 'PowerDNS'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'requires_reconf' => ['dns']
|
||||
],
|
||||
'system_bindconf_directory' => [
|
||||
'label' => lng('serversettings.bindconf_directory'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'bindconf_directory',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/bind/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_bindreload_command' => array(
|
||||
'label' => $lng['serversettings']['bindreload_command'],
|
||||
'visible' => Settings::Get('system.dns_server') == 'Bind',
|
||||
'requires_reconf' => ['dns:bind']
|
||||
],
|
||||
'system_bindreload_command' => [
|
||||
'label' => lng('serversettings.bindreload_command'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'bindreload_command',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '/etc/init.d/bind9 reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_nameservers' => array(
|
||||
'label' => $lng['serversettings']['nameservers'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_nameservers' => [
|
||||
'label' => lng('serversettings.nameservers'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nameservers',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^(([a-z0-9\-\._]+, ?)*[a-z0-9\-\._]+)?$/i',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'system_mxservers' => array(
|
||||
'label' => $lng['serversettings']['mxservers'],
|
||||
'save_method' => 'storeSettingFieldInsertBindTask'
|
||||
],
|
||||
'system_mxservers' => [
|
||||
'label' => lng('serversettings.mxservers'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mxservers',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^(([0-9]+ [a-z0-9\-\._]+, ?)*[0-9]+ [a-z0-9\-\._]+)?$/i',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_axfrservers' => array(
|
||||
'label' => $lng['serversettings']['axfrservers'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_axfrservers' => [
|
||||
'label' => lng('serversettings.axfrservers'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'axfrservers',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'validate_ip_incl_private',
|
||||
'string_delimiter' => ',',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_dns_createhostnameentry' => array(
|
||||
'label' => $lng['serversettings']['dns_createhostnameentry'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dns_createhostnameentry',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_dns_createmailentry' => array(
|
||||
'label' => $lng['serversettings']['mail_also_with_mxservers'],
|
||||
],
|
||||
'system_powerdns_mode' => [
|
||||
'label' => lng('serversettings.powerdns_mode'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'powerdns_mode',
|
||||
'type' => 'select',
|
||||
'default' => 'Native',
|
||||
'select_var' => [
|
||||
'Native' => 'Native',
|
||||
'Master' => 'Master'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true,
|
||||
'visible' => Settings::Get('system.dns_server') == 'PowerDNS',
|
||||
],
|
||||
'system_dns_createmailentry' => [
|
||||
'label' => lng('serversettings.mail_also_with_mxservers'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dns_createmailentry',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_defaultttl' => array(
|
||||
'label' => $lng['serversettings']['defaultttl'],
|
||||
],
|
||||
'system_dns_createcaaentry' => [
|
||||
'label' => lng('serversettings.caa_entry'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'dns_createcaaentry',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'caa_caa_entry' => [
|
||||
'label' => lng('serversettings.caa_entry_custom'),
|
||||
'settinggroup' => 'caa',
|
||||
'varname' => 'caa_entry',
|
||||
'type' => 'textarea',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_defaultttl' => [
|
||||
'label' => lng('serversettings.defaultttl'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'defaultttl',
|
||||
'type' => 'int',
|
||||
'type' => 'number',
|
||||
'default' => 604800, /* 1 week */
|
||||
'int_min' => 3600, /* 1 hour */
|
||||
'int_max' => 2147483647, /* integer max */
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'min' => 3600, /* 1 hour */
|
||||
'max' => 2147483647, /* integer max */
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_soaemail' => [
|
||||
'label' => lng('serversettings.soaemail'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'soaemail',
|
||||
'type' => 'email',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,82 +2,92 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'logging' => array(
|
||||
'title' => $lng['admin']['loggersettings'],
|
||||
'fields' => array(
|
||||
'logger_enabled' => array(
|
||||
'label' => $lng['serversettings']['logger']['enable'],
|
||||
return [
|
||||
'groups' => [
|
||||
'logging' => [
|
||||
'title' => lng('admin.loggersettings'),
|
||||
'icon' => 'fa-solid fa-file-lines',
|
||||
'fields' => [
|
||||
'logger_enabled' => [
|
||||
'label' => lng('serversettings.logger.enable'),
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'logger_severity' => array(
|
||||
'label' => $lng['serversettings']['logger']['severity'],
|
||||
],
|
||||
'logger_severity' => [
|
||||
'label' => lng('serversettings.logger.severity'),
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'severity',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 1,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(1 => $lng['admin']['logger']['normal'], 2 => $lng['admin']['logger']['paranoid']),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'logger_logtypes' => array(
|
||||
'label' => $lng['serversettings']['logger']['types'],
|
||||
'select_var' => [
|
||||
1 => lng('admin.logger.normal'),
|
||||
2 => lng('admin.logger.paranoid')
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'logger_logtypes' => [
|
||||
'label' => lng('serversettings.logger.types'),
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'logtypes',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'syslog,mysql',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array('syslog' => 'syslog', 'file' => 'file', 'mysql' => 'mysql'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'logger_logfile' => array(
|
||||
'label' => $lng['serversettings']['logger']['logfile'],
|
||||
'select_mode' => 'multiple',
|
||||
'select_var' => [
|
||||
'syslog' => 'syslog',
|
||||
'file' => 'file',
|
||||
'mysql' => 'mysql'
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'logger_logfile' => [
|
||||
'label' => lng('serversettings.logger.logfile'),
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'logfile',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'logger_log_cron' => array(
|
||||
'label' => $lng['serversettings']['logger']['logcron'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'logger_log_cron' => [
|
||||
'label' => lng('serversettings.logger.logcron'),
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'log_cron',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 0,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(
|
||||
0 => $lng['serversettings']['logger']['logcronoption']['never'],
|
||||
1 => $lng['serversettings']['logger']['logcronoption']['once'],
|
||||
2 => $lng['serversettings']['logger']['logcronoption']['always']
|
||||
),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
'select_var' => [
|
||||
0 => lng('serversettings.logger.logcronoption.never'),
|
||||
1 => lng('serversettings.logger.logcronoption.once'),
|
||||
2 => lng('serversettings.logger.logcronoption.always')
|
||||
],
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -2,133 +2,144 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'dkim' => array(
|
||||
'title' => $lng['admin']['dkimsettings'],
|
||||
'fields' => array(
|
||||
'dkim_enabled' => array(
|
||||
'label' => $lng['dkim']['use_dkim'],
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'dkim' => [
|
||||
'title' => lng('admin.dkimsettings'),
|
||||
'icon' => 'fa-solid fa-fingerprint',
|
||||
'fields' => [
|
||||
'dkim_use_dkim' => [
|
||||
'label' => lng('dkim.use_dkim'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'use_dkim',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
'overview_option' => true
|
||||
),
|
||||
'dkim_prefix' => array(
|
||||
'label' => $lng['dkim']['dkim_prefix'],
|
||||
],
|
||||
'dkim_dkim_prefix' => [
|
||||
'label' => lng('dkim.dkim_prefix'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_prefix',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/postfix/dkim/',
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'dkim_privkeysuffix' => [
|
||||
'label' => lng('dkim.privkeysuffix'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'privkeysuffix',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||
'default' => '.priv',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'dkim_domains' => array(
|
||||
'label' => $lng['dkim']['dkim_domains'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'dkim_dkim_domains' => [
|
||||
'label' => lng('dkim.dkim_domains'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_domains',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||
'default' => 'domains',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'dkim_dkimkeys' => array(
|
||||
'label' => $lng['dkim']['dkim_dkimkeys'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'dkim_dkim_dkimkeys' => [
|
||||
'label' => lng('dkim.dkim_dkimkeys'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_dkimkeys',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||
'default' => 'dkim-keys.conf',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'dkim_algorithm' => array(
|
||||
'label' => $lng['dkim']['dkim_algorithm'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'dkim_dkim_algorithm' => [
|
||||
'label' => lng('dkim.dkim_algorithm'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_algorithm',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => 'all',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array('all' => 'All', 'sha1' => 'SHA1', 'sha256' => 'SHA256'),
|
||||
'select_mode' => 'multiple',
|
||||
'select_var' => [
|
||||
'all' => 'All',
|
||||
'sha1' => 'SHA1',
|
||||
'sha256' => 'SHA256'
|
||||
],
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_servicetype' => array(
|
||||
'label' => $lng['dkim']['dkim_servicetype'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'dkim_dkim_servicetype' => [
|
||||
'label' => lng('dkim.dkim_servicetype'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_servicetype',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => '0',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('0' => 'All', '1' => 'E-Mail'),
|
||||
'select_var' => [
|
||||
'0' => 'All',
|
||||
'1' => 'E-Mail'
|
||||
],
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_keylength' => array(
|
||||
'label' => array(
|
||||
'title' => $lng['dkim']['dkim_keylength']['title'],
|
||||
'description' => sprintf($lng['dkim']['dkim_keylength']['description'], Settings::Get('dkim.dkim_prefix'))
|
||||
),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'dkim_dkim_keylength' => [
|
||||
'label' => [
|
||||
'title' => lng('dkim.dkim_keylength.title'),
|
||||
'description' => lng('dkim.dkim_keylength.description', [Settings::Get('dkim.dkim_prefix')])
|
||||
],
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_keylength',
|
||||
'type' => 'option',
|
||||
'type' => 'select',
|
||||
'default' => '1024',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('1024' => '1024 Bit', '2048' => '2048 Bit'),
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_notes' => array(
|
||||
'label' => $lng['dkim']['dkim_notes'],
|
||||
'select_var' => [
|
||||
'1024' => '1024 Bit',
|
||||
'2048' => '2048 Bit'
|
||||
],
|
||||
'save_method' => 'storeSettingFieldInsertBindTask'
|
||||
],
|
||||
'dkim_dkim_notes' => [
|
||||
'label' => lng('dkim.dkim_notes'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_notes',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\._]+$/i',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_add_adsp' => array(
|
||||
'label' => $lng['dkim']['dkim_add_adsp'],
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_add_adsp',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_add_adsppolicy' => array(
|
||||
'label' => $lng['dkim']['dkim_add_adsppolicy'],
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_add_adsppolicy',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('0' => 'Unknown', '1' => 'All', '2' => 'Discardable'),
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkimrestart_command' => array(
|
||||
'label' => $lng['dkim']['dkimrestart_command'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'dkim_dkimrestart_command' => [
|
||||
'label' => lng('dkim.dkimrestart_command'),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkimrestart_command',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'string_regexp' => '/^[a-z0-9\/\._\- ]+$/i',
|
||||
'default' => '/etc/init.d/dkim-filter restart',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -4,42 +4,49 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'spf' => array(
|
||||
'title' => $lng['admin']['spfsettings'],
|
||||
'fields' => array(
|
||||
'spf_enabled' => array(
|
||||
'label' => $lng['spf']['use_spf'],
|
||||
return [
|
||||
'groups' => [
|
||||
'spf' => [
|
||||
'title' => lng('admin.spfsettings'),
|
||||
'icon' => 'fa-solid fa-clipboard-check',
|
||||
'fields' => [
|
||||
'spf_use_spf' => [
|
||||
'label' => lng('spf.use_spf'),
|
||||
'settinggroup' => 'spf',
|
||||
'varname' => 'use_spf',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'spf_entry' => array(
|
||||
'label' => $lng['spf']['spf_entry'],
|
||||
],
|
||||
'spf_spf_entry' => [
|
||||
'label' => lng('spf.spf_entry'),
|
||||
'settinggroup' => 'spf',
|
||||
'varname' => 'spf_entry',
|
||||
'type' => 'string',
|
||||
'default' => '@ IN TXT "v=spf1 a mx -all"',
|
||||
'type' => 'text',
|
||||
'default' => '"v=spf1 a mx -all"',
|
||||
'save_method' => 'storeSettingField'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'ticket' => array(
|
||||
'title' => $lng['admin']['ticketsettings'],
|
||||
'fields' => array(
|
||||
'ticket_enabled' => array(
|
||||
'label' => $lng['serversettings']['ticket']['enable'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/ticket',
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'ticket_noreply_email' => array(
|
||||
'label' => $lng['serversettings']['ticket']['noreply_email'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'noreply_email',
|
||||
'type' => 'string',
|
||||
'string_type' => 'mail',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_noreply_name' => array(
|
||||
'label' => $lng['serversettings']['ticket']['noreply_name'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'noreply_name',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_reset_cycle' => array(
|
||||
'label' => $lng['serversettings']['ticket']['reset_cycle'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'reset_cycle',
|
||||
'type' => 'option',
|
||||
'default' => 1,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(0 => html_entity_decode($lng['admin']['tickets']['daily']), 1 => html_entity_decode($lng['admin']['tickets']['weekly']), 2 => html_entity_decode($lng['admin']['tickets']['monthly']), 3 => html_entity_decode($lng['admin']['tickets']['yearly'])),
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'setCycleOfCronjob',
|
||||
),
|
||||
'ticket_concurrently_open' => array(
|
||||
'label' => $lng['serversettings']['ticket']['concurrentlyopen'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'concurrently_open',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_archiving_days' => array(
|
||||
'label' => $lng['serversettings']['ticket']['archiving_days'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'archiving_days',
|
||||
'type' => 'int',
|
||||
'int_min' => 1,
|
||||
'int_max' => 99,
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_worktime_all' => array(
|
||||
'label' => $lng['serversettings']['ticket']['worktime_all'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'worktime_all',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_worktime_begin' => array(
|
||||
'label' => $lng['serversettings']['ticket']['worktime_begin'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'worktime_begin',
|
||||
'type' => 'string',
|
||||
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_worktime_end' => array(
|
||||
'label' => $lng['serversettings']['ticket']['worktime_end'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'worktime_end',
|
||||
'type' => 'string',
|
||||
'string_regexp' => '/^[012][0-9]:[0-6][0-9]$/',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_worktime_sat' => array(
|
||||
'label' => $lng['serversettings']['ticket']['worktime_sat'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'worktime_sat',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'ticket_worktime_sun' => array(
|
||||
'label' => $lng['serversettings']['ticket']['worktime_sun'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'worktime_sun',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_last_archive_run' => array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'last_archive_run',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'ticket_default_priority' => array(
|
||||
'label' => $lng['serversettings']['ticket']['default_priority'],
|
||||
'settinggroup' => 'ticket',
|
||||
'varname' => 'default_priority',
|
||||
'type' => 'option',
|
||||
'default' => 2,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(1 => $lng['ticket']['high'], 2 => $lng['ticket']['normal'], 3 => $lng['ticket']['low']),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -2,69 +2,115 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'security' => array(
|
||||
'title' => $lng['admin']['security_settings'],
|
||||
'fields' => array(
|
||||
'panel_unix_names' => array(
|
||||
'label' => $lng['serversettings']['unix_names'],
|
||||
use Froxlor\Settings;
|
||||
|
||||
return [
|
||||
'groups' => [
|
||||
'security' => [
|
||||
'title' => lng('admin.security_settings'),
|
||||
'icon' => 'fa-solid fa-user-lock',
|
||||
'fields' => [
|
||||
'panel_unix_names' => [
|
||||
'label' => lng('serversettings.unix_names'),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'unix_names',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mailpwcleartext' => array(
|
||||
'label' => $lng['serversettings']['mailpwcleartext'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_mailpwcleartext' => [
|
||||
'label' => lng('serversettings.mailpwcleartext'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mailpwcleartext',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_passwordcryptfunc' => array(
|
||||
'label' => $lng['serversettings']['passwordcryptfunc'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_passwordcryptfunc' => [
|
||||
'label' => lng('serversettings.passwordcryptfunc'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'passwordcryptfunc',
|
||||
'type' => 'option',
|
||||
'default' => 0,
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getAvailablePasswordHashes',
|
||||
'type' => 'select',
|
||||
'default' => PASSWORD_DEFAULT,
|
||||
'option_options_method' => [
|
||||
'\\Froxlor\\System\\Crypt',
|
||||
'getAvailablePasswordHashes'
|
||||
],
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_allow_error_report_admin' => array(
|
||||
'label' => $lng['serversettings']['allow_error_report_admin'],
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_allow_error_report_admin' => [
|
||||
'label' => lng('serversettings.allow_error_report_admin'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'allow_error_report_admin',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_allow_error_report_customer' => array(
|
||||
'label' => $lng['serversettings']['allow_error_report_customer'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_allow_error_report_customer' => [
|
||||
'label' => lng('serversettings.allow_error_report_customer'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'allow_error_report_customer',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_allow_customer_shell' => [
|
||||
'label' => lng('serversettings.allow_allow_customer_shell'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'allow_customer_shell',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_available_shells' => [
|
||||
'label' => lng('serversettings.available_shells'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'available_shells',
|
||||
'type' => 'text',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'advanced_mode' => true
|
||||
],
|
||||
'system_froxlorusergroup' => [
|
||||
'label' => lng('serversettings.froxlorusergroup'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'froxlorusergroup',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => [
|
||||
'\\Froxlor\\Validate\\Check',
|
||||
'checkLocalGroup'
|
||||
],
|
||||
'visible' => Settings::Get('system.nssextrausers'),
|
||||
'advanced_mode' => true
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -1,60 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2011- the Froxlor Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2011-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Settings
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'diskquota' => array(
|
||||
'title' => $lng['diskquota'],
|
||||
'fields' => array(
|
||||
'diskquota_enabled' => array(
|
||||
'label' => $lng['serversettings']['diskquota_enabled'],
|
||||
return [
|
||||
'groups' => [
|
||||
'diskquota' => [
|
||||
'title' => lng('diskquota'),
|
||||
'icon' => 'fa-solid fa-sliders',
|
||||
'advanced_mode' => true,
|
||||
'fields' => [
|
||||
'system_diskquota_enabled' => [
|
||||
'label' => lng('serversettings.diskquota_enabled'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'diskquota_enabled',
|
||||
'type' => 'bool',
|
||||
'type' => 'checkbox',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'diskquota_repquota_path' => array(
|
||||
'label' => $lng['serversettings']['diskquota_repquota_path']['description'],
|
||||
],
|
||||
'system_diskquota_repquota_path' => [
|
||||
'label' => lng('serversettings.diskquota_repquota_path.description'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'diskquota_repquota_path',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '/usr/sbin/repquota',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'diskquota_quotatool_path' => array(
|
||||
'label' => $lng['serversettings']['diskquota_quotatool_path']['description'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_diskquota_quotatool_path' => [
|
||||
'label' => lng('serversettings.diskquota_quotatool_path.description'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'diskquota_quotatool_path',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '/usr/bin/quotatool',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'diskquota_customer_partition' => array(
|
||||
'label' => $lng['serversettings']['diskquota_customer_partition']['description'],
|
||||
'save_method' => 'storeSettingField'
|
||||
],
|
||||
'system_diskquota_customer_partition' => [
|
||||
'label' => lng('serversettings.diskquota_customer_partition.description'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'diskquota_customer_partition',
|
||||
'type' => 'string',
|
||||
'type' => 'text',
|
||||
'default' => '/dev/root',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
'save_method' => 'storeSettingField'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
0
actions/admin/settings/index.html
Normal file
0
actions/index.html
Normal file
946
admin_admins.php
@@ -1,415 +1,234 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| APC |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 2006-2011 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Ralf Becker <beckerr@php.net> |
|
||||
| Rasmus Lerdorf <rasmus@php.net> |
|
||||
| Ilia Alshanetsky <ilia@prohost.org> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
All other licensing and usage conditions are those of the PHP Group.
|
||||
|
||||
Based on https://github.com/krakjoe/apcu/blob/master/apc.php
|
||||
Implemented into Froxlor: Janos Muzsi <muzsij@hypernics.hu>
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @author Janos Muzsi <muzsij@hypernics.hu>
|
||||
* @author Ralf Becker <beckerr@php.net>
|
||||
* @author Rasmus Lerdorf <rasmus@php.net>
|
||||
* @author Ilia Alshanetsky <ilia@prohost.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*
|
||||
* Based on https://github.com/krakjoe/apcu/blob/master/apc.php, which is
|
||||
* licensed under the PHP licence (version 3.01), which can be viewed
|
||||
* online at https://www.php.net/license/3_01.txt
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\UI\HTML;
|
||||
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
$horizontal_bar_size = 950; // 1280px window width
|
||||
|
||||
if ($action == 'delete' &&
|
||||
function_exists('apcu_clear_cache') &&
|
||||
$userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
apcu_clear_cache();
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "cleared APCu cache");
|
||||
header('Location: ' . $linker->getLink(array('section' => 'apcuinfo', 'page' => 'showinfo')));
|
||||
exit();
|
||||
if ($action == 'delete' && function_exists('apcu_clear_cache') && $userinfo['change_serversettings'] == '1') {
|
||||
if ($_POST['send'] == 'send') {
|
||||
apcu_clear_cache();
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "cleared APCu cache");
|
||||
header('Location: ' . $linker->getLink([
|
||||
'section' => 'apcuinfo',
|
||||
'page' => 'showinfo'
|
||||
]));
|
||||
exit();
|
||||
} else {
|
||||
HTML::askYesNo('cache_reallydelete', $filename, [
|
||||
'page' => $page,
|
||||
'action' => 'delete',
|
||||
], '', [
|
||||
'section' => 'apcuinfo',
|
||||
'page' => 'showinfo'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('apcu_cache_info') ||
|
||||
!function_exists('apcu_sma_info')
|
||||
) {
|
||||
standard_error($lng['error']['no_apcuinfo']);
|
||||
if (!function_exists('apcu_cache_info') || !function_exists('apcu_sma_info')) {
|
||||
Response::standardError(lng('error.no_apcuinfo'));
|
||||
}
|
||||
|
||||
if ($page == 'showinfo'
|
||||
) {
|
||||
$cache = apcu_cache_info();
|
||||
$mem = apcu_sma_info();
|
||||
$time = time();
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
|
||||
if ($page == 'showinfo' && $userinfo['change_serversettings'] == '1') {
|
||||
$cache = apcu_cache_info();
|
||||
$mem = apcu_sma_info();
|
||||
$time = time();
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_apcuinfo");
|
||||
|
||||
$passtime = $time - $cache['start_time'] > 0 ? $time - $cache['start_time'] : 1; // zero division
|
||||
$mem_size = $mem['num_seg'] * $mem['seg_size'];
|
||||
$mem_avail = $mem['avail_mem'];
|
||||
$mem_used = $mem_size - $mem_avail;
|
||||
$seg_size = bsize($mem['seg_size']);
|
||||
$sharedmem = sprintf($lng['apcuinfo']['sharedmemval'], $mem['num_seg'], $seg_size, $cache['memory_type']);
|
||||
$req_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / $passtime) : 0);
|
||||
$hit_rate_user = sprintf("%.2f", $cache['num_hits'] ? (($cache['num_hits']) / $passtime) : 0);
|
||||
$miss_rate_user = sprintf("%.2f", $cache['num_misses'] ? (($cache['num_misses']) / $passtime) : 0);
|
||||
$insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts']) / $passtime) : 0);
|
||||
$apcversion = phpversion('apcu');
|
||||
$phpversion = phpversion();
|
||||
$number_vars = $cache['num_entries'];
|
||||
$starttime = date('Y-m-d H:i:s', $cache['start_time']);
|
||||
$uptime_duration = duration($cache['start_time']);
|
||||
$size_vars = bsize($cache['mem_size']);
|
||||
// check for possible empty values that are used in the templates
|
||||
if (!isset($cache['file_upload_progress'])) {
|
||||
$cache['file_upload_progress'] = lng('logger.unknown');
|
||||
}
|
||||
|
||||
// check for possible empty values that are used in the templates
|
||||
if (!isset($cache['file_upload_progress'])) {
|
||||
$cache['file_upload_progress'] = $lng['logger']['unknown'];
|
||||
}
|
||||
if (!isset($cache['num_expunges'])) {
|
||||
$cache['num_expunges'] = lng('logger.unknown');
|
||||
}
|
||||
|
||||
if (!isset($cache['num_expunges'])) {
|
||||
$cache['num_expunges'] = $lng['logger']['unknown'];
|
||||
}
|
||||
$overview = [
|
||||
'mem_size' => $mem['num_seg'] * $mem['seg_size'],
|
||||
'mem_avail' => $mem['avail_mem'],
|
||||
'mem_used' => ($mem['num_seg'] * $mem['seg_size']) - $mem['avail_mem'],
|
||||
'seg_size' => bsize($mem['seg_size']),
|
||||
'num_hits' => $cache['num_hits'],
|
||||
'num_misses' => $cache['num_misses'],
|
||||
'num_inserts' => $cache['num_inserts'],
|
||||
'req_rate_user' => sprintf("%.2f",
|
||||
$cache['num_hits'] ? (($cache['num_hits'] + $cache['num_misses']) / ($time - $cache['start_time'])) : 0),
|
||||
'hit_rate_user' => sprintf("%.2f",
|
||||
$cache['num_hits'] ? (($cache['num_hits']) / ($time - $cache['start_time'])) : 0),
|
||||
'miss_rate_user' => sprintf("%.2f",
|
||||
$cache['num_misses'] ? (($cache['num_misses']) / ($time - $cache['start_time'])) : 0),
|
||||
'insert_rate_user' => sprintf("%.2f",
|
||||
$cache['num_inserts'] ? (($cache['num_inserts']) / ($time - $cache['start_time'])) : 0),
|
||||
'apcversion' => phpversion('apcu'),
|
||||
'phpversion' => phpversion(),
|
||||
'number_vars' => $cache['num_entries'],
|
||||
'size_vars' => bsize($cache['mem_size']),
|
||||
'num_hits_and_misses' => 0 >= ($cache['num_hits'] + $cache['num_misses']) ? 1 : ($cache['num_hits'] + $cache['num_misses']),
|
||||
'file_upload_progress' => $cache['file_upload_progress'],
|
||||
'num_expunges' => $cache['num_expunges'],
|
||||
'host' => (function_exists('gethostname')
|
||||
? gethostname()
|
||||
: (php_uname('n')
|
||||
?: (empty($_SERVER['SERVER_NAME'])
|
||||
? $_SERVER['HOST_NAME']
|
||||
: $_SERVER['SERVER_NAME']
|
||||
)
|
||||
)
|
||||
),
|
||||
'server' => $_SERVER['SERVER_SOFTWARE'] ?: '',
|
||||
'start_time' => $cache['start_time'],
|
||||
'uptime' => duration($cache['start_time'])
|
||||
];
|
||||
|
||||
$runtimelines = '';
|
||||
foreach (ini_get_all('apcu') as $name => $v) {
|
||||
$value = $v['local_value'];
|
||||
eval("\$runtimelines.=\"" . getTemplate("settings/apcuinfo/runtime_line") . "\";");
|
||||
}
|
||||
$overview['mem_used_percentage'] = number_format(($overview['mem_used'] / $overview['mem_avail']) * 100, 1);
|
||||
$overview['num_hits_percentage'] = number_format(($overview['num_hits'] / $overview['num_hits_and_misses']) * 100,
|
||||
1);
|
||||
$overview['num_misses_percentage'] = number_format(($overview['num_misses'] / $overview['num_hits_and_misses']) * 100,
|
||||
1);
|
||||
$overview['readable'] = [
|
||||
'mem_size' => bsize($overview['mem_size']),
|
||||
'mem_avail' => bsize($overview['mem_avail']),
|
||||
'mem_used' => bsize($overview['mem_used']),
|
||||
'num_hits' => number_format($overview['num_hits']),
|
||||
'num_misses' => number_format($overview['num_misses']),
|
||||
'number_vars' => number_format($overview['number_vars']),
|
||||
];
|
||||
|
||||
$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']));
|
||||
$overview['runtimelines'] = [];
|
||||
foreach (ini_get_all('apcu') as $name => $v) {
|
||||
$value = $v['local_value'];
|
||||
$overview['runtimelines'][$name] = $value;
|
||||
}
|
||||
|
||||
// Fragementation: (freeseg - 1) / total_seg
|
||||
$nseg = $freeseg = $fragsize = $freetotal = 0;
|
||||
for ($i = 0; $i < $mem['num_seg']; $i++) {
|
||||
$ptr = 0;
|
||||
foreach ($mem['block_lists'][$i] as $block) {
|
||||
if ($block['offset'] != $ptr) {
|
||||
++$nseg;
|
||||
}
|
||||
$ptr = $block['offset'] + $block['size'];
|
||||
/* Only consider blocks <5M for the fragmentation % */
|
||||
if ($block['size'] < (5 * 1024 * 1024))
|
||||
$fragsize+=$block['size'];
|
||||
$freetotal+=$block['size'];
|
||||
}
|
||||
$freeseg += count($mem['block_lists'][$i]);
|
||||
}
|
||||
// Fragementation: (freeseg - 1) / total_seg
|
||||
$nseg = $freeseg = $fragsize = $freetotal = 0;
|
||||
for ($i = 0; $i < $mem['num_seg']; $i++) {
|
||||
$ptr = 0;
|
||||
foreach ($mem['block_lists'][$i] as $block) {
|
||||
if ($block['offset'] != $ptr) {
|
||||
++$nseg;
|
||||
}
|
||||
$ptr = $block['offset'] + $block['size'];
|
||||
/* Only consider blocks <5M for the fragmentation % */
|
||||
if ($block['size'] < (5 * 1024 * 1024)) {
|
||||
$fragsize += $block['size'];
|
||||
}
|
||||
$freetotal += $block['size'];
|
||||
}
|
||||
$freeseg += count($mem['block_lists'][$i]);
|
||||
}
|
||||
|
||||
if ($freeseg > 1) {
|
||||
$frag = sprintf("%.2f%% (%s out of %s in %d fragments)", ($fragsize / $freetotal) * 100, bsize($fragsize), bsize($freetotal), $freeseg);
|
||||
} else {
|
||||
$frag = "0%";
|
||||
}
|
||||
$overview['fragmentation'] = [];
|
||||
if ($freeseg > 1) {
|
||||
$overview['fragmentation']['used_percentage'] = number_format(($fragsize / $freetotal) * 100, 1);
|
||||
$overview['fragmentation']['used_bytes'] = $fragsize;
|
||||
$overview['fragmentation']['total_bytes'] = $freetotal;
|
||||
$overview['fragmentation']['num_frags'] = $freeseg;
|
||||
$overview['fragmentation']['readable'] = [
|
||||
'used_bytes' => bsize($fragsize),
|
||||
'total_bytes' => bsize($freetotal),
|
||||
'num_frags' => number_format($freeseg)
|
||||
];
|
||||
} else {
|
||||
$overview['fragmentation'] = 0;
|
||||
}
|
||||
|
||||
foreach (ini_get_all('apcu') as $name => $v) {
|
||||
$value = $v['local_value'];
|
||||
}
|
||||
|
||||
$img_src1 = '';
|
||||
$img_src2 = '';
|
||||
$img_src3 = '';
|
||||
if (graphics_avail()) {
|
||||
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img1', 'action' => mt_rand(0, 1000000)));
|
||||
eval("\$img_src1=\"" . getTemplate("settings/apcuinfo/img_line") . "\";");
|
||||
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img2', 'action' => mt_rand(0, 1000000)));
|
||||
eval("\$img_src2=\"" . getTemplate("settings/apcuinfo/img_line") . "\";");
|
||||
$img_src = $linker->getLink(array('section' => 'apcuinfo', 'page' => 'img3', 'action' => mt_rand(0, 1000000)));
|
||||
eval("\$img_src3=\"" . getTemplate("settings/apcuinfo/img_line") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/apcuinfo/showinfo") . "\";");
|
||||
|
||||
} elseif ($page == 'img1'
|
||||
) {
|
||||
|
||||
$mem = apcu_sma_info();
|
||||
|
||||
$size = 460;
|
||||
$image = imagecreate($size + 5, $size + 5);
|
||||
|
||||
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
|
||||
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
|
||||
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
|
||||
$col_black = imagecolorallocate($image, 0, 0, 0);
|
||||
|
||||
imagecolortransparent($image, $col_white);
|
||||
|
||||
$s = $mem['num_seg'] * $mem['seg_size'];
|
||||
$a = $mem['avail_mem'];
|
||||
$x = $y = $size / 2;
|
||||
$fuzz = 0.000001;
|
||||
|
||||
// This block of code creates the pie chart. It is a lot more complex than you
|
||||
// would expect because we try to visualize any memory fragmentation as well.
|
||||
$angle_from = 0;
|
||||
$string_placement = array();
|
||||
for ($i = 0; $i < $mem['num_seg']; $i++) {
|
||||
$ptr = 0;
|
||||
$free = $mem['block_lists'][$i];
|
||||
uasort($free, 'block_sort');
|
||||
foreach ($free as $block) {
|
||||
if ($block['offset'] != $ptr) { // Used block
|
||||
$angle_to = $angle_from + ($block['offset'] - $ptr) / $s;
|
||||
if (($angle_to + $fuzz) > 1)
|
||||
$angle_to = 1;
|
||||
if (($angle_to * 360) - ($angle_from * 360) >= 1) {
|
||||
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
|
||||
if (($angle_to - $angle_from) > 0.05) {
|
||||
array_push($string_placement, array($angle_from, $angle_to));
|
||||
}
|
||||
}
|
||||
$angle_from = $angle_to;
|
||||
}
|
||||
$angle_to = $angle_from + ($block['size']) / $s;
|
||||
if (($angle_to + $fuzz) > 1)
|
||||
$angle_to = 1;
|
||||
if (($angle_to * 360) - ($angle_from * 360) >= 1) {
|
||||
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_green);
|
||||
if (($angle_to - $angle_from) > 0.05) {
|
||||
array_push($string_placement, array($angle_from, $angle_to));
|
||||
}
|
||||
}
|
||||
$angle_from = $angle_to;
|
||||
$ptr = $block['offset'] + $block['size'];
|
||||
}
|
||||
if ($ptr < $mem['seg_size']) { // memory at the end
|
||||
$angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
|
||||
if (($angle_to + $fuzz) > 1)
|
||||
$angle_to = 1;
|
||||
fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
|
||||
if (($angle_to - $angle_from) > 0.05) {
|
||||
array_push($string_placement, array($angle_from, $angle_to));
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($string_placement as $angle) {
|
||||
text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
|
||||
}
|
||||
|
||||
header("Content-type: image/png");
|
||||
imagepng($image);
|
||||
exit;
|
||||
} elseif ($page == 'img2'
|
||||
) {
|
||||
|
||||
$cache = apcu_cache_info();
|
||||
|
||||
$size = $horizontal_bar_size;
|
||||
$image = imagecreate($size + 5, 140);
|
||||
|
||||
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
|
||||
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
|
||||
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
|
||||
$col_black = imagecolorallocate($image, 0, 0, 0);
|
||||
|
||||
imagecolortransparent($image, $col_white);
|
||||
|
||||
$s = $cache['num_hits'] + $cache['num_misses'];
|
||||
$a = $cache['num_hits'];
|
||||
|
||||
fill_box($image, 1, 10, $s ? ($a * ($size - 21) / $s) : $size, 50, $col_black, $col_green/* , sprintf("%.1f%%", $s ? $cache['num_hits'] * 100 / $s : 0) */);
|
||||
fill_box($image, 1, 80, $s ? max(4, ($s - $a) * ($size - 21) / $s) : $size, 50, $col_black, $col_red/* , sprintf("%.1f%%", $s ? $cache['num_misses'] * 100 / $s : 0) */);
|
||||
|
||||
header("Content-type: image/png");
|
||||
imagepng($image);
|
||||
exit;
|
||||
} elseif ($page == 'img3'
|
||||
) {
|
||||
|
||||
$mem = apcu_sma_info();
|
||||
|
||||
$size = $horizontal_bar_size;
|
||||
$image = imagecreate($size, 70);
|
||||
|
||||
$col_white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
|
||||
$col_red = imagecolorallocate($image, 0xD0, 0x60, 0x30);
|
||||
$col_green = imagecolorallocate($image, 0x60, 0xF0, 0x60);
|
||||
$col_black = imagecolorallocate($image, 0, 0, 0);
|
||||
|
||||
imagecolortransparent($image, $col_white);
|
||||
|
||||
$s = $mem['num_seg'] * $mem['seg_size'];
|
||||
$a = $mem['avail_mem'];
|
||||
$x = 10;
|
||||
$y = 0;
|
||||
|
||||
// This block of code creates the bar chart. It is a lot more complex than you
|
||||
// would expect because we try to visualize any memory fragmentation as well.
|
||||
for ($i = 0; $i < $mem['num_seg']; $i++) {
|
||||
$ptr = 0;
|
||||
$free = $mem['block_lists'][$i];
|
||||
uasort($free, 'block_sort');
|
||||
foreach ($free as $block) {
|
||||
if ($block['offset'] != $ptr) { // Used block
|
||||
$h = ($size - 5) * ($block['offset'] - $ptr) / $s;
|
||||
if ($h > 0) {
|
||||
fill_box($image, $y, $x, $h, 50, $col_black, $col_red);
|
||||
}
|
||||
$y+=$h;
|
||||
}
|
||||
$h = ($size - 5) * ($block['size']) / $s;
|
||||
if ($h > 0) {
|
||||
fill_box($image, $y, $x, $h, 50, $col_black, $col_green);
|
||||
}
|
||||
$y+=$h;
|
||||
$ptr = $block['offset'] + $block['size'];
|
||||
}
|
||||
if ($ptr < $mem['seg_size']) { // memory at the end
|
||||
$h = ($size - 5) * ($mem['seg_size'] - $ptr) / $s;
|
||||
if ($h > 0) {
|
||||
fill_box($image, $y, $x, $h, 50, $col_black, $col_red, bsize($mem['seg_size'] - $ptr), $j++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-type: image/png");
|
||||
imagepng($image);
|
||||
exit;
|
||||
UI::view('settings/apcuinfo.html.twig', [
|
||||
'apcuinfo' => $overview
|
||||
]);
|
||||
}
|
||||
|
||||
function graphics_avail() {
|
||||
return extension_loaded('gd');
|
||||
}
|
||||
|
||||
// pretty printer for byte values
|
||||
//
|
||||
function bsize($s) {
|
||||
foreach (array('', 'K', 'M', 'G') as $i => $k) {
|
||||
if ($s < 1024)
|
||||
break;
|
||||
$s/=1024;
|
||||
}
|
||||
return sprintf("%5.1f %sBytes", $s, $k);
|
||||
function bsize($size)
|
||||
{
|
||||
$i = 0;
|
||||
$val = ['b', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
while (($size / 1024) > 1) {
|
||||
$size /= 1024;
|
||||
++$i;
|
||||
}
|
||||
return sprintf(
|
||||
'%.2f%s%s',
|
||||
$size,
|
||||
'',
|
||||
$val[$i]
|
||||
);
|
||||
}
|
||||
|
||||
function duration($ts) {
|
||||
global $time;
|
||||
$years = (int) ((($time - $ts) / (7 * 86400)) / 52.177457);
|
||||
$rem = (int) (($time - $ts) - ($years * 52.177457 * 7 * 86400));
|
||||
$weeks = (int) (($rem) / (7 * 86400));
|
||||
$days = (int) (($rem) / 86400) - $weeks * 7;
|
||||
$hours = (int) (($rem) / 3600) - $days * 24 - $weeks * 7 * 24;
|
||||
$mins = (int) (($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60;
|
||||
$str = '';
|
||||
if ($years == 1)
|
||||
$str .= "$years year, ";
|
||||
if ($years > 1)
|
||||
$str .= "$years years, ";
|
||||
if ($weeks == 1)
|
||||
$str .= "$weeks week, ";
|
||||
if ($weeks > 1)
|
||||
$str .= "$weeks weeks, ";
|
||||
if ($days == 1)
|
||||
$str .= "$days day,";
|
||||
if ($days > 1)
|
||||
$str .= "$days days,";
|
||||
if ($hours == 1)
|
||||
$str .= " $hours hour and";
|
||||
if ($hours > 1)
|
||||
$str .= " $hours hours and";
|
||||
if ($mins == 1)
|
||||
$str .= " 1 minute";
|
||||
else
|
||||
$str .= " $mins minutes";
|
||||
return $str;
|
||||
}
|
||||
|
||||
function block_sort($array1, $array2) {
|
||||
if ($array1['offset'] > $array2['offset']) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $color2, $text = '', $placeindex = 0) {
|
||||
$r = $diameter / 2;
|
||||
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
|
||||
|
||||
|
||||
if (function_exists("imagefilledarc")) {
|
||||
// exists only if GD 2.0.1 is available
|
||||
imagefilledarc($im, $centerX + 1, $centerY + 1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE);
|
||||
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
|
||||
imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED);
|
||||
} else {
|
||||
imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
|
||||
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
|
||||
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
|
||||
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
|
||||
imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
|
||||
imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2);
|
||||
}
|
||||
if ($text) {
|
||||
if ($placeindex > 0) {
|
||||
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
|
||||
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
|
||||
} else {
|
||||
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0) {
|
||||
$r = $diameter / 2;
|
||||
$w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
|
||||
|
||||
if ($placeindex > 0) {
|
||||
imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
|
||||
imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
|
||||
} else {
|
||||
imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
|
||||
}
|
||||
}
|
||||
|
||||
function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '') {
|
||||
global $col_black;
|
||||
$x1 = $x + $w - 1;
|
||||
$y1 = $y + $h - 1;
|
||||
|
||||
imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black);
|
||||
if ($y1 > $y)
|
||||
imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
|
||||
else
|
||||
imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
|
||||
imagerectangle($im, $x, $y1, $x1, $y, $color1);
|
||||
if ($text) {
|
||||
if ($placeindex > 0) {
|
||||
|
||||
if ($placeindex < 16) {
|
||||
$px = 5;
|
||||
$py = $placeindex * 12 + 6;
|
||||
imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2);
|
||||
imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2);
|
||||
imagestring($im, 2, $px, $py - 6, $text, $color1);
|
||||
} else {
|
||||
if ($placeindex < 31) {
|
||||
$px = $x + 40 * 2;
|
||||
$py = ($placeindex - 15) * 12 + 6;
|
||||
} else {
|
||||
$px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15);
|
||||
$py = ($placeindex % 15) * 12 + 6;
|
||||
}
|
||||
imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2);
|
||||
imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2);
|
||||
imagestring($im, 2, $px + 2, $py - 6, $text, $color1);
|
||||
}
|
||||
} else {
|
||||
imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1);
|
||||
}
|
||||
}
|
||||
function duration($ts)
|
||||
{
|
||||
global $time;
|
||||
$years = (int)((($time - $ts) / (7 * 86400)) / 52.177457);
|
||||
$rem = (int)(($time - $ts) - ($years * 52.177457 * 7 * 86400));
|
||||
$weeks = (int)(($rem) / (7 * 86400));
|
||||
$days = (int)(($rem) / 86400) - $weeks * 7;
|
||||
$hours = (int)(($rem) / 3600) - $days * 24 - $weeks * 7 * 24;
|
||||
$mins = (int)(($rem) / 60) - $hours * 60 - $days * 24 * 60 - $weeks * 7 * 24 * 60;
|
||||
$str = '';
|
||||
if ($years == 1) {
|
||||
$str .= "$years year, ";
|
||||
}
|
||||
if ($years > 1) {
|
||||
$str .= "$years years, ";
|
||||
}
|
||||
if ($weeks == 1) {
|
||||
$str .= "$weeks week, ";
|
||||
}
|
||||
if ($weeks > 1) {
|
||||
$str .= "$weeks weeks, ";
|
||||
}
|
||||
if ($days == 1) {
|
||||
$str .= "$days day,";
|
||||
}
|
||||
if ($days > 1) {
|
||||
$str .= "$days days,";
|
||||
}
|
||||
if ($hours == 1) {
|
||||
$str .= " $hours hour and";
|
||||
}
|
||||
if ($hours > 1) {
|
||||
$str .= " $hours hours and";
|
||||
}
|
||||
if ($mins == 1) {
|
||||
$str .= " 1 minute";
|
||||
} else {
|
||||
$str .= " $mins minutes";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
@@ -2,201 +2,198 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2016 the Froxlor Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Frontend
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* @since 0.9.35
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
// define update-uri
|
||||
define('UPDATE_URI', "https://version.froxlor.org/Froxlor/legacy/" . $version);
|
||||
define('RELEASE_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip");
|
||||
define('CHECKSUM_URI', "https://autoupdate.froxlor.org/froxlor-{version}.zip.sha256");
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\Install\AutoUpdate;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// check for allow_url_fopen
|
||||
if (ini_get('allow_url_fopen') === false) {
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 1));
|
||||
}
|
||||
|
||||
// check for archive-stuff
|
||||
if (function_exists('gzopen') === false) {
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 2));
|
||||
if ($page != 'error') {
|
||||
// check for webupdate to be enabled
|
||||
if (Settings::Config('enable_webupdate') != true) {
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'error',
|
||||
'errno' => 11
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// display initial version check
|
||||
if ($page == 'overview') {
|
||||
|
||||
// log our actions
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "checking auto-update");
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "checking auto-update");
|
||||
|
||||
// check for new version
|
||||
$latestversion = @file(UPDATE_URI);
|
||||
|
||||
if (isset($latestversion[0])) {
|
||||
$latestversion = explode('|', $latestversion[0]);
|
||||
|
||||
if (is_array($latestversion)
|
||||
&& count($latestversion) >= 1
|
||||
) {
|
||||
$_version = $latestversion[0];
|
||||
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
|
||||
// add the branding so debian guys are not gettings confused
|
||||
// about their version-number
|
||||
$version_label = $_version.$branding;
|
||||
$version_link = $_link;
|
||||
$message_addinfo = $_message;
|
||||
|
||||
// not numeric -> error-message
|
||||
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
||||
// check for customized version to not output
|
||||
// "There is a newer version of froxlor" besides the error-message
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 3));
|
||||
} elseif (version_compare2($version, $_version) == -1) {
|
||||
// there is a newer version - yay
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
// nothing new
|
||||
$isnewerversion = 0;
|
||||
}
|
||||
|
||||
// anzeige über version-status mit ggfls. formular
|
||||
// zum update schritt #1 -> download
|
||||
if ($isnewerversion == 1) {
|
||||
$text = 'There is a newer version available. Update to version <b>'.$_version.'</b> now?<br/>(Your current version is: '.$version.')';
|
||||
$hiddenparams = '<input type="hidden" name="newversion" value="'.$_version.'" />';
|
||||
$yesfile = $filename.'?s='.$s.'&page=getdownload';
|
||||
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
||||
exit;
|
||||
}
|
||||
elseif ($isnewerversion == 0) {
|
||||
// all good
|
||||
standard_success ('noupdatesavail');
|
||||
} else {
|
||||
standard_error ('customized_version');
|
||||
}
|
||||
}
|
||||
try {
|
||||
$result = AutoUpdate::checkVersion();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
// error (something weird came from version.froxlor.org)
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 5));
|
||||
}
|
||||
// download the new archive
|
||||
elseif ($page == 'getdownload') {
|
||||
|
||||
if ($result == 1) {
|
||||
|
||||
// anzeige über version-status mit ggfls. formular
|
||||
// zum update schritt #1 -> download
|
||||
$text = lng('admin.newerversionavailable') . ' ' . lng('admin.newerversiondetails', [AutoUpdate::getFromResult('version'), Froxlor::VERSION]);
|
||||
|
||||
$upd_formfield = [
|
||||
'updates' => [
|
||||
'title' => lng('update.update'),
|
||||
'image' => 'fa-solid fa-download',
|
||||
'sections' => [
|
||||
'section_autoupd' => [
|
||||
'fields' => [
|
||||
'newversion' => ['type' => 'hidden', 'value' => AutoUpdate::getFromResult('version')]
|
||||
]
|
||||
]
|
||||
],
|
||||
'buttons' => [
|
||||
[
|
||||
'class' => 'btn-outline-secondary',
|
||||
'label' => lng('panel.cancel'),
|
||||
'type' => 'reset'
|
||||
],
|
||||
[
|
||||
'label' => lng('update.proceed')
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'autoupdate', 'page' => 'getdownload']),
|
||||
'formdata' => $upd_formfield['updates'],
|
||||
// alert
|
||||
'type' => 'warning',
|
||||
'alert_msg' => $text
|
||||
]);
|
||||
} else if ($result < 0 || $result > 1) {
|
||||
// remote errors
|
||||
if ($result < 0) {
|
||||
Response::dynamicError(AutoUpdate::getLastError());
|
||||
} else {
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'error',
|
||||
'errno' => $result
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// no new version
|
||||
Response::standardSuccess('update.noupdatesavail', (Settings::Get('system.update_channel') == 'testing' ? lng('serversettings.uc_testing') . ' ' : ''));
|
||||
}
|
||||
} // download the new archive
|
||||
elseif ($page == 'getdownload') {
|
||||
// retrieve the new version from the form
|
||||
$newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null;
|
||||
|
||||
$result = 6;
|
||||
// valid?
|
||||
if ($newversion !== null) {
|
||||
|
||||
// define files to get
|
||||
$toLoad = str_replace('{version}', $newversion, RELEASE_URI);
|
||||
$toCheck = str_replace('{version}', $newversion, CHECKSUM_URI);
|
||||
|
||||
// get archive data
|
||||
$newArchive = @file_get_contents($toLoad);
|
||||
|
||||
// check for local destination folder
|
||||
if (!is_dir(FROXLOR_INSTALL_DIR.'/updates/')) {
|
||||
mkdir(FROXLOR_INSTALL_DIR.'/updates/');
|
||||
$result = AutoUpdate::downloadZip($newversion);
|
||||
if (!is_numeric($result)) {
|
||||
// to the next step
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'extract',
|
||||
'archive' => $result
|
||||
]);
|
||||
}
|
||||
|
||||
// name archive
|
||||
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.basename($toLoad);
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "Downloading ".$toLoad." to ".$localArchive);
|
||||
|
||||
// remove old archive
|
||||
if (file_exists($localArchive)) {
|
||||
@unlink($localArchive);
|
||||
}
|
||||
|
||||
// store archive
|
||||
$fh = fopen($localArchive, 'w');
|
||||
if (!fwrite($fh, $newArchive)) {
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 4));
|
||||
}
|
||||
|
||||
// close file-handle
|
||||
fclose($fh);
|
||||
|
||||
// validate the integrity of the downloaded file
|
||||
$_shouldsum = @file_get_contents($toCheck);
|
||||
if (!empty($_shouldsum)) {
|
||||
$_t = explode(" ", $_shouldsum);
|
||||
$shouldsum = $_t[0];
|
||||
} else {
|
||||
$shouldsum = null;
|
||||
}
|
||||
$filesum = hash_file('sha256', $localArchive);
|
||||
|
||||
if ($filesum != $shouldsum) {
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 9));
|
||||
}
|
||||
|
||||
// to the next step
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'extract', 'archive' => basename($localArchive)));
|
||||
}
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 6));
|
||||
}
|
||||
// extract and install new version
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'error',
|
||||
'errno' => $result
|
||||
]);
|
||||
} // extract and install new version
|
||||
elseif ($page == 'extract') {
|
||||
|
||||
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
|
||||
$localArchive = FROXLOR_INSTALL_DIR.'/updates/'.$toExtract;
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
// decompress from zip
|
||||
$zip = new ZipArchive;
|
||||
$res = $zip->open($localArchive);
|
||||
if ($res === true) {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "Extracting ".$localArchive." to ".dirname(FROXLOR_INSTALL_DIR));
|
||||
$zip->extractTo(dirname(FROXLOR_INSTALL_DIR));
|
||||
$zip->close();
|
||||
// success - remove unused archive
|
||||
@unlink($localArchive);
|
||||
} else {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$toExtract = isset($_POST['archive']) ? $_POST['archive'] : null;
|
||||
$localArchive = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/updates/' . $toExtract);
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "Extracting " . $localArchive . " to " . Froxlor::getInstallDir());
|
||||
$result = AutoUpdate::extractZip($localArchive);
|
||||
if ($result > 0) {
|
||||
// error
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 8));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'error',
|
||||
'errno' => $result
|
||||
]);
|
||||
}
|
||||
|
||||
// redirect to update-page?
|
||||
redirectTo('admin_updates.php', array('s' => $s));
|
||||
// redirect to update-page
|
||||
Response::redirectTo('admin_updates.php');
|
||||
} else {
|
||||
$toExtract = isset($_GET['archive']) ? $_GET['archive'] : null;
|
||||
$localArchive = FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/updates/' . $toExtract);
|
||||
}
|
||||
|
||||
if (!file_exists($localArchive)) {
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 7));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'error',
|
||||
'errno' => 7
|
||||
]);
|
||||
}
|
||||
|
||||
$text = 'Extract downloaded archive "'.$toExtract.'"?';
|
||||
$hiddenparams = '';
|
||||
$yesfile = $filename.'?s='.$s.'&page=extract&archive='.$toExtract;
|
||||
eval("echo \"" . getTemplate("misc/question_yesno", true) . "\";");
|
||||
}
|
||||
$text = lng('admin.extractdownloadedzip', [$toExtract]);
|
||||
|
||||
// display error
|
||||
$upd_formfield = [
|
||||
'updates' => [
|
||||
'title' => lng('update.update'),
|
||||
'image' => 'fa-solid fa-download',
|
||||
'sections' => [
|
||||
'section_autoupd' => [
|
||||
'fields' => [
|
||||
'archive' => ['type' => 'hidden', 'value' => $toExtract]
|
||||
]
|
||||
]
|
||||
],
|
||||
'buttons' => [
|
||||
[
|
||||
'class' => 'btn-outline-secondary',
|
||||
'label' => lng('panel.cancel'),
|
||||
'type' => 'reset'
|
||||
],
|
||||
[
|
||||
'label' => lng('update.proceed')
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'autoupdate', 'page' => 'extract']),
|
||||
'formdata' => $upd_formfield['updates'],
|
||||
// alert
|
||||
'type' => 'warning',
|
||||
'alert_msg' => $text
|
||||
]);
|
||||
} // display error
|
||||
elseif ($page == 'error') {
|
||||
|
||||
// retrieve error-number via url-parameter
|
||||
$errno = isset($_GET['errno']) ? (int)$_GET['errno'] : 0;
|
||||
|
||||
// 1 = no allow_url_fopen
|
||||
// 2 = no Zlib
|
||||
// 3 = custom version detected
|
||||
// 4 = could not store archive to local hdd
|
||||
@@ -205,5 +202,11 @@ elseif ($page == 'error') {
|
||||
// 7 = local archive does not exist
|
||||
// 8 = could not extract archive
|
||||
// 9 = checksum mismatch
|
||||
standard_error ('autoupdate_'.$errno);
|
||||
// 10 = <php-7.4
|
||||
// 11 = enable_webupdate = false
|
||||
$errmsg = 'autoupdate_' . $errno;
|
||||
if ($errno == 3) {
|
||||
$errmsg = 'customized_version';
|
||||
}
|
||||
Response::standardError($errmsg);
|
||||
}
|
||||
|
||||
@@ -4,214 +4,193 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* @since 0.9.34
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Config\ConfigParser;
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Validate\Validate;
|
||||
|
||||
if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
$replace_arr = Array(
|
||||
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
||||
'<SQL_DB>' => $sql['db'],
|
||||
'<SQL_HOST>' => $sql['host'],
|
||||
'<SQL_SOCKET>' => isset($sql['socket']) ? $sql['socket'] : null,
|
||||
'<SERVERNAME>' => Settings::Get('system.hostname'),
|
||||
'<SERVERIP>' => Settings::Get('system.ipaddress'),
|
||||
'<NAMESERVERS>' => Settings::Get('system.nameservers'),
|
||||
'<VIRTUAL_MAILBOX_BASE>' => Settings::Get('system.vmail_homedir'),
|
||||
'<VIRTUAL_UID_MAPS>' => Settings::Get('system.vmail_uid'),
|
||||
'<VIRTUAL_GID_MAPS>' => Settings::Get('system.vmail_gid'),
|
||||
'<SSLPROTOCOLS>' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '',
|
||||
'<CUSTOMER_TMP>' => (Settings::Get('system.mod_fcgid_tmpdir') != '') ? makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir')) : '/tmp/',
|
||||
'<BASE_PATH>' => makeCorrectDir(FROXLOR_INSTALL_DIR),
|
||||
'<BIND_CONFIG_PATH>' => makeCorrectDir(Settings::Get('system.bindconf_directory')),
|
||||
'<WEBSERVER_RELOAD_CMD>' => Settings::Get('system.apachereload_command'),
|
||||
'<CUSTOMER_LOGS>' => makeCorrectDir(Settings::Get('system.logfiles_directory')),
|
||||
'<FPM_IPCDIR>' => makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')),
|
||||
'<WEBSERVER_GROUP>' => Settings::Get('system.httpgroup')
|
||||
);
|
||||
|
||||
// get distro from URL param
|
||||
$distribution = (isset($_GET['distribution']) && $_GET['distribution'] != 'choose') ? $_GET['distribution'] : "";
|
||||
$service = (isset($_GET['service']) && $_GET['service'] != 'choose') ? $_GET['service'] : "";
|
||||
$daemon = (isset($_GET['daemon']) && $_GET['daemon'] != 'choose') ? $_GET['daemon'] : "";
|
||||
$distributions_select = "";
|
||||
$services_select = "";
|
||||
$daemons_select = "";
|
||||
|
||||
$configfiles = "";
|
||||
$services = "";
|
||||
$daemons = "";
|
||||
|
||||
$config_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . '/lib/configfiles/');
|
||||
|
||||
if ($distribution != "") {
|
||||
// create configparser object
|
||||
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");
|
||||
|
||||
// get distro-info
|
||||
$dist_display = getCompleteDistroName($configfiles);
|
||||
|
||||
// get all the services from the distro
|
||||
$services = $configfiles->getServices();
|
||||
|
||||
if ($service != "") {
|
||||
|
||||
$daemons = $services[$service]->getDaemons();
|
||||
|
||||
if ($daemon == "") {
|
||||
foreach ($daemons as $di => $dd) {
|
||||
$title = $dd->title;
|
||||
if ($dd->default) {
|
||||
$title = $title." (".strtolower($lng['panel']['default']).")";
|
||||
}
|
||||
$daemons_select .= makeoption($title, $di);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($services as $si => $sd) {
|
||||
$services_select .= makeoption($sd->title, $si);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// show list of available distro's
|
||||
$distros = glob($config_dir . '*.xml');
|
||||
// tmp array
|
||||
$distributions_select_data = array();
|
||||
// read in all the distros
|
||||
foreach ($distros as $_distribution) {
|
||||
// get configparser object
|
||||
$dist = new ConfigParser($_distribution);
|
||||
// get distro-info
|
||||
$dist_display = getCompleteDistroName($dist);
|
||||
// store in tmp array
|
||||
$distributions_select_data[$dist_display] = str_replace(".xml", "", strtolower(basename($_distribution)));
|
||||
}
|
||||
|
||||
// sort by distribution name
|
||||
ksort($distributions_select_data);
|
||||
|
||||
foreach ($distributions_select_data as $dist_display => $dist_index) {
|
||||
// create select-box-option
|
||||
$distributions_select .= makeoption($dist_display, $dist_index);
|
||||
}
|
||||
}
|
||||
|
||||
if ($distribution != "" && $service != "" && $daemon != "") {
|
||||
|
||||
$confarr = $daemons[$daemon]->getConfig();
|
||||
|
||||
$configpage = '';
|
||||
|
||||
$distro_editor = $configfiles->distributionEditor;
|
||||
if ($action == 'setconfigured') {
|
||||
Settings::Set('panel.is_configured', '1', true);
|
||||
Response::redirectTo('admin_configfiles.php');
|
||||
}
|
||||
|
||||
$commands_pre = "";
|
||||
$commands_file = "";
|
||||
$commands_post = "";
|
||||
|
||||
$lasttype = '';
|
||||
$commands = '';
|
||||
foreach ($confarr as $idx => $action) {
|
||||
if ($lasttype != '' && $lasttype != $action['type']) {
|
||||
$commands = trim($commands);
|
||||
$numbrows = count(explode("\n", $commands));
|
||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
||||
$lasttype = '';
|
||||
$commands = '';
|
||||
}
|
||||
switch ($action['type']) {
|
||||
case "install":
|
||||
$commands .= $action['content'] . "\n";
|
||||
$lasttype = "install";
|
||||
break;
|
||||
case "command":
|
||||
$commands .= $action['content'] . "\n";
|
||||
$lasttype = "command";
|
||||
break;
|
||||
case "file":
|
||||
if (array_key_exists('content', $action)) {
|
||||
$commands_file = getFileContentContainer($action['content'], $replace_arr, $action['name'], $distro_editor);
|
||||
} elseif (array_key_exists('subcommands', $action)) {
|
||||
foreach ($action['subcommands'] as $fileaction) {
|
||||
if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") {
|
||||
$commands_pre .= $fileaction['content'] . "\n";
|
||||
} elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") {
|
||||
$commands_post .= $fileaction['content'] . "\n";
|
||||
} elseif ($fileaction['type'] == 'file') {
|
||||
$commands_file = getFileContentContainer($fileaction['content'], $replace_arr, $action['name'], $distro_editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
$realname = $action['name'];
|
||||
$commands = trim($commands_pre);
|
||||
if ($commands != "") {
|
||||
$numbrows = count(explode("\n", $commands));
|
||||
eval("\$commands_pre=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
||||
}
|
||||
$commands = trim($commands_post);
|
||||
if ($commands != "") {
|
||||
$numbrows = count(explode("\n", $commands));
|
||||
eval("\$commands_post=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
||||
}
|
||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_subfileblock") . "\";");
|
||||
$commands = '';
|
||||
$commands_pre = '';
|
||||
$commands_post = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$commands = trim($commands);
|
||||
if ($commands != '') {
|
||||
$numbrows = count(explode("\n", $commands));
|
||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";");
|
||||
}
|
||||
eval("echo \"" . getTemplate("configfiles/configfiles") . "\";");
|
||||
} else {
|
||||
eval("echo \"" . getTemplate("configfiles/wizard") . "\";");
|
||||
}
|
||||
// get distro from URL param
|
||||
$distribution = Request::any('distribution');
|
||||
$reselect = Request::any('reselect', 0);
|
||||
|
||||
// check for possible setting
|
||||
if (empty($distribution)) {
|
||||
$distribution = Settings::Get('system.distribution') ?? "";
|
||||
}
|
||||
if ($reselect == 1) {
|
||||
$distribution = '';
|
||||
}
|
||||
|
||||
$distributions_select = [];
|
||||
|
||||
$services = [];
|
||||
$config_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/');
|
||||
|
||||
if (!empty($distribution)) {
|
||||
if (!file_exists($config_dir . '/' . $distribution . ".xml")) {
|
||||
Response::dynamicError("Unknown distribution");
|
||||
}
|
||||
|
||||
// update setting if different
|
||||
if ($distribution != Settings::Get('system.distribution')) {
|
||||
Settings::Set('system.distribution', $distribution);
|
||||
}
|
||||
|
||||
// create configparser object
|
||||
$configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml");
|
||||
|
||||
// get distro-info
|
||||
$dist_display = $configfiles->getCompleteDistroName();
|
||||
|
||||
// get all the services from the distro
|
||||
$services = $configfiles->getServices();
|
||||
} else {
|
||||
// show list of available distro's
|
||||
$distros = glob($config_dir . '*.xml');
|
||||
// read in all the distros
|
||||
foreach ($distros as $_distribution) {
|
||||
// get configparser object
|
||||
$dist = new ConfigParser($_distribution);
|
||||
// store in tmp array
|
||||
$distributions_select[str_replace(".xml", "", strtolower(basename($_distribution)))] = $dist->getCompleteDistroName();
|
||||
}
|
||||
|
||||
// sort by distribution name
|
||||
asort($distributions_select);
|
||||
}
|
||||
|
||||
if ($distribution != "" && isset($_POST['finish'])) {
|
||||
$valid_keys = ['http', 'dns', 'smtp', 'mail', 'ftp', 'system', 'distro'];
|
||||
unset($_POST['finish']);
|
||||
unset($_POST['csrf_token']);
|
||||
$params = $_POST;
|
||||
$params['distro'] = $distribution;
|
||||
$params['system'] = [];
|
||||
foreach ($_POST['system'] as $sysdaemon) {
|
||||
$params['system'][] = $sysdaemon;
|
||||
}
|
||||
// validate params
|
||||
foreach ($params as $key => $value) {
|
||||
if (!in_array($key, $valid_keys)) {
|
||||
unset($params[$key]);
|
||||
continue;
|
||||
}
|
||||
if (!is_array($value)) {
|
||||
$params[$key] = Validate::validate($value, $key);
|
||||
} else {
|
||||
foreach ($value as $subkey => $subvalue) {
|
||||
$params[$key][$subkey] = Validate::validate($subvalue, $key.'.'.$subkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
$params_content = json_encode($params);
|
||||
$params_filename = FileDir::makeCorrectFile(Froxlor::getInstallDir() . 'install/' . Froxlor::genSessionId() . '.json');
|
||||
file_put_contents($params_filename, $params_content);
|
||||
|
||||
UI::twigBuffer('settings/configuration-final.html.twig', [
|
||||
'distribution' => $distribution,
|
||||
// alert
|
||||
'type' => 'info',
|
||||
'alert_msg' => lng('admin.configfiles.finishnote'),
|
||||
'basedir' => Froxlor::getInstallDir(),
|
||||
'params_filename' => $params_filename
|
||||
]);
|
||||
} else {
|
||||
if (!empty($distribution)) {
|
||||
// show available services to configure
|
||||
$fields = $services;
|
||||
$link_params = ['section' => 'configfiles', 'distribution' => $distribution];
|
||||
UI::twigBuffer('settings/configuration.html.twig', [
|
||||
'action' => $linker->getLink($link_params),
|
||||
'fields' => $fields,
|
||||
'distribution' => $distribution
|
||||
]);
|
||||
} else {
|
||||
$cfg_formfield = [
|
||||
'config' => [
|
||||
'title' => lng('admin.configfiles.serverconfiguration'),
|
||||
'image' => 'fa-solid fa-wrench',
|
||||
'description' => lng('admin.configfiles.description'),
|
||||
'sections' => [
|
||||
'section_config' => [
|
||||
'fields' => [
|
||||
'distribution' => [
|
||||
'type' => 'select',
|
||||
'select_var' => $distributions_select,
|
||||
'label' => lng('admin.configfiles.distribution'),
|
||||
'selected' => Settings::Get('system.distribution') ?? ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
'buttons' => [
|
||||
[
|
||||
'class' => 'btn-outline-secondary',
|
||||
'label' => lng('panel.cancel'),
|
||||
'type' => 'reset'
|
||||
],
|
||||
[
|
||||
'label' => lng('update.proceed')
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
UI::twigBuffer('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'configfiles']),
|
||||
'formdata' => $cfg_formfield['config'],
|
||||
'actions_links' => (int)Settings::Get('panel.is_configured') == 0 ? [
|
||||
[
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'configfiles',
|
||||
'page' => 'overview',
|
||||
'action' => 'setconfigured'
|
||||
]),
|
||||
'label' => lng('panel.ihave_configured'),
|
||||
'class' => 'btn-outline-warning',
|
||||
'icon' => 'fa-solid fa-circle-check'
|
||||
]
|
||||
] : [],
|
||||
// alert
|
||||
'type' => 'warning',
|
||||
'alert_msg' => lng('panel.settings_before_configuration') . ((int)Settings::Get('panel.is_configured') == 1 ? '<br><br>' . lng('panel.system_is_configured') : '')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
UI::twigOutputBuffer();
|
||||
} else {
|
||||
die('not allowed to see this page');
|
||||
// redirect or similar here
|
||||
}
|
||||
|
||||
// helper functions
|
||||
function getFileContentContainer($file_content, &$replace_arr, $realname, $distro_editor)
|
||||
{
|
||||
$files = "";
|
||||
$file_content = trim($file_content);
|
||||
if ($file_content != '') {
|
||||
$file_content = strtr($file_content, $replace_arr);
|
||||
$file_content = htmlspecialchars($file_content);
|
||||
$numbrows = count(explode("\n", $file_content));
|
||||
eval("\$files=\"" . getTemplate("configfiles/configfiles_file") . "\";");
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
function getCompleteDistroName($cparser)
|
||||
{
|
||||
// get distro-info
|
||||
$dist_display = $cparser->distributionName;
|
||||
if ($cparser->distributionCodename != '') {
|
||||
$dist_display .= " ".$cparser->distributionCodename;
|
||||
}
|
||||
if ($cparser->distributionVersion != '') {
|
||||
$dist_display .= " (" . $cparser->distributionVersion . ")";
|
||||
}
|
||||
if ($cparser->deprecated) {
|
||||
$dist_display .= " [deprecated]";
|
||||
}
|
||||
return $dist_display;
|
||||
Response::redirectTo('admin_index.php');
|
||||
}
|
||||
|
||||
@@ -4,135 +4,90 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
use Froxlor\Api\Commands\Cronjobs;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
if ($page == 'cronjobs' || $page == 'overview') {
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if (($page == 'cronjobs' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
|
||||
if ($action == '') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs');
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs');
|
||||
|
||||
$fields = array(
|
||||
'c.lastrun' => $lng['cron']['lastrun'],
|
||||
'c.interval' => $lng['cron']['interval'],
|
||||
'c.isactive' => $lng['cron']['isactive']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_CRONRUNS, $fields);
|
||||
|
||||
$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)) {
|
||||
if ($cmod != $row['module']) {
|
||||
$_mod = explode("/", $row['module']);
|
||||
$module = ucfirst($_mod[1]);
|
||||
eval("\$crons.=\"" . getTemplate('cronjobs/cronjobs_cronjobmodule') . "\";");
|
||||
$cmod = $row['module'];
|
||||
}
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($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']];
|
||||
|
||||
eval("\$crons.=\"" . getTemplate('cronjobs/cronjobs_cronjob') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
try {
|
||||
$cron_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.cronjobs.php';
|
||||
$collection = (new Collection(Cronjobs::class, $userinfo))
|
||||
->withPagination($cron_list_data['cron_list']['columns'], $cron_list_data['cron_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('cronjobs/cronjobs') . "\";");
|
||||
|
||||
UI::view('user/table-note.html.twig', [
|
||||
'listing' => Listing::format($collection, $cron_list_data, 'cron_list'),
|
||||
// alert-box
|
||||
'type' => 'warning',
|
||||
'alert_msg' => lng('cron.changewarning')
|
||||
]);
|
||||
} elseif ($action == 'new') {
|
||||
/*
|
||||
* @TODO later
|
||||
*/
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`= :id");
|
||||
Database::pexecute($result_stmt, array('id' => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = Cronjobs::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
if ($result['cronfile'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$isactive = isset($_POST['isactive']) ? 1 : 0;
|
||||
$interval_value = validate($_POST['interval_value'], 'interval_value', '/^([0-9]+)$/Di', 'stringisempty');
|
||||
$interval_interval = validate($_POST['interval_interval'], 'interval_interval');
|
||||
|
||||
if ($isactive != 1) {
|
||||
$isactive = 0;
|
||||
try {
|
||||
Cronjobs::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$interval = $interval_value . ' ' . strtoupper($interval_interval);
|
||||
|
||||
$upd = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||
SET `isactive` = :isactive, `interval` = :int
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($upd, array('isactive' => $isactive, 'int' => $interval, 'id' => $id));
|
||||
|
||||
// insert task to re-generate the cron.d-file
|
||||
inserttask('99');
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$cronjobs_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php';
|
||||
|
||||
// interval
|
||||
$interval_nfo = explode(' ', $result['interval']);
|
||||
$interval_value = $interval_nfo[0];
|
||||
|
||||
$interval_interval = '';
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['minutes'], 'MINUTE', $interval_nfo[1]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['hours'], 'HOUR', $interval_nfo[1]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['days'], 'DAY', $interval_nfo[1]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]);
|
||||
// end of interval
|
||||
|
||||
$change_cronfile = false;
|
||||
if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor') {
|
||||
$change_cronfile = true;
|
||||
}
|
||||
|
||||
$cronjobs_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/cronjobs/formfield.cronjobs_edit.php';
|
||||
$cronjobs_edit_form = htmlform::genHTMLForm($cronjobs_edit_data);
|
||||
|
||||
$title = $cronjobs_edit_data['cronjobs_edit']['title'];
|
||||
$image = $cronjobs_edit_data['cronjobs_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('cronjobs/cronjob_edit') . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'cronjobs', 'id' => $id]),
|
||||
'formdata' => $cronjobs_edit_data['cronjobs_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delete' && $id != 0) {
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
/*
|
||||
* @TODO later
|
||||
*/
|
||||
|
||||
1898
admin_customers.php
2226
admin_domains.php
505
admin_index.php
@@ -2,176 +2,169 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if ($action == 'logout') {
|
||||
use Froxlor\Api\Commands\Admins as Admins;
|
||||
use Froxlor\Api\Commands\Froxlor as Froxlor;
|
||||
use Froxlor\CurrentUser;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\System\Cronjob;
|
||||
use Froxlor\System\Crypt;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Validate\Validate;
|
||||
use Froxlor\Language;
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "logged out");
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
$params = array('adminid' => (int)$userinfo['adminid']);
|
||||
if ($action == 'logout') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "logged out");
|
||||
unset($_SESSION['userinfo']);
|
||||
CurrentUser::setData();
|
||||
session_destroy();
|
||||
|
||||
if (Settings::Get('session.allow_multiple_login') == '1') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :adminid
|
||||
AND `adminsession` = '1'
|
||||
AND `hash` = :hash"
|
||||
);
|
||||
$params['hash'] = $s;
|
||||
Response::redirectTo('index.php');
|
||||
} elseif ($action == 'suback') {
|
||||
if (is_array(CurrentUser::getField('switched_user'))) {
|
||||
$result = CurrentUser::getData();
|
||||
$result = $result['switched_user'];
|
||||
session_regenerate_id(true);
|
||||
CurrentUser::setData($result);
|
||||
$target = (isset($_GET['target']) ? $_GET['target'] : 'index');
|
||||
$redirect = "admin_" . $target . ".php";
|
||||
if (!file_exists(\Froxlor\Froxlor::getInstallDir() . "/" . $redirect)) {
|
||||
$redirect = "admin_index.php";
|
||||
}
|
||||
Response::redirectTo($redirect, null, true);
|
||||
} else {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :adminid
|
||||
AND `adminsession` = '1'"
|
||||
);
|
||||
Response::dynamicError("Cannot change back - You've never switched to another user :-)");
|
||||
}
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
redirectTo('index.php');
|
||||
}
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
||||
$log->logAction(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(case when `diskspace` > 0 then `diskspace` else 0 end) AS `diskspace_assigned`,
|
||||
SUM(`diskspace_used`) AS `diskspace_used`,
|
||||
SUM(case when `mysqls` > 0 then `mysqls` else 0 end) AS `mysqls_assigned`,
|
||||
SUM(`mysqls_used`) AS `mysqls_used`,
|
||||
SUM(case when `emails` > 0 then `emails` else 0 end) AS `emails_assigned`,
|
||||
SUM(`emails_used`) AS `emails_used`,
|
||||
SUM(case when `email_accounts` > 0 then `email_accounts` else 0 end) AS `email_accounts_assigned`,
|
||||
SUM(`email_accounts_used`) AS `email_accounts_used`,
|
||||
SUM(case when `email_forwarders` > 0 then `email_forwarders` else 0 end) AS `email_forwarders_assigned`,
|
||||
SUM(`email_forwarders_used`) AS `email_forwarders_used`,
|
||||
SUM(case when `email_quota` > 0 then `email_quota` else 0 end) AS `email_quota_assigned`,
|
||||
SUM(`email_quota_used`) AS `email_quota_used`,
|
||||
SUM(case when `ftps` > 0 then `ftps` else 0 end) AS `ftps_assigned`,
|
||||
SUM(`ftps_used`) AS `ftps_used`,
|
||||
SUM(`tickets_used`) AS `tickets_used`,
|
||||
SUM(case when `subdomains` > 0 then `subdomains` else 0 end) AS `subdomains_assigned`,
|
||||
SUM(`subdomains_used`) AS `subdomains_used`,
|
||||
SUM(case when `traffic` > 0 then `traffic` else 0 end) AS `traffic_assigned`,
|
||||
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);
|
||||
$userinfo['diskspace_bytes'] = ($userinfo['diskspace'] > -1) ? $userinfo['diskspace'] * 1024 : -1;
|
||||
$overview['diskspace_bytes'] = $overview['diskspace_assigned'] * 1024;
|
||||
$overview['diskspace_bytes_used'] = $overview['diskspace_used'] * 1024;
|
||||
|
||||
$userinfo['traffic_bytes'] = ($userinfo['traffic'] > -1) ? $userinfo['traffic'] * 1024 : -1;
|
||||
$overview['traffic_bytes'] = $overview['traffic_assigned'] * 1024;
|
||||
$overview['traffic_bytes_used'] = $overview['traffic_used'] * 1024;
|
||||
|
||||
$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']));
|
||||
WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid"));
|
||||
$number_domains = Database::pexecute_first($number_domains_stmt, $params);
|
||||
|
||||
$overview['number_domains'] = $number_domains['number_domains'];
|
||||
|
||||
$phpversion = phpversion();
|
||||
$mysqlserverversion = Database::getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$webserverinterface = strtoupper(@php_sapi_name());
|
||||
|
||||
if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|
||||
|| (isset($lookfornewversion) && $lookfornewversion == 'yes')
|
||||
) {
|
||||
$update_check_uri = 'http://version.froxlor.org/Froxlor/legacy/' . $version;
|
||||
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$latestversion = @file($update_check_uri);
|
||||
|
||||
if (isset($latestversion[0])) {
|
||||
$latestversion = explode('|', $latestversion[0]);
|
||||
|
||||
if (is_array($latestversion)
|
||||
&& count($latestversion) >= 1
|
||||
) {
|
||||
$_version = $latestversion[0];
|
||||
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
|
||||
// add the branding so debian guys are not gettings confused
|
||||
// about their version-number
|
||||
$lookfornewversion_lable = $_version.$branding;
|
||||
$lookfornewversion_link = $_link;
|
||||
$lookfornewversion_addinfo = $_message;
|
||||
|
||||
// not numeric -> error-message
|
||||
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
||||
// check for customized version to not output
|
||||
// "There is a newer version of froxlor" besides the error-message
|
||||
$isnewerversion = 2;
|
||||
} elseif (version_compare2($version, $_version) == -1) {
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
$isnewerversion = 0;
|
||||
}
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
}
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
}
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
if ((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes') || (isset($lookfornewversion) && $lookfornewversion == 'yes')) {
|
||||
try {
|
||||
$json_result = Froxlor::getLocal($userinfo)->checkUpdate();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$lookfornewversion_lable = $result['version'];
|
||||
$lookfornewversion_link = $result['link'];
|
||||
$lookfornewversion_message = $result['message'];
|
||||
$lookfornewversion_addinfo = $result['additional_info'];
|
||||
$isnewerversion = $result['isnewerversion'];
|
||||
} else {
|
||||
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
||||
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
$lookfornewversion_lable = lng('admin.lookfornewversion.clickhere');
|
||||
$lookfornewversion_link = htmlspecialchars($filename . '?page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
$lookfornewversion_message = '';
|
||||
$lookfornewversion_addinfo = '';
|
||||
$isnewerversion = 0;
|
||||
}
|
||||
|
||||
$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 = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
||||
$cron_last_runs = Cronjob::getCronjobsLastRun();
|
||||
$outstanding_tasks = Cronjob::getOutstandingTasks();
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
$cron_last_runs = getCronjobsLastRun();
|
||||
$outstanding_tasks = getOutstandingTasks();
|
||||
// additional sys-infos
|
||||
$meminfo = explode("\n", @file_get_contents("/proc/meminfo"));
|
||||
$memory = "";
|
||||
for ($i = 0; $i < count($meminfo); ++$i) {
|
||||
if (substr($meminfo[$i], 0, 3) === "Mem") {
|
||||
$memory .= $meminfo[$i] . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if (function_exists('sys_getloadavg')) {
|
||||
$loadArray = sys_getloadavg();
|
||||
$load = number_format($loadArray[0], 2, '.', '') . " / " . number_format($loadArray[1], 2, '.', '') . " / " . number_format($loadArray[2], 2, '.', '');
|
||||
} else {
|
||||
$load = @file_get_contents('/proc/loadavg');
|
||||
|
||||
if (!$load) {
|
||||
$load = $lng['admin']['noloadavailable'];
|
||||
$load = lng('admin.noloadavailable');
|
||||
}
|
||||
}
|
||||
|
||||
$kernel = '';
|
||||
if (function_exists('posix_uname')) {
|
||||
$showkernel = 1;
|
||||
$kernel_nfo = posix_uname();
|
||||
$kernel = $kernel_nfo['release'] . ' (' . $kernel_nfo['machine'] . ')';
|
||||
} else {
|
||||
$showkernel = 0;
|
||||
$kernel = '';
|
||||
}
|
||||
|
||||
// Try to get the uptime
|
||||
// First: With exec (let's hope it's enabled for the Froxlor - vHost)
|
||||
$uptime_array = explode(" ", @file_get_contents("/proc/uptime"));
|
||||
|
||||
if (is_array($uptime_array)
|
||||
&& isset($uptime_array[0])
|
||||
&& is_numeric($uptime_array[0])
|
||||
) {
|
||||
$uptime = '';
|
||||
if (is_array($uptime_array) && isset($uptime_array[0]) && is_numeric($uptime_array[0])) {
|
||||
// Some calculatioon to get a nicly formatted display
|
||||
$seconds = round($uptime_array[0], 0);
|
||||
$minutes = $seconds / 60;
|
||||
@@ -181,226 +174,136 @@ if ($page == 'overview') {
|
||||
$minutes = floor($minutes - ($days * 24 * 60) - ($hours * 60));
|
||||
$seconds = floor($seconds - ($days * 24 * 60 * 60) - ($hours * 60 * 60) - ($minutes * 60));
|
||||
$uptime = "{$days}d, {$hours}h, {$minutes}m, {$seconds}s";
|
||||
|
||||
// Just cleanup
|
||||
unset($uptime_array, $seconds, $minutes, $hours, $days);
|
||||
} else {
|
||||
// Nothing of the above worked, show an error :/
|
||||
$uptime = '';
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/index") . "\";");
|
||||
$sysinfo = [
|
||||
'webserver' => $_SERVER['SERVER_SOFTWARE'] ?? 'unknown',
|
||||
'phpversion' => phpversion(),
|
||||
'mysqlserverversion' => Database::getAttribute(PDO::ATTR_SERVER_VERSION),
|
||||
'phpsapi' => strtoupper(@php_sapi_name()),
|
||||
'hostname' => gethostname(),
|
||||
'memory' => $memory,
|
||||
'load' => $load,
|
||||
'kernel' => $kernel,
|
||||
'uptime' => $uptime
|
||||
];
|
||||
|
||||
} elseif($page == 'change_password') {
|
||||
UI::twig()->addGlobal('userinfo', $userinfo);
|
||||
UI::view('user/index.html.twig', [
|
||||
'sysinfo' => $sysinfo,
|
||||
'overview' => $overview,
|
||||
'outstanding_tasks' => $outstanding_tasks,
|
||||
'cron_last_runs' => $cron_last_runs
|
||||
]);
|
||||
} elseif ($page == 'change_password') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$old_password = Validate::validate($_POST['old_password'], 'old password');
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$old_password = validate($_POST['old_password'], 'old password');
|
||||
|
||||
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_ADMINS,'adminid')) {
|
||||
standard_error('oldpasswordnotcorrect');
|
||||
if (!Crypt::validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_ADMINS, 'adminid')) {
|
||||
Response::standardError('oldpasswordnotcorrect');
|
||||
}
|
||||
|
||||
$new_password = validate($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
||||
try {
|
||||
$new_password = Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($old_password == '') {
|
||||
standard_error(array('stringisempty', 'oldpassword'));
|
||||
} elseif($new_password == '') {
|
||||
standard_error(array('stringisempty', 'newpassword'));
|
||||
} elseif($new_password_confirm == '') {
|
||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||
} elseif($new_password != $new_password_confirm) {
|
||||
standard_error('newpasswordconfirmerror');
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.old_password'
|
||||
]);
|
||||
} elseif ($new_password == '') {
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.new_password'
|
||||
]);
|
||||
} elseif ($new_password_confirm == '') {
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.new_password_confirm'
|
||||
]);
|
||||
} elseif ($new_password != $new_password_confirm) {
|
||||
Response::standardError('newpasswordconfirmerror');
|
||||
} else {
|
||||
$chgpwd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
SET `password`= :newpasswd
|
||||
WHERE `adminid`= :adminid"
|
||||
);
|
||||
Database::pexecute($chgpwd_stmt, array(
|
||||
'newpasswd' => makeCryptPassword($new_password),
|
||||
'adminid' => (int)$userinfo['adminid']
|
||||
));
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'changed password');
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
try {
|
||||
Admins::getLocal($userinfo, [
|
||||
'id' => $userinfo['adminid'],
|
||||
'admin_password' => $new_password
|
||||
])->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'changed password');
|
||||
Response::redirectTo($filename);
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
||||
UI::view('user/change_password.html.twig');
|
||||
}
|
||||
|
||||
} elseif($page == 'change_language') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$def_language = validate($_POST['def_language'], 'default language');
|
||||
} elseif ($page == 'change_language') {
|
||||
$languages = Language::getLanguages();
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$def_language = Validate::validate($_POST['def_language'], 'default language');
|
||||
|
||||
if (isset($languages[$def_language])) {
|
||||
$lng_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
SET `def_language`= :deflng
|
||||
WHERE `adminid`= :adminid"
|
||||
);
|
||||
Database::pexecute($lng_stmt, array(
|
||||
'deflng' => $def_language,
|
||||
'adminid' => (int)$userinfo['adminid']
|
||||
));
|
||||
|
||||
$lng_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_SESSIONS . "`
|
||||
SET `language`= :lng
|
||||
WHERE `hash`= :hash"
|
||||
);
|
||||
Database::pexecute($lng_stmt, array(
|
||||
'lng' => $def_language,
|
||||
'hash' => $s
|
||||
));
|
||||
try {
|
||||
Admins::getLocal($userinfo, [
|
||||
'id' => $userinfo['adminid'],
|
||||
'def_language' => $def_language
|
||||
])->update();
|
||||
CurrentUser::setField('language', $def_language);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "changed his/her default language to '" . $def_language . "'");
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "changed his/her default language to '" . $def_language . "'");
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
|
||||
$language_options = '';
|
||||
|
||||
$default_lang = Settings::Get('panel.standardlanguage');
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
|
||||
UI::view('user/change_language.html.twig', [
|
||||
'languages' => $languages,
|
||||
'default_lang' => $default_lang
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'change_theme') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$theme = Validate::validate($_POST['theme'], 'theme');
|
||||
try {
|
||||
Admins::getLocal($userinfo, [
|
||||
'id' => $userinfo['adminid'],
|
||||
'theme' => $theme
|
||||
])->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
||||
}
|
||||
|
||||
} elseif ($page == 'change_theme') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$theme = validate($_POST['theme'], 'theme');
|
||||
|
||||
$theme_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
SET `theme`= :theme
|
||||
WHERE `adminid`= :adminid"
|
||||
);
|
||||
Database::pexecute($theme_stmt, array(
|
||||
'theme' => $theme,
|
||||
'adminid' => (int)$userinfo['adminid']
|
||||
));
|
||||
|
||||
$theme_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_SESSIONS . "`
|
||||
SET `theme`= :theme
|
||||
WHERE `hash`= :hash"
|
||||
);
|
||||
Database::pexecute($theme_stmt, array(
|
||||
'theme' => $theme,
|
||||
'hash' => $s
|
||||
));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "changed his/her theme to '" . $theme . "'");
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "changed his/her theme to '" . $theme . "'");
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
|
||||
$theme_options = '';
|
||||
|
||||
$default_theme = Settings::Get('panel.default_theme');
|
||||
if ($userinfo['theme'] != '') {
|
||||
$default_theme = $userinfo['theme'];
|
||||
}
|
||||
|
||||
$themes_avail = getThemes();
|
||||
foreach ($themes_avail as $t => $d) {
|
||||
$theme_options.= makeoption($d, $t, $default_theme, true);
|
||||
}
|
||||
$themes_avail = UI::getThemes();
|
||||
|
||||
eval("echo \"" . getTemplate("index/change_theme") . "\";");
|
||||
}
|
||||
|
||||
} elseif ($page == 'send_error_report'
|
||||
&& Settings::Get('system.allow_error_report_admin') == '1'
|
||||
) {
|
||||
|
||||
// only show this if we really have an exception to report
|
||||
if (isset($_GET['errorid'])
|
||||
&& $_GET['errorid'] != ''
|
||||
) {
|
||||
|
||||
$errid = $_GET['errorid'];
|
||||
// read error file
|
||||
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
|
||||
$err_file = makeCorrectFile($err_dir."/".$errid."_sql-error.log");
|
||||
|
||||
if (file_exists($err_file)) {
|
||||
|
||||
$error_content = file_get_contents($err_file);
|
||||
$error = explode("|", $error_content);
|
||||
|
||||
$_error = array(
|
||||
'code' => str_replace("\n", "", substr($error[1], 5)),
|
||||
'message' => str_replace("\n", "", substr($error[2], 4)),
|
||||
'file' => str_replace("\n", "", substr($error[3], 5 + strlen(FROXLOR_INSTALL_DIR))),
|
||||
'line' => str_replace("\n", "", substr($error[4], 5)),
|
||||
'trace' => str_replace(FROXLOR_INSTALL_DIR, "", substr($error[5], 6))
|
||||
);
|
||||
|
||||
// build mail-content
|
||||
$mail_body = "Dear froxlor-team,\n\n";
|
||||
$mail_body .= "the following error has been reported by a user:\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n";
|
||||
$mail_body .= $_error['code'].' '.$_error['message']."\n\n";
|
||||
$mail_body .= "File: ".$_error['file'].':'.$_error['line']."\n\n";
|
||||
$mail_body .= "Trace:\n".trim($_error['trace'])."\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n\n";
|
||||
$mail_body .= "Froxlor-version: ".$version."\n\n";
|
||||
$mail_body .= "End of report";
|
||||
$mail_html = nl2br($mail_body);
|
||||
|
||||
// send actual report to dev-team
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
// send mail and say thanks
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = '[Froxlor] Error report by user';
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML($mail_html);
|
||||
$mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team');
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
// error when reporting an error...LOLFUQ
|
||||
standard_error('send_report_error', $mailerr_msg);
|
||||
}
|
||||
|
||||
// finally remove error from fs
|
||||
@unlink($err_file);
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
// show a nice summary of the error-report
|
||||
// before actually sending anything
|
||||
eval("echo \"" . getTemplate("index/send_error_report") . "\";");
|
||||
|
||||
} else {
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
} else {
|
||||
redirectTo($filename, array('s' => $s));
|
||||
UI::view('user/change_theme.html.twig', [
|
||||
'themes' => $themes_avail,
|
||||
'default_theme' => $default_theme
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_admin') == '1') {
|
||||
require_once __DIR__ . '/error_report.php';
|
||||
} elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/api_keys.php';
|
||||
} elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) {
|
||||
require_once __DIR__ . '/2fa.php';
|
||||
}
|
||||
|
||||
@@ -2,436 +2,152 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
use Froxlor\Api\Commands\IpsAndPorts;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
if ($page == 'ipsandports'
|
||||
|| $page == 'overview'
|
||||
) {
|
||||
// Do not display attributes that are not used by the current webserver
|
||||
$websrv = Settings::Get('system.webserver');
|
||||
$is_nginx = ($websrv == 'nginx');
|
||||
$is_apache = ($websrv == 'apache2');
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if (($page == 'ipsandports' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
|
||||
if ($action == '') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
|
||||
$fields = array(
|
||||
'ip' => $lng['admin']['ipsandports']['ip'],
|
||||
'port' => $lng['admin']['ipsandports']['port']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
|
||||
$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 = htmlentities_array($row);
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
eval("\$ipsandports.=\"" . getTemplate("ipsandports/ipsandports_ipandport") . "\";");
|
||||
$count++;
|
||||
}
|
||||
$i++;
|
||||
try {
|
||||
$ipsandports_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.ipsandports.php';
|
||||
$collection = (new Collection(IpsAndPorts::class, $userinfo))
|
||||
->withPagination($ipsandports_list_data['ipsandports_list']['columns'], $ipsandports_list_data['ipsandports_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports") . "\";");
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $ipsandports_list_data, 'ipsandports_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'ipsandports', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.ipsandports.add')
|
||||
]
|
||||
]
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = IpsAndPorts::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
} elseif($action == 'delete'
|
||||
&& $id != 0
|
||||
) {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :id");
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if (isset($result['id'])
|
||||
&& $result['id'] == $id
|
||||
) {
|
||||
$result_checkdomain_stmt = Database::prepare("
|
||||
SELECT `id_domain` as `id` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports` = :id"
|
||||
);
|
||||
$result_checkdomain = Database::pexecute_first($result_checkdomain_stmt, array('id' => $id));
|
||||
|
||||
if ($result_checkdomain['id'] == '') {
|
||||
if (!in_array($result['id'], explode(',', Settings::Get('system.defaultip')))) {
|
||||
|
||||
$result_sameipotherport_stmt = Database::prepare("
|
||||
SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `ip` = :ip AND `id` <> :id"
|
||||
);
|
||||
$result_sameipotherport = Database::pexecute_first($result_sameipotherport_stmt, array('id' => $id, 'ip' => $result['ip']));
|
||||
|
||||
if (($result['ip'] != Settings::Get('system.ipaddress'))
|
||||
|| ($result['ip'] == Settings::Get('system.ipaddress')
|
||||
&& $result_sameipotherport['id'] != '')
|
||||
) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if ($result['ip'] != '') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($del_stmt, array('id' => $id));
|
||||
|
||||
// also, remove connections to domains (multi-stack)
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `".TABLE_DOMAINTOIP."` WHERE `id_ipandports` = :id"
|
||||
);
|
||||
Database::pexecute($del_stmt, array('id' => $id));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "deleted IP/port '" . $result['ip'] . ":" . $result['port'] . "'");
|
||||
inserttask('1');
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
ask_yesno('admin_ip_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['ip'] . ':' . $result['port']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
standard_error('cantdeletesystemip');
|
||||
}
|
||||
} else {
|
||||
standard_error('cantdeletedefaultip');
|
||||
if (isset($result['id']) && $result['id'] == $id) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
IpsAndPorts::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
standard_error('ipstillhasdomains');
|
||||
HTML::askYesNo('admin_ip_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['ip'] . ':' . $result['port']);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($action == 'add') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$ip = validate_ip($_POST['ip']);
|
||||
$port = validate($_POST['port'], 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array('stringisempty', 'myport'));
|
||||
$listen_statement = isset($_POST['listen_statement']) ? 1 : 0;
|
||||
$namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0;
|
||||
$vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0;
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
|
||||
$vhostcontainer_servername_statement = isset($_POST['vhostcontainer_servername_statement']) ? 1 : 0;
|
||||
$default_vhostconf_domain = validate(str_replace("\r\n", "\n", $_POST['default_vhostconf_domain']), 'default_vhostconf_domain', '/^[^\0]*$/');
|
||||
$docroot = validate($_POST['docroot'], 'docroot');
|
||||
|
||||
if ((int)Settings::Get('system.use_ssl') == 1) {
|
||||
$ssl = isset($_POST['ssl']) ? intval($_POST['ssl']) : 0;
|
||||
$ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file');
|
||||
$ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file');
|
||||
$ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file');
|
||||
$ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile');
|
||||
} else {
|
||||
$ssl = 0;
|
||||
$ssl_cert_file = '';
|
||||
$ssl_key_file = '';
|
||||
$ssl_ca_file = '';
|
||||
$ssl_cert_chainfile = '';
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
IpsAndPorts::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($listen_statement != '1') {
|
||||
$listen_statement = '0';
|
||||
}
|
||||
|
||||
if ($namevirtualhost_statement != '1') {
|
||||
$namevirtualhost_statement = '0';
|
||||
}
|
||||
|
||||
if ($vhostcontainer != '1') {
|
||||
$vhostcontainer = '0';
|
||||
}
|
||||
|
||||
if ($vhostcontainer_servername_statement != '1') {
|
||||
$vhostcontainer_servername_statement = '0';
|
||||
}
|
||||
|
||||
if ($ssl != '1') {
|
||||
$ssl = '0';
|
||||
}
|
||||
|
||||
if ($ssl_cert_file != '') {
|
||||
$ssl_cert_file = makeCorrectFile($ssl_cert_file);
|
||||
}
|
||||
|
||||
if ($ssl_key_file != '') {
|
||||
$ssl_key_file = makeCorrectFile($ssl_key_file);
|
||||
}
|
||||
|
||||
if ($ssl_ca_file != '') {
|
||||
$ssl_ca_file = makeCorrectFile($ssl_ca_file);
|
||||
}
|
||||
|
||||
if ($ssl_cert_chainfile != '') {
|
||||
$ssl_cert_chainfile = makeCorrectFile($ssl_cert_chainfile);
|
||||
}
|
||||
|
||||
if (strlen(trim($docroot)) > 0) {
|
||||
$docroot = makeCorrectDir($docroot);
|
||||
} else {
|
||||
$docroot = '';
|
||||
}
|
||||
|
||||
$result_checkfordouble_stmt = Database::prepare("
|
||||
SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `ip` = :ip AND `port` = :port"
|
||||
);
|
||||
$result_checkfordouble = Database::pexecute_first($result_checkfordouble_stmt, array('ip' => $ip, 'port' => $port));
|
||||
|
||||
if ($result_checkfordouble['id'] != '') {
|
||||
standard_error('myipnotdouble');
|
||||
} else {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
SET
|
||||
`ip` = :ip, `port` = :port, `listen_statement` = :ls,
|
||||
`namevirtualhost_statement` = :nvhs, `vhostcontainer` = :vhc,
|
||||
`vhostcontainer_servername_statement` = :vhcss,
|
||||
`specialsettings` = :ss, `ssl` = :ssl,
|
||||
`ssl_cert_file` = :ssl_cert, `ssl_key_file` = :ssl_key,
|
||||
`ssl_ca_file` = :ssl_ca, `ssl_cert_chainfile` = :ssl_chain,
|
||||
`default_vhostconf_domain` = :dvhd, `docroot` = :docroot;
|
||||
");
|
||||
$ins_data = array(
|
||||
'ip' => $ip,
|
||||
'port' => $port,
|
||||
'ls' => $listen_statement,
|
||||
'nvhs' => $namevirtualhost_statement,
|
||||
'vhc' => $vhostcontainer,
|
||||
'vhcss' => $vhostcontainer_servername_statement,
|
||||
'ss' => $specialsettings,
|
||||
'ssl' => $ssl,
|
||||
'ssl_cert' => $ssl_cert_file,
|
||||
'ssl_key' => $ssl_key_file,
|
||||
'ssl_ca' => $ssl_ca_file,
|
||||
'ssl_chain' => $ssl_cert_chainfile,
|
||||
'dvhd' => $default_vhostconf_domain,
|
||||
'docroot' => $docroot
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$ip = '[' . $ip . ']';
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "added IP/port '" . $ip . ":" . $port . "'");
|
||||
inserttask('1');
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$ipsandports_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
|
||||
|
||||
$ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
|
||||
$ipsandports_add_form = htmlform::genHTMLForm($ipsandports_add_data);
|
||||
|
||||
$title = $ipsandports_add_data['ipsandports_add']['title'];
|
||||
$image = $ipsandports_add_data['ipsandports_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports_add") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'ipsandports']),
|
||||
'formdata' => $ipsandports_add_data['ipsandports_add']
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif($action == 'edit'
|
||||
&& $id != 0
|
||||
) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
try {
|
||||
$json_result = IpsAndPorts::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($result['ip'] != '') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$ip = validate_ip($_POST['ip']);
|
||||
$port = validate($_POST['port'], 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array('stringisempty', 'myport'));
|
||||
$listen_statement = isset($_POST['listen_statement']) ? 1 : 0;
|
||||
$namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0;
|
||||
$vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0;
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
|
||||
$vhostcontainer_servername_statement = isset($_POST['vhostcontainer_servername_statement']) ? 1 : 0;
|
||||
$default_vhostconf_domain = validate(str_replace("\r\n", "\n", $_POST['default_vhostconf_domain']), 'default_vhostconf_domain', '/^[^\0]*$/');
|
||||
$docroot = validate($_POST['docroot'], 'docroot');
|
||||
|
||||
$result_checkfordouble_stmt = Database::prepare("
|
||||
SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `ip` = :ip AND `port` = :port"
|
||||
);
|
||||
$result_checkfordouble = Database::pexecute_first($result_checkfordouble_stmt, array('ip' => $ip, 'port' => $port));
|
||||
|
||||
$result_sameipotherport_stmt = Database::prepare("
|
||||
SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
WHERE `ip` = :ip AND `id` <> :id"
|
||||
);
|
||||
$result_sameipotherport = Database::pexecute_first($result_sameipotherport_stmt, array('ip' => $ip, 'id' => $id));
|
||||
|
||||
if ((int)Settings::Get('system.use_ssl') == 1
|
||||
&& isset($_POST['ssl'])
|
||||
&& $_POST['ssl'] != 0
|
||||
) {
|
||||
$ssl = 1;
|
||||
$ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file');
|
||||
$ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file');
|
||||
$ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file');
|
||||
$ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile');
|
||||
} else {
|
||||
$ssl = 0;
|
||||
$ssl_cert_file = '';
|
||||
$ssl_key_file = '';
|
||||
$ssl_ca_file = '';
|
||||
$ssl_cert_chainfile = '';
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
IpsAndPorts::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($listen_statement != '1') {
|
||||
$listen_statement = '0';
|
||||
}
|
||||
|
||||
if ($namevirtualhost_statement != '1') {
|
||||
$namevirtualhost_statement = '0';
|
||||
}
|
||||
|
||||
if ($vhostcontainer != '1') {
|
||||
$vhostcontainer = '0';
|
||||
}
|
||||
|
||||
if ($vhostcontainer_servername_statement != '1') {
|
||||
$vhostcontainer_servername_statement = '0';
|
||||
}
|
||||
|
||||
if ($ssl != '1') {
|
||||
$ssl = '0';
|
||||
}
|
||||
|
||||
if ($ssl_cert_file != '') {
|
||||
$ssl_cert_file = makeCorrectFile($ssl_cert_file);
|
||||
}
|
||||
|
||||
if ($ssl_key_file != '') {
|
||||
$ssl_key_file = makeCorrectFile($ssl_key_file);
|
||||
}
|
||||
|
||||
if ($ssl_ca_file != '') {
|
||||
$ssl_ca_file = makeCorrectFile($ssl_ca_file);
|
||||
}
|
||||
|
||||
if ($ssl_cert_chainfile != '') {
|
||||
$ssl_cert_chainfile = makeCorrectFile($ssl_cert_chainfile);
|
||||
}
|
||||
|
||||
if (strlen(trim($docroot)) > 0) {
|
||||
$docroot = makeCorrectDir($docroot);
|
||||
} else {
|
||||
$docroot = '';
|
||||
}
|
||||
|
||||
if ($result['ip'] != $ip
|
||||
&& $result['ip'] == Settings::Get('system.ipaddress')
|
||||
&& $result_sameipotherport['id'] == ''
|
||||
) {
|
||||
standard_error('cantchangesystemip');
|
||||
|
||||
} elseif($result_checkfordouble['id'] != ''
|
||||
&& $result_checkfordouble['id'] != $id
|
||||
) {
|
||||
standard_error('myipnotdouble');
|
||||
|
||||
} else {
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
SET
|
||||
`ip` = :ip, `port` = :port, `listen_statement` = :ls,
|
||||
`namevirtualhost_statement` = :nvhs, `vhostcontainer` = :vhc,
|
||||
`vhostcontainer_servername_statement` = :vhcss,
|
||||
`specialsettings` = :ss, `ssl` = :ssl,
|
||||
`ssl_cert_file` = :ssl_cert, `ssl_key_file` = :ssl_key,
|
||||
`ssl_ca_file` = :ssl_ca, `ssl_cert_chainfile` = :ssl_chain,
|
||||
`default_vhostconf_domain` = :dvhd, `docroot` = :docroot
|
||||
WHERE `id` = :id;
|
||||
");
|
||||
$upd_data = array(
|
||||
'ip' => $ip,
|
||||
'port' => $port,
|
||||
'ls' => $listen_statement,
|
||||
'nvhs' => $namevirtualhost_statement,
|
||||
'vhc' => $vhostcontainer,
|
||||
'vhcss' => $vhostcontainer_servername_statement,
|
||||
'ss' => $specialsettings,
|
||||
'ssl' => $ssl,
|
||||
'ssl_cert' => $ssl_cert_file,
|
||||
'ssl_key' => $ssl_key_file,
|
||||
'ssl_ca' => $ssl_ca_file,
|
||||
'ssl_chain' => $ssl_cert_chainfile,
|
||||
'dvhd' => $default_vhostconf_domain,
|
||||
'docroot' => $docroot,
|
||||
'id' => $id
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data);
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "changed IP/port from '" . $result['ip'] . ":" . $result['port'] . "' to '" . $ip . ":" . $port . "'");
|
||||
inserttask('1');
|
||||
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
$ipsandports_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
|
||||
|
||||
$ipsandports_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
|
||||
$ipsandports_edit_form = htmlform::genHTMLForm($ipsandports_edit_data);
|
||||
|
||||
$title = $ipsandports_edit_data['ipsandports_edit']['title'];
|
||||
$image = $ipsandports_edit_data['ipsandports_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports_edit") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'ipsandports', 'id' => $id]),
|
||||
'formdata' => $ipsandports_edit_data['ipsandports_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
} 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();
|
||||
}
|
||||
}
|
||||
|
||||
170
admin_logger.php
@@ -2,131 +2,75 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if ($page == 'log'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
use Froxlor\Api\Commands\SysLog;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
if ($page == 'log' && $userinfo['change_serversettings'] == '1') {
|
||||
if ($action == '') {
|
||||
$fields = array(
|
||||
'date' => $lng['logger']['date'],
|
||||
'type' => $lng['logger']['type'],
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
||||
$result_stmt = Database::query('
|
||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
||||
);
|
||||
$logs_count = Database::num_rows();
|
||||
$paging->setEntries($logs_count);
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (!isset($clog[$row['action']])
|
||||
|| !is_array($clog[$row['action']])
|
||||
) {
|
||||
$clog[$row['action']] = array();
|
||||
}
|
||||
$clog[$row['action']][$row['logid']] = $row;
|
||||
try {
|
||||
$syslog_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/tablelisting.syslog.php';
|
||||
$collection = (new Collection(SysLog::class, $userinfo))
|
||||
->withPagination($syslog_list_data['syslog_list']['columns'], $syslog_list_data['syslog_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'date'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($clog);
|
||||
} else {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
$log = '';
|
||||
foreach ($clog as $action => $logrows) {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
switch ($action) {
|
||||
case USR_ACTION:
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
case RES_ACTION:
|
||||
$_action = $lng['logger']['reseller'];
|
||||
break;
|
||||
case ADM_ACTION:
|
||||
$_action = $lng['logger']['admin'];
|
||||
break;
|
||||
case CRON_ACTION:
|
||||
$_action = $lng['logger']['cron'];
|
||||
break;
|
||||
case LOGIN_ACTION:
|
||||
$_action = $lng['logger']['login'];
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
$_action = $lng['logger']['intern'];
|
||||
break;
|
||||
default:
|
||||
$_action = $lng['logger']['unknown'];
|
||||
break;
|
||||
}
|
||||
|
||||
$row['action'] = $_action;
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||
}
|
||||
|
||||
$log_count++;
|
||||
$row['type'] = getLogLevelDesc($row['type']);
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('logger/logger') . "\";");
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $syslog_list_data, 'syslog_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'logger', 'page' => 'log', 'action' => 'truncate']),
|
||||
'label' => lng('logger.truncate'),
|
||||
'icon' => 'fa-solid fa-recycle',
|
||||
'class' => 'btn-warning'
|
||||
]
|
||||
]
|
||||
]);
|
||||
} 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(ADM_ACTION, LOG_WARNING, 'truncated the system-log (mysql)');
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
SysLog::getLocal($userinfo, [
|
||||
'min_to_keep' => 10
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('logger_reallytruncate', $filename, array('page' => $page, 'action' => $action), TABLE_PANEL_LOG);
|
||||
HTML::askYesNo('logger_reallytruncate', $filename, [
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], TABLE_PANEL_LOG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,56 +2,65 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\User;
|
||||
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
$note_type = null;
|
||||
$note_msg = null;
|
||||
|
||||
if ($page == 'message') {
|
||||
if ($action == '') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if ($_POST['receipient'] == 0
|
||||
&& $userinfo['customers_see_all'] == '1'
|
||||
) {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins');
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
if ($_POST['recipient'] == 0 && $userinfo['customers_see_all'] == '1') {
|
||||
$log->logAction(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(ADM_ACTION, LOG_NOTICE, 'sending messages to ALL customers');
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'sending messages to ALL customers');
|
||||
$result = Database::query('SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
||||
} else {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to customers');
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'sending messages to customers');
|
||||
$result = Database::prepare('
|
||||
SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `adminid` = :adminid"
|
||||
);
|
||||
Database::pexecute($result, array('adminid' => $userinfo['adminid']));
|
||||
WHERE `adminid` = :adminid");
|
||||
Database::pexecute($result, [
|
||||
'adminid' => $userinfo['adminid']
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
standard_error('noreceipientsgiven');
|
||||
Response::standardError('norecipientsgiven');
|
||||
}
|
||||
|
||||
$subject = $_POST['subject'];
|
||||
@@ -63,10 +72,13 @@ if ($page == 'message') {
|
||||
$mail->Subject = $subject;
|
||||
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$row['firstname'] = isset($row['firstname']) ? $row['firstname'] : '';
|
||||
$row['company'] = isset($row['company']) ? $row['company'] : '';
|
||||
$mail->AddAddress($row['email'], getCorrectUserSalutation(array('firstname' => $row['firstname'], 'name' => $row['name'], 'company' => $row['company'])));
|
||||
$mail->AddAddress($row['email'], User::getCorrectUserSalutation([
|
||||
'firstname' => $row['firstname'],
|
||||
'name' => $row['name'],
|
||||
'company' => $row['company']
|
||||
]));
|
||||
$mail->From = $userinfo['email'];
|
||||
$mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
|
||||
|
||||
@@ -77,45 +89,62 @@ if ($page == 'message') {
|
||||
$mailerr_msg = $row['email'];
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_ERR, 'Error sending mail: ' . $mailerr_msg);
|
||||
standard_error('errorsendingmail', $row['email']);
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_ERR, 'Error sending mail: ' . $mailerr_msg);
|
||||
Response::standardError('errorsendingmail', $row['email']);
|
||||
}
|
||||
|
||||
$mailcounter++;
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page,
|
||||
'action' => 'showsuccess',
|
||||
'sentitems' => $mailcounter
|
||||
]);
|
||||
} else {
|
||||
standard_error('nomessagetosend');
|
||||
Response::standardError('nomessagetosend');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'showsuccess') {
|
||||
|
||||
$success = 1;
|
||||
} elseif ($action == 'showsuccess') {
|
||||
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
|
||||
|
||||
if ($sentitems == 0) {
|
||||
$successmessage = $lng['message']['noreceipients'];
|
||||
$note_type = 'info';
|
||||
$note_msg = lng('message.norecipients');
|
||||
} else {
|
||||
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
||||
$note_type = 'success';
|
||||
$note_msg = str_replace('%s', $sentitems, lng('message.success'));
|
||||
}
|
||||
|
||||
} else {
|
||||
$success = 0;
|
||||
$sentitems = 0;
|
||||
$successmessage = '';
|
||||
}
|
||||
|
||||
$action = '';
|
||||
$receipients = '';
|
||||
$recipients = [];
|
||||
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
$receipients.= makeoption($lng['panel']['reseller'], 0);
|
||||
$recipients[0] = lng('panel.reseller');
|
||||
}
|
||||
$recipients[1] = lng('panel.customer');
|
||||
|
||||
$receipients .= makeoption($lng['panel']['customer'], 1);
|
||||
eval("echo \"" . getTemplate('message/message') . "\";");
|
||||
$messages_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/messages/formfield.messages_add.php';
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'message']),
|
||||
'formdata' => $messages_add_data['messages_add'],
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'settings',
|
||||
'page' => 'overview',
|
||||
'part' => 'system',
|
||||
'em' => 'system_mail_use_smtp'
|
||||
]),
|
||||
'label' => lng('admin.smtpsettings'),
|
||||
'icon' => 'fa-solid fa-gears',
|
||||
'class' => 'btn-outline-secondary'
|
||||
]
|
||||
],
|
||||
// alert-box
|
||||
'type' => $note_type,
|
||||
'alert_msg' => $note_msg
|
||||
]);
|
||||
}
|
||||
|
||||
144
admin_mysqlserver.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\MysqlServer;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if (($page == 'mysqlserver' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
|
||||
if ($action == '') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_mysqlserver");
|
||||
|
||||
try {
|
||||
$mysqlserver_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.mysqlserver.php';
|
||||
$collection = (new Collection(MysqlServer::class, $userinfo))
|
||||
->withPagination($mysqlserver_list_data['mysqlserver_list']['columns'], $mysqlserver_list_data['mysqlserver_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $mysqlserver_list_data, 'mysqlserver_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'mysqlserver', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.mysqlserver.add')
|
||||
]
|
||||
]
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = MysqlServer::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['id']) && $result['id'] == $id) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
MysqlServer::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
HTML::askYesNo('admin_mysqlserver_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['caption'] . ' (' . $result['host'] . ')');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
MysqlServer::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$mysqlserver_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/mysqlserver/formfield.mysqlserver_add.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'mysqlserver']),
|
||||
'formdata' => $mysqlserver_add_data['mysqlserver_add']
|
||||
]);
|
||||
}
|
||||
} elseif ($action == 'edit' && $id >= 0) {
|
||||
try {
|
||||
$json_result = MysqlServer::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['id']) && $result['id'] == $id) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
MysqlServer::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$mysqlserver_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/mysqlserver/formfield.mysqlserver_edit.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'mysqlserver', 'id' => $id]),
|
||||
'formdata' => $mysqlserver_edit_data['mysqlserver_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,155 +4,305 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Janos Muzsi <muzsij@hypernics.hu> (2016)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* Based on https://github.com/amnuts/opcache-gui
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @author Janos Muzsi <muzsij@hypernics.hu>
|
||||
* @author Andrew Collington <andy@amnuts.com>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*
|
||||
* Based on https://github.com/amnuts/opcache-gui, which is
|
||||
* licensed under the MIT licence, which can be viewed
|
||||
* online at https://acollington.mit-license.org/
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\UI\HTML;
|
||||
|
||||
if ($action == 'reset' &&
|
||||
function_exists('opcache_reset') &&
|
||||
$userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
opcache_reset();
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "reseted OPcache");
|
||||
header('Location: ' . $linker->getLink(array('section' => 'opcacheinfo', 'page' => 'showinfo')));
|
||||
exit();
|
||||
if ($action == 'reset' && function_exists('opcache_reset') && $userinfo['change_serversettings'] == '1') {
|
||||
if ($_POST['send'] == 'send') {
|
||||
opcache_reset();
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "reset OPcache");
|
||||
header('Location: ' . $linker->getLink([
|
||||
'section' => 'opcacheinfo',
|
||||
'page' => 'showinfo'
|
||||
]));
|
||||
exit();
|
||||
} else {
|
||||
HTML::askYesNo('cache_reallydelete', $filename, [
|
||||
'page' => $page,
|
||||
'action' => 'reset',
|
||||
], '', [
|
||||
'section' => 'opcacheinfo',
|
||||
'page' => 'showinfo'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('opcache_get_configuration')
|
||||
) {
|
||||
standard_error($lng['error']['no_opcacheinfo']);
|
||||
if (!function_exists('opcache_get_configuration')) {
|
||||
Response::standardError(lng('error.no_opcacheinfo'));
|
||||
}
|
||||
|
||||
if ($page == 'showinfo'
|
||||
) {
|
||||
|
||||
$opcache_info = opcache_get_configuration();
|
||||
$opcache_status = opcache_get_status(false);
|
||||
$time = time();
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed OPcache info");
|
||||
|
||||
$runtimelines = '';
|
||||
if (isset($opcache_info['directives']) && is_array($opcache_info['directives'])) {
|
||||
foreach ($opcache_info['directives'] as $name => $value) {
|
||||
$linkname= str_replace('_', '-', $name);
|
||||
if ($name=='opcache.optimization_level' && is_integer($value)) {
|
||||
$value='0x'.dechex($value);
|
||||
}
|
||||
if ($name=='opcache.memory_consumption' && is_integer($value) && $value%(1024*1024)==0) {
|
||||
$value=$value/(1024*1024);
|
||||
}
|
||||
if ($value===null || $value==='') {
|
||||
$value=$lng['opcacheinfo']['novalue'];
|
||||
}
|
||||
if ($value===true) {
|
||||
$value=$lng['opcacheinfo']['true'];
|
||||
}
|
||||
if ($value===false) {
|
||||
$value=$lng['opcacheinfo']['false'];
|
||||
}
|
||||
if (is_integer($value)) {
|
||||
$value=number_format($value,0,'.',' ');
|
||||
}
|
||||
$name=str_replace('_', ' ', $name);
|
||||
eval("\$runtimelines.=\"" . getTemplate("settings/opcacheinfo/runtime_line") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
$cachehits=@$opcache_status['opcache_statistics']['hits'] ?: 0;
|
||||
$cachemiss=@$opcache_status['opcache_statistics']['misses'] ?: 0;
|
||||
$blacklistmiss=@$opcache_status['opcache_statistics']['blacklist_misses'] ?: 0;
|
||||
$cachetotal=$cachehits+$cachemiss+$blacklistmiss;
|
||||
|
||||
$general=array(
|
||||
'version' => (isset($opcache_info['version']['opcache_product_name']) ? $opcache_info['version']['opcache_product_name'].' ' : '').$opcache_info['version']['version'],
|
||||
'phpversion' => phpversion(),
|
||||
'start_time' => @$opcache_status['opcache_statistics']['start_time'] ? date('Y-m-d H:i:s',$opcache_status['opcache_statistics']['start_time']) : '',
|
||||
'last_restart_time' => @$opcache_status['opcache_statistics']['last_restart_time'] ? date('Y-m-d H:i:s',$opcache_status['opcache_statistics']['last_restart_time']) : $lng['opcacheinfo']['never'],
|
||||
'oom_restarts' => number_format(@$opcache_status['opcache_statistics']['oom_restarts'] ?: 0,0,'.',' '),
|
||||
'hash_restarts' => number_format(@$opcache_status['opcache_statistics']['hash_restarts'] ?: 0,0,'.',' '),
|
||||
'manual_restarts' => number_format(@$opcache_status['opcache_statistics']['manual_restarts'] ?: 0,0,'.',' '),
|
||||
'status' => (@$opcache_status['restart_in_progress'] ? $lng['opcacheinfo']['restartinprogress'] :
|
||||
(@$opcache_status['restart_pending'] ? $lng['opcacheinfo']['restartpending'] :
|
||||
(@$opcache_status['cache_full'] ? $lng['opcacheinfo']['cachefull'] :
|
||||
(@$opcache_status['opcache_enabled'] ? $lng['opcacheinfo']['enabled'] : $lng['opcacheinfo']['novalue'])))),
|
||||
'cachedscripts' => number_format(@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0,0,'.',' '),
|
||||
'cachehits' => number_format($cachehits,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $cachehits/($cachetotal)*100) : ''),
|
||||
'cachemiss' => number_format($cachemiss,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $cachemiss/($cachetotal)*100) : ''),
|
||||
'blacklistmiss' => number_format($blacklistmiss,0,'.',' ') . ($cachetotal>0 ? sprintf(" (%.1f %%)", $blacklistmiss/($cachetotal)*100) : ''),
|
||||
);
|
||||
|
||||
$usedmem=@$opcache_status['memory_usage']['used_memory'] ?: 0;
|
||||
$usedmemstr=bsize($usedmem);
|
||||
$freemem=@$opcache_status['memory_usage']['free_memory'] ?: 0;
|
||||
$freememstr=bsize($freemem);
|
||||
$totalmem=$usedmem+$freemem;
|
||||
$wastedmem=@$opcache_status['memory_usage']['wasted_memory'] ?: 0;
|
||||
$wastedmemstr=bsize($wastedmem);
|
||||
if ($totalmem) {
|
||||
$memory=array(
|
||||
'total' => bsize($totalmem),
|
||||
'used' => $usedmemstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $usedmem/($totalmem)*100) : ''),
|
||||
'free' => $freememstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $freemem/($totalmem)*100) : ''),
|
||||
'wasted' => $wastedmemstr . ($totalmem>0 ? sprintf(" (%.1f %%)", $wastedmem/($totalmem)*100) : ''),
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($opcache_status['interned_strings_usage'])) {
|
||||
$usedstring=@$opcache_status['interned_strings_usage']['used_memory'] ?: 0;
|
||||
$usedstringstr=bsize($usedstring);
|
||||
$freestring=@$opcache_status['interned_strings_usage']['free_memory'] ?: 0;
|
||||
$freestringstr=bsize($freestring);
|
||||
$totalstring=$usedstring+$freestring;
|
||||
$stringbuffer=array(
|
||||
'total' => bsize($totalstring),
|
||||
'used' => $usedstringstr . ($totalstring>0 ? sprintf(" (%.1f %%)", $usedstring/$totalstring*100) : ''),
|
||||
'free' => $freestringstr . ($totalstring>0 ? sprintf(" (%.1f %%)", $freestring/$totalstring*100) : ''),
|
||||
'strcount' => number_format(@$opcache_status['interned_strings_usage']['number_of_strings'] ?: 0,0,'.',' '),
|
||||
);
|
||||
}
|
||||
if ($page == 'showinfo' && $userinfo['change_serversettings'] == '1') {
|
||||
$time = time();
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed OPcache info");
|
||||
|
||||
$usedkey=@$opcache_status['opcache_statistics']['num_cached_keys'] ?: 0;
|
||||
$usedkeystr=number_format($usedkey,0,'.',' ');
|
||||
$totalkey=@$opcache_status['opcache_statistics']['max_cached_keys'] ?: 0;
|
||||
$wastedkey=$usedkey - (@$opcache_status['opcache_statistics']['num_cached_scripts'] ?: 0);
|
||||
if (isset($opcache_status['opcache_statistics'])) {
|
||||
$keystat=array(
|
||||
'total' => number_format($totalkey,0,'.',' '),
|
||||
'used' => $usedkeystr . ($totalkey>0 ? sprintf(" (%.1f %%)", $usedkey/($totalkey)*100) : ''),
|
||||
'wasted' => number_format($wastedkey,0,'.',' ') . ($totalkey>0 ? sprintf(" (%.1f %%)", $wastedkey/($totalkey)*100) : ''),
|
||||
);
|
||||
}
|
||||
|
||||
$blacklistlines = '';
|
||||
if (isset($opcache_info['blacklist']) && is_array($opcache_info['blacklist'])) {
|
||||
foreach ($opcache_info['blacklist'] as $value) {
|
||||
eval("\$blacklistlines.=\"" . getTemplate("settings/opcacheinfo/blacklist_line") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/opcacheinfo/showinfo") . "\";");
|
||||
|
||||
$optimizationLevels = [
|
||||
1 << 0 => 'CSE, STRING construction',
|
||||
1 << 1 => 'Constant conversion and jumps',
|
||||
1 << 2 => '++, +=, series of jumps',
|
||||
1 << 3 => 'INIT_FCALL_BY_NAME -> DO_FCALL',
|
||||
1 << 4 => 'CFG based optimization',
|
||||
1 << 5 => 'DFA based optimization',
|
||||
1 << 6 => 'CALL GRAPH optimization',
|
||||
1 << 7 => 'SCCP (constant propagation)',
|
||||
1 << 8 => 'TMP VAR usage',
|
||||
1 << 9 => 'NOP removal',
|
||||
1 << 10 => 'Merge equal constants',
|
||||
1 << 11 => 'Adjust used stack',
|
||||
1 << 12 => 'Remove unused variables',
|
||||
1 << 13 => 'DCE (dead code elimination)',
|
||||
1 << 14 => '(unsafe) Collect constants',
|
||||
1 << 15 => 'Inline functions'
|
||||
];
|
||||
|
||||
$jitModes = [
|
||||
[
|
||||
'flag' => 'CPU-specific optimization',
|
||||
'value' => [
|
||||
'Disable CPU-specific optimization',
|
||||
'Enable use of AVX, if the CPU supports it'
|
||||
]
|
||||
],
|
||||
[
|
||||
'flag' => 'Register allocation',
|
||||
'value' => [
|
||||
'Do not perform register allocation',
|
||||
'Perform block-local register allocation',
|
||||
'Perform global register allocation'
|
||||
]
|
||||
],
|
||||
[
|
||||
'flag' => 'Trigger',
|
||||
'value' => [
|
||||
'Compile all functions on script load',
|
||||
'Compile functions on first execution',
|
||||
'Profile functions on first request and compile the hottest functions afterwards',
|
||||
'Profile on the fly and compile hot functions',
|
||||
'Currently unused',
|
||||
'Use tracing JIT. Profile on the fly and compile traces for hot code segments'
|
||||
]
|
||||
],
|
||||
[
|
||||
'flag' => 'Optimization level',
|
||||
'value' => [
|
||||
'No JIT',
|
||||
'Minimal JIT (call standard VM handlers)',
|
||||
'Inline VM handlers',
|
||||
'Use type inference',
|
||||
'Use call graph',
|
||||
'Optimize whole script'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$jitModeMapping = [
|
||||
'tracing' => 1254,
|
||||
'on' => 1254,
|
||||
'function' => 1205
|
||||
];
|
||||
|
||||
$status = opcache_get_status(false);
|
||||
$config = opcache_get_configuration();
|
||||
$missingConfig = array_diff_key(ini_get_all('zend opcache', false), $config['directives']);
|
||||
if (!empty($missingConfig)) {
|
||||
$config['directives'] = array_merge($config['directives'], $missingConfig);
|
||||
}
|
||||
|
||||
$files = [];
|
||||
if (!empty($status['scripts'])) {
|
||||
uasort($status['scripts'], static function ($a, $b) {
|
||||
return $a['hits'] <=> $b['hits'];
|
||||
});
|
||||
foreach ($status['scripts'] as &$file) {
|
||||
$file['full_path'] = str_replace('\\', '/', $file['full_path']);
|
||||
$file['readable'] = [
|
||||
'hits' => number_format($file['hits']),
|
||||
'memory_consumption' => bsize($file['memory_consumption'])
|
||||
];
|
||||
}
|
||||
$files = array_values($status['scripts']);
|
||||
}
|
||||
|
||||
if ($config['directives']['opcache.file_cache_only'] || !empty($status['file_cache_only'])) {
|
||||
$overview = false;
|
||||
} else {
|
||||
$status['opcache_statistics']['start_time'] = $status['opcache_statistics']['start_time'] ?? time();
|
||||
$status['opcache_statistics']['last_restart_time'] = $status['opcache_statistics']['last_restart_time'] ?? time();
|
||||
|
||||
$overview = array_merge(
|
||||
$status['memory_usage'],
|
||||
$status['opcache_statistics'],
|
||||
[
|
||||
'total_memory' => $config['directives']['opcache.memory_consumption'],
|
||||
'used_memory_percentage' => round(100 * (
|
||||
($status['memory_usage']['used_memory'] + $status['memory_usage']['wasted_memory'])
|
||||
/ $config['directives']['opcache.memory_consumption']
|
||||
)),
|
||||
'hit_rate_percentage' => round($status['opcache_statistics']['opcache_hit_rate']),
|
||||
'used_key_percentage' => round(100 * ($status['opcache_statistics']['num_cached_keys']
|
||||
/ $status['opcache_statistics']['max_cached_keys']
|
||||
)),
|
||||
'wasted_percentage' => round($status['memory_usage']['current_wasted_percentage'], 2),
|
||||
'readable' => [
|
||||
'total_memory' => bsize($config['directives']['opcache.memory_consumption']),
|
||||
'used_memory' => bsize($status['memory_usage']['used_memory']),
|
||||
'free_memory' => bsize($status['memory_usage']['free_memory']),
|
||||
'wasted_memory' => bsize($status['memory_usage']['wasted_memory']),
|
||||
'num_cached_scripts' => number_format($status['opcache_statistics']['num_cached_scripts']),
|
||||
'hits' => number_format($status['opcache_statistics']['hits']),
|
||||
'misses' => number_format($status['opcache_statistics']['misses']),
|
||||
'blacklist_miss' => number_format($status['opcache_statistics']['blacklist_misses']),
|
||||
'num_cached_keys' => number_format($status['opcache_statistics']['num_cached_keys']),
|
||||
'max_cached_keys' => number_format($status['opcache_statistics']['max_cached_keys']),
|
||||
'interned' => null,
|
||||
'start_time' => (new DateTimeImmutable("@{$status['opcache_statistics']['start_time']}"))
|
||||
->setTimezone(new DateTimeZone(date_default_timezone_get()))
|
||||
->format('Y-m-d H:i:s'),
|
||||
'last_restart_time' => ($status['opcache_statistics']['last_restart_time'] == 0
|
||||
? 'never'
|
||||
: (new DateTimeImmutable("@{$status['opcache_statistics']['last_restart_time']}"))
|
||||
->setTimezone(new DateTimeZone(date_default_timezone_get()))
|
||||
->format('Y-m-d H:i:s')
|
||||
)
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$preload = [];
|
||||
if (!empty($status['preload_statistics']['scripts'])) {
|
||||
$preload = $status['preload_statistics']['scripts'];
|
||||
sort($preload, SORT_STRING);
|
||||
if ($overview) {
|
||||
$overview['preload_memory'] = $status['preload_statistics']['memory_consumption'];
|
||||
$overview['readable']['preload_memory'] = bsize($status['preload_statistics']['memory_consumption']);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($status['interned_strings_usage'])) {
|
||||
$overview['readable']['interned'] = [
|
||||
'buffer_size' => bsize($status['interned_strings_usage']['buffer_size']),
|
||||
'strings_used_memory' => bsize($status['interned_strings_usage']['used_memory']),
|
||||
'strings_free_memory' => bsize($status['interned_strings_usage']['free_memory']),
|
||||
'number_of_strings' => number_format($status['interned_strings_usage']['number_of_strings'])
|
||||
];
|
||||
}
|
||||
|
||||
if ($overview && !empty($status['jit'])) {
|
||||
$overview['jit_buffer_used_percentage'] = ($status['jit']['buffer_size']
|
||||
? round(100 * (($status['jit']['buffer_size'] - $status['jit']['buffer_free']) / $status['jit']['buffer_size']))
|
||||
: 0
|
||||
);
|
||||
$overview['readable'] = array_merge($overview['readable'], [
|
||||
'jit_buffer_size' => bsize($status['jit']['buffer_size']),
|
||||
'jit_buffer_free' => bsize($status['jit']['buffer_free'])
|
||||
]);
|
||||
}
|
||||
|
||||
$directives = [];
|
||||
ksort($config['directives']);
|
||||
foreach ($config['directives'] as $k => $v) {
|
||||
if (in_array($k, ['opcache.max_file_size', 'opcache.memory_consumption', 'opcache.jit_buffer_size']) && $v) {
|
||||
$v = bsize($v) . " ({$v})";
|
||||
} elseif ($k === 'opcache.optimization_level') {
|
||||
$levels = [];
|
||||
foreach ($optimizationLevels as $level => $info) {
|
||||
if ($level & $v) {
|
||||
$levels[] = "{$info} [{$level}]";
|
||||
}
|
||||
}
|
||||
$v = $levels ?: 'none';
|
||||
} elseif ($k === 'opcache.jit') {
|
||||
if ($v === '1') {
|
||||
$v = 'on';
|
||||
}
|
||||
if (isset($jitModeMapping[$v]) || is_numeric($v)) {
|
||||
$levels = [];
|
||||
foreach (str_split((string)($jitModeMapping[$v] ?? $v)) as $type => $level) {
|
||||
$levels[] = "{$level}: {$jitModes[$type]['value'][$level]} ({$jitModes[$type]['flag']})";
|
||||
}
|
||||
$v = [$v, $levels];
|
||||
} elseif (empty($v) || strtolower($v) === 'off') {
|
||||
$v = 'Off';
|
||||
}
|
||||
}
|
||||
$directives[] = [
|
||||
'k' => $k,
|
||||
'v' => $v
|
||||
];
|
||||
}
|
||||
|
||||
$version = array_merge(
|
||||
$config['version'],
|
||||
[
|
||||
'php' => phpversion(),
|
||||
'server' => $_SERVER['SERVER_SOFTWARE'] ?: '',
|
||||
'host' => (function_exists('gethostname')
|
||||
? gethostname()
|
||||
: (php_uname('n')
|
||||
?: (empty($_SERVER['SERVER_NAME'])
|
||||
? $_SERVER['HOST_NAME']
|
||||
: $_SERVER['SERVER_NAME']
|
||||
)
|
||||
)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
UI::view('settings/opcacheinfo.html.twig', [
|
||||
'opcacheinfo' => [
|
||||
'version' => $version,
|
||||
'overview' => $overview,
|
||||
'files' => $files,
|
||||
'preload' => $preload,
|
||||
'directives' => $directives,
|
||||
'blacklist' => $config['blacklist'],
|
||||
'functions' => get_extension_funcs('Zend OPcache')
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
function bsize($s) {
|
||||
foreach (array('', 'K', 'M', 'G') as $i => $k) {
|
||||
if ($s < 1024)
|
||||
break;
|
||||
$s/=1024;
|
||||
}
|
||||
return sprintf("%5.1f %sBytes", $s, $k);
|
||||
function bsize($size)
|
||||
{
|
||||
$i = 0;
|
||||
$val = ['b', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
while (($size / 1024) > 1) {
|
||||
$size /= 1024;
|
||||
++$i;
|
||||
}
|
||||
return sprintf(
|
||||
'%.2f%s%s',
|
||||
$size,
|
||||
'',
|
||||
$val[$i]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,343 +2,296 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
use Froxlor\Api\Commands\FpmDaemons;
|
||||
use Froxlor\Api\Commands\PhpSettings;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if ($page == 'overview') {
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
$result = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$domainresult = false;
|
||||
$query_params = array('id' => $row['id']);
|
||||
|
||||
$query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."`
|
||||
WHERE `phpsettingid` = :id
|
||||
AND `parentdomainid` = '0'";
|
||||
|
||||
if ((int)$userinfo['domains_see_all'] == 0) {
|
||||
$query .= " AND `adminid` = :adminid";
|
||||
$query_params['adminid'] = $userinfo['adminid'];
|
||||
}
|
||||
|
||||
if ((int)Settings::Get('panel.phpconfigs_hidestdsubdomain') == 1) {
|
||||
$ssdids_res = Database::query("
|
||||
SELECT DISTINCT `standardsubdomain` FROM `".TABLE_PANEL_CUSTOMERS."`
|
||||
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;"
|
||||
);
|
||||
$ssdids = array();
|
||||
while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) {
|
||||
$ssdids[] = $ssd['standardsubdomain'];
|
||||
}
|
||||
if (count($ssdids) > 0) {
|
||||
$query .= " AND `id` NOT IN (".implode(', ', $ssdids).")";
|
||||
}
|
||||
}
|
||||
|
||||
$domainresult_stmt = Database::prepare($query);
|
||||
Database::pexecute($domainresult_stmt, $query_params);
|
||||
|
||||
$domains = '';
|
||||
if (Database::num_rows() > 0) {
|
||||
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains.= $row2['domain'] . '<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
// check whether we use that config as froxor-vhost config
|
||||
if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id']
|
||||
|| Settings::Get('phpfpm.vhost_defaultini') == $row['id']
|
||||
) {
|
||||
$domains .= Settings::Get('system.hostname');
|
||||
}
|
||||
|
||||
if ($domains == '') {
|
||||
$domains = $lng['admin']['phpsettings']['notused'];
|
||||
}
|
||||
|
||||
// check whether this is our default config
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini') == $row['id'])
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.defaultini') == $row['id'])
|
||||
) {
|
||||
$row['description'] = '<b>'.$row['description'].'</b>';
|
||||
}
|
||||
|
||||
$count ++;
|
||||
eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";");
|
||||
try {
|
||||
$phpconf_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.phpconfigs.php';
|
||||
$collection = (new Collection(PhpSettings::class, $userinfo, ['with_subdomains' => true]))
|
||||
->withPagination($phpconf_list_data['phpconf_list']['columns'], $phpconf_list_data['phpconf_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting overview has been viewed by '" . $userinfo['loginname'] . "'");
|
||||
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $phpconf_list_data, 'phpconf_list'),
|
||||
'actions_links' => (bool)$userinfo['change_serversettings'] ? [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'phpsettings', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.phpsettings.addnew')
|
||||
]
|
||||
] : []
|
||||
]);
|
||||
}
|
||||
|
||||
if ($action == 'add') {
|
||||
|
||||
if ((int)$userinfo['change_serversettings'] == 1) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
|
||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||
// disable fpm stuff
|
||||
$fpm_enableslowlog = 0;
|
||||
$fpm_reqtermtimeout = 0;
|
||||
$fpm_reqslowtimeout = 0;
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
// disable fcgid stuff
|
||||
$binary = '/usr/bin/php-cgi';
|
||||
$file_extensions = 'php';
|
||||
$mod_fcgid_starter = 0;
|
||||
$mod_fcgid_maxrequests = 0;
|
||||
$mod_fcgid_umask = "022";
|
||||
}
|
||||
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||
`description` = :desc,
|
||||
`binary` = :binary,
|
||||
`file_extensions` = :fext,
|
||||
`mod_fcgid_starter` = :starter,
|
||||
`mod_fcgid_maxrequests` = :mreq,
|
||||
`mod_fcgid_umask` = :umask,
|
||||
`fpm_slowlog` = :fpmslow,
|
||||
`fpm_reqterm` = :fpmreqterm,
|
||||
`fpm_reqslow` = :fpmreqslow,
|
||||
`phpsettings` = :phpsettings"
|
||||
);
|
||||
$ins_data = array(
|
||||
'desc' => $description,
|
||||
'binary' => $binary,
|
||||
'fext' => $file_extensions,
|
||||
'starter' => $mod_fcgid_starter,
|
||||
'mreq' => $mod_fcgid_maxrequests,
|
||||
'umask' => $mod_fcgid_umask,
|
||||
'fpmslow' => $fpm_enableslowlog,
|
||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||
'phpsettings' => $phpsettings
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been created by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
if (file_exists(Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php')) {
|
||||
include Froxlor::getInstallDir() . '/templates/misc/php/default.ini.php';
|
||||
$result = [
|
||||
'phpsettings' => $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);
|
||||
}
|
||||
|
||||
$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");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
$fpmconfigs[$row['id']] = $row['description'];
|
||||
}
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
$phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data);
|
||||
$phpconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
|
||||
$title = $phpconfig_add_data['phpconfig_add']['title'];
|
||||
$image = $phpconfig_add_data['phpconfig_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'phpsettings']),
|
||||
'formdata' => $phpconfig_add_data['phpconfig_add'],
|
||||
'replacers' => $phpconfig_add_data['phpconfig_replacers']
|
||||
]);
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $id)
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.vhost_defaultini') == $id)
|
||||
) {
|
||||
standard_error('cannotdeletehostnamephpconfig');
|
||||
try {
|
||||
$json_result = PhpSettings::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ((Settings::Get('system.mod_fcgid') == '1'
|
||||
&& Settings::Get('system.mod_fcgid_defaultini') == $id)
|
||||
|| (Settings::Get('phpfpm.enabled') == '1'
|
||||
&& Settings::Get('phpfpm.defaultini') == $id)
|
||||
) {
|
||||
standard_error('cannotdeletedefaultphpconfig');
|
||||
}
|
||||
|
||||
if ($result['id'] != 0
|
||||
&& $result['id'] == $id
|
||||
&& (int)$userinfo['change_serversettings'] == 1
|
||||
&& $id != 1 // cannot delete the default php.config
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
// set php-config to default for all domains using the
|
||||
// config that is to be deleted
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||
`phpsettingid` = '1' WHERE `phpsettingid` = :id"
|
||||
);
|
||||
Database::pexecute($upd_stmt, array('id' => $id));
|
||||
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($del_stmt, array('id' => $id));
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with id #" . (int)$id . " has been deleted by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
||||
{
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('phpsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']);
|
||||
HTML::askYesNo('phpsetting_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['description']);
|
||||
}
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'edit') {
|
||||
try {
|
||||
$json_result = PhpSettings::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = :id"
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('id' => $id));
|
||||
|
||||
if ($result['id'] != 0
|
||||
&& $result['id'] == $id
|
||||
&& (int)$userinfo['change_serversettings'] == 1
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$description = validate($_POST['description'], 'description');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
|
||||
if (Settings::Get('system.mod_fcgid') == 1) {
|
||||
$binary = makeCorrectFile(validate($_POST['binary'], 'binary'));
|
||||
$file_extensions = validate($_POST['file_extensions'], 'file_extensions', '/^[a-zA-Z0-9\s]*$/');
|
||||
$mod_fcgid_starter = validate($_POST['mod_fcgid_starter'], 'mod_fcgid_starter', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_maxrequests = validate($_POST['mod_fcgid_maxrequests'], 'mod_fcgid_maxrequests', '/^[0-9]*$/', '', array('-1', ''));
|
||||
$mod_fcgid_umask = validate($_POST['mod_fcgid_umask'], 'mod_fcgid_umask', '/^[0-9]*$/');
|
||||
// disable fpm stuff
|
||||
$fpm_enableslowlog = 0;
|
||||
$fpm_reqtermtimeout = 0;
|
||||
$fpm_reqslowtimeout = 0;
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
PhpSettings::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
elseif (Settings::Get('phpfpm.enabled') == 1) {
|
||||
$fpm_enableslowlog = isset($_POST['phpfpm_enable_slowlog']) ? (int)$_POST['phpfpm_enable_slowlog'] : 0;
|
||||
$fpm_reqtermtimeout = validate($_POST['phpfpm_reqtermtimeout'], 'phpfpm_reqtermtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
$fpm_reqslowtimeout = validate($_POST['phpfpm_reqslowtimeout'], 'phpfpm_reqslowtimeout', '/^([0-9]+)(|s|m|h|d)$/');
|
||||
// disable fcgid stuff
|
||||
$binary = '/usr/bin/php-cgi';
|
||||
$file_extensions = 'php';
|
||||
$mod_fcgid_starter = 0;
|
||||
$mod_fcgid_maxrequests = 0;
|
||||
$mod_fcgid_umask = "022";
|
||||
}
|
||||
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET
|
||||
`description` = :desc,
|
||||
`binary` = :binary,
|
||||
`file_extensions` = :fext,
|
||||
`mod_fcgid_starter` = :starter,
|
||||
`mod_fcgid_maxrequests` = :mreq,
|
||||
`mod_fcgid_umask` = :umask,
|
||||
`fpm_slowlog` = :fpmslow,
|
||||
`fpm_reqterm` = :fpmreqterm,
|
||||
`fpm_reqslow` = :fpmreqslow,
|
||||
`phpsettings` = :phpsettings
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
$upd_data = array(
|
||||
'desc' => $description,
|
||||
'binary' => $binary,
|
||||
'fext' => $file_extensions,
|
||||
'starter' => $mod_fcgid_starter,
|
||||
'mreq' => $mod_fcgid_maxrequests,
|
||||
'umask' => $mod_fcgid_umask,
|
||||
'fpmslow' => $fpm_enableslowlog,
|
||||
'fpmreqterm' => $fpm_reqtermtimeout,
|
||||
'fpmreqslow' => $fpm_reqslowtimeout,
|
||||
'phpsettings' => $phpsettings,
|
||||
'id' => $id
|
||||
);
|
||||
Database::pexecute($upd_stmt, $upd_data);
|
||||
|
||||
inserttask('1');
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "php.ini setting with description '" . $description . "' has been changed by '" . $userinfo['loginname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$fpmconfigs = [];
|
||||
$configs = Database::query("SELECT * FROM `" . TABLE_PANEL_FPMDAEMONS . "` ORDER BY `description` ASC");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
$fpmconfigs[$row['id']] = $row['description'];
|
||||
}
|
||||
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
|
||||
$title = $phpconfig_edit_data['phpconfig_edit']['title'];
|
||||
$image = $phpconfig_edit_data['phpconfig_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'phpsettings', 'id' => $id]),
|
||||
'formdata' => $phpconfig_edit_data['phpconfig_edit'],
|
||||
'replacers' => $phpconfig_edit_data['phpconfig_replacers'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
} elseif ($page == 'fpmdaemons') {
|
||||
if ($action == '') {
|
||||
try {
|
||||
$fpmconf_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.fpmconfigs.php';
|
||||
$collection = (new Collection(FpmDaemons::class, $userinfo))
|
||||
->withPagination($fpmconf_list_data['fpmconf_list']['columns'], $fpmconf_list_data['fpmconf_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $fpmconf_list_data, 'fpmconf_list'),
|
||||
'actions_links' => (bool)$userinfo['change_serversettings'] ? [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'phpsettings', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.fpmsettings.addnew')
|
||||
]
|
||||
] : []
|
||||
]);
|
||||
}
|
||||
|
||||
if ($action == 'add') {
|
||||
if ((int)$userinfo['change_serversettings'] == 1) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
FpmDaemons::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$fpmconfig_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_add.php';
|
||||
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'phpsettings', 'page' => 'fpmdaemons']),
|
||||
'formdata' => $fpmconfig_add_data['fpmconfig_add'],
|
||||
'replacers' => $fpmconfig_add_data['fpmconfig_replacers']
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
try {
|
||||
$json_result = FpmDaemons::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($id == 1) {
|
||||
Response::standardError('cannotdeletedefaultphpconfig');
|
||||
}
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1 && $id != 1) // cannot delete the default php.config
|
||||
{
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
FpmDaemons::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
HTML::askYesNo('fpmsetting_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['description']);
|
||||
}
|
||||
} else {
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'edit') {
|
||||
try {
|
||||
$json_result = FpmDaemons::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
FpmDaemons::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$fpmconfig_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/phpconfig/formfield.fpmconfig_edit.php';
|
||||
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'phpsettings', 'page' => 'fpmdaemons', 'id' => $id]),
|
||||
'formdata' => $fpmconfig_edit_data['fpmconfig_edit'],
|
||||
'replacers' => $fpmconfig_edit_data['fpmconfig_replacers'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
278
admin_plans.php
Normal file
@@ -0,0 +1,278 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\HostingPlans;
|
||||
use Froxlor\Api\Commands\MysqlServer;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if ($page == '' || $page == 'overview') {
|
||||
if ($action == '') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_plans");
|
||||
|
||||
try {
|
||||
$plan_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.plans.php';
|
||||
$collection = (new Collection(HostingPlans::class, $userinfo))
|
||||
->withPagination($plan_list_data['plan_list']['columns'], $plan_list_data['plan_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $plan_list_data, 'plan_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'plans', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.plans.add')
|
||||
]
|
||||
]
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = HostingPlans::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['adminid'] == $result['adminid']) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
HostingPlans::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
HTML::askYesNo('plan_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['name']);
|
||||
}
|
||||
} else {
|
||||
Response::standardError('nopermissionsorinvalidid');
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
HostingPlans::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$mysql_servers = [];
|
||||
try {
|
||||
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||
foreach ($result_decoded as $dbserver => $dbdata) {
|
||||
$mysql_servers[] = [
|
||||
'label' => $dbdata['caption'],
|
||||
'value' => $dbserver
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* just none */
|
||||
}
|
||||
|
||||
$phpconfigs = [];
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int)Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = [
|
||||
'label' => $row['description'] . " [" . $row['interpreter'] . "]",
|
||||
'value' => $row['id']
|
||||
];
|
||||
} else {
|
||||
$phpconfigs[] = [
|
||||
'label' => $row['description'],
|
||||
'value' => $row['id']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// dummy to avoid unknown variables
|
||||
$hosting_plans = null;
|
||||
|
||||
$plans_add_data = include_once __DIR__ . '/lib/formfields/admin/plans/formfield.plans_add.php';
|
||||
$cust_add_data = include_once __DIR__ . '/lib/formfields/admin/customer/formfield.customer_add.php';
|
||||
// unset unneeded stuff
|
||||
unset($cust_add_data['customer_add']['sections']['section_a']);
|
||||
unset($cust_add_data['customer_add']['sections']['section_b']);
|
||||
unset($cust_add_data['customer_add']['sections']['section_cpre']);
|
||||
// merge
|
||||
$plans_add_data['plans_add']['sections'] = array_merge($plans_add_data['plans_add']['sections'], $cust_add_data['customer_add']['sections']);
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'plans']),
|
||||
'formdata' => $plans_add_data['plans_add']
|
||||
]);
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
try {
|
||||
$json_result = HostingPlans::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ($result['name'] != '') {
|
||||
$result['value'] = json_decode($result['value'], true);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
foreach ($result['value'] as $index => $value) {
|
||||
$result[$index] = $value;
|
||||
}
|
||||
$result['allowed_phpconfigs'] = json_encode($result['allowed_phpconfigs']);
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
HostingPlans::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$mysql_servers = [];
|
||||
try {
|
||||
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||
foreach ($result_decoded as $dbserver => $dbdata) {
|
||||
$mysql_servers[] = [
|
||||
'label' => $dbdata['caption'],
|
||||
'value' => $dbserver
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* just none */
|
||||
}
|
||||
|
||||
$phpconfigs = [];
|
||||
$configs = Database::query("
|
||||
SELECT c.*, fc.description as interpreter
|
||||
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
||||
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
||||
");
|
||||
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ((int)Settings::Get('phpfpm.enabled') == 1) {
|
||||
$phpconfigs[] = [
|
||||
'label' => $row['description'] . " [" . $row['interpreter'] . "]",
|
||||
'value' => $row['id']
|
||||
];
|
||||
} else {
|
||||
$phpconfigs[] = [
|
||||
'label' => $row['description'],
|
||||
'value' => $row['id']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$result['imap'] = $result['email_imap'];
|
||||
$result['pop3'] = $result['email_pop3'];
|
||||
|
||||
// dummy to avoid unknown variables
|
||||
$result['loginname'] = null;
|
||||
$result['documentroot'] = null;
|
||||
$result['standardsubdomain'] = null;
|
||||
$result['deactivated'] = null;
|
||||
$result['def_language'] = null;
|
||||
$result['firstname'] = null;
|
||||
$result['gender'] = null;
|
||||
$result['company'] = null;
|
||||
$result['street'] = null;
|
||||
$result['zipcode'] = null;
|
||||
$result['city'] = null;
|
||||
$result['phone'] = null;
|
||||
$result['fax'] = null;
|
||||
$result['email'] = null;
|
||||
$result['customernumber'] = null;
|
||||
$result['custom_notes'] = null;
|
||||
$result['custom_notes_show'] = null;
|
||||
$result['api_allowed'] = null;
|
||||
$hosting_plans = null;
|
||||
$admin_select = [];
|
||||
|
||||
$plans_edit_data = include_once __DIR__ . '/lib/formfields/admin/plans/formfield.plans_edit.php';
|
||||
$cust_edit_data = include_once __DIR__ . '/lib/formfields/admin/customer/formfield.customer_edit.php';
|
||||
// unset unneeded stuff
|
||||
unset($cust_edit_data['customer_edit']['sections']['section_a']);
|
||||
unset($cust_edit_data['customer_edit']['sections']['section_b']);
|
||||
unset($cust_edit_data['customer_edit']['sections']['section_cpre']);
|
||||
unset($cust_edit_data['customer_edit']['sections']['section_d']);
|
||||
// merge
|
||||
$plans_edit_data['plans_edit']['sections'] = array_merge($plans_edit_data['plans_edit']['sections'], $cust_edit_data['customer_edit']['sections']);
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'plans', 'id' => $id]),
|
||||
'formdata' => $plans_edit_data['plans_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'jqGetPlanValues') {
|
||||
$planid = (int)Request::any('planid', 0);
|
||||
try {
|
||||
$json_result = HostingPlans::getLocal($userinfo, [
|
||||
'id' => $planid
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
echo $result['value'];
|
||||
exit();
|
||||
}
|
||||
}
|
||||
@@ -2,38 +2,52 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
use Froxlor\Api\Commands\Froxlor;
|
||||
use Froxlor\Cron\TaskId;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Database\IntegrityCheck;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\System\Cronjob;
|
||||
use Froxlor\UI\Form;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\User;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
|
||||
// get sql-root access data
|
||||
Database::needRoot(true);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
||||
$settings = loadSettings($settings_data);
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$settings_data = PhpHelper::loadConfigArrayDir('./actions/admin/settings/');
|
||||
Settings::loadSettingsInto($settings_data);
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
if ($_part == '') {
|
||||
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||
@@ -48,7 +62,6 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
$settings_part = true;
|
||||
}
|
||||
$only_enabledisable = false;
|
||||
|
||||
} else {
|
||||
$settings_all = false;
|
||||
$settings_part = false;
|
||||
@@ -56,192 +69,135 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
}
|
||||
|
||||
// check if the session timeout is too low #815
|
||||
if (isset($_POST['session_sessiontimeout'])
|
||||
&& $_POST['session_sessiontimeout'] < 60
|
||||
) {
|
||||
standard_error($lng['error']['session_timeout'], $lng['error']['session_timeout_desc']);
|
||||
if (isset($_POST['session_sessiontimeout']) && $_POST['session_sessiontimeout'] < 60) {
|
||||
Response::standardError(lng('error.session_timeout'), lng('error.session_timeout_desc'));
|
||||
}
|
||||
|
||||
if (processFormEx(
|
||||
$settings_data,
|
||||
$_POST,
|
||||
array('filename' => $filename, 'action' => $action, 'page' => $page),
|
||||
$_part,
|
||||
$settings_all,
|
||||
$settings_part,
|
||||
$only_enabledisable
|
||||
)
|
||||
) {
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles due to changed setting");
|
||||
inserttask('1');
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
try {
|
||||
if (Form::processForm($settings_data, $_POST, [
|
||||
'filename' => $filename,
|
||||
'action' => $action,
|
||||
'page' => $page
|
||||
], $_part, $settings_all, $settings_part, $only_enabledisable)) {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles due to changed setting");
|
||||
Cronjob::inserttask(TaskId::REBUILD_VHOST);
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
Cronjob::inserttask(TaskId::REBUILD_DNS);
|
||||
// cron.d file
|
||||
Cronjob::inserttask(TaskId::REBUILD_CRON);
|
||||
|
||||
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
|
||||
Response::standardSuccess('settingssaved', '', [
|
||||
'filename' => $filename,
|
||||
'action' => $action,
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
if ($_part == '') {
|
||||
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||
}
|
||||
|
||||
$fields = buildFormEx($settings_data, $_part);
|
||||
$fields = Form::buildForm($settings_data, $_part);
|
||||
|
||||
$settings_page = '';
|
||||
if ($_part == '') {
|
||||
eval("\$settings_page .= \"" . getTemplate("settings/settings_overview") . "\";");
|
||||
if ($_part == '' || $_part == 'all') {
|
||||
UI::view('settings/index.html.twig', ['fields' => $fields]);
|
||||
} else {
|
||||
eval("\$settings_page .= \"" . getTemplate("settings/settings") . "\";");
|
||||
$em = Request::any('em', '');
|
||||
UI::view('settings/detailpart.html.twig', ['fields' => $fields, 'em' => $em]);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/settings_form_begin") . "\";");
|
||||
eval("echo \$settings_page;");
|
||||
eval("echo \"" . getTemplate("settings/settings_form_end") . "\";");
|
||||
|
||||
}
|
||||
|
||||
} elseif($page == 'phpinfo'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
} elseif ($page == 'phpinfo' && $userinfo['change_serversettings'] == '1') {
|
||||
ob_start();
|
||||
phpinfo();
|
||||
$phpinfo = array('phpinfo' => array());
|
||||
if (preg_match_all(
|
||||
'#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s',
|
||||
ob_get_clean(), $matches, PREG_SET_ORDER
|
||||
)
|
||||
) {
|
||||
$phpinfo = [
|
||||
'phpinfo' => []
|
||||
];
|
||||
if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $match) {
|
||||
$end = array_keys($phpinfo);
|
||||
$end = end($end);
|
||||
if (strlen($match[1])) {
|
||||
$phpinfo[$match[1]] = array();
|
||||
$phpinfo[$match[1]] = [];
|
||||
} elseif (isset($match[3])) {
|
||||
$phpinfo[$end][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
|
||||
$phpinfo[$end][$match[2]] = isset($match[4]) ? [
|
||||
$match[3],
|
||||
$match[4]
|
||||
] : $match[3];
|
||||
} else {
|
||||
$phpinfo[$end][] = $match[2];
|
||||
}
|
||||
}
|
||||
$phpinfohtml = '';
|
||||
foreach ($phpinfo as $name => $section) {
|
||||
$phpinfoentries = "";
|
||||
foreach ($section as $key => $val) {
|
||||
if (is_array($val)) {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_3") . "\";");
|
||||
} elseif (is_string($key)) {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_2") . "\";");
|
||||
} else {
|
||||
eval("\$phpinfoentries .= \"" . getTemplate("settings/phpinfo/phpinfo_1") . "\";");
|
||||
}
|
||||
}
|
||||
// first header -> show actual php version
|
||||
if (strtolower($name) == "phpinfo") {
|
||||
$name = "PHP ".PHP_VERSION;
|
||||
}
|
||||
eval("\$phpinfohtml .= \"" . getTemplate("settings/phpinfo/phpinfo_table") . "\";");
|
||||
}
|
||||
$phpinfo = $phpinfohtml;
|
||||
} else {
|
||||
standard_error($lng['error']['no_phpinfo']);
|
||||
Response::standardError(lng('error.no_phpinfo'));
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/phpinfo") . "\";");
|
||||
|
||||
} elseif($page == 'rebuildconfigs'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles");
|
||||
inserttask('1');
|
||||
inserttask('10');
|
||||
UI::view('settings/phpinfo.html.twig', [
|
||||
'phpversion' => PHP_VERSION,
|
||||
'phpinfo' => $phpinfo
|
||||
]);
|
||||
} elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "rebuild configfiles");
|
||||
Cronjob::inserttask(TaskId::REBUILD_VHOST);
|
||||
Cronjob::inserttask(TaskId::CREATE_QUOTA);
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
Cronjob::inserttask(TaskId::REBUILD_DNS);
|
||||
// cron.d file
|
||||
inserttask('99');
|
||||
|
||||
standard_success('rebuildingconfigs', '', array('filename' => 'admin_index.php'));
|
||||
Cronjob::inserttask(TaskId::REBUILD_CRON);
|
||||
|
||||
Response::standardSuccess('rebuildingconfigs', '', [
|
||||
'filename' => 'admin_index.php'
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page));
|
||||
HTML::askYesNo('admin_configs_reallyrebuild', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif($page == 'updatecounters'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "updated resource-counters");
|
||||
$updatecounters = updateCounters(true);
|
||||
$customers = '';
|
||||
foreach ($updatecounters['customers'] as $customerid => $customer) {
|
||||
eval("\$customers.=\"" . getTemplate("settings/updatecounters_row_customer") . "\";");
|
||||
}
|
||||
|
||||
$admins = '';
|
||||
foreach ($updatecounters['admins'] as $adminid => $admin) {
|
||||
eval("\$admins.=\"" . getTemplate("settings/updatecounters_row_admin") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/updatecounters") . "\";");
|
||||
|
||||
} elseif ($page == 'updatecounters' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "updated resource-counters");
|
||||
$updatecounters = User::updateCounters(true);
|
||||
UI::view('user/resource-counter.html.twig', [
|
||||
'counters' => $updatecounters
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('admin_counters_reallyupdate', $filename, array('page' => $page));
|
||||
HTML::askYesNo('admin_counters_reallyupdate', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif ($page == 'wipecleartextmailpws'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "wiped all cleartext mail passwords");
|
||||
} elseif ($page == 'wipecleartextmailpws' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_WARNING, "wiped all cleartext mail passwords");
|
||||
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `password` = '';");
|
||||
Database::query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '0' WHERE `settinggroup` = 'system' AND `varname` = 'mailpwcleartext'");
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array('page' => $page));
|
||||
HTML::askYesNo('admin_cleartextmailpws_reallywipe', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif($page == 'wipequotas'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "wiped all mailquotas");
|
||||
} elseif ($page == 'wipequotas' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_WARNING, "wiped all mailquotas");
|
||||
|
||||
// Set the quota to 0 which means unlimited
|
||||
Database::query("UPDATE `" . TABLE_MAIL_USERS . "` SET `quota` = '0';");
|
||||
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota_used` = '0'");
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
ask_yesno('admin_quotas_reallywipe', $filename, array('page' => $page));
|
||||
HTML::askYesNo('admin_quotas_reallywipe', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif ($page == 'enforcequotas'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
} elseif ($page == 'enforcequotas' && $userinfo['change_serversettings'] == '1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// Fetch all accounts
|
||||
$result_stmt = Database::query("SELECT `quota`, `customerid` FROM `" . TABLE_MAIL_USERS . "`");
|
||||
|
||||
if (Database::num_rows() > 0) {
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||
`email_quota_used` = `email_quota_used` + :diff
|
||||
@@ -250,7 +206,10 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
|
||||
while ($array = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$difference = Settings::Get('system.mail_quota') - $array['quota'];
|
||||
Database::pexecute($upd_stmt, array('diff' => $difference, 'customerid' => $customerid));
|
||||
Database::pexecute($upd_stmt, [
|
||||
'diff' => $difference,
|
||||
'customerid' => $customerid
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,35 +217,205 @@ if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_MAIL_USERS . "` SET `quota` = :quota
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('quota' => Settings::Get('system.mail_quota')));
|
||||
Database::pexecute($upd_stmt, [
|
||||
'quota' => Settings::Get('system.mail_quota')
|
||||
]);
|
||||
|
||||
// Update the Customer, if the used quota is bigger than the allowed quota
|
||||
Database::query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_quota` = `email_quota_used` WHERE `email_quota` < `email_quota_used`");
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, 'enforcing mailquota to all customers: ' . Settings::Get('system.mail_quota') . ' MB');
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_WARNING, 'enforcing mailquota to all customers: ' . Settings::Get('system.mail_quota') . ' MB');
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
|
||||
HTML::askYesNo('admin_quotas_reallyenforce', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'integritycheck'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
} elseif ($page == 'integritycheck' && $userinfo['change_serversettings'] == '1') {
|
||||
$integrity = new IntegrityCheck();
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$integrity->fixAll();
|
||||
} elseif(isset($_GET['action'])
|
||||
&& $_GET['action'] == "fix") {
|
||||
ask_yesno('admin_integritycheck_reallyfix', $filename, array('page' => $page));
|
||||
} elseif (isset($_GET['action']) && $_GET['action'] == "fix") {
|
||||
HTML::askYesNo('admin_integritycheck_reallyfix', $filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
$integritycheck = '';
|
||||
$integritycheck = [];
|
||||
foreach ($integrity->available as $id => $check) {
|
||||
$displayid = $id + 1;
|
||||
$result = $integrity->$check();
|
||||
$checkdesc = $lng['integrity_check'][$check];
|
||||
eval("\$integritycheck.=\"" . getTemplate("settings/integritycheck_row") . "\";");
|
||||
$integritycheck[] = [
|
||||
'displayid' => $id + 1,
|
||||
'result' => $integrity->$check(),
|
||||
'checkdesc' => lng('integrity_check.' . $check)
|
||||
];
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/integritycheck") . "\";");
|
||||
|
||||
$integrity_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.integrity.php';
|
||||
$collection = [
|
||||
'data' => $integritycheck,
|
||||
'pagination' => []
|
||||
];
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::formatFromArray($collection, $integrity_list_data['integrity_list'], 'integrity_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'settings', 'page' => $page, 'action' => 'fix']),
|
||||
'label' => lng('admin.integrityfix'),
|
||||
'icon' => 'fa-solid fa-screwdriver-wrench',
|
||||
'class' => 'btn-warning'
|
||||
]
|
||||
]
|
||||
]);
|
||||
} elseif ($page == 'importexport' && $userinfo['change_serversettings'] == '1') {
|
||||
// check for json-stuff
|
||||
if (!extension_loaded('json')) {
|
||||
Response::standardError('jsonextensionnotfound');
|
||||
}
|
||||
|
||||
if (isset($_GET['action']) && $_GET['action'] == "export") {
|
||||
// export
|
||||
try {
|
||||
$json_result = Froxlor::getLocal($userinfo)->exportSettings();
|
||||
$json_export = json_decode($json_result, true)['data'];
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
header('Content-disposition: attachment; filename=Froxlor_settings-' . \Froxlor\Froxlor::VERSION . '-' . \Froxlor\Froxlor::DBVERSION . '_' . date('d.m.Y') . '.json');
|
||||
header('Content-type: application/json');
|
||||
echo $json_export;
|
||||
exit();
|
||||
} elseif (isset($_GET['action']) && $_GET['action'] == "import") {
|
||||
// import
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// get uploaded file
|
||||
if (isset($_FILES["import_file"]["tmp_name"])) {
|
||||
$imp_content = file_get_contents($_FILES["import_file"]["tmp_name"]);
|
||||
try {
|
||||
Froxlor::getLocal($userinfo, [
|
||||
'json_str' => $imp_content
|
||||
])->importSettings();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::standardSuccess('settingsimported', '', [
|
||||
'filename' => 'admin_settings.php'
|
||||
]);
|
||||
}
|
||||
Response::dynamicError("Upload failed");
|
||||
}
|
||||
} else {
|
||||
$settings_data = include_once dirname(__FILE__) . '/lib/formfields/admin/settings/formfield.settings_import.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'settings', 'page' => $page, 'action' => 'import']),
|
||||
'formdata' => $settings_data['settings_import'],
|
||||
'actions_links' => [
|
||||
[
|
||||
'class' => 'btn-outline-primary',
|
||||
'href' => $linker->getLink(['section' => 'settings', 'page' => 'overview']),
|
||||
'label' => lng('admin.configfiles.overview'),
|
||||
'icon' => 'fa-solid fa-grip'
|
||||
],
|
||||
[
|
||||
'class' => 'btn-outline-secondary',
|
||||
'href' => $linker->getLink(['section' => 'settings', 'page' => $page, 'action' => 'export']),
|
||||
'label' => 'Download/export ' . lng('admin.serversettings'),
|
||||
'icon' => 'fa-solid fa-file-import'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'testmail') {
|
||||
$note_type = 'info';
|
||||
$note_msg = lng('admin.smtptestnote');
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$test_addr = isset($_POST['test_addr']) ? $_POST['test_addr'] : null;
|
||||
|
||||
// Initialize the mailingsystem
|
||||
$testmail = new PHPMailer(true);
|
||||
$testmail->CharSet = "UTF-8";
|
||||
|
||||
if (Settings::Get('system.mail_use_smtp')) {
|
||||
$testmail->isSMTP();
|
||||
$testmail->Host = Settings::Get('system.mail_smtp_host');
|
||||
$testmail->SMTPAuth = Settings::Get('system.mail_smtp_auth') == '1';
|
||||
$testmail->Username = Settings::Get('system.mail_smtp_user');
|
||||
$testmail->Password = Settings::Get('system.mail_smtp_passwd');
|
||||
if (Settings::Get('system.mail_smtp_usetls')) {
|
||||
$testmail->SMTPSecure = 'tls';
|
||||
} else {
|
||||
$testmail->SMTPAutoTLS = false;
|
||||
}
|
||||
$testmail->Port = Settings::Get('system.mail_smtp_port');
|
||||
}
|
||||
|
||||
$_mailerror = false;
|
||||
if (PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
|
||||
// set return-to address and custom sender-name, see #76
|
||||
$testmail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
|
||||
if (Settings::Get('panel.adminmail_return') != '') {
|
||||
$testmail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
|
||||
}
|
||||
|
||||
try {
|
||||
$testmail->Subject = "Froxlor Test-Mail";
|
||||
$mail_body = "Yay, this worked :)";
|
||||
$testmail->AltBody = $mail_body;
|
||||
$testmail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$testmail->AddAddress($test_addr);
|
||||
$testmail->Send();
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
$note_type = 'danger';
|
||||
$note_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$note_type = 'danger';
|
||||
$note_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if (!$_mailerror) {
|
||||
// success
|
||||
$mail->ClearAddresses();
|
||||
Response::standardSuccess('testmailsent', '', [
|
||||
'filename' => 'admin_settings.php',
|
||||
'page' => 'testmail'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// invalid sender e-mail
|
||||
$note_type = 'warning';
|
||||
$note_msg = "Invalid sender e-mail address: " . Settings::Get('panel.adminmail');
|
||||
}
|
||||
}
|
||||
|
||||
$mailtest_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/settings/formfield.settings_mailtest.php';
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'settings']),
|
||||
'formdata' => $mailtest_add_data['mailtest'],
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'settings',
|
||||
'page' => 'overview',
|
||||
'part' => 'system',
|
||||
'em' => 'system_mail_use_smtp'
|
||||
]),
|
||||
'label' => lng('admin.smtpsettings'),
|
||||
'icon' => 'fa-solid fa-gears',
|
||||
'class' => 'btn-outline-secondary'
|
||||
]
|
||||
],
|
||||
// alert-box
|
||||
'type' => $note_type,
|
||||
'alert_msg' => $note_msg
|
||||
]);
|
||||
} elseif ($page == 'toggleSettingsMode') {
|
||||
if ($userinfo['change_serversettings'] == '1') {
|
||||
$cmode = Settings::Get('panel.settings_mode');
|
||||
Settings::Set('panel.settings_mode', (int)(!(bool)$cmode));
|
||||
}
|
||||
Response::redirectTo($filename);
|
||||
}
|
||||
|
||||
@@ -2,267 +2,318 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['subjectid'])) {
|
||||
$subjectid = intval($_POST['subjectid']);
|
||||
$mailbodyid = intval($_POST['mailbodyid']);
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Language;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Validate\Validate;
|
||||
use Froxlor\CurrentUser;
|
||||
|
||||
} elseif(isset($_GET['subjectid'])) {
|
||||
$subjectid = intval($_GET['subjectid']);
|
||||
$mailbodyid = intval($_GET['mailbodyid']);
|
||||
}
|
||||
$id = (int)Request::any('id');
|
||||
$subjectid = intval(Request::any('subjectid'));
|
||||
$mailbodyid = intval(Request::any('mailbodyid'));
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
$available_templates = array(
|
||||
$available_templates = [
|
||||
'createcustomer',
|
||||
'pop_success',
|
||||
'new_database_by_customer',
|
||||
'new_ftpaccount_by_customer',
|
||||
'password_reset'
|
||||
);
|
||||
];
|
||||
|
||||
// only show templates of features that are enabled #1191
|
||||
if ((int)Settings::Get('system.report_enable') == 1) {
|
||||
array_push($available_templates,
|
||||
'trafficmaxpercent',
|
||||
'diskmaxpercent'
|
||||
);
|
||||
array_push($available_templates, 'trafficmaxpercent', 'diskmaxpercent');
|
||||
}
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
array_push($available_templates, 'pop_success_alternative');
|
||||
}
|
||||
|
||||
if ((int)Settings::Get('ticket.enabled') == 1) {
|
||||
array_push($available_templates,
|
||||
'new_ticket_by_customer',
|
||||
'new_ticket_for_customer',
|
||||
'new_ticket_by_staff',
|
||||
'new_reply_ticket_by_customer',
|
||||
'new_reply_ticket_by_staff'
|
||||
);
|
||||
}
|
||||
|
||||
$file_templates = array(
|
||||
$file_templates = [
|
||||
'index_html'
|
||||
);
|
||||
];
|
||||
|
||||
$languages = Language::getLanguages();
|
||||
|
||||
if ($action == '') {
|
||||
//email templates
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
||||
// email templates
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
||||
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$available_templates[] = 'pop_success_alternative';
|
||||
}
|
||||
|
||||
$templates_array = array();
|
||||
$templates_array = [];
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `templategroup`='mails'
|
||||
ORDER BY `language`, `varname`"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
|
||||
ORDER BY `language`, `varname`
|
||||
");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid']
|
||||
]);
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$parts = array();
|
||||
$parts = [];
|
||||
preg_match('/^([a-z]([a-z_]+[a-z])*)_(mailbody|subject)$/', $row['varname'], $parts);
|
||||
$templates_array[$row['language']][$parts[1]][$parts[3]] = $row['id'];
|
||||
}
|
||||
|
||||
$templates = '';
|
||||
$templates = [];
|
||||
foreach ($templates_array as $language => $template_defs) {
|
||||
foreach ($template_defs as $action => $email) {
|
||||
$subjectid = $email['subject'];
|
||||
$mailbodyid = $email['mailbody'];
|
||||
$template = $lng['admin']['templates'][$action];
|
||||
eval("\$templates.=\"" . getTemplate("templates/templates_template") . "\";");
|
||||
$templates[] = [
|
||||
'subjectid' => $email['subject'],
|
||||
'mailbodyid' => $email['mailbody'],
|
||||
'template' => lng('admin.templates.' . $action),
|
||||
'language' => $language
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$add = false;
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
|
||||
$templates_done = array();
|
||||
$mail_actions_links = false;
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$templates_done = [];
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `language`= :lang
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name));
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'
|
||||
");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language_name
|
||||
]);
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templates_done[] = str_replace('_subject', '', $row['varname']);
|
||||
}
|
||||
|
||||
if (count(array_diff($available_templates, $templates_done)) > 0) {
|
||||
$add = true;
|
||||
$mail_actions_links = [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'templates', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('admin.templates.template_add')
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
//filetemplates
|
||||
$filetemplates = '';
|
||||
$filetemplateadd = false;
|
||||
$mailtpl_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.mailtemplates.php';
|
||||
$collection_mail = [
|
||||
'data' => $templates,
|
||||
'pagination' => []
|
||||
];
|
||||
|
||||
// filetemplates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `templategroup`='files'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
|
||||
|
||||
if (Database::num_rows() != count($file_templates)) {
|
||||
$filetemplateadd = true;
|
||||
}
|
||||
WHERE `adminid` = :adminid AND `templategroup`='files'");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid']
|
||||
]);
|
||||
|
||||
$filetemplates = [];
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
eval("\$filetemplates.=\"" . getTemplate("templates/templates_filetemplate") . "\";");
|
||||
$filetemplates[] = [
|
||||
'id' => $row['id'],
|
||||
'template' => lng('admin.templates.' . $row['varname'])
|
||||
];
|
||||
}
|
||||
eval("echo \"" . getTemplate("templates/templates") . "\";");
|
||||
|
||||
} elseif($action == 'delete'
|
||||
&& $subjectid != 0
|
||||
&& $mailbodyid != 0
|
||||
) {
|
||||
//email templates
|
||||
$file_actions_links = false;
|
||||
if (Database::num_rows() != count($file_templates)) {
|
||||
$file_actions_links = [
|
||||
[
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'templates',
|
||||
'page' => $page,
|
||||
'action' => 'add',
|
||||
'files' => 'files'
|
||||
]),
|
||||
'label' => lng('admin.templates.template_fileadd')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$filetpl_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.filetemplates.php';
|
||||
$collection_file = [
|
||||
'data' => $filetemplates,
|
||||
'pagination' => []
|
||||
];
|
||||
|
||||
if ($mail_actions_links === false) {
|
||||
$mail_actions_links = [];
|
||||
}
|
||||
if ($file_actions_links === false) {
|
||||
$file_actions_links = [];
|
||||
}
|
||||
|
||||
UI::view('user/table-tpl.html.twig', [
|
||||
'maillisting' => Listing::formatFromArray($collection_mail, $mailtpl_list_data['mailtpl_list'], 'mailtpl_list'),
|
||||
'filelisting' => Listing::formatFromArray($collection_file, $filetpl_list_data['filetpl_list'], 'filetpl_list'),
|
||||
'actions_links' => array_merge($mail_actions_links, $file_actions_links)
|
||||
]);
|
||||
} elseif ($action == 'delete' && $subjectid != 0 && $mailbodyid != 0) {
|
||||
// email templates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $subjectid));
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $subjectid
|
||||
]);
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['varname'] != '') {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid
|
||||
AND (`id` = :ida OR `id` = :idb)"
|
||||
);
|
||||
Database::pexecute($del_stmt, array(
|
||||
AND (`id` = :ida OR `id` = :idb)");
|
||||
Database::pexecute($del_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'ida' => $subjectid,
|
||||
'idb' => $mailbodyid
|
||||
));
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
]);
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "deleted template '" . $result['language'] . ' - ' . lng('admin.templates.' . str_replace('_subject', '', $result['varname'])) . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('admin_template_reallydelete', $filename, array('subjectid' => $subjectid, 'mailbodyid' => $mailbodyid, 'page' => $page, 'action' => $action), $result['language'] . ' - ' . $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])]);
|
||||
HTML::askYesNo('admin_template_reallydelete', $filename, [
|
||||
'subjectid' => $subjectid,
|
||||
'mailbodyid' => $mailbodyid,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['language'] . ' - ' . lng('admin.templates.' . str_replace('_subject', '', $result['varname'])));
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($action == 'deletef'
|
||||
&& $id != 0
|
||||
) {
|
||||
//file templates
|
||||
} elseif ($action == 'deletef' && $id != 0) {
|
||||
// file templates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $id
|
||||
]);
|
||||
|
||||
if (Database::num_rows() > 0) {
|
||||
|
||||
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$del_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($del_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted template '" . $lng['admin']['templates'][$row['varname']] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
Database::pexecute($del_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $id
|
||||
]);
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "deleted template '" . lng('admin.templates.' . $row['varname']) . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('admin_template_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $lng['admin']['templates'][$row['varname']]);
|
||||
HTML::askYesNo('admin_template_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], lng('admin.templates.' . $row['varname']));
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('templatenotfound');
|
||||
Response::standardError('templatenotfound');
|
||||
}
|
||||
|
||||
} elseif($action == 'add') {
|
||||
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$available_templates[] = 'pop_success_alternative';
|
||||
}
|
||||
|
||||
if (isset($_POST['prepare'])
|
||||
&& $_POST['prepare'] == 'prepare'
|
||||
) {
|
||||
//email templates
|
||||
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
|
||||
$template = validate($_POST['template'], 'template');
|
||||
|
||||
$lng_bak = $lng;
|
||||
foreach ($langs['English'] as $key => $value) {
|
||||
include_once makeSecurePath($value['file']);
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['prepare']) && $_POST['prepare'] == 'prepare') {
|
||||
// email templates
|
||||
$language = htmlentities(Validate::validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
|
||||
if (!array_key_exists($language, $languages)) {
|
||||
Response::standardError('templatelanguageinvalid');
|
||||
}
|
||||
if ($language != 'English') {
|
||||
foreach ($langs[$language] as $key => $value) {
|
||||
include makeSecurePath($value['file']);
|
||||
}
|
||||
$template = Validate::validate($_POST['template'], 'template');
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT COUNT(*) as def FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `language` = :lang
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE :template
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language,
|
||||
'template' => $template . '%'
|
||||
]);
|
||||
if ($result && $result['def'] > 0) {
|
||||
Response::standardError('templatelanguagecombodefined');
|
||||
}
|
||||
|
||||
$subject = $lng['mails'][$template]['subject'];
|
||||
$body = str_replace('\n', "\n", $lng['mails'][$template]['mailbody']);
|
||||
// set target language
|
||||
Language::setLanguage($language);
|
||||
|
||||
$lng = $lng_bak;
|
||||
$subject = lng('mails.' . $template . '.subject');
|
||||
$body = str_replace('\n', "\n", lng('mails.' . $template . '.mailbody'));
|
||||
|
||||
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php';
|
||||
$template_add_form = htmlform::genHTMLForm($template_add_data);
|
||||
// re set language to user
|
||||
Language::setLanguage(CurrentUser::getField('def_language'));
|
||||
|
||||
$title = $template_add_data['template_add']['title'];
|
||||
$image = $template_add_data['template_add']['image'];
|
||||
$template_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_add.php';
|
||||
|
||||
eval("echo \"" . getTemplate("templates/templates_add_2") . "\";");
|
||||
|
||||
} elseif(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
//email templates
|
||||
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
|
||||
$template = validate($_POST['template'], 'template');
|
||||
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||
$templates = array();
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'templates']),
|
||||
'formdata' => $template_add_data['template_add'],
|
||||
'replacers' => $template_add_data['template_replacers']
|
||||
]);
|
||||
} elseif (isset($_POST['send']) && $_POST['send'] == 'send' && !isset($_POST['filesend'])) {
|
||||
// email templates
|
||||
$language = htmlentities(Validate::validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
|
||||
if (!array_key_exists($language, $languages)) {
|
||||
Response::standardError('templatelanguageinvalid');
|
||||
}
|
||||
$template = Validate::validate($_POST['template'], 'template');
|
||||
$subject = Validate::validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||
$mailbody = Validate::validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||
$templates = [];
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `language` = :lang
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language));
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language
|
||||
]);
|
||||
|
||||
while($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||
}
|
||||
|
||||
$templates = array_diff($available_templates, $templates);
|
||||
if (array_search($template, $templates) === false) {
|
||||
standard_error('templatenotfound');
|
||||
|
||||
if (!in_array($template, $templates)) {
|
||||
Response::standardError('templatenotfound');
|
||||
} else {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
@@ -270,37 +321,35 @@ if ($action == '') {
|
||||
`language` = :lang,
|
||||
`templategroup` = 'mails',
|
||||
`varname` = :var,
|
||||
`value` = :value"
|
||||
);
|
||||
`value` = :value");
|
||||
|
||||
// mail-subject
|
||||
$ins_data = array(
|
||||
$ins_data = [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language,
|
||||
'var' => $template.'_subject',
|
||||
'var' => $template . '_subject',
|
||||
'value' => $subject
|
||||
);
|
||||
];
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
// mail-body
|
||||
$ins_data = array(
|
||||
$ins_data = [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language,
|
||||
'var' => $template.'_mailbody',
|
||||
'var' => $template . '_mailbody',
|
||||
'value' => $mailbody
|
||||
);
|
||||
];
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif(isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend'
|
||||
) {
|
||||
//file templates
|
||||
$template = validate($_POST['template'], 'template');
|
||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
} elseif (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') {
|
||||
// file templates
|
||||
$template = Validate::validate($_POST['template'], 'template');
|
||||
$filecontent = Validate::validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
@@ -308,34 +357,35 @@ if ($action == '') {
|
||||
`language` = '',
|
||||
`templategroup` = 'files',
|
||||
`varname` = :var,
|
||||
`value` = :value"
|
||||
);
|
||||
`value` = :value");
|
||||
|
||||
$ins_data = array(
|
||||
$ins_data = [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'var' => $template,
|
||||
'value' => $filecontent
|
||||
);
|
||||
];
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} elseif(!isset($_GET['files'])) {
|
||||
|
||||
//email templates
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} elseif (!isset($_GET['files'])) {
|
||||
// email templates
|
||||
$add = false;
|
||||
$language_options = '';
|
||||
$template_options = '';
|
||||
$language_options = [];
|
||||
$template_options = [];
|
||||
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$templates = array();
|
||||
foreach ($languages as $language_file => $language_name) {
|
||||
$templates = [];
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `language` = :lang
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'lang' => $language_name));
|
||||
AND `templategroup` = 'mails' AND `varname` LIKE '%_subject'");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language_name
|
||||
]);
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||
@@ -343,173 +393,192 @@ if ($action == '') {
|
||||
|
||||
if (count(array_diff($available_templates, $templates)) > 0) {
|
||||
$add = true;
|
||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true, true);
|
||||
$language_options[$language_file] = $language_name;
|
||||
|
||||
$templates = array_diff($available_templates, $templates);
|
||||
|
||||
foreach ($templates as $template) {
|
||||
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
|
||||
$template_options[$template] = lng('admin.templates.' . $template);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($add) {
|
||||
eval("echo \"" . getTemplate("templates/templates_add_1") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'templates']),
|
||||
'formdata' => [
|
||||
'title' => lng('admin.templates.template_add'),
|
||||
'image' => 'fa-solid fa-plus',
|
||||
'self_overview' => ['section' => 'templates', 'page' => 'email'],
|
||||
'sections' => [
|
||||
'section_a' => [
|
||||
'title' => lng('admin.templates.template_add'),
|
||||
'fields' => [
|
||||
'language' => [
|
||||
'label' => lng('login.language'),
|
||||
'type' => 'select',
|
||||
'select_var' => $language_options,
|
||||
'selected' => $userinfo['language']
|
||||
],
|
||||
'template' => [
|
||||
'label' => lng('admin.templates.action'),
|
||||
'type' => 'select',
|
||||
'select_var' => $template_options
|
||||
],
|
||||
'prepare' => [
|
||||
'type' => 'hidden',
|
||||
'value' => 'prepare'
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
'editid' => $id
|
||||
]);
|
||||
} else {
|
||||
standard_error('alltemplatesdefined');
|
||||
Response::standardError('alltemplatesdefined');
|
||||
}
|
||||
|
||||
} else {
|
||||
//filetemplates
|
||||
// filetemplates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `templategroup`='files'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
|
||||
WHERE `adminid` = :adminid AND `templategroup`='files'");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid']
|
||||
]);
|
||||
|
||||
if (Database::num_rows() == count($file_templates)) {
|
||||
standard_error('alltemplatesdefined');
|
||||
|
||||
Response::standardError('alltemplatesdefined');
|
||||
} else {
|
||||
|
||||
$templatesdefined = array();
|
||||
$free_templates = '';
|
||||
$templatesdefined = [];
|
||||
$free_templates = [];
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templatesdefined[] = $row['varname'];
|
||||
}
|
||||
|
||||
foreach (array_diff($file_templates, $templatesdefined) as $template) {
|
||||
$free_templates.= makeoption($lng['admin']['templates'][$template], $template, '', true);
|
||||
$free_templates[$template] = lng('admin.templates.' . $template);
|
||||
}
|
||||
|
||||
$filetemplate_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_add.php';
|
||||
$filetemplate_add_form = htmlform::genHTMLForm($filetemplate_add_data);
|
||||
$filetemplate_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_add.php';
|
||||
|
||||
$title = $filetemplate_add_data['filetemplate_add']['title'];
|
||||
$image = $filetemplate_add_data['filetemplate_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("templates/filetemplates_add") . "\";");
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'templates']),
|
||||
'formdata' => $filetemplate_add_data['filetemplate_add'],
|
||||
'replacers' => $filetemplate_add_data['filetemplate_replacers']
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($action == 'edit'
|
||||
&& $subjectid != 0
|
||||
&& $mailbodyid != 0
|
||||
) {
|
||||
//email templates
|
||||
} elseif ($action == 'edit' && $subjectid != 0 && $mailbodyid != 0) {
|
||||
// email templates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `id` = :subjectid"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'subjectid' => $subjectid));
|
||||
WHERE `adminid` = :adminid AND `id` = :subjectid");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'subjectid' => $subjectid
|
||||
]);
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($result['varname'] != '') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$subject = Validate::validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||
$mailbody = Validate::validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`value` = :value
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
// subject
|
||||
Database::pexecute($upd_stmt, array(
|
||||
Database::pexecute($upd_stmt, [
|
||||
'value' => $subject,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $subjectid
|
||||
));
|
||||
]);
|
||||
// same query but mailbody
|
||||
Database::pexecute($upd_stmt, array(
|
||||
Database::pexecute($upd_stmt, [
|
||||
'value' => $mailbody,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $mailbodyid
|
||||
));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
]);
|
||||
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
$template_name = lng('admin.templates.' . str_replace('_subject', '', $result['varname']));
|
||||
$subject = $result['value'];
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `language`, `varname`, `value`
|
||||
FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('id' => $mailbodyid));
|
||||
WHERE `id` = :id");
|
||||
Database::pexecute($result_stmt, [
|
||||
'id' => $mailbodyid
|
||||
]);
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$template_name = str_replace('_mailbody', '', $result['varname']);
|
||||
|
||||
$template = str_replace('_mailbody', '', $result['varname']);
|
||||
|
||||
// don't escape the already escaped language-string so save up before htmlentities()
|
||||
$language = $result['language'];
|
||||
$result = htmlentities_array($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
$mailbody = $result['value'];
|
||||
|
||||
$template_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_edit.php';
|
||||
$template_edit_form = htmlform::genHTMLForm($template_edit_data);
|
||||
$template_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.template_edit.php';
|
||||
|
||||
$title = $template_edit_data['template_edit']['title'];
|
||||
$image = $template_edit_data['template_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("templates/templates_edit") . "\";");
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'templates']),
|
||||
'formdata' => $template_edit_data['template_edit'],
|
||||
'replacers' => $template_edit_data['template_replacers']
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($action == 'editf'
|
||||
&& $id != 0
|
||||
) {
|
||||
//file templates
|
||||
} elseif ($action == 'editf' && $id != 0) {
|
||||
// file templates
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid'], 'id' => $id));
|
||||
|
||||
if(Database::num_rows() > 0) {
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
Database::pexecute($result_stmt, [
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $id
|
||||
]);
|
||||
|
||||
if (Database::num_rows() > 0) {
|
||||
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
//filetemplates
|
||||
if (isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend'
|
||||
) {
|
||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
// filetemplates
|
||||
if (isset($_POST['filesend']) && $_POST['filesend'] == 'filesend') {
|
||||
$filecontent = Validate::validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`value` = :value
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($upd_stmt, array(
|
||||
WHERE `adminid` = :adminid AND `id` = :id");
|
||||
Database::pexecute($upd_stmt, [
|
||||
'value' => $filecontent,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
]);
|
||||
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$row = htmlentities_array($row);
|
||||
$row = PhpHelper::htmlentitiesArray($row);
|
||||
|
||||
$filetemplate_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
|
||||
$filetemplate_edit_form = htmlform::genHTMLForm($filetemplate_edit_data);
|
||||
$filetemplate_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
|
||||
|
||||
$title = $filetemplate_edit_data['filetemplate_edit']['title'];
|
||||
$image = $filetemplate_edit_data['filetemplate_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("templates/filetemplates_edit") . "\";");
|
||||
UI::view('user/form-replacers.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'templates']),
|
||||
'formdata' => $filetemplate_edit_data['filetemplate_edit'],
|
||||
'replacers' => $filetemplate_edit_data['filetemplate_replacers'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('templatenotfound');
|
||||
Response::standardError('templatenotfound');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,909 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
|
||||
} elseif(isset($_GET['id'])) {
|
||||
|
||||
$id = intval($_GET['id']);
|
||||
|
||||
// only check if this is not a category-id
|
||||
if (!isset($_GET['page']) || (isset($_GET['page']) && $_GET['page'] != 'categories')) {
|
||||
if (!$userinfo['customers_see_all']) {
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$stmt = Database::prepare("
|
||||
SELECT `id` FROM `panel_tickets`
|
||||
WHERE `id` = :id AND `adminid` = :adminid
|
||||
");
|
||||
$result = Database::pexecute_first($stmt, array('id' => $id, 'adminid' => $userinfo['adminid']));
|
||||
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($page == 'tickets'
|
||||
&& $userinfo['customers'] != '0'
|
||||
) {
|
||||
// Let's see how many customers we have
|
||||
$countcustomers_stmt = Database::prepare("
|
||||
SELECT COUNT(`customerid`) as `countcustomers`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " .
|
||||
($userinfo['customers_see_all'] ? '' : "WHERE `adminid` = :adminid")
|
||||
);
|
||||
$countcustomers = Database::pexecute_first($countcustomers_stmt, array('adminid' => $userinfo['adminid']));
|
||||
$countcustomers = (int)$countcustomers['countcustomers'];
|
||||
|
||||
if ($action == '') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets");
|
||||
$fields = array(
|
||||
'status' => $lng['ticket']['status'],
|
||||
'lastchange' => $lng['ticket']['lastchange'],
|
||||
'subject' => $lng['ticket']['subject'],
|
||||
'lastreplier' => $lng['ticket']['lastreplier']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields, null, null, 1, 'desc');
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `main`.`id`, `main`.`customerid`, (
|
||||
SELECT COUNT(`sub`.`id`)
|
||||
FROM `" . TABLE_PANEL_TICKETS . "` `sub`
|
||||
WHERE `sub`.`answerto` = `main`.`id`) as `ticket_answers`,
|
||||
`main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority`
|
||||
FROM `" . TABLE_PANEL_TICKETS . "` as `main`
|
||||
WHERE `main`.`answerto` = '0' AND `archived` = '0' " .
|
||||
($userinfo['customers_see_all'] ? '' : " AND `adminid` = :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);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$ctickets = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (!isset($ctickets[$row['customerid']])
|
||||
|| !is_array($ctickets[$row['customerid']])
|
||||
) {
|
||||
$ctickets[$row['customerid']] = array();
|
||||
}
|
||||
$ctickets[$row['customerid']][$row['id']] = $row;
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'customerid'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($ctickets);
|
||||
} else {
|
||||
ksort($ctickets);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$tickets_count = 0;
|
||||
$tickets = '';
|
||||
foreach ($ctickets as $cid => $ticketrows) {
|
||||
$_cid = 0;
|
||||
foreach ($ticketrows as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
|
||||
$row = htmlentities_array($row);
|
||||
$row['lastchange'] = date("d.m.y H:i", $row['lastchange']);
|
||||
|
||||
if ($_cid != $row['customerid']) {
|
||||
$cid = $row['customerid'];
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
|
||||
if (isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = $usr['loginname'];
|
||||
$customerid = $usr['customerid'];
|
||||
} else {
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
}
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_customer") . "\";");
|
||||
}
|
||||
|
||||
$tickets_count++;
|
||||
|
||||
if ($row['status'] >= 0
|
||||
&& $row['status'] <= 2
|
||||
) {
|
||||
$reopen = 0;
|
||||
} else {
|
||||
$reopen = 1;
|
||||
}
|
||||
|
||||
$row['status'] = ticket::getStatusText($lng, $row['status']);
|
||||
$row['priority'] = ticket::getPriorityText($lng, $row['priority']);
|
||||
|
||||
if ($row['lastreplier'] == '1') {
|
||||
$row['lastreplier'] = $lng['ticket']['staff'];
|
||||
$cananswer = 0;
|
||||
} else {
|
||||
$row['lastreplier'] = $lng['ticket']['customer'];
|
||||
$cananswer = 1;
|
||||
}
|
||||
|
||||
$row['subject'] = html_entity_decode($row['subject']);
|
||||
if (strlen($row['subject']) > 30) {
|
||||
$ts = wordwrap($row['subject'], 30, "|");
|
||||
$ts = explode("|", $ts);
|
||||
$row['subject'] = $ts[0]. '...';
|
||||
}
|
||||
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
||||
$count++;
|
||||
$_cid = $row['customerid'];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
eval("echo \"" . getTemplate("tickets/tickets") . "\";");
|
||||
|
||||
} elseif($action == 'new') {
|
||||
|
||||
if ($userinfo['tickets_used'] < $userinfo['tickets']
|
||||
|| $userinfo['tickets'] == '-1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$newticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$newticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$newticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$newticket->Set('category', validate($_POST['category'], 'category'), true, false);
|
||||
$newticket->Set('customer', (int)$_POST['customer'], true, false);
|
||||
$newticket->Set('message', validate(htmlentities(str_replace("\r\n", "\n", $_POST['message'])), 'message', '/^[^\0]*$/'), true, false);
|
||||
|
||||
if ($newticket->Get('subject') == null) {
|
||||
standard_error(array('stringisempty', 'mysubject'));
|
||||
} elseif($newticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
} else {
|
||||
$now = time();
|
||||
$newticket->Set('admin', $userinfo['adminid'], true, true);
|
||||
$newticket->Set('dt', $now, true, true);
|
||||
$newticket->Set('lastchange', $now, true, true);
|
||||
$newticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||
$newticket->Set('status', '0', true, true);
|
||||
$newticket->Set('lastreplier', '1', true, true);
|
||||
$newticket->Set('by', '1', true, true);
|
||||
$newticket->Insert();
|
||||
$newticket->sendMail((int)$newticket->Get('customer'), 'new_ticket_by_staff_subject', $lng['mails']['new_ticket_by_staff']['subject'], 'new_ticket_by_staff_mailbody', $lng['mails']['new_ticket_by_staff']['mailbody']);
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "opened a new ticket for customer #" . $newticket->Get('customer') . " - '" . $newticket->Get('subject') . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$categories = '';
|
||||
$where = '';
|
||||
if ($userinfo['tickets_see_all'] != '1') {
|
||||
$where = 'WHERE `adminid` = :adminid';
|
||||
}
|
||||
$result_stmt = Database::prepare('
|
||||
SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
'.$where.' ORDER BY `logicalorder`, `name` ASC'
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array('adminid' => $userinfo['adminid']));
|
||||
|
||||
if (isset($result['name'])
|
||||
&& $result['name'] != ''
|
||||
) {
|
||||
$result2_stmt = Database::prepare('
|
||||
SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
'.$where.' ORDER BY `logicalorder`, `name` ASC'
|
||||
);
|
||||
Database::pexecute($result2_stmt, array('adminid' => $userinfo['adminid']));
|
||||
|
||||
while ($row = $result2_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$categories.= makeoption($row['name'], $row['id']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||
}
|
||||
|
||||
$customers = '';
|
||||
$result_customers_stmt = Database::prepare("
|
||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " .
|
||||
($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid")."
|
||||
ORDER BY `name` ASC"
|
||||
);
|
||||
Database::pexecute($result_customers_stmt, array('adminid' => $userinfo['adminid']));
|
||||
|
||||
while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||
}
|
||||
|
||||
$def_prio = Settings::Get('ticket.default_priority');
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', $def_prio);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $def_prio);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', $def_prio);
|
||||
|
||||
$ticket_new_data = include_once dirname(__FILE__).'/lib/formfields/admin/tickets/formfield.ticket_new.php';
|
||||
$ticket_new_form = htmlform::genHTMLForm($ticket_new_data);
|
||||
|
||||
$title = $ticket_new_data['ticket_new']['title'];
|
||||
$image = $ticket_new_data['ticket_new']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_new") . "\";");
|
||||
}
|
||||
|
||||
} else {
|
||||
standard_error('nomoreticketsavailable');
|
||||
}
|
||||
|
||||
} elseif($action == 'answer'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$replyticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$replyticket->Set('message', validate(htmlentities(str_replace("\r\n", "\n", $_POST['message'])), 'message', '/^[^\0]*$/'), true, false);
|
||||
|
||||
if ($replyticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
} else {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$replyticket->Set('customer', $mainticket->Get('customer'), true, true);
|
||||
$replyticket->Set('lastchange', $now, true, true);
|
||||
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||
$replyticket->Set('status', '1', true, true);
|
||||
$replyticket->Set('answerto', (int)$id, true, false);
|
||||
$replyticket->Set('by', '1', true, true);
|
||||
$replyticket->Insert();
|
||||
|
||||
// Update priority if changed
|
||||
if ($replyticket->Get('priority') != $mainticket->Get('priority')) {
|
||||
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
||||
}
|
||||
|
||||
$mainticket->Set('lastchange', $now);
|
||||
$mainticket->Set('lastreplier', '1');
|
||||
$mainticket->Set('status', '2');
|
||||
$mainticket->Update();
|
||||
$mainticket->sendMail((int)$mainticket->Get('customer'), 'new_reply_ticket_by_staff_subject', $lng['mails']['new_reply_ticket_by_staff']['subject'], 'new_reply_ticket_by_staff_mailbody', $lng['mails']['new_reply_ticket_by_staff']['mailbody']);
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "answered ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$ticket_replies = '';
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||
|
||||
if ($mainticket->Get('status') >= 0
|
||||
&& $mainticket->Get('status') <= 2
|
||||
) {
|
||||
$isclosed = 0;
|
||||
} else {
|
||||
$isclosed = 1;
|
||||
}
|
||||
|
||||
if ($mainticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
$message = $mainticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_main") . "\";");
|
||||
|
||||
$result_stmt = Database::prepare('
|
||||
SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = :cid'
|
||||
);
|
||||
$row = Database::pexecute_first($result_stmt, array('cid' => $mainticket->Get('category')));
|
||||
|
||||
$andere_stmt = Database::prepare('
|
||||
SELECT * FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `answerto` = :id ORDER BY `lastchange` ASC'
|
||||
);
|
||||
Database::pexecute($andere_stmt, array('id' => $id));
|
||||
$numrows_andere = Database::num_rows();
|
||||
|
||||
while ($row2 = $andere_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$subticket = ticket::getInstanceOf($userinfo, (int)$row2['id']);
|
||||
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
||||
|
||||
if ($subticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $subticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
}
|
||||
|
||||
$subject = $subticket->Get('subject');
|
||||
$message = $subticket->Get('message');
|
||||
|
||||
$row2 = htmlentities_array($row2);
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', $mainticket->Get('priority'), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $mainticket->Get('priority'), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', $mainticket->Get('priority'), true, true);
|
||||
$subject = htmlentities($mainticket->Get('subject'));
|
||||
$ticket_replies_count = $numrows_andere + 1;
|
||||
|
||||
// don't forget the main-ticket!
|
||||
$ticket_reply_data = include_once dirname(__FILE__).'/lib/formfields/admin/tickets/formfield.ticket_reply.php';
|
||||
$ticket_reply_form = htmlform::genHTMLForm($ticket_reply_data);
|
||||
|
||||
$title = $ticket_reply_data['ticket_reply']['title'];
|
||||
$image = $ticket_reply_data['ticket_reply']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_reply") . "\";");
|
||||
}
|
||||
|
||||
} elseif($action == 'close'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '1', true, true);
|
||||
$mainticket->Set('status', '3', true, true);
|
||||
$mainticket->Update();
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "closed ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
|
||||
} elseif($action == 'reopen'
|
||||
&& $id != 0
|
||||
) {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '1', true, true);
|
||||
$mainticket->Set('status', '0', true, true);
|
||||
$mainticket->Update();
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "reopened ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} elseif($action == 'archive'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '1', true, true);
|
||||
$mainticket->Set('status', '3', true, true);
|
||||
$mainticket->Update();
|
||||
$mainticket->Archive();
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "archived ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallyarchive', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
|
||||
} elseif($action == 'delete'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted ticket '" . $mainticket->Get('subject') . "'");
|
||||
$mainticket->Delete();
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($page == 'categories'
|
||||
&& $userinfo['customers'] != '0'
|
||||
) {
|
||||
if ($action == '') {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::categories");
|
||||
$fields = array(
|
||||
'name' => $lng['ticket']['category'],
|
||||
'logicalorder' => $lng['ticket']['logicalorder']
|
||||
);
|
||||
|
||||
$where = '1'; // WHERE 1 is like no 'where-clause'
|
||||
if ($userinfo['tickets_see_all'] != '1') {
|
||||
$where = " `main`.`adminid` = :adminid";
|
||||
}
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKET_CATS, $fields);
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `main`.`id`, `main`.`name`, `main`.`logicalorder`, (
|
||||
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
|
||||
WHERE `sub`.`category` = `main`.`id`
|
||||
AND `sub`.`answerto` = '0'
|
||||
AND `sub`.`adminid` = :adminid
|
||||
) as `ticketcount`, (
|
||||
SELECT COUNT(`sub2`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub2`
|
||||
WHERE `sub2`.`category` = `main`.`id`
|
||||
AND `sub2`.`answerto` = '0'
|
||||
AND (`sub2`.`status` = '0' OR `sub2`.`status` = '1' OR `sub2`.`status` = '2')
|
||||
AND `sub2`.`adminid` = :adminid
|
||||
) as `ticketcountnotclosed`
|
||||
FROM `" . TABLE_PANEL_TICKET_CATS . "` `main`
|
||||
WHERE " . $where . $paging->getSqlWhere(true) . " " .
|
||||
$paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
);
|
||||
Database::pexecute($result_stmt, array('adminid' => $userinfo['adminid']));
|
||||
$numrows = Database::num_rows();
|
||||
$paging->setEntries($numrows);
|
||||
$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;
|
||||
$ticketcategories = '';
|
||||
$categories_count = $numrows;
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$closedtickets_count = ($row['ticketcount'] - $row['ticketcountnotclosed']);
|
||||
eval("\$ticketcategories.=\"" . getTemplate("tickets/tickets_categories") . "\";");
|
||||
$count++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
eval("echo \"" . getTemplate("tickets/categories") . "\";");
|
||||
|
||||
} elseif($action == 'addcategory') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$category = validate($_POST['category'], 'category');
|
||||
$order = validate($_POST['logicalorder'], 'logicalorder');
|
||||
|
||||
if ($order < 1 || $order >= 1000) {
|
||||
// use the latest available
|
||||
$order = ticket::getHighestOrderNumber($userinfo['adminid']) + 1;
|
||||
}
|
||||
|
||||
if ($category == '') {
|
||||
standard_error(array('stringisempty', 'mycategory'));
|
||||
} else {
|
||||
ticket::addCategory($category, $userinfo['adminid'], $order);
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$order = ticket::getHighestOrderNumber($userinfo['adminid']) + 1;
|
||||
|
||||
$category_new_data = include_once dirname(__FILE__).'/lib/formfields/admin/tickets/formfield.category_new.php';
|
||||
$category_new_form = htmlform::genHTMLForm($category_new_data);
|
||||
|
||||
$title = $category_new_data['category_new']['title'];
|
||||
$image = $category_new_data['category_new']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_newcategory") . "\";");
|
||||
}
|
||||
|
||||
} elseif($action == 'editcategory'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$category = validate($_POST['category'], 'category');
|
||||
$order = validate($_POST['logicalorder'], 'logicalorder');
|
||||
|
||||
if ($order < 1 || $order >= 1000) {
|
||||
$order = 1;
|
||||
}
|
||||
|
||||
if ($category == '') {
|
||||
standard_error(array('stringisempty', 'mycategory'));
|
||||
} else {
|
||||
ticket::editCategory($category, $id, $order);
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$row_stmt = Database::prepare('
|
||||
SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = :id'
|
||||
);
|
||||
$row = Database::pexecute_first($row_stmt, array('id' => $id));
|
||||
$row = htmlentities_array($row);
|
||||
$category_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/tickets/formfield.category_edit.php';
|
||||
$category_edit_form = htmlform::genHTMLForm($category_edit_data);
|
||||
|
||||
$title = $category_edit_data['category_edit']['title'];
|
||||
$image = $category_edit_data['category_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_editcategory") . "\";");
|
||||
}
|
||||
|
||||
} elseif($action == 'deletecategory'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (ticket::deleteCategory($id) == false) {
|
||||
standard_error('categoryhastickets');
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted ticket-category #" . $id);
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
$name = ticket::getCategoryName($id);
|
||||
ask_yesno('ticket_reallydeletecat', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $name);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif($page == 'archive'
|
||||
&& $userinfo['customers'] != '0'
|
||||
) {
|
||||
if ($action == '') {
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_tickets::archive");
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$priority = array();
|
||||
$categories = array();
|
||||
$subject = validate($_POST['subject'], 'subject');
|
||||
$priority[0] = isset($_POST['priority1']) ? $_POST['priority1'] : '';
|
||||
$priority[1] = isset($_POST['priority2']) ? $_POST['priority2'] : '';
|
||||
$priority[2] = isset($_POST['priority3']) ? $_POST['priority3'] : '';
|
||||
$fromdate = validate($_POST['fromdate'], 'fromdate');
|
||||
$todate = validate($_POST['todate'], 'todate');
|
||||
$message = validate($_POST['message'], 'message');
|
||||
$customer = validate($_POST['customer'], 'customer');
|
||||
|
||||
$cat_stmt = Database::query('SELECT COUNT(`id`) as `ccount` FROM `' . TABLE_PANEL_TICKET_CATS . '`');
|
||||
$cat = $cat_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
for ($x = 0;$x < $cat['ccount'];$x++) {
|
||||
$categories[$x] = isset($_POST['category' . $x]) ? $_POST['category' . $x] : '';
|
||||
}
|
||||
|
||||
$archive_search = ticket::getArchiveSearchStatement($subject, $priority, $fromdate, $todate, $message, $customer, $userinfo['adminid'], $categories);
|
||||
|
||||
$query = $archive_search[0];
|
||||
$archive_params = $archive_search[1];
|
||||
|
||||
$fields = array(
|
||||
'lastchange' => $lng['ticket']['lastchange'],
|
||||
'subject' => $lng['ticket']['subject'],
|
||||
'lastreplier' => $lng['ticket']['lastreplier']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields);
|
||||
$result_stmt = Database::prepare($query . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
Database::pexecute($result_stmt, $archive_params);
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$ctickets = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (!isset($ctickets[$row['customerid']])
|
||||
|| !is_array($ctickets[$row['customerid']])
|
||||
) {
|
||||
$ctickets[$row['customerid']] = array();
|
||||
}
|
||||
$ctickets[$row['customerid']][$row['id']] = $row;
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'customerid'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($ctickets);
|
||||
} else {
|
||||
ksort($ctickets);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$tickets_count = 0;
|
||||
$tickets = '';
|
||||
foreach ($ctickets as $cid => $ticketrows) {
|
||||
if ($paging->sortfield == 'lastchange'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($ticketrows);
|
||||
} else {
|
||||
ksort($ticketrows);
|
||||
}
|
||||
|
||||
$_cid = -1;
|
||||
foreach ($ticketrows as $ticket) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$ticket['lastchange'] = date("d.m.y H:i", $ticket['lastchange']);
|
||||
if ($_cid != $ticket['customerid']) {
|
||||
$cid = $ticket['customerid'];
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
|
||||
if (isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = $usr['loginname'];
|
||||
$customerid = $usr['customerid'];
|
||||
} else {
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
$customerid = 0;
|
||||
$customerloginname = '';
|
||||
}
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_customer") . "\";");
|
||||
}
|
||||
|
||||
$tickets_count++;
|
||||
switch ($ticket['priority'])
|
||||
{
|
||||
case 1: $ticket['display'] = 'high';
|
||||
break;
|
||||
case 2: $ticket['display'] = 'normal';
|
||||
break;
|
||||
case 3: $ticket['display'] = 'low';
|
||||
break;
|
||||
default: $ticket['display'] = 'unknown';
|
||||
}
|
||||
$ticket['priority'] = ticket::getPriorityText($lng, $ticket['priority']);
|
||||
|
||||
if ($ticket['lastreplier'] == '1') {
|
||||
$ticket['lastreplier'] = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$ticket['lastreplier'] = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
if (strlen($ticket['subject']) > 20) {
|
||||
$ticket['subject'] = substr($ticket['subject'], 0, 17) . '...';
|
||||
}
|
||||
$ticket = htmlentities_array($ticket);
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/archived_tickets") . "\";");
|
||||
$count++;
|
||||
$_cid = $ticket['customerid'];
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
eval("echo \"" . getTemplate("tickets/archivesearch") . "\";");
|
||||
|
||||
} else {
|
||||
|
||||
$archived = array();
|
||||
$archived = ticket::getLastArchived(6, $userinfo['adminid']);
|
||||
$tickets = '';
|
||||
|
||||
if ($archived !== false) {
|
||||
|
||||
foreach ($archived as $id => $ticket) {
|
||||
|
||||
$ticket['lastchange'] = date("d.m.y H:i", $ticket['lastchange']);
|
||||
$ticket['priority'] = ticket::getPriorityText($lng, $ticket['priority']);
|
||||
|
||||
if ($ticket['lastreplier'] == '1') {
|
||||
$ticket['lastreplier'] = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$ticket['lastreplier'] = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
if (strlen($ticket['subject']) > 20) {
|
||||
$ticket['subject'] = substr($ticket['subject'], 0, 17) . '...';
|
||||
}
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/archived_tickets") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
$priorities_options = makecheckbox('priority1', $lng['ticket']['high'], '1');
|
||||
$priorities_options.= makecheckbox('priority2', $lng['ticket']['normal'], '2');
|
||||
$priorities_options.= makecheckbox('priority3', $lng['ticket']['low'], '3');
|
||||
$category_options = '';
|
||||
$ccount = 0;
|
||||
$result = Database::query('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
|
||||
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$category_options.= makecheckbox('category' . $ccount, $row['name'], $row['id'], true);
|
||||
$ccount++;
|
||||
}
|
||||
|
||||
$customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1');
|
||||
$result_customers_stmt = Database::prepare("
|
||||
SELECT `customerid`, `loginname`, `name`, `firstname`, `company`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "` " .
|
||||
($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = :adminid")."
|
||||
ORDER BY `name` ASC"
|
||||
);
|
||||
Database::pexecute($result_customers_stmt, array('adminid' => $userinfo['adminid']));
|
||||
|
||||
while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$customers.= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
|
||||
}
|
||||
eval("echo \"" . getTemplate("tickets/archive") . "\";");
|
||||
}
|
||||
|
||||
} elseif($action == 'view'
|
||||
&& $id != 0
|
||||
) {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed archived-ticket #" . $id);
|
||||
$ticket_replies = '';
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$lastchange = date("d.m.Y H:i\h", $mainticket->Get('lastchange'));
|
||||
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||
$isclosed = 1;
|
||||
|
||||
if ($mainticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
|
||||
if (isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = ' ('.$usr['loginname'].')';
|
||||
$customerid = $usr['customerid'];
|
||||
} else {
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
$customerid = 0;
|
||||
$customerloginname = '';
|
||||
}
|
||||
if ($customerid != 0) {
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $customerid)).'" rel="external">';
|
||||
$by .= $customer.$customerloginname.'</a>';
|
||||
} else {
|
||||
$by = $customer;
|
||||
}
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
$message = $mainticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_main") . "\";");
|
||||
|
||||
$result_stmt = Database::prepare('
|
||||
SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = :cid'
|
||||
);
|
||||
$row = Database::pexecute_first($result_stmt, array('cid' => $mainticket->Get('category')));
|
||||
|
||||
$andere_stmt = Database::prepare('
|
||||
SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto` = :id'
|
||||
);
|
||||
Database::pexecute($andere_stmt, array('id' => $id));
|
||||
$numrows_andere = Database::num_rows();
|
||||
|
||||
while ($row2 = $andere_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$subticket = ticket::getInstanceOf($userinfo, (int)$row2['id']);
|
||||
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
||||
|
||||
if ($subticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $subticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :cid'
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array('cid' => $cid));
|
||||
|
||||
if (isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = ' ('.$usr['loginname'].')';
|
||||
$customerid = $usr['customerid'];
|
||||
} else {
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
$customerid = 0;
|
||||
$customerloginname = '';
|
||||
}
|
||||
if ($customerid != 0) {
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $customerid)).'" rel="external">';
|
||||
$by .= $customer.$customerloginname.'</a>';
|
||||
} else {
|
||||
$by = $customer;
|
||||
}
|
||||
}
|
||||
|
||||
$subject = $subticket->Get('subject');
|
||||
$message = $subticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$subject = $mainticket->Get('subject');
|
||||
$ticket_replies_count = $numrows_andere + 1;
|
||||
|
||||
// don't forget the main-ticket!
|
||||
eval("echo \"" . getTemplate("tickets/tickets_view") . "\";");
|
||||
|
||||
} elseif($action == 'delete'
|
||||
&& $id != 0
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted archived ticket '" . $mainticket->Get('subject') . "'");
|
||||
$mainticket->Delete();
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
standard_error('nocustomerforticket');
|
||||
}
|
||||
@@ -2,140 +2,47 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Morton Jonuschat <m.jonuschat@chrome-it.de>
|
||||
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if ($action == 'logout') {
|
||||
$logout_stmt = Database::prepare("
|
||||
DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :adminid
|
||||
AND `adminsession` = '1'"
|
||||
);
|
||||
Database::pexecute($logout_stmt, array('adminid' => $userinfo['adminid']));
|
||||
redirectTo('index.php');
|
||||
}
|
||||
use Froxlor\Traffic\Traffic;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
$months = array(
|
||||
'0' => 'empty',
|
||||
'1' => 'jan',
|
||||
'2' => 'feb',
|
||||
'3' => 'mar',
|
||||
'4' => 'apr',
|
||||
'5' => 'may',
|
||||
'6' => 'jun',
|
||||
'7' => 'jul',
|
||||
'8' => 'aug',
|
||||
'9' => 'sep',
|
||||
'10' => 'oct',
|
||||
'11' => 'nov',
|
||||
'12' => 'dec',
|
||||
);
|
||||
$range = Request::any('range', 'currentmonth');
|
||||
|
||||
if ($page == 'overview' || $page == 'customers') {
|
||||
|
||||
$customerview = 1;
|
||||
$stats_tables = '';
|
||||
$minyear_stmt = Database::query("SELECT `year` FROM `". TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");
|
||||
$minyear = $minyear_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!isset($minyear['year']) || $minyear['year'] == 0) {
|
||||
$maxyears = 0;
|
||||
} else {
|
||||
$maxyears = date("Y") - $minyear['year'];
|
||||
try {
|
||||
$context = Traffic::getCustomerStats($userinfo, $range);
|
||||
} catch (Exception $e) {
|
||||
if ($e->getCode() === 405) {
|
||||
Response::dynamicError(lng('traffic.nocustomers'));
|
||||
}
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
for ($years = 0; $years<=$maxyears; $years++) {
|
||||
|
||||
$overview['year'] = date("Y")-$years;
|
||||
$overview['type'] = $lng['traffic']['customer'];
|
||||
$domain_list = '';
|
||||
$totals = array(
|
||||
'jan' => 0,
|
||||
'feb' => 0,
|
||||
'mar' => 0,
|
||||
'apr' => 0,
|
||||
'may' => 0,
|
||||
'jun' => 0,
|
||||
'jul' => 0,
|
||||
'aug' => 0,
|
||||
'sep' => 0,
|
||||
'oct' => 0,
|
||||
'nov' => 0,
|
||||
'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']));
|
||||
|
||||
while($customer_name = $customer_name_list_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$virtual_host = array(
|
||||
'name' => ($customer_name['company'] == '' ? $customer_name['name'] . ", " . $customer_name['firstname'] : $customer_name['company']),
|
||||
'customerid' => $customer_name['customerid'],
|
||||
'jan' => '-',
|
||||
'feb' => '-',
|
||||
'mar' => '-',
|
||||
'apr' => '-',
|
||||
'may' => '-',
|
||||
'jun' => '-',
|
||||
'jul' => '-',
|
||||
'aug' => '-',
|
||||
'sep' => '-',
|
||||
'oct' => '-',
|
||||
'nov' => '-',
|
||||
'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']));
|
||||
|
||||
while ($traffic_month = $traffic_list_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$virtual_host[$months[(int)$traffic_month['month']]] = size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$totals[$months[(int)$traffic_month['month']]] += $traffic_month['traffic'];
|
||||
}
|
||||
eval("\$domain_list .= sprintf(\"%s\", \"" . getTemplate("traffic/index_table_row") . "\");");
|
||||
}
|
||||
// sum up totals
|
||||
$virtual_host = array(
|
||||
'name' => $lng['traffic']['months']['total'],
|
||||
);
|
||||
foreach ($totals as $month => $bytes) {
|
||||
$virtual_host[$month] = ($bytes == 0 ? '-' : size_readable($bytes, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s'));
|
||||
}
|
||||
$customerview = 0;
|
||||
eval("\$total_list = sprintf(\"%s\", \"" . getTemplate("traffic/index_table_row") . "\");");
|
||||
eval("\$stats_tables .= sprintf(\"%s\", \"" . getTemplate("traffic/index_table") . "\");");
|
||||
}
|
||||
eval("echo \"" . getTemplate("traffic/index") . "\";");
|
||||
// pass metrics to the view
|
||||
UI::view('user/traffic.html.twig', $context);
|
||||
}
|
||||
|
||||
@@ -4,118 +4,113 @@
|
||||
* 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
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Cron\TaskId;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Install\Preconfig;
|
||||
use Froxlor\Install\Update;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\System\Cronjob;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\User;
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
||||
|
||||
/**
|
||||
* this is a dirty hack but syscp 1.4.2.1 does not
|
||||
* have any version/dbversion in the database (don't know why)
|
||||
* so we have to set them both to run a correct upgrade
|
||||
*/
|
||||
if (!isFroxlor()) {
|
||||
if (Settings::Get('panel.version') == null
|
||||
|| Settings::Get('panel.version') == ''
|
||||
) {
|
||||
Settings::Set('panel.version', '1.4.2.1');
|
||||
}
|
||||
if (Settings::Get('system.dbversion') == null
|
||||
|| Settings::Get('system.dbversion') == ''
|
||||
) {
|
||||
/**
|
||||
* for syscp-stable (1.4.2.1) this value has to be 0
|
||||
* so the required table-fields are added correctly
|
||||
* and the svn-version has its value in the database
|
||||
* -> bug #54
|
||||
*/
|
||||
$result_stmt = Database::query("
|
||||
SELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'"
|
||||
);
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($result['value'])) {
|
||||
Settings::Set('system.dbversion', (int)$result['value'], false);
|
||||
} else {
|
||||
Settings::Set('system.dbversion', 0, false);
|
||||
}
|
||||
}
|
||||
if (!Froxlor::isFroxlor()) {
|
||||
throw new Exception('SysCP/customized upgrades are not supported');
|
||||
}
|
||||
|
||||
if (hasDbUpdates($dbversion) || hasUpdates($version)) {
|
||||
if (Froxlor::hasDbUpdates() || Froxlor::hasUpdates()) {
|
||||
$successful_update = false;
|
||||
$message = '';
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if ((isset($_POST['update_preconfig'])
|
||||
&& isset($_POST['update_changesagreed'])
|
||||
&& intval($_POST['update_changesagreed']) != 0)
|
||||
|| !isset($_POST['update_preconfig'])
|
||||
) {
|
||||
eval("echo \"" . getTemplate('update/update_start') . "\";");
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
if ((isset($_POST['update_preconfig']) && isset($_POST['update_changesagreed']) && intval($_POST['update_changesagreed']) != 0) || !isset($_POST['update_preconfig'])) {
|
||||
include_once Froxlor::getInstallDir() . 'install/updatesql.php';
|
||||
|
||||
include_once './install/updatesql.php';
|
||||
User::updateCounters();
|
||||
Cronjob::inserttask(TaskId::REBUILD_VHOST);
|
||||
@chmod(Froxlor::getInstallDir() . '/lib/userdata.inc.php', 0400);
|
||||
|
||||
$redirect_url = 'admin_index.php?s=' . $s;
|
||||
eval("echo \"" . getTemplate('update/update_end') . "\";");
|
||||
|
||||
updateCounters();
|
||||
inserttask('1');
|
||||
@chmod('./lib/userdata.inc.php', 0440);
|
||||
|
||||
$successful_update = true;
|
||||
UI::view('install/update.html.twig', [
|
||||
'checks' => Update::getUpdateTasks()
|
||||
]);
|
||||
exit;
|
||||
} else {
|
||||
$message = '<br /><strong class="red">You have to agree that you have read the update notifications.</strong>';
|
||||
$message = '<br><br><strong>You have to agree that you have read the update notifications.</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$successful_update) {
|
||||
$current_version = Settings::Get('panel.version');
|
||||
$current_db_version = Settings::Get('panel.db_version');
|
||||
if (empty($current_db_version)) {
|
||||
$current_db_version = "0";
|
||||
}
|
||||
$new_version = $version;
|
||||
$new_db_version = $dbversion;
|
||||
|
||||
$ui_text = $lng['update']['update_information']['part_a'];
|
||||
if ($version != $current_version) {
|
||||
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
||||
} else {
|
||||
// show db version
|
||||
$ui_text = str_replace('%curversion', $current_db_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_db_version, $ui_text);
|
||||
}
|
||||
$update_information = $ui_text;
|
||||
|
||||
include_once './install/updates/preconfig.php';
|
||||
$preconfig = getPreConfig($current_version, $current_db_version);
|
||||
if ($preconfig != '') {
|
||||
$update_information .= '<br />' . $preconfig . $message;
|
||||
}
|
||||
|
||||
$update_information .= $lng['update']['update_information']['part_b'];
|
||||
|
||||
eval("echo \"" . getTemplate('update/index') . "\";");
|
||||
$current_version = Settings::Get('panel.version');
|
||||
$current_db_version = Settings::Get('panel.db_version');
|
||||
if (empty($current_db_version)) {
|
||||
$current_db_version = "0";
|
||||
}
|
||||
$new_version = Froxlor::VERSION;
|
||||
$new_db_version = Froxlor::DBVERSION;
|
||||
|
||||
if (Froxlor::VERSION != $current_version) {
|
||||
$replacer_currentversion = $current_version;
|
||||
$replacer_newversion = $new_version;
|
||||
} else {
|
||||
// show db version
|
||||
$replacer_currentversion = $current_db_version;
|
||||
$replacer_newversion = $new_db_version;
|
||||
}
|
||||
$ui_text = lng('update.update_information.part_a', [$replacer_newversion, $replacer_currentversion]);
|
||||
$ui_text .= lng('update.update_information.part_b');
|
||||
|
||||
$upd_formfield = [
|
||||
'updates' => [
|
||||
'title' => lng('update.update'),
|
||||
'image' => 'fa-solid fa-download',
|
||||
'description' => lng('update.description'),
|
||||
'sections' => [],
|
||||
'buttons' => [
|
||||
[
|
||||
'label' => lng('update.proceed')
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
$preconfig = Preconfig::getPreConfig();
|
||||
if (!empty($preconfig)) {
|
||||
$upd_formfield['updates']['sections'] = $preconfig;
|
||||
}
|
||||
|
||||
UI::view('user/form-note.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'updates']),
|
||||
'formdata' => $upd_formfield['updates'],
|
||||
// alert
|
||||
'type' => !empty($message) ? 'danger' : 'info',
|
||||
'alert_msg' => $ui_text . $message
|
||||
]);
|
||||
} else {
|
||||
$success_message = $lng['update']['noupdatesavail'];
|
||||
$redirect_url = 'admin_index.php?s=' . $s;
|
||||
eval("echo \"" . getTemplate('update/noupdatesavail') . "\";");
|
||||
Response::standardSuccess('update.noupdatesavail', Settings::Get('system.update_channel') == 'testing' ? lng('serversettings.uc_testing') . ' ' : '');
|
||||
}
|
||||
}
|
||||
|
||||
44
api.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
use Froxlor\Api\Api;
|
||||
use Froxlor\Api\Response;
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
require __DIR__ . '/lib/functions.php';
|
||||
require __DIR__ . '/lib/tables.inc.php';
|
||||
|
||||
// set error-handler
|
||||
@set_error_handler([
|
||||
'\\Froxlor\\Api\\Api',
|
||||
'phpErrHandler'
|
||||
]);
|
||||
|
||||
// Return response
|
||||
try {
|
||||
echo (new Api)->formatMiddleware(@file_get_contents('php://input'))->handle();
|
||||
} catch (Exception $e) {
|
||||
echo Response::jsonErrorResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
186
api_keys.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
if (!defined('AREA')) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// redirect if this customer has no permission for API usage
|
||||
if ($userinfo['adminsession'] == 0 && $userinfo['api_allowed'] == 0) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
// redirect if this admin has no permission for API usage
|
||||
if ($userinfo['adminsession'] == 1 && $userinfo['api_allowed'] == 0) {
|
||||
Response::redirectTo('admin_index.php');
|
||||
}
|
||||
|
||||
// This file is being included in admin_index and customer_index
|
||||
// and therefore does not need to require lib/init.php
|
||||
|
||||
$del_stmt = Database::prepare("DELETE FROM `" . TABLE_API_KEYS . "` WHERE id = :id");
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
// do the delete and then just show a success-message and the apikeys list again
|
||||
if ($action == 'delete' && $id > 0) {
|
||||
HTML::askYesNo('apikey_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => 'deletesure'
|
||||
], '', [
|
||||
'section' => 'index',
|
||||
'page' => $page
|
||||
]);
|
||||
} elseif (isset($_POST['send']) && $_POST['send'] == 'send' && $action == 'deletesure' && $id > 0) {
|
||||
$chk = (AREA == 'admin' && $userinfo['customers_see_all'] == '1') ? true : false;
|
||||
if (AREA == 'customer') {
|
||||
$chk_stmt = Database::prepare("
|
||||
SELECT c.customerid FROM `" . TABLE_PANEL_CUSTOMERS . "` c
|
||||
LEFT JOIN `" . TABLE_API_KEYS . "` ak ON ak.customerid = c.customerid
|
||||
WHERE ak.`id` = :id AND c.`customerid` = :cid
|
||||
");
|
||||
$chk = Database::pexecute_first($chk_stmt, [
|
||||
'id' => $id,
|
||||
'cid' => $userinfo['customerid']
|
||||
]);
|
||||
} elseif (AREA == 'admin' && $userinfo['customers_see_all'] == '0') {
|
||||
$chk_stmt = Database::prepare("
|
||||
SELECT a.adminid FROM `" . TABLE_PANEL_ADMINS . "` a
|
||||
LEFT JOIN `" . TABLE_API_KEYS . "` ak ON ak.adminid = a.adminid
|
||||
WHERE ak.`id` = :id AND a.`adminid` = :aid
|
||||
");
|
||||
$chk = Database::pexecute_first($chk_stmt, [
|
||||
'id' => $id,
|
||||
'aid' => $userinfo['adminid']
|
||||
]);
|
||||
}
|
||||
if ($chk !== false) {
|
||||
Database::pexecute($del_stmt, [
|
||||
'id' => $id
|
||||
]);
|
||||
Response::standardSuccess('apikeys.apikey_removed', $id, [
|
||||
'filename' => $filename,
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_API_KEYS . "` SET
|
||||
`apikey` = :key, `secret` = :secret, `adminid` = :aid, `customerid` = :cid, `valid_until` = '-1', `allowed_from` = ''
|
||||
");
|
||||
// customer generates for himself, admins will see a customer-select-box later
|
||||
if (AREA == 'admin') {
|
||||
$cid = 0;
|
||||
} elseif (AREA == 'customer') {
|
||||
$cid = $userinfo['customerid'];
|
||||
}
|
||||
$key = hash('sha256', openssl_random_pseudo_bytes(64 * 64));
|
||||
$secret = hash('sha512', openssl_random_pseudo_bytes(64 * 64 * 4));
|
||||
Database::pexecute($ins_stmt, [
|
||||
'key' => $key,
|
||||
'secret' => $secret,
|
||||
'aid' => $userinfo['adminid'],
|
||||
'cid' => $cid
|
||||
]);
|
||||
Response::standardSuccess('apikeys.apikey_added', '', [
|
||||
'filename' => $filename,
|
||||
'page' => $page
|
||||
]);
|
||||
}
|
||||
HTML::askYesNo('apikey_reallyadd', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], '', [
|
||||
'section' => 'index',
|
||||
'page' => $page
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed api::api_keys");
|
||||
|
||||
// select all my (accessible) api-keys
|
||||
$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`
|
||||
LEFT JOIN `" . TABLE_PANEL_ADMINS . "` a ON `a`.`adminid` = `ak`.`adminid`
|
||||
WHERE ";
|
||||
|
||||
$qry_params = [];
|
||||
if (AREA == 'admin' && $userinfo['customers_see_all'] == '0') {
|
||||
// admin with only customer-specific permissions
|
||||
$keys_stmt_query .= "ak.adminid = :adminid ";
|
||||
$qry_params['adminid'] = $userinfo['adminid'];
|
||||
$fields = [
|
||||
'a.loginname' => lng('login.username')
|
||||
];
|
||||
} elseif (AREA == 'customer') {
|
||||
// customer-area
|
||||
$keys_stmt_query .= "ak.customerid = :cid ";
|
||||
$qry_params['cid'] = $userinfo['customerid'];
|
||||
$fields = [
|
||||
'c.loginname' => lng('login.username')
|
||||
];
|
||||
} else {
|
||||
// admin who can see all customers / reseller / admins
|
||||
$keys_stmt_query .= "1 ";
|
||||
$fields = [
|
||||
'a.loginname' => lng('login.username')
|
||||
];
|
||||
}
|
||||
|
||||
//$keys_stmt_query .= $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit();
|
||||
|
||||
$keys_stmt = Database::prepare($keys_stmt_query);
|
||||
Database::pexecute($keys_stmt, $qry_params);
|
||||
$all_keys = $keys_stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$apikeys_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/tablelisting.apikeys.php';
|
||||
$collection = [
|
||||
'data' => $all_keys,
|
||||
'pagination' => []
|
||||
];
|
||||
|
||||
$tpl = 'user/table.html.twig';
|
||||
|
||||
UI::view($tpl, [
|
||||
'listing' => Listing::formatFromArray($collection, $apikeys_list_data['apikeys_list'], 'apikeys_list'),
|
||||
'actions_links' => (int)$userinfo['api_allowed'] == 1 ? [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'index', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('apikeys.key_add')
|
||||
]
|
||||
] : null,
|
||||
]);
|
||||
66
bin/froxlor-cli
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Froxlor\Cli\ConfigDiff;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Froxlor\Cli\RunApiCommand;
|
||||
use Froxlor\Cli\ConfigServices;
|
||||
use Froxlor\Cli\PhpSessionclean;
|
||||
use Froxlor\Cli\SwitchServerIp;
|
||||
use Froxlor\Cli\UpdateCommand;
|
||||
use Froxlor\Cli\InstallCommand;
|
||||
use Froxlor\Cli\MasterCron;
|
||||
use Froxlor\Cli\UserCommand;
|
||||
use Froxlor\Cli\ValidateAcmeWebroot;
|
||||
use Froxlor\Froxlor;
|
||||
|
||||
// validate correct php version
|
||||
if (version_compare("7.4.0", PHP_VERSION, ">=")) {
|
||||
die('Froxlor requires at least php-7.4. Please validate that your php-cli version is suitable.');
|
||||
}
|
||||
|
||||
// ensure that default timezone is set
|
||||
if (function_exists("date_default_timezone_set") && function_exists("date_default_timezone_get")) {
|
||||
@date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
require dirname(__DIR__) . '/lib/tables.inc.php';
|
||||
|
||||
$application = new Application('froxlor-cli', Froxlor::getFullVersion());
|
||||
$application->add(new RunApiCommand());
|
||||
$application->add(new ConfigServices());
|
||||
$application->add(new PhpSessionclean());
|
||||
$application->add(new SwitchServerIp());
|
||||
$application->add(new UpdateCommand());
|
||||
$application->add(new InstallCommand());
|
||||
$application->add(new MasterCron());
|
||||
$application->add(new UserCommand());
|
||||
$application->add(new ValidateAcmeWebroot());
|
||||
$application->add(new ConfigDiff());
|
||||
$application->run();
|
||||
278
build.xml
Normal file
@@ -0,0 +1,278 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project name="froxlor" default="build">
|
||||
|
||||
<!-- Use this when the tools are managed by Composer in ${basedir}/vendor/bin -->
|
||||
<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="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,-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,-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,-check-failure"
|
||||
description="Performs a lint check and runs the tests (without generating code coverage reports)" />
|
||||
|
||||
<target name="static-analysis"
|
||||
depends="composer,lint,phploc-ci,pdepend,phpmd-ci,phpcs-ci,phpcompat-ci,phpcpd-ci"
|
||||
description="Performs static analysis" />
|
||||
|
||||
<!-- Adjust the threadCount attribute's value to the number of CPUs -->
|
||||
<target name="static-analysis-parallel"
|
||||
description="Performs static analysis (executing the tools in parallel)">
|
||||
<parallel threadCount="2">
|
||||
<sequential>
|
||||
<antcall target="pdepend" />
|
||||
<antcall target="phpmd-ci" />
|
||||
</sequential>
|
||||
<antcall target="lint" />
|
||||
<antcall target="phpcpd-ci" />
|
||||
<antcall target="phpcs-ci" />
|
||||
<antcall target="phpcompat-ci" />
|
||||
<antcall target="phploc-ci" />
|
||||
</parallel>
|
||||
</target>
|
||||
|
||||
<target name="clean" unless="clean.done"
|
||||
description="Cleanup build artifacts">
|
||||
<delete dir="${basedir}/build/api" />
|
||||
<delete dir="${basedir}/build/coverage" />
|
||||
<delete dir="${basedir}/build/logs" />
|
||||
<delete dir="${basedir}/build/pdepend" />
|
||||
<property name="clean.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="prepare" unless="prepare.done" depends="clean"
|
||||
description="Prepare for build">
|
||||
<mkdir dir="${basedir}/build/api" />
|
||||
<mkdir dir="${basedir}/build/coverage" />
|
||||
<mkdir dir="${basedir}/build/logs" />
|
||||
<mkdir dir="${basedir}/build/pdepend" />
|
||||
|
||||
<property name="prepare.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="composer"
|
||||
description="Installing composer dependencies" depends="prepare">
|
||||
<exec executable="composer" failonerror="true">
|
||||
<arg value="install" />
|
||||
<arg value="--prefer-dist" />
|
||||
<arg value="--no-progress" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="lint" unless="lint.done"
|
||||
description="Perform syntax check of sourcecode files">
|
||||
<apply executable="php" taskname="lint">
|
||||
<arg value="-l" />
|
||||
|
||||
<fileset dir="${basedir}/lib/Froxlor">
|
||||
<include name="**/*.php" />
|
||||
<modified />
|
||||
</fileset>
|
||||
|
||||
<fileset dir="${basedir}/tests">
|
||||
<include name="**/*.php" />
|
||||
<modified />
|
||||
</fileset>
|
||||
</apply>
|
||||
|
||||
<property name="lint.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phploc" unless="phploc.done"
|
||||
description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
|
||||
<exec executable="${phploc}" taskname="phploc">
|
||||
<arg value="--count-tests" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg path="${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phploc.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phploc-ci" unless="phploc.done" depends="prepare"
|
||||
description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${phploc}" taskname="phploc">
|
||||
<arg value="--count-tests" />
|
||||
<arg value="--log-csv" />
|
||||
<arg path="${basedir}/build/logs/phploc.csv" />
|
||||
<arg value="--log-xml" />
|
||||
<arg path="${basedir}/build/logs/phploc.xml" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg path="${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phploc.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="pdepend" unless="pdepend.done" depends="prepare"
|
||||
description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${pdepend}" taskname="pdepend">
|
||||
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
|
||||
<arg
|
||||
value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
|
||||
<arg
|
||||
value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
</exec>
|
||||
|
||||
<property name="pdepend.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpmd" unless="phpmd.done"
|
||||
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
|
||||
<exec executable="${phpmd}" taskname="phpmd">
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg value="text" />
|
||||
<arg path="${basedir}/phpmd.xml" />
|
||||
</exec>
|
||||
|
||||
<property name="phpmd.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpmd-ci" unless="phpmd.done" depends="prepare"
|
||||
description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${phpmd}" taskname="phpmd">
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg value="xml" />
|
||||
<arg path="${basedir}/phpmd.xml" />
|
||||
<arg value="--reportfile" />
|
||||
<arg path="${basedir}/build/logs/pmd.xml" />
|
||||
</exec>
|
||||
|
||||
<property name="phpmd.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcs" unless="phpcs.done"
|
||||
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
|
||||
<exec executable="${phpcs}" taskname="phpcs">
|
||||
<arg value="--standard=${basedir}/phpcs.xml" />
|
||||
<arg value="--extensions=php" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg path="${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcs.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcs-ci" unless="phpcs.done" depends="prepare"
|
||||
description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${phpcs}" output="/dev/null" taskname="phpcs">
|
||||
<arg value="--report=checkstyle" />
|
||||
<arg
|
||||
value="--report-file=${basedir}/build/logs/checkstyle-standard.xml" />
|
||||
<arg value="--standard=${basedir}/phpcs.xml" />
|
||||
<arg value="--extensions=php" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
<arg path="${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcs.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcompat" unless="phpcompat.done"
|
||||
depends="composer"
|
||||
description="Find php violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
|
||||
<exec executable="${phpcs}" taskname="phpcompat">
|
||||
<arg
|
||||
line="--standard=PHPCompatibility --runtime-set testVersion 5.6 ${basedir}/lib/Froxlor ${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcompat.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcompat-ci" unless="phpcompat.done"
|
||||
depends="composer"
|
||||
description="Find php violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${phpcs}" output="/dev/null"
|
||||
taskname="phpcompat">
|
||||
<arg
|
||||
line="--standard=PHPCompatibility --runtime-set testVersion 5.6 --report=checkstyle --report-file=${basedir}/build/logs/checkstyle-compat.xml ${basedir}/lib/Froxlor ${basedir}/tests" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcompat.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcpd" unless="phpcpd.done"
|
||||
description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
|
||||
<exec executable="${phpcpd}" taskname="phpcpd">
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcpd.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpcpd-ci" unless="phpcpd.done" depends="prepare"
|
||||
description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
|
||||
<exec executable="${phpcpd}" taskname="phpcpd">
|
||||
<arg value="--log-pmd" />
|
||||
<arg path="${basedir}/build/logs/pmd-cpd.xml" />
|
||||
<arg path="${basedir}/lib/Froxlor" />
|
||||
</exec>
|
||||
|
||||
<property name="phpcpd.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpunit-prepare" unless="phpunit-prepare.done" depends="composer"
|
||||
description="prepare xdebug unit tests">
|
||||
<exec executable="${phpunit}" resultproperty="result.phpunit-prepare"
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--dump-xdebug-filter" />
|
||||
<arg path="${basedir}/tests/xdebug-filter.php" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit-prepare.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpunit" unless="phpunit.done" depends="phpunit-prepare"
|
||||
description="Run unit tests with PHPUnit">
|
||||
<exec executable="${phpunit}" failonerror="true" resultproperty="result.phpunit"
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--testsuite" />
|
||||
<arg value="froxlor" />
|
||||
<arg value="--prepend" />
|
||||
<arg path="${basedir}/tests/xdebug-filter.php" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit.done" value="true" />
|
||||
</target>
|
||||
|
||||
<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" resultproperty="result.phpunit"
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--testsuite" />
|
||||
<arg value="froxlor" />
|
||||
<arg value="--no-coverage" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="-check-failure">
|
||||
<fail message="PHPUnit did not finish successfully">
|
||||
<condition>
|
||||
<not>
|
||||
<equals arg1="${result.phpunit}" arg2="0" />
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
</project>
|
||||
2
cache/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!.gitignore
|
||||
*
|
||||
88
composer.json
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "froxlor/froxlor",
|
||||
"description": "The server administration software for your needs. Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.",
|
||||
"keywords": [
|
||||
"server",
|
||||
"administration",
|
||||
"php"
|
||||
],
|
||||
"homepage": "https://www.froxlor.org",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Kaufmann",
|
||||
"email": "team@froxlor.org",
|
||||
"role": "Lead Developer"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "team@froxlor.org",
|
||||
"issues": "https://github.com/Froxlor/Froxlor/issues",
|
||||
"forum": "https://forum.froxlor.org/",
|
||||
"source": "https://github.com/Froxlor/Froxlor",
|
||||
"docs": "https://docs.froxlor.org/",
|
||||
"chat": "https://discord.froxlor.org/"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/d00p"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"ext-session": "*",
|
||||
"ext-ctype": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-pdo_mysql": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-filter": "*",
|
||||
"ext-posix": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"ext-gmp": "*",
|
||||
"ext-gd": "*",
|
||||
"phpmailer/phpmailer": "~6.0",
|
||||
"monolog/monolog": "^1.24",
|
||||
"robthree/twofactorauth": "^1.6",
|
||||
"froxlor/idna-convert-legacy": "^2.1",
|
||||
"voku/anti-xss": "^4.1",
|
||||
"twig/twig": "^3.3",
|
||||
"erusev/parsedown": "^1.7",
|
||||
"symfony/console": "^5.4",
|
||||
"pear/net_dns2": "^1.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9",
|
||||
"ext-pcntl": "*",
|
||||
"phpcompatibility/php-compatibility": "*",
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"pdepend/pdepend": "^2.9",
|
||||
"sebastian/phpcpd": "^6.0",
|
||||
"phploc/phploc": "^7.0",
|
||||
"phpmd/phpmd": "^2.10",
|
||||
"phpunit/php-timer" : "^5",
|
||||
"phpstan/phpstan": "^1.8"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "*",
|
||||
"ext-zip": "*",
|
||||
"ext-apcu": "*",
|
||||
"ext-readline": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Froxlor\\": [
|
||||
"lib/Froxlor"
|
||||
]
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": "if [ -f ./vendor/bin/phpcs ]; then \"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility ; fi",
|
||||
"post-update-cmd" : "if [ -f ./vendor/bin/phpcs ]; then \"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility ; fi"
|
||||
}
|
||||
}
|
||||
4476
composer.lock
generated
Normal file
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 369 B |
|
Before Width: | Height: | Size: 387 B |
|
Before Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 287 B |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
7
css/jquery-ui.min.css
vendored
1029
customer_domains.php
1258
customer_email.php
@@ -2,592 +2,343 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\CustomerBackups as CustomerBackups;
|
||||
use Froxlor\Api\Commands\DirOptions as DirOptions;
|
||||
use Froxlor\Api\Commands\DirProtections as DirProtections;
|
||||
use Froxlor\Customer\Customer;
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras");
|
||||
eval("echo \"" . getTemplate("extras/extras") . "\";");
|
||||
} elseif ($page == 'htpasswds') {
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if ($page == 'overview' || $page == 'htpasswds') {
|
||||
// redirect if this customer sub-page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras.directoryprotection')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htpasswds");
|
||||
$fields = array(
|
||||
'username' => $lng['login']['username'],
|
||||
'path' => $lng['panel']['path']
|
||||
);
|
||||
$paging = new 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());
|
||||
$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'] = makeCorrectDir($row['path']);
|
||||
$row = htmlentities_array($row);
|
||||
eval("\$htpasswds.=\"" . getTemplate("extras/htpasswds_htpasswd") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_extras::htpasswds");
|
||||
$fields = [
|
||||
'username' => lng('login.username'),
|
||||
'path' => lng('panel.path')
|
||||
];
|
||||
try {
|
||||
$htpasswd_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.htpasswd.php';
|
||||
$collection = (new Collection(DirProtections::class, $userinfo))
|
||||
->withPagination($htpasswd_list_data['htpasswd_list']['columns'], $htpasswd_list_data['htpasswd_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htpasswds") . "\";");
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $htpasswd_list_data, 'htpasswd_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'extras', 'page' => 'htpasswds', 'action' => 'add']),
|
||||
'label' => lng('extras.directoryprotection_add')
|
||||
]
|
||||
],
|
||||
'entity_info' => lng('extras.description')
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = DirProtections::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['username']) && $result['username'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id");
|
||||
Database::pexecute($stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
try {
|
||||
DirProtections::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
ask_yesno('extras_reallydelete', $filename, array(
|
||||
HTML::askYesNo('extras_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $result['username'] . ' (' . $result['path'] . ')');
|
||||
], $result['username'] . ' (' . $result['path'] . ')');
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$path = makeCorrectDir(validate($_POST['path'], 'path'));
|
||||
$userpath = $path;
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
$username = validate($_POST['username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
|
||||
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
|
||||
validate($_POST['directory_password'], 'password');
|
||||
|
||||
$username_path_check_stmt = Database::prepare("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `username`= :username
|
||||
AND `path`= :path
|
||||
AND `customerid`= :customerid");
|
||||
$params = array(
|
||||
"username" => $username,
|
||||
"path" => $path,
|
||||
"customerid" => $userinfo['customerid']
|
||||
);
|
||||
Database::pexecute($username_path_check_stmt, $params);
|
||||
$username_path_check = $username_path_check_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (CRYPT_STD_DES == 1) {
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
$password = crypt($_POST['directory_password'], $saltfordescrypt);
|
||||
} else {
|
||||
$password = crypt($_POST['directory_password']);
|
||||
}
|
||||
|
||||
if (! $_POST['path']) {
|
||||
standard_error('invalidpath');
|
||||
}
|
||||
|
||||
if ($username == '') {
|
||||
standard_error(array(
|
||||
'stringisempty',
|
||||
'myloginname'
|
||||
));
|
||||
} elseif ($username_path_check['username'] == $username && $username_path_check['path'] == $path) {
|
||||
standard_error('userpathcombinationdupe');
|
||||
} elseif ($_POST['directory_password'] == '') {
|
||||
standard_error(array(
|
||||
'stringisempty',
|
||||
'mypassword'
|
||||
));
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
} elseif ($_POST['directory_password'] == $username) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
} else {
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` SET
|
||||
`customerid` = :customerid,
|
||||
`username` = :username,
|
||||
`password` = :password,
|
||||
`path` = :path,
|
||||
`authname` = :authname");
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $username,
|
||||
"password" => $password,
|
||||
"path" => $path,
|
||||
"authname" => $authname
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added htpasswd for '" . $username . " (" . $path . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
try {
|
||||
DirProtections::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$pathSelect = FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
|
||||
$htpasswd_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htpasswd_add.php';
|
||||
$htpasswd_add_form = htmlform::genHTMLForm($htpasswd_add_data);
|
||||
|
||||
$title = $htpasswd_add_data['htpasswd_add']['title'];
|
||||
$image = $htpasswd_add_data['htpasswd_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htpasswds_add") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'extras']),
|
||||
'formdata' => $htpasswd_add_data['htpasswd_add']
|
||||
]);
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = DirProtections::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['username']) && $result['username'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
validate($_POST['directory_password'], 'password');
|
||||
$authname = validate($_POST['directory_authname'], 'directory_authname', '/^[a-zA-Z0-9][a-zA-Z0-9\-_ ]+\$?$/');
|
||||
|
||||
if (CRYPT_STD_DES == 1) {
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
$password = crypt($_POST['directory_password'], $saltfordescrypt);
|
||||
} else {
|
||||
$password = crypt($_POST['directory_password']);
|
||||
}
|
||||
|
||||
if ($_POST['directory_password'] == $result['username']) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
);
|
||||
|
||||
$pwd_sql = '';
|
||||
if ($_POST['directory_password'] != '') {
|
||||
$pwd_sql = "`password`= :password ";
|
||||
$params["password"] = $password;
|
||||
}
|
||||
|
||||
$auth_sql = '';
|
||||
if ($authname != $result['authname']) {
|
||||
$auth_sql = "`authname`= :authname ";
|
||||
$params["authname"] = $authname;
|
||||
}
|
||||
|
||||
if ($pwd_sql != '' || $auth_sql != '') {
|
||||
if ($pwd_sql != '' && $auth_sql != '') {
|
||||
$pwd_sql .= ', ';
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
SET " . $pwd_sql . $auth_sql . "
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id");
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
try {
|
||||
DirProtections::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$htpasswd_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htpasswd_edit.php';
|
||||
$htpasswd_edit_form = htmlform::genHTMLForm($htpasswd_edit_data);
|
||||
|
||||
$title = $htpasswd_edit_data['htpasswd_edit']['title'];
|
||||
$image = $htpasswd_edit_data['htpasswd_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htpasswds_edit") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'extras', 'id' => $id]),
|
||||
'formdata' => $htpasswd_edit_data['htpasswd_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($page == 'htaccess') {
|
||||
// redirect if this customer sub-page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras.pathoptions')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
|
||||
$fields = array(
|
||||
'path' => $lng['panel']['path'],
|
||||
'options_indexes' => $lng['extras']['view_directory'],
|
||||
'error404path' => $lng['extras']['error404path'],
|
||||
'error403path' => $lng['extras']['error403path'],
|
||||
'error500path' => $lng['extras']['error500path'],
|
||||
'options_cgi' => $lng['extras']['execute_perl']
|
||||
);
|
||||
$paging = new 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());
|
||||
$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 = '';
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
|
||||
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
$cperlenabled = 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'] = 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 = htmlentities_array($row);
|
||||
eval("\$htaccess.=\"" . getTemplate("extras/htaccess_htaccess") . "\";");
|
||||
$count ++;
|
||||
}
|
||||
|
||||
$i ++;
|
||||
try {
|
||||
$htaccess_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.htaccess.php';
|
||||
$collection = (new Collection(DirOptions::class, $userinfo))
|
||||
->withPagination($htaccess_list_data['htaccess_list']['columns'], $htaccess_list_data['htaccess_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htaccess") . "\";");
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $htaccess_list_data, 'htaccess_list'),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'extras', 'page' => 'htaccess', 'action' => 'add']),
|
||||
'label' => lng('extras.pathoptions_add')
|
||||
]
|
||||
],
|
||||
'entity_info' => lng('extras.description')
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = DirOptions::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['customerid']) && $result['customerid'] != '' && $result['customerid'] == $userinfo['customerid']) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// do we have to remove the symlink and folder in suexecpath?
|
||||
if ((int) Settings::Get('perl.suexecworkaround') == 1) {
|
||||
$loginname = getCustomerDetail($result['customerid'], 'loginname');
|
||||
$suexecpath = makeCorrectDir(Settings::Get('perl.suexecpath') . '/' . $loginname . '/' . md5($result['path']) . '/');
|
||||
$perlsymlink = makeCorrectFile($result['path'] . '/cgi-bin');
|
||||
// remove symlink
|
||||
if (file_exists($perlsymlink)) {
|
||||
safe_exec('rm -f ' . escapeshellarg($perlsymlink));
|
||||
$log->logAction(USR_ACTION, LOG_DEBUG, "deleted suexecworkaround symlink '" . $perlsymlink . "'");
|
||||
}
|
||||
// remove folder in suexec-path
|
||||
if (file_exists($suexecpath)) {
|
||||
safe_exec('rm -rf ' . escapeshellarg($suexecpath));
|
||||
$log->logAction(USR_ACTION, LOG_DEBUG, "deleted suexecworkaround path '" . $suexecpath . "'");
|
||||
}
|
||||
try {
|
||||
DirOptions::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `id`= :id");
|
||||
Database::pexecute($stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htaccess for '" . str_replace($userinfo['documentroot'], '/', $result['path']) . "'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno('extras_reallydelete_pathoptions', $filename, array(
|
||||
HTML::askYesNo('extras_reallydelete_pathoptions', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), str_replace($userinfo['documentroot'], '/', $result['path']));
|
||||
], str_replace($userinfo['documentroot'], '/', $result['path']));
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$path = makeCorrectDir(validate($_POST['path'], 'path'));
|
||||
$userpath = $path;
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
$path_dupe_check_stmt = Database::prepare("SELECT `id`, `path` FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `path`= :path
|
||||
AND `customerid`= :customerid");
|
||||
Database::pexecute($path_dupe_check_stmt, array(
|
||||
"path" => $path,
|
||||
"customerid" => $userinfo['customerid']
|
||||
));
|
||||
$path_dupe_check = $path_dupe_check_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (! $_POST['path']) {
|
||||
standard_error('invalidpath');
|
||||
}
|
||||
|
||||
if (isset($_POST['options_cgi']) && (int) $_POST['options_cgi'] != 0) {
|
||||
$options_cgi = '1';
|
||||
} else {
|
||||
$options_cgi = '0';
|
||||
}
|
||||
|
||||
$error404path = '';
|
||||
if (isset($_POST['error404path'])) {
|
||||
$error404path = correctErrorDocument($_POST['error404path']);
|
||||
}
|
||||
|
||||
$error403path = '';
|
||||
if (isset($_POST['error403path'])) {
|
||||
$error403path = correctErrorDocument($_POST['error403path']);
|
||||
}
|
||||
|
||||
$error500path = '';
|
||||
if (isset($_POST['error500path'])) {
|
||||
$error500path = correctErrorDocument($_POST['error500path']);
|
||||
}
|
||||
|
||||
if ($path_dupe_check['path'] == $path) {
|
||||
standard_error('errordocpathdupe', $userpath);
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
} else {
|
||||
$stmt = Database::prepare('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` SET
|
||||
`customerid` = :customerid,
|
||||
`path` = :path,
|
||||
`options_indexes` = :options_indexes,
|
||||
`error404path` = :error404path,
|
||||
`error403path` = :error403path,
|
||||
`error500path` = :error500path,
|
||||
`options_cgi` = :options_cgi');
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"path" => $path,
|
||||
"options_indexes" => $_POST['options_indexes'] == '1' ? '1' : '0',
|
||||
"error403path" => $error403path,
|
||||
"error404path" => $error404path,
|
||||
"error500path" => $error500path,
|
||||
"options_cgi" => $options_cgi
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added htaccess for '" . $path . "'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
try {
|
||||
DirOptions::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
$pathSelect = FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$cperlenabled = Customer::customerHasPerlEnabled($userinfo['customerid']);
|
||||
|
||||
$htaccess_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htaccess_add.php';
|
||||
$htaccess_add_form = htmlform::genHTMLForm($htaccess_add_data);
|
||||
|
||||
$title = $htaccess_add_data['htaccess_add']['title'];
|
||||
$image = $htaccess_add_data['htaccess_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htaccess_add") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'extras']),
|
||||
'formdata' => $htaccess_add_data['htaccess_add']
|
||||
]);
|
||||
}
|
||||
} elseif (($action == 'edit') && ($id != 0)) {
|
||||
$result_stmt = Database::prepare("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id");
|
||||
Database::pexecute($result_stmt, array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = DirOptions::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if ((isset($result['customerid'])) && ($result['customerid'] != '') && ($result['customerid'] == $userinfo['customerid'])) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$option_indexes = intval($_POST['options_indexes']);
|
||||
$options_cgi = isset($_POST['options_cgi']) ? intval($_POST['options_cgi']) : 0;
|
||||
|
||||
if ($option_indexes != '1') {
|
||||
$option_indexes = '0';
|
||||
try {
|
||||
DirOptions::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($options_cgi != '1') {
|
||||
$options_cgi = '0';
|
||||
}
|
||||
|
||||
$error404path = correctErrorDocument($_POST['error404path']);
|
||||
$error403path = correctErrorDocument($_POST['error403path']);
|
||||
$error500path = correctErrorDocument($_POST['error500path']);
|
||||
|
||||
if (($option_indexes != $result['options_indexes']) || ($error404path != $result['error404path']) || ($error403path != $result['error403path']) || ($error500path != $result['error500path']) || ($options_cgi != $result['options_cgi'])) {
|
||||
inserttask('1');
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTACCESS . "`
|
||||
SET `options_indexes` = :options_indexes,
|
||||
`error404path` = :error404path,
|
||||
`error403path` = :error403path,
|
||||
`error500path` = :error500path,
|
||||
`options_cgi` = :options_cgi
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id");
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"options_indexes" => $_POST['options_indexes'] == '1' ? '1' : '0',
|
||||
"error403path" => $error403path,
|
||||
"error404path" => $error404path,
|
||||
"error500path" => $error500path,
|
||||
"options_cgi" => $options_cgi,
|
||||
"id" => $id
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '/', $result['path']) . "'");
|
||||
}
|
||||
|
||||
redirectTo($filename, array(
|
||||
'page' => $page,
|
||||
's' => $s
|
||||
));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
$cperlenabled = Customer::customerHasPerlEnabled($userinfo['customerid']);
|
||||
|
||||
$result['error404path'] = $result['error404path'];
|
||||
$result['error403path'] = $result['error403path'];
|
||||
$result['error500path'] = $result['error500path'];
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
/*
|
||||
* $options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
|
||||
* $options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
|
||||
*/
|
||||
$result = htmlentities_array($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$htaccess_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.htaccess_edit.php';
|
||||
$htaccess_edit_form = htmlform::genHTMLForm($htaccess_edit_data);
|
||||
|
||||
$title = $htaccess_edit_data['htaccess_edit']['title'];
|
||||
$image = $htaccess_edit_data['htaccess_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htaccess_edit") . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'extras', 'id' => $id]),
|
||||
'formdata' => $htaccess_edit_data['htaccess_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($page == 'backup') {
|
||||
// redirect if this customer sub-page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras.backup')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if (Settings::Get('system.backupenabled') == 1)
|
||||
{
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::backup");
|
||||
if (Settings::Get('system.backupenabled') == 1) {
|
||||
if ($action == 'abort') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "customer_extras::backup - aborted scheduled backupjob");
|
||||
try {
|
||||
CustomerBackups::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page,
|
||||
'action' => ''
|
||||
]);
|
||||
} else {
|
||||
HTML::askYesNo('extras_reallydelete_backup', $filename, [
|
||||
'backup_job_entry' => $id,
|
||||
'section' => 'extras',
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
]);
|
||||
}
|
||||
} elseif ($action == '') {
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_extras::backup");
|
||||
|
||||
// check whether there is a backup-job for this customer
|
||||
$sel_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_TASKS."` WHERE `type` = '20'");
|
||||
Database::pexecute($sel_stmt);
|
||||
while ($entry = $sel_stmt->fetch())
|
||||
{
|
||||
$data = unserialize($entry['data']);
|
||||
if ($data['customerid'] == $userinfo['customerid']) {
|
||||
standard_error('customerhasongoingbackupjob');
|
||||
}
|
||||
try {
|
||||
$backup_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.backups.php';
|
||||
$collection = (new Collection(CustomerBackups::class, $userinfo));
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
|
||||
if (! $_POST['path']) {
|
||||
standard_error('invalidpath');
|
||||
try {
|
||||
CustomerBackups::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$path = makeCorrectDir(validate($_POST['path'], 'path'));
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
$backup_dbs = isset($_POST['backup_dbs']) ? intval($_POST['backup_dbs']) : 0;
|
||||
$backup_mail = isset($_POST['backup_mail']) ? intval($_POST['backup_mail']) : 0;
|
||||
$backup_web = isset($_POST['backup_web']) ? intval($_POST['backup_web']) : 0;
|
||||
|
||||
if ($backup_dbs != '1') {
|
||||
$backup_dbs = '0';
|
||||
}
|
||||
|
||||
if ($backup_mail != '1') {
|
||||
$backup_mail = '0';
|
||||
}
|
||||
|
||||
if ($backup_web != '1') {
|
||||
$backup_web = '0';
|
||||
}
|
||||
|
||||
$task_data = array(
|
||||
'customerid' => $userinfo['customerid'],
|
||||
'uid' => $userinfo['guid'],
|
||||
'gid' => $userinfo['guid'],
|
||||
'loginname' => $userinfo['loginname'],
|
||||
'destdir' => $path,
|
||||
'backup_dbs' => $backup_dbs,
|
||||
'backup_mail' => $backup_mail,
|
||||
'backup_web' => $backup_web
|
||||
);
|
||||
// schedule backup job
|
||||
inserttask('20', $task_data);
|
||||
|
||||
standard_success('backupscheduled');
|
||||
Response::standardSuccess('backupscheduled');
|
||||
} else {
|
||||
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$pathSelect = FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$backup_data = include_once dirname(__FILE__) . '/lib/formfields/customer/extras/formfield.backup.php';
|
||||
$backup_form = htmlform::genHTMLForm($backup_data);
|
||||
$title = $backup_data['backup']['title'];
|
||||
$image = $backup_data['backup']['image'];
|
||||
eval("echo \"" . getTemplate("extras/backup") . "\";");
|
||||
|
||||
UI::view('user/form-datatable.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'extras']),
|
||||
'formdata' => $backup_data['backup'],
|
||||
'tabledata' => Listing::format($collection, $backup_list_data, 'backup_list'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error('backupfunctionnotenabled');
|
||||
} else {
|
||||
Response::standardError('backupfunctionnotenabled');
|
||||
}
|
||||
}
|
||||
|
||||
525
customer_ftp.php
@@ -2,447 +2,202 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
$id = 0;
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
use Froxlor\Api\Commands\Ftps as Ftps;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\CurrentUser;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'ftp')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp");
|
||||
eval("echo \"" . getTemplate('ftp/ftp') . "\";");
|
||||
} elseif ($page == 'accounts') {
|
||||
$id = (int)Request::any('id', 0);
|
||||
|
||||
if ($page == 'overview' || $page == 'accounts') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
|
||||
$fields = array(
|
||||
'username' => $lng['login']['username'],
|
||||
'homedir' => $lng['panel']['path'],
|
||||
'description' => $lng['panel']['ftpdesc']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_FTP_USERS, $fields);
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir` 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);
|
||||
$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'] = makeCorrectDir($row['documentroot']);
|
||||
|
||||
$row = htmlentities_array($row);
|
||||
eval("\$accounts.=\"" . getTemplate('ftp/accounts_account') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
|
||||
try {
|
||||
$ftp_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.ftps.php';
|
||||
$collection = (new Collection(Ftps::class, $userinfo))
|
||||
->withPagination($ftp_list_data['ftp_list']['columns'], $ftp_list_data['ftp_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('ftp/accounts') . "\";");
|
||||
$actions_links = false;
|
||||
if (CurrentUser::canAddResource('ftps')) {
|
||||
$actions_links = [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'ftp', 'page' => 'accounts', 'action' => 'add']),
|
||||
'label' => lng('ftp.account_add')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $ftp_list_data, 'ftp_list'),
|
||||
'actions_links' => $actions_links,
|
||||
'entity_info' => lng('ftp.description')
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `username`, `homedir`, `up_count`, `up_bytes`, `down_count`, `down_bytes` FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = Ftps::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['username']) && $result['username'] != $userinfo['loginname']) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `up_count` = `up_count` + :up_count,
|
||||
`up_bytes` = `up_bytes` + :up_bytes,
|
||||
`down_count` = `down_count` + :down_count,
|
||||
`down_bytes` = `down_bytes` + :down_bytes
|
||||
WHERE `username` = :username"
|
||||
);
|
||||
$params = array(
|
||||
"up_count" => $result['up_count'],
|
||||
"up_bytes" => $result['up_bytes'],
|
||||
"down_count" => $result['down_count'],
|
||||
"down_bytes" => $result['down_bytes'],
|
||||
"username" => $userinfo['loginname']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `username`, `homedir` FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = :name");
|
||||
Database::pexecute($stmt, array("name" => $result['username']));
|
||||
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
|
||||
$stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_FTP_GROUPS . "` SET
|
||||
`members` = REPLACE(`members`, :username,'')
|
||||
WHERE `customerid` = :customerid
|
||||
");
|
||||
Database::pexecute($stmt, array("username" => ",".$result['username'], "customerid" => $userinfo['customerid']));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
|
||||
|
||||
$resetaccnumber = ($userinfo['ftps_used'] == '1') ? " , `ftp_lastaccountnumber`='0'" : '';
|
||||
|
||||
// refs #293
|
||||
if (isset($_POST['delete_userfiles']) && (int)$_POST['delete_userfiles'] == 1) {
|
||||
inserttask('8', $userinfo['loginname'], $result['homedir']);
|
||||
try {
|
||||
Ftps::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `ftps_used` = `ftps_used` - 1 $resetaccnumber
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
|
||||
HTML::askYesNoWithCheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $result['username']);
|
||||
}
|
||||
} else {
|
||||
standard_error('ftp_cantdeletemainaccount');
|
||||
Response::standardError('ftp_cantdeletemainaccount');
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send') {
|
||||
$description = validate($_POST['ftp_description'], 'description');
|
||||
// @FIXME use a good path-validating regex here (refs #1231)
|
||||
$path = validate($_POST['path'], 'path');
|
||||
$password = validate($_POST['ftp_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
|
||||
$sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0;
|
||||
if ($sendinfomail != 1) {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$ftpusername = validate($_POST['ftp_username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
|
||||
if ($ftpusername == '') {
|
||||
standard_error(array('stringisempty', 'username'));
|
||||
}
|
||||
$ftpdomain = $idna_convert->encode(validate($_POST['ftp_domain'], 'domain'));
|
||||
$ftpdomain_check_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `domain` = :domain
|
||||
AND `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($ftpdomain_check_stmt, array("domain" => $ftpdomain, "customerid" => $userinfo['customerid']));
|
||||
$ftpdomain_check = $ftpdomain_check_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($ftpdomain_check['domain'] != $ftpdomain) {
|
||||
standard_error('maindomainnonexist', $domain);
|
||||
}
|
||||
$username = $ftpusername . "@" . $ftpdomain;
|
||||
} else {
|
||||
$username = $userinfo['loginname'] . Settings::Get('customer.ftpprefix') . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
}
|
||||
|
||||
$username_check_stmt = Database::prepare("SELECT * FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `username` = :username"
|
||||
);
|
||||
Database::pexecute($username_check_stmt, array("username" => $username));
|
||||
$username_check = $username_check_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!empty($username_check) && $username_check['username'] = $username) {
|
||||
standard_error('usernamealreadyexists', $username);
|
||||
} elseif ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
} elseif ($username == $password) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_FTP_USERS . "`
|
||||
(`customerid`, `username`, `description`, `password`, `homedir`, `login_enabled`, `uid`, `gid`)
|
||||
VALUES (:customerid, :username, :description, :password, :homedir, 'y', :guid, :guid)"
|
||||
);
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $username,
|
||||
"description" => $description,
|
||||
"password" => $cryptPassword,
|
||||
"homedir" => $path,
|
||||
"guid" => $userinfo['guid']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `bytes_in_used` FROM `" . TABLE_FTP_QUOTATALLIES . "`
|
||||
WHERE `name` = :name"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("name" => $userinfo['loginname']));
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_FTP_QUOTATALLIES . "`
|
||||
(`name`, `quota_type`, `bytes_in_used`, `bytes_out_used`, `bytes_xfer_used`, `files_in_used`, `files_out_used`, `files_xfer_used`)
|
||||
VALUES (:name, 'user', :bytes_in_used, '0', '0', '0', '0', '0')"
|
||||
);
|
||||
Database::pexecute($stmt, array("name" => $username, "bytes_in_used" => $row['bytes_in_used']));
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_GROUPS . "`
|
||||
SET `members` = CONCAT_WS(',',`members`, :username)
|
||||
WHERE `customerid`= :customerid
|
||||
AND `gid`= :guid"
|
||||
);
|
||||
$params = array(
|
||||
"username" => $username,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"guid" => $userinfo['guid']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `ftps_used` = `ftps_used` + 1,
|
||||
`ftp_lastaccountnumber` = `ftp_lastaccountnumber` + 1
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
|
||||
inserttask(5);
|
||||
|
||||
if ($sendinfomail == 1) {
|
||||
$replace_arr = array(
|
||||
'SALUTATION' => getCorrectUserSalutation($userinfo),
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||
'USR_NAME' => $username,
|
||||
'USR_PASS' => $password,
|
||||
'USR_PATH' => makeCorrectDir(str_replace($userinfo['documentroot'], "/", $path))
|
||||
);
|
||||
|
||||
$def_language = $userinfo['def_language'];
|
||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid
|
||||
AND `language` = :lang
|
||||
AND `templategroup`='mails'
|
||||
AND `varname`='new_ftpaccount_by_customer_subject'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['subject']), $replace_arr));
|
||||
|
||||
$def_language = $userinfo['def_language'];
|
||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid
|
||||
AND `language` = :lang
|
||||
AND `templategroup`='mails'
|
||||
AND `varname`='new_ftpaccount_by_customer_mailbody'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = $mail_subject;
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||
standard_error('errorsendingmail', $userinfo['email']);
|
||||
}
|
||||
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
Ftps::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
|
||||
$pathSelect = FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
|
||||
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domainlist = array();
|
||||
$domains = '';
|
||||
|
||||
$domainlist = [];
|
||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :customerid"
|
||||
);
|
||||
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid']));
|
||||
WHERE `customerid`= :customerid ORDER BY `domain` ASC");
|
||||
Database::pexecute($result_domains_stmt, [
|
||||
"customerid" => $userinfo['customerid']
|
||||
]);
|
||||
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domainlist[] = $row_domain['domain'];
|
||||
$domainlist[$row_domain['domain']] = $idna_convert->decode($row_domain['domain']);
|
||||
}
|
||||
}
|
||||
|
||||
sort($domainlist);
|
||||
|
||||
if (isset($domainlist[0]) && $domainlist[0] != '') {
|
||||
foreach ($domainlist as $dom) {
|
||||
$domains .= makeoption($idna_convert->decode($dom), $dom);
|
||||
if (Settings::Get('system.allow_customer_shell') == '1') {
|
||||
$shells['/bin/false'] = "/bin/false";
|
||||
$shells_avail = Settings::Get('system.available_shells');
|
||||
if (!empty($shells_avail)) {
|
||||
$shells_avail_arr = explode(",", $shells_avail);
|
||||
$shells_avail_arr = array_map("trim", $shells_avail_arr);
|
||||
foreach ($shells_avail_arr as $shell) {
|
||||
$shells[$shell] = $shell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
$ftp_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_add.php';
|
||||
|
||||
$ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php';
|
||||
$ftp_add_form = htmlform::genHTMLForm($ftp_add_data);
|
||||
|
||||
$title = $ftp_add_data['ftp_add']['title'];
|
||||
$image = $ftp_add_data['ftp_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('ftp/accounts_add') . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'ftp']),
|
||||
'formdata' => $ftp_add_data['ftp_add']
|
||||
]);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `username`, `description`, `homedir`, `uid`, `gid` FROM `" . TABLE_FTP_USERS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = Ftps::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['username']) && $result['username'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// @FIXME use a good path-validating regex here (refs #1231)
|
||||
$path = validate($_POST['path'], 'path');
|
||||
|
||||
$_setnewpass = false;
|
||||
if (isset($_POST['ftp_password']) && $_POST['ftp_password'] != '') {
|
||||
$password = validate($_POST['ftp_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
$_setnewpass = true;
|
||||
try {
|
||||
Ftps::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($_setnewpass) {
|
||||
if ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
} elseif ($result['username'] == $password) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $id, "password" => $cryptPassword));
|
||||
}
|
||||
|
||||
if ($path != '') {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
if ($path != $result['homedir']) {
|
||||
if (!file_exists($path)) {
|
||||
// it's the task for "new ftp" but that will
|
||||
// create all directories and correct their permissions
|
||||
inserttask(5);
|
||||
}
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account homdir for '" . $result['username'] . "'");
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `homedir` = :homedir
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
$params = array(
|
||||
"homedir" => $path,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"id" => $id
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
}
|
||||
}
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited ftp-account '" . $result['username'] . "'");
|
||||
$description = validate($_POST['ftp_description'], 'description');
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `description` = :desc
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("desc" => $description, "customerid" => $userinfo['customerid'], "id" => $id));
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']);
|
||||
} else {
|
||||
$homedir = $result['homedir'];
|
||||
}
|
||||
$homedir = makeCorrectDir($homedir);
|
||||
$homedir = FileDir::makeCorrectDir($homedir);
|
||||
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir);
|
||||
$pathSelect = FileDir::makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir);
|
||||
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domains = '';
|
||||
|
||||
$result_domains_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($result_domains_stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||
if (Settings::Get('system.allow_customer_shell') == '1') {
|
||||
$shells['/bin/false'] = "/bin/false";
|
||||
$shells_avail = Settings::Get('system.available_shells');
|
||||
if (!empty($shells_avail)) {
|
||||
$shells_avail_arr = explode(",", $shells_avail);
|
||||
$shells_avail_arr = array_map("trim", $shells_avail_arr);
|
||||
foreach ($shells_avail_arr as $shell) {
|
||||
$shells[$shell] = $shell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ftp_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_edit.php';
|
||||
$ftp_edit_form = htmlform::genHTMLForm($ftp_edit_data);
|
||||
$ftp_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/ftp/formfield.ftp_edit.php';
|
||||
|
||||
$title = $ftp_edit_data['ftp_edit']['title'];
|
||||
$image = $ftp_edit_data['ftp_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('ftp/accounts_edit') . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'ftp', 'id' => $id]),
|
||||
'formdata' => $ftp_edit_data['ftp_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,65 +2,87 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\Customers as Customers;
|
||||
use Froxlor\CurrentUser;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\System\Crypt;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Validate\Validate;
|
||||
use Froxlor\Language;
|
||||
use Froxlor\System\Cronjob;
|
||||
use Froxlor\Cron\TaskId;
|
||||
|
||||
if ($action == 'logout') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'logged out');
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, 'logged out');
|
||||
|
||||
$params = array("customerid" => $userinfo['customerid']);
|
||||
if (Settings::Get('session.allow_multiple_login') == '1') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :customerid
|
||||
AND `adminsession` = '0'
|
||||
AND `hash` = :hash"
|
||||
);
|
||||
$params["hash"] = $s;
|
||||
unset($_SESSION['userinfo']);
|
||||
CurrentUser::setData();
|
||||
session_destroy();
|
||||
|
||||
Response::redirectTo('index.php');
|
||||
} elseif ($action == 'suback') {
|
||||
if (is_array(CurrentUser::getField('switched_user'))) {
|
||||
$result = CurrentUser::getData();
|
||||
$result = $result['switched_user'];
|
||||
session_regenerate_id(true);
|
||||
CurrentUser::setData($result);
|
||||
$target = (isset($_GET['target']) ? $_GET['target'] : 'index');
|
||||
$redirect = "admin_" . $target . ".php";
|
||||
if (!file_exists(Froxlor::getInstallDir() . "/" . $redirect)) {
|
||||
$redirect = "admin_index.php";
|
||||
}
|
||||
Response::redirectTo($redirect, null, true);
|
||||
} else {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :customerid
|
||||
AND `adminsession` = '0'"
|
||||
);
|
||||
Response::dynamicError("Cannot change back - You've never switched to another user :-)");
|
||||
}
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
redirectTo('index.php');
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_index");
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_index");
|
||||
|
||||
$domain_stmt = Database::prepare("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `parentdomainid` = '0'
|
||||
AND `id` <> :standardsubdomain
|
||||
");
|
||||
Database::pexecute($domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
|
||||
|
||||
$domains = '';
|
||||
$domainArray = array();
|
||||
Database::pexecute($domain_stmt, [
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"standardsubdomain" => $userinfo['standardsubdomain']
|
||||
]);
|
||||
|
||||
$domainArray = [];
|
||||
while ($row = $domain_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domainArray[] = $idna_convert->decode($row['domain']);
|
||||
}
|
||||
|
||||
natsort($domainArray);
|
||||
$domains = implode(',<br />', $domainArray);
|
||||
|
||||
// standard-subdomain
|
||||
$stdsubdomain = '';
|
||||
@@ -70,7 +92,10 @@ if ($page == 'overview') {
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :standardsubdomain
|
||||
");
|
||||
$std_domain = Database::pexecute_first($std_domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
|
||||
$std_domain = Database::pexecute_first($std_domain_stmt, [
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"standardsubdomain" => $userinfo['standardsubdomain']
|
||||
]);
|
||||
$stdsubdomain = $std_domain['domain'];
|
||||
}
|
||||
|
||||
@@ -78,236 +103,175 @@ if ($page == 'overview') {
|
||||
$yesterday = time() - (60 * 60 * 24);
|
||||
$month = date('M Y', $yesterday);
|
||||
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, Settings::Get('panel.decimal_places'));
|
||||
$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 = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota ftps tickets subdomains');
|
||||
// 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, [
|
||||
'cid' => $userinfo['customerid']
|
||||
]);
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
// 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;
|
||||
|
||||
$services_enabled = "";
|
||||
$se = array();
|
||||
if ($userinfo['imap'] == '1') $se[] = "IMAP";
|
||||
if ($userinfo['pop3'] == '1') $se[] = "POP3";
|
||||
if ($userinfo['phpenabled'] == '1') $se[] = "PHP";
|
||||
if ($userinfo['perlenabled'] == '1') $se[] = "Perl/CGI";
|
||||
$services_enabled = implode(", ", $se);
|
||||
if ($usages) {
|
||||
$userinfo['diskspace_bytes_used'] = $usages['webspace'] * 1024;
|
||||
$userinfo['mailspace_used'] = $usages['mail'] * 1024;
|
||||
$userinfo['dbspace_used'] = $usages['mysql'] * 1024;
|
||||
$userinfo['total_bytes_used'] = ($usages['webspace'] + $usages['mail'] + $usages['mysql']) * 1024;
|
||||
} else {
|
||||
$userinfo['diskspace_bytes_used'] = 0;
|
||||
$userinfo['total_bytes_used'] = 0;
|
||||
$userinfo['mailspace_used'] = 0;
|
||||
$userinfo['dbspace_used'] = 0;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('index/index') . "\";");
|
||||
UI::twig()->addGlobal('userinfo', $userinfo);
|
||||
UI::view('user/index.html.twig', [
|
||||
'domains' => $domainArray,
|
||||
'stdsubdomain' => $stdsubdomain
|
||||
]);
|
||||
} elseif ($page == 'change_password') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$old_password = validate($_POST['old_password'], 'old password');
|
||||
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_CUSTOMERS,'customerid')) {
|
||||
standard_error('oldpasswordnotcorrect');
|
||||
$old_password = Validate::validate($_POST['old_password'], 'old password');
|
||||
|
||||
if (!Crypt::validatePasswordLogin($userinfo, $old_password, TABLE_PANEL_CUSTOMERS, 'customerid')) {
|
||||
Response::standardError('oldpasswordnotcorrect');
|
||||
}
|
||||
|
||||
$new_password = validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
try {
|
||||
$new_password = Crypt::validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = Crypt::validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($old_password == '') {
|
||||
standard_error(array('stringisempty', 'oldpassword'));
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.old_password'
|
||||
]);
|
||||
} elseif ($new_password == '') {
|
||||
standard_error(array('stringisempty', 'newpassword'));
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.new_password'
|
||||
]);
|
||||
} elseif ($new_password_confirm == '') {
|
||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||
Response::standardError([
|
||||
'stringisempty',
|
||||
'changepassword.new_password_confirm'
|
||||
]);
|
||||
} elseif ($new_password != $new_password_confirm) {
|
||||
standard_error('newpasswordconfirmerror');
|
||||
Response::standardError('newpasswordconfirmerror');
|
||||
} else {
|
||||
// Update user password
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `password` = :newpassword
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
$params = array(
|
||||
"newpassword" => makeCryptPassword($new_password),
|
||||
"customerid" => $userinfo['customerid']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed password');
|
||||
try {
|
||||
Customers::getLocal($userinfo, [
|
||||
'id' => $userinfo['customerid'],
|
||||
'new_customer_password' => $new_password
|
||||
])->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, 'changed password');
|
||||
|
||||
// Update ftp password
|
||||
if (isset($_POST['change_main_ftp']) && $_POST['change_main_ftp'] == 'true') {
|
||||
$cryptPassword = makeCryptPassword($new_password);
|
||||
$cryptPassword = Crypt::makeCryptPassword($new_password);
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
AND `username` = :username"
|
||||
);
|
||||
$params = array(
|
||||
AND `username` = :username");
|
||||
$params = [
|
||||
"password" => $cryptPassword,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $userinfo['loginname']
|
||||
);
|
||||
];
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
||||
}
|
||||
|
||||
// Update webalizer password
|
||||
if (isset($_POST['change_webalizer']) && $_POST['change_webalizer'] == 'true') {
|
||||
if (CRYPT_STD_DES == 1) {
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
$new_webalizer_password = crypt($new_password, $saltfordescrypt);
|
||||
} else {
|
||||
$new_webalizer_password = crypt($new_password);
|
||||
}
|
||||
// Update statistics password
|
||||
if (isset($_POST['change_stats']) && $_POST['change_stats'] == 'true') {
|
||||
$new_stats_password = Crypt::makeCryptPassword($new_password, true);
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
AND `username` = :username"
|
||||
);
|
||||
$params = array(
|
||||
"password" => $new_webalizer_password,
|
||||
AND `username` = :username");
|
||||
$params = [
|
||||
"password" => $new_stats_password,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $userinfo['loginname']
|
||||
);
|
||||
];
|
||||
Database::pexecute($stmt, $params);
|
||||
Cronjob::inserttask(TaskId::REBUILD_VHOST);
|
||||
}
|
||||
|
||||
redirectTo($filename, array('s' => $s));
|
||||
Response::redirectTo($filename);
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate('index/change_password') . "\";");
|
||||
UI::view('user/change_password.html.twig');
|
||||
}
|
||||
} elseif ($page == 'change_language') {
|
||||
$languages = Language::getLanguages();
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$def_language = validate($_POST['def_language'], 'default language');
|
||||
$def_language = Validate::validate($_POST['def_language'], 'default language');
|
||||
if (isset($languages[$def_language])) {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `def_language` = :lang
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($stmt, array("lang" => $def_language, "customerid" => $userinfo['customerid']));
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
|
||||
SET `language` = :lang
|
||||
WHERE `hash` = :hash"
|
||||
);
|
||||
Database::pexecute($stmt, array("lang" => $def_language, "hash" => $s));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
||||
try {
|
||||
Customers::getLocal($userinfo, [
|
||||
'id' => $userinfo['customerid'],
|
||||
'def_language' => $def_language
|
||||
])->update();
|
||||
CurrentUser::setField('language', $def_language);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
redirectTo($filename, array('s' => $s));
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
$default_lang = Settings::Get('panel.standardlanguage');
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
|
||||
$language_options = '';
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$language_options .= makeoption($language_name, $language_file, $default_lang, true);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('index/change_language') . "\";");
|
||||
UI::view('user/change_language.html.twig', [
|
||||
'languages' => $languages,
|
||||
'default_lang' => $default_lang
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'change_theme') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$theme = validate($_POST['theme'], 'theme');
|
||||
$theme = Validate::validate($_POST['theme'], 'theme');
|
||||
try {
|
||||
Customers::getLocal($userinfo, [
|
||||
'id' => $userinfo['customerid'],
|
||||
'theme' => $theme
|
||||
])->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `theme` = :theme
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($stmt, array("theme" => $theme, "customerid" => $userinfo['customerid']));
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_SESSIONS . "`
|
||||
SET `theme` = :theme
|
||||
WHERE `hash` = :hash"
|
||||
);
|
||||
Database::pexecute($stmt, array("theme" => $theme, "hash" => $s));
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
|
||||
redirectTo($filename, array('s' => $s));
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
|
||||
Response::redirectTo($filename);
|
||||
} else {
|
||||
$default_theme = Settings::Get('panel.default_theme');
|
||||
if ($userinfo['theme'] != '') {
|
||||
$default_theme = $userinfo['theme'];
|
||||
}
|
||||
|
||||
$theme_options = '';
|
||||
$themes_avail = getThemes();
|
||||
foreach ($themes_avail as $t => $d) {
|
||||
$theme_options.= makeoption($d, $t, $default_theme, true);
|
||||
}
|
||||
$themes_avail = UI::getThemes();
|
||||
|
||||
eval("echo \"" . getTemplate('index/change_theme') . "\";");
|
||||
UI::view('user/change_theme.html.twig', [
|
||||
'themes' => $themes_avail,
|
||||
'default_theme' => $default_theme
|
||||
]);
|
||||
}
|
||||
|
||||
} elseif ($page == 'send_error_report' && Settings::Get('system.allow_error_report_customer') == '1') {
|
||||
|
||||
// only show this if we really have an exception to report
|
||||
if (isset($_GET['errorid']) && $_GET['errorid'] != '') {
|
||||
|
||||
$errid = $_GET['errorid'];
|
||||
// read error file
|
||||
$err_dir = makeCorrectDir(FROXLOR_INSTALL_DIR."/logs/");
|
||||
$err_file = makeCorrectFile($err_dir."/".$errid."_sql-error.log");
|
||||
|
||||
if (file_exists($err_file)) {
|
||||
|
||||
$error_content = file_get_contents($err_file);
|
||||
$error = explode("|", $error_content);
|
||||
|
||||
$_error = array(
|
||||
'code' => str_replace("\n", "", substr($error[1], 5)),
|
||||
'message' => str_replace("\n", "", substr($error[2], 4)),
|
||||
'file' => str_replace("\n", "", substr($error[3], 5 + strlen(FROXLOR_INSTALL_DIR))),
|
||||
'line' => str_replace("\n", "", substr($error[4], 5)),
|
||||
'trace' => str_replace(FROXLOR_INSTALL_DIR, "", substr($error[5], 6))
|
||||
);
|
||||
|
||||
// build mail-content
|
||||
$mail_body = "Dear froxlor-team,\n\n";
|
||||
$mail_body .= "the following error has been reported by a user:\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n";
|
||||
$mail_body .= $_error['code'].' '.$_error['message']."\n\n";
|
||||
$mail_body .= "File: ".$_error['file'].':'.$_error['line']."\n\n";
|
||||
$mail_body .= "Trace:\n".trim($_error['trace'])."\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n\n";
|
||||
$mail_body .= "Froxlor-version: ".$version."\n\n";
|
||||
$mail_body .= "End of report";
|
||||
$mail_html = str_replace("\n", "<br />", $mail_body);
|
||||
|
||||
// send actual report to dev-team
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
// send mail and say thanks
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = '[Froxlor] Error report by user';
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML($mail_html);
|
||||
$mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team');
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
// error when reporting an error...LOLFUQ
|
||||
standard_error('send_report_error', $mailerr_msg);
|
||||
}
|
||||
|
||||
// finally remove error from fs
|
||||
@unlink($err_file);
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
// show a nice summary of the error-report
|
||||
// before actually sending anything
|
||||
eval("echo \"" . getTemplate("index/send_error_report") . "\";");
|
||||
|
||||
} else {
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
} else {
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
require_once __DIR__ . '/error_report.php';
|
||||
} elseif ($page == 'apikeys' && Settings::Get('api.enabled') == 1) {
|
||||
require_once __DIR__ . '/api_keys.php';
|
||||
} elseif ($page == '2fa' && Settings::Get('2fa.enabled') == 1) {
|
||||
require_once __DIR__ . '/2fa.php';
|
||||
}
|
||||
|
||||
@@ -2,116 +2,53 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if ($page == 'log'
|
||||
) {
|
||||
use Froxlor\Api\Commands\SysLog;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'extras.logger')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if ($page == 'log') {
|
||||
if ($action == '') {
|
||||
$fields = array(
|
||||
'date' => $lng['logger']['date'],
|
||||
'type' => $lng['logger']['type'],
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_LOG, $fields, null, null, 0, 'desc');
|
||||
$result_stmt = Database::prepare('
|
||||
SELECT * FROM `' . TABLE_PANEL_LOG . '` WHERE `user` = :loginname ' . $paging->getSqlWhere(true) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit()
|
||||
);
|
||||
Database::pexecute($result_stmt, array("loginname" => $userinfo['loginname']));
|
||||
$logs_count = Database::num_rows();
|
||||
$paging->setEntries($logs_count);
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (!isset($clog[$row['action']])
|
||||
|| !is_array($clog[$row['action']])
|
||||
) {
|
||||
$clog[$row['action']] = array();
|
||||
}
|
||||
$clog[$row['action']][$row['logid']] = $row;
|
||||
try {
|
||||
$syslog_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/tablelisting.syslog.php';
|
||||
$collection = (new Collection(SysLog::class, $userinfo))
|
||||
->withPagination($syslog_list_data['syslog_list']['columns'], $syslog_list_data['syslog_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
if ($paging->sortfield == 'date'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($clog);
|
||||
} else {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
$log = '';
|
||||
foreach ($clog as $action => $logrows) {
|
||||
$_action = 0;
|
||||
foreach ($logrows as $row) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$row['date'] = date("d.m.y H:i:s", $row['date']);
|
||||
|
||||
if ($_action != $action) {
|
||||
switch ($action) {
|
||||
case USR_ACTION:
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
case RES_ACTION:
|
||||
$_action = $lng['logger']['reseller'];
|
||||
break;
|
||||
case ADM_ACTION:
|
||||
$_action = $lng['logger']['admin'];
|
||||
break;
|
||||
case CRON_ACTION:
|
||||
$_action = $lng['logger']['cron'];
|
||||
break;
|
||||
case LOGIN_ACTION:
|
||||
$_action = $lng['logger']['login'];
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
$_action = $lng['logger']['intern'];
|
||||
break;
|
||||
default:
|
||||
$_action = $lng['logger']['unknown'];
|
||||
break;
|
||||
}
|
||||
|
||||
$row['action'] = $_action;
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||
}
|
||||
|
||||
$log_count++;
|
||||
$row['type'] = getLogLevelDesc($row['type']);
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('logger/logger') . "\";");
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $syslog_list_data, 'syslog_list')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,47 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Api\Commands\Mysqls;
|
||||
use Froxlor\Api\Commands\MysqlServer;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\CurrentUser;
|
||||
|
||||
// redirect if this customer page is hidden via settings or no resources given
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'mysql') || $userinfo['mysqls'] == 0) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
// get sql-root access data
|
||||
Database::needRoot(true);
|
||||
@@ -26,78 +50,49 @@ Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
$id = (int)Request::any('id');
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql");
|
||||
Database::needSqlData();
|
||||
$sql = Database::getSqlData();
|
||||
$lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']);
|
||||
eval("echo \"" . getTemplate('mysql/mysql') . "\";");
|
||||
} elseif ($page == 'mysqls') {
|
||||
if ($page == 'overview' || $page == 'mysqls') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql::mysqls");
|
||||
$fields = array(
|
||||
'databasename' => $lng['mysql']['databasename'],
|
||||
'description' => $lng['mysql']['databasedescription']
|
||||
);
|
||||
$paging = new 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);
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_mysql::mysqls");
|
||||
|
||||
$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 = '';
|
||||
$multiple_mysqlservers = count(json_decode($userinfo['allowed_mysqlserver'] ?? '[]', true)) > 1;
|
||||
|
||||
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`");
|
||||
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$count_mysqlservers = $dbserver['numservers'];
|
||||
|
||||
// Begin root-session
|
||||
Database::needRoot(true);
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($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'] = size_readable($mbdata['MB'], 'GiB', 'bi', '%01.' . (int)Settings::Get('panel.decimal_places') . 'f %s');
|
||||
eval("\$mysqls.=\"" . getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count++;
|
||||
}
|
||||
$i++;
|
||||
try {
|
||||
$mysql_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.mysqls.php';
|
||||
$collection = (new Collection(Mysqls::class, $userinfo))
|
||||
->withPagination($mysql_list_data['mysql_list']['columns'], $mysql_list_data['mysql_list']['default_sorting']);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
|
||||
eval("echo \"" . getTemplate('mysql/mysqls') . "\";");
|
||||
$actions_links = false;
|
||||
if (CurrentUser::canAddResource('mysqls')) {
|
||||
$actions_links = [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'mysql', 'page' => 'mysqls', 'action' => 'add']),
|
||||
'label' => lng('mysql.database_create')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => Listing::format($collection, $mysql_list_data, 'mysql_list'),
|
||||
'actions_links' => $actions_links,
|
||||
'entity_info' => lng('mysql.description')
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
$result_stmt = Database::prepare('SELECT `id`, `databasename`, `description`, `dbserver` FROM `' . TABLE_PANEL_DATABASES . '`
|
||||
WHERE `customerid`="' . (int)$userinfo['customerid'] . '"
|
||||
AND `id`="' . (int)$id . '"'
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = Mysqls::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['databasename']) && $result['databasename'] != '') {
|
||||
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
Database::needRoot(true, $result['dbserver'], false);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
@@ -107,261 +102,96 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// Begin root-session
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
$dbm = new DbManager($log);
|
||||
$dbm->getManager()->deleteDatabase($result['databasename']);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted database '" . $result['databasename'] . "'");
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_DATABASES . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
|
||||
$resetaccnumber = ($userinfo['mysqls_used'] == '1') ? " , `mysql_lastaccountnumber` = '0' " : '';
|
||||
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `mysqls_used` = `mysqls_used` - 1 " . $resetaccnumber . "
|
||||
WHERE `customerid` = :customerid"
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
try {
|
||||
Mysqls::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$dbnamedesc = $result['databasename'];
|
||||
if (isset($result['description']) && $result['description'] != '') {
|
||||
$dbnamedesc .= ' ('.$result['description'].')';
|
||||
$dbnamedesc .= ' (' . $result['description'] . ')';
|
||||
}
|
||||
ask_yesno('mysql_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $dbnamedesc);
|
||||
HTML::askYesNo('mysql_reallydelete', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
], $dbnamedesc);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$password = validate($_POST['mysql_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
|
||||
$sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0;
|
||||
if ($sendinfomail != 1) {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
} else {
|
||||
$dbserver = 0;
|
||||
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`");
|
||||
$_dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$count_mysqlservers = $_dbserver['numservers'];
|
||||
if ($count_mysqlservers > 1) {
|
||||
$dbserver = validate($_POST['mysql_server'], html_entity_decode($lng['mysql']['mysql_server']), '', '', 0);
|
||||
Database::needRoot(true, $dbserver);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
if (!isset($sql_root) || !is_array($sql_root)) {
|
||||
$dbserver = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// validate description before actual adding the database, #1052
|
||||
$databasedescription = validate(trim($_POST['description']), 'description');
|
||||
|
||||
// create database, user, set permissions, etc.pp.
|
||||
$dbm = new DbManager($log);
|
||||
$username = $dbm->createDatabase(
|
||||
$userinfo['loginname'],
|
||||
$password,
|
||||
$userinfo['mysql_lastaccountnumber']
|
||||
);
|
||||
|
||||
// we've checked against the password in dbm->createDatabase
|
||||
if ($username == false) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
|
||||
// Statement modified for Database description -- PH 2004-11-29
|
||||
$stmt = Database::prepare('INSERT INTO `' . TABLE_PANEL_DATABASES . '`
|
||||
(`customerid`, `databasename`, `description`, `dbserver`)
|
||||
VALUES (:customerid, :databasename, :description, :dbserver)'
|
||||
);
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"databasename" => $username,
|
||||
"description" => $databasedescription,
|
||||
"dbserver" => $dbserver
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
SET `mysqls_used` = `mysqls_used` + 1, `mysql_lastaccountnumber` = `mysql_lastaccountnumber` + 1
|
||||
WHERE `customerid` = :customerid'
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if ($sendinfomail == 1) {
|
||||
$pma = $lng['admin']['notgiven'];
|
||||
if (Settings::Get('panel.phpmyadmin_url') != '') {
|
||||
$pma = Settings::Get('panel.phpmyadmin_url');
|
||||
}
|
||||
|
||||
Database::needRoot(true, $dbserver);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
$replace_arr = array(
|
||||
'SALUTATION' => getCorrectUserSalutation($userinfo),
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||
'DB_NAME' => $username,
|
||||
'DB_PASS' => $password,
|
||||
'DB_DESC' => $databasedescription,
|
||||
'DB_SRV' => $sql_root['host'],
|
||||
'PMA_URI' => $pma
|
||||
);
|
||||
|
||||
$def_language = $userinfo['def_language'];
|
||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid` = :adminid
|
||||
AND `language` = :lang
|
||||
AND `templategroup`='mails'
|
||||
AND `varname`='new_database_by_customer_subject'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_database_by_customer']['subject']), $replace_arr));
|
||||
|
||||
$result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `adminid`= :adminid
|
||||
AND `language`= :lang
|
||||
AND `templategroup` = 'mails'
|
||||
AND `varname` = 'new_database_by_customer_mailbody'"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['new_database_by_customer']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = $mail_subject;
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
$log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||
standard_error('errorsendingmail', $userinfo['email']);
|
||||
}
|
||||
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
try {
|
||||
Mysqls::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
|
||||
$dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `".TABLE_PANEL_DATABASES."`");
|
||||
$mysql_servers = '';
|
||||
$count_mysqlservers = 0;
|
||||
while ($dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
Database::needRoot(true, $dbserver['dbserver']);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
$mysql_servers .= makeoption($sql_root['caption'], $dbserver['dbserver']);
|
||||
$count_mysqlservers++;
|
||||
$mysql_servers = [];
|
||||
try {
|
||||
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||
foreach ($result_decoded as $dbserver => $dbdata) {
|
||||
$mysql_servers[$dbserver] = $dbdata['caption'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* just none */
|
||||
}
|
||||
Database::needRoot(false);
|
||||
|
||||
$mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php';
|
||||
$mysql_add_form = htmlform::genHTMLForm($mysql_add_data);
|
||||
$mysql_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_add.php';
|
||||
|
||||
$title = $mysql_add_data['mysql_add']['title'];
|
||||
$image = $mysql_add_data['mysql_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('mysql/mysqls_add') . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'mysql']),
|
||||
'formdata' => $mysql_add_data['mysql_add']
|
||||
]);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `databasename`, `description`, `dbserver` FROM `" . TABLE_PANEL_DATABASES . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid'], "id" => $id));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
try {
|
||||
$json_result = Mysqls::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['databasename']) && $result['databasename'] != '') {
|
||||
if (!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']])) {
|
||||
$result['dbserver'] = 0;
|
||||
}
|
||||
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// Only change Password if it is set, do nothing if it is empty! -- PH 2004-11-29
|
||||
$password = validate($_POST['mysql_password'], 'password');
|
||||
if ($password != '') {
|
||||
// validate password
|
||||
$password = validatePassword($password);
|
||||
|
||||
if ($password == $result['databasename']) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
try {
|
||||
$json_result = Mysqls::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
]);
|
||||
} else {
|
||||
$mysql_servers = [];
|
||||
try {
|
||||
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||
foreach ($result_decoded as $dbserver => $dbdata) {
|
||||
$mysql_servers[$dbserver] = $dbdata['caption'] . ' (' . $dbdata['host'] . (isset($dbdata['port']) && !empty($dbdata['port']) ? ':' . $dbdata['port'] : '').')';
|
||||
}
|
||||
|
||||
// Begin root-session
|
||||
Database::needRoot(true);
|
||||
foreach (array_map('trim', explode(',', Settings::Get('system.mysql_access_host'))) as $mysql_access_host) {
|
||||
$stmt = Database::prepare("SET PASSWORD FOR :dbname@:host = PASSWORD(:password)");
|
||||
$params = array(
|
||||
"dbname" => $result['databasename'],
|
||||
"host" => $mysql_access_host,
|
||||
"password" => $password
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
}
|
||||
|
||||
$stmt = Database::prepare("FLUSH PRIVILEGES");
|
||||
Database::pexecute($stmt);
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
} catch (Exception $e) {
|
||||
/* just none */
|
||||
}
|
||||
|
||||
// Update the Database description -- PH 2004-11-29
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited database '" . $result['databasename'] . "'");
|
||||
$databasedescription = validate($_POST['description'], 'description');
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DATABASES . "`
|
||||
SET `description` = :desc
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($stmt, array("desc" => $databasedescription, "customerid" => $userinfo['customerid'], "id" => $id));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mysql_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_edit.php';
|
||||
|
||||
$dbservers_stmt = Database::query("SELECT COUNT(DISTINCT `dbserver`) as numservers FROM `".TABLE_PANEL_DATABASES."`");
|
||||
$dbserver = $dbservers_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$count_mysqlservers = $dbserver['numservers'];
|
||||
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
$mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_edit.php';
|
||||
$mysql_edit_form = htmlform::genHTMLForm($mysql_edit_data);
|
||||
|
||||
$title = $mysql_edit_data['mysql_edit']['title'];
|
||||
$image = $mysql_edit_data['mysql_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('mysql/mysqls_edit') . "\";");
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(['section' => 'mysql', 'id' => $id]),
|
||||
'formdata' => $mysql_edit_data['mysql_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,387 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
|
||||
$id = intval($_POST['id']);
|
||||
|
||||
//Check if the current user is allowed to see the current ticket.
|
||||
$stmt = Database::prepare("SELECT `id` FROM `panel_tickets` WHERE `id` = :id AND `customerid` = :customerid");
|
||||
$result = Database::pexecute_first($stmt, array("id" => $id, "customerid" => $userinfo['customerid']));
|
||||
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
|
||||
eval("echo \"" . getTemplate("tickets/ticket") . "\";");
|
||||
} elseif ($page == 'tickets') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
|
||||
$fields = array(
|
||||
'status' => $lng['ticket']['status'],
|
||||
'lastchange' => $lng['ticket']['lastchange'],
|
||||
'subject' => $lng['ticket']['subject'],
|
||||
'lastreplier' => $lng['ticket']['lastreplier']
|
||||
);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_TICKETS, $fields);
|
||||
$stmt = Database::prepare('SELECT `main`.`id`, (SELECT COUNT(`sub`.`id`) FROM `' . TABLE_PANEL_TICKETS . '` `sub`
|
||||
WHERE `sub`.`answerto` = `main`.`id`) AS `ticket_answers`, `main`.`lastchange`, `main`.`subject`, `main`.`status`, `main`.`lastreplier`, `main`.`priority`
|
||||
FROM `' . TABLE_PANEL_TICKETS . '` as `main`
|
||||
WHERE `main`.`answerto` = "0"
|
||||
AND `archived` = "0"
|
||||
AND `customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
$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;
|
||||
$tickets = '';
|
||||
$tickets_count = 0;
|
||||
|
||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$tickets_count++;
|
||||
$row = htmlentities_array($row);
|
||||
$row['lastchange'] = date("d.m.y H:i", $row['lastchange']);
|
||||
|
||||
if ($row['status'] >= 0 && $row['status'] <= 2) {
|
||||
$reopen = 0;
|
||||
} else {
|
||||
$reopen = 1;
|
||||
}
|
||||
|
||||
$row['status'] = ticket::getStatusText($lng, $row['status']);
|
||||
$row['priority'] = ticket::getPriorityText($lng, $row['priority']);
|
||||
|
||||
if ($row['lastreplier'] == '1') {
|
||||
$row['lastreplier'] = $lng['ticket']['staff'];
|
||||
$cananswer = 1;
|
||||
} else {
|
||||
$row['lastreplier'] = $lng['ticket']['customer'];
|
||||
$cananswer = 0;
|
||||
}
|
||||
|
||||
$row['subject'] = html_entity_decode($row['subject']);
|
||||
if (strlen($row['subject']) > 30) {
|
||||
$ts = wordwrap($row['subject'], 30, "|");
|
||||
$ts = explode("|", $ts);
|
||||
$row['subject'] = $ts[0]. '...';
|
||||
}
|
||||
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$supportavailable = 0;
|
||||
$time = date("Hi", time());
|
||||
$day = date("w", time());
|
||||
$start = substr(Settings::Get('ticket.worktime_begin'), 0, 2) . substr(Settings::Get('ticket.worktime_begin'), 3, 2);
|
||||
$end = substr(Settings::Get('ticket.worktime_end'), 0, 2) . substr(Settings::Get('ticket.worktime_end'), 3, 2);
|
||||
|
||||
if ($time >= $start && $time <= $end) {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
if (Settings::Get('ticket.worktime_sat') == "0" && $day == "6") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if (Settings::Get('ticket.worktime_sun') == "0" && $day == "0") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if (Settings::Get('ticket.worktime_all') == "1") {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
$ticketsopen = 0;
|
||||
$stmt = Database::prepare('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `answerto` = "0"
|
||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")'
|
||||
);
|
||||
$opentickets = Database::pexecute_first($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if (Settings::Get('ticket.concurrently_open') != - 1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => Settings::Get('ticket.concurrently_open')));
|
||||
} else {
|
||||
$notmorethanxopentickets = '';
|
||||
}
|
||||
|
||||
$ticketsopen = (int)$opentickets['count'];
|
||||
eval("echo \"" . getTemplate("tickets/tickets") . "\";");
|
||||
|
||||
} elseif ($action == 'new') {
|
||||
if ($userinfo['tickets_used'] < $userinfo['tickets'] || $userinfo['tickets'] == '-1') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$newticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$newticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$newticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$newticket->Set('category', validate($_POST['category'], 'category'), true, false);
|
||||
$newticket->Set('customer', (int)$userinfo['customerid'], true, false);
|
||||
$newticket->Set('admin', (int)$userinfo['adminid'], true, false);
|
||||
$newticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
||||
|
||||
if ($newticket->Get('subject') == null) {
|
||||
standard_error(array('stringisempty', 'mysubject'));
|
||||
} elseif ($newticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
} else {
|
||||
$now = time();
|
||||
$newticket->Set('dt', $now, true, true);
|
||||
$newticket->Set('lastchange', $now, true, true);
|
||||
$newticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||
$newticket->Set('status', '0', true, true);
|
||||
$newticket->Set('lastreplier', '0', true, true);
|
||||
$newticket->Set('by', '0', true, true);
|
||||
$newticket->Insert();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "opened support-ticket '" . $newticket->Get('subject') . "'");
|
||||
|
||||
$stmt = Database::prepare('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
SET `tickets_used`=`tickets_used` + 1
|
||||
WHERE `customerid`= :customerid'
|
||||
);
|
||||
Database::pexecute($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
// Customer mail
|
||||
$newticket->sendMail((int)$userinfo['customerid'], 'new_ticket_for_customer_subject', $lng['mails']['new_ticket_for_customer']['subject'], 'new_ticket_for_customer_mailbody', $lng['mails']['new_ticket_for_customer']['mailbody']);
|
||||
|
||||
// Admin mail
|
||||
$newticket->sendMail(-1, 'new_ticket_by_customer_subject', $lng['mails']['new_ticket_by_customer']['subject'], 'new_ticket_by_customer_mailbody', $lng['mails']['new_ticket_by_customer']['mailbody']);
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$categories = '';
|
||||
$result_stmt = Database::prepare('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
WHERE `adminid` = :adminid
|
||||
ORDER BY `logicalorder`, `name` ASC'
|
||||
);
|
||||
$result = Database::pexecute_first($result_stmt, array("adminid" => $userinfo['adminid']));
|
||||
|
||||
if (isset($result['name']) && $result['name'] != '') {
|
||||
$result2_stmt = Database::prepare('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
WHERE `adminid` = :adminid
|
||||
ORDER BY `logicalorder`, `name` ASC'
|
||||
);
|
||||
Database::pexecute($result2_stmt, array("adminid" => $userinfo['adminid']));
|
||||
|
||||
while ($row = $result2_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$categories.= makeoption($row['name'], $row['id']);
|
||||
}
|
||||
} else {
|
||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1');
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2');
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3');
|
||||
$ticketsopen = 0;
|
||||
$opentickets_stmt = Database::prepare('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `answerto` = "0"
|
||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")'
|
||||
);
|
||||
$opentickets = Database::pexecute_first($opentickets_stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if (Settings::Get('ticket.concurrently_open') != -1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => Settings::Get('ticket.concurrently_open')));
|
||||
} else {
|
||||
$notmorethanxopentickets = '';
|
||||
}
|
||||
|
||||
$ticketsopen = (int)$opentickets['count'];
|
||||
|
||||
$ticket_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/tickets/formfield.ticket_add.php';
|
||||
$ticket_add_form = htmlform::genHTMLForm($ticket_add_data);
|
||||
|
||||
$title = $ticket_add_data['ticket_add']['title'];
|
||||
$image = $ticket_add_data['ticket_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_new") . "\";");
|
||||
}
|
||||
} else {
|
||||
standard_error('nomoreticketsavailable');
|
||||
}
|
||||
} elseif ($action == 'answer' && $id != 0) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$replyticket = ticket::getInstanceOf($userinfo, -1);
|
||||
$replyticket->Set('subject', validate($_POST['subject'], 'subject'), true, false);
|
||||
$replyticket->Set('priority', validate($_POST['priority'], 'priority'), true, false);
|
||||
$replyticket->Set('message', validate(str_replace("\r\n", "\n", $_POST['message']), 'message', '/^[^\0]*$/'), true, false);
|
||||
|
||||
if ($replyticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
} else {
|
||||
$now = time();
|
||||
$replyticket->Set('customer', (int)$userinfo['customerid'], true, true);
|
||||
$replyticket->Set('lastchange', $now, true, true);
|
||||
$replyticket->Set('ip', $_SERVER['REMOTE_ADDR'], true, true);
|
||||
$replyticket->Set('status', '1', true, true);
|
||||
$replyticket->Set('answerto', (int)$id, true, false);
|
||||
$replyticket->Set('by', '0', true, true);
|
||||
$replyticket->Insert();
|
||||
|
||||
// Update priority if changed
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
|
||||
if ($replyticket->Get('priority') != $mainticket->Get('priority')) {
|
||||
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
||||
}
|
||||
|
||||
$mainticket->Set('lastchange', $now);
|
||||
$mainticket->Set('lastreplier', '0');
|
||||
$mainticket->Set('status', '1');
|
||||
$mainticket->Update();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "answered support-ticket '" . $mainticket->Get('subject') . "'");
|
||||
$mainticket->sendMail(-1, 'new_reply_ticket_by_customer_subject', $lng['mails']['new_reply_ticket_by_customer']['subject'], 'new_reply_ticket_by_customer_mailbody', $lng['mails']['new_reply_ticket_by_customer']['mailbody']);
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$ticket_replies = '';
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$dt = date("d.m.Y H:i\h", $mainticket->Get('dt'));
|
||||
$status = ticket::getStatusText($lng, $mainticket->Get('status'));
|
||||
|
||||
if ($mainticket->Get('status') >= 0 && $mainticket->Get('status') <= 2) {
|
||||
$isclosed = 0;
|
||||
} else {
|
||||
$isclosed = 1;
|
||||
}
|
||||
|
||||
if ($mainticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :customerid '
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array("customerid" => $cid));
|
||||
$by = getCorrectFullUserDetails($usr);
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
$message = $mainticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_main") . "\";");
|
||||
$result_stmt = Database::prepare('SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
WHERE `id`= :id '
|
||||
);
|
||||
$row = Database::pexecute_first($result_stmt, array("id" => $mainticket->Get('category')));
|
||||
|
||||
$andere_stmt = Database::prepare('SELECT * FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `answerto`= :answerto
|
||||
ORDER BY `lastchange` ASC'
|
||||
);
|
||||
Database::pexecute($andere_stmt, array("answerto" => $id));
|
||||
$numrows_andere = Database::num_rows();
|
||||
|
||||
while ($row2 = $andere_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$subticket = ticket::getInstanceOf($userinfo, (int)$row2['id']);
|
||||
$lastchange = date("d.m.Y H:i\h", $subticket->Get('lastchange'));
|
||||
|
||||
if ($subticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
} else {
|
||||
$cid = $subticket->Get('customer');
|
||||
$usr_stmt = Database::prepare('
|
||||
SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = :customerid '
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array("customerid" => $cid));
|
||||
$by = getCorrectFullUserDetails($usr);
|
||||
}
|
||||
|
||||
$subject = $subticket->Get('subject');
|
||||
$message = $subticket->Get('message');
|
||||
|
||||
$row2 = htmlentities_array($row2);
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', $mainticket->Get('priority'), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $mainticket->Get('priority'), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', $mainticket->Get('priority'), true, true);
|
||||
$subject = htmlentities($mainticket->Get('subject'));
|
||||
$ticket_replies_count = $numrows_andere + 1;
|
||||
|
||||
// don't forget the main-ticket!
|
||||
$ticket_reply_data = include_once dirname(__FILE__).'/lib/formfields/customer/tickets/formfield.ticket_reply.php';
|
||||
$ticket_reply_form = htmlform::genHTMLForm($ticket_reply_data);
|
||||
|
||||
$title = $ticket_reply_data['ticket_reply']['title'];
|
||||
$image = $ticket_reply_data['ticket_reply']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_reply") . "\";");
|
||||
}
|
||||
} elseif ($action == 'close' && $id != 0) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '0', true, true);
|
||||
$mainticket->Set('status', '3', true, true);
|
||||
$mainticket->Update();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "closed support-ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
ask_yesno('ticket_reallyclose', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
} elseif ($action == 'reopen' && $id != 0) {
|
||||
$ticketsopen = 0;
|
||||
$opentickets_stmt = Database::prepare('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `answerto` = "0"
|
||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")'
|
||||
);
|
||||
$opentickets = Database::pexecute_first($opentickets_stmt, array("customerid" => $userinfo['customerid']));
|
||||
$ticketsopen = (int)$opentickets['count'];
|
||||
|
||||
if ($ticketsopen > Settings::Get('ticket.concurrently_open') && Settings::Get('ticket.concurrently_open') != - 1 && Settings::Get('ticket.concurrently_open') != '') {
|
||||
standard_error('notmorethanxopentickets', Settings::Get('ticket.concurrently_open'));
|
||||
}
|
||||
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
$mainticket->Set('lastchange', $now, true, true);
|
||||
$mainticket->Set('lastreplier', '0', true, true);
|
||||
$mainticket->Set('status', '0', true, true);
|
||||
$mainticket->Update();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "reopened support-ticket '" . $mainticket->Get('subject') . "'");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
@@ -2,159 +2,52 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
$intrafficpage = 1;
|
||||
require './lib/init.php';
|
||||
$traffic = '';
|
||||
$month = null;
|
||||
$year = null;
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
if (isset($_POST['month']) && isset($_POST['year'])) {
|
||||
$month = intval($_POST['month']);
|
||||
$year = intval($_POST['year']);
|
||||
} elseif (isset($_GET['month']) && isset($_GET['year'])) {
|
||||
$month = intval($_GET['month']);
|
||||
$year = intval($_GET['year']);
|
||||
}
|
||||
//BAM! $_GET???
|
||||
elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
|
||||
if (date('d') != '01') {
|
||||
$month = date('m');
|
||||
$year = date('Y');
|
||||
} else {
|
||||
if (date('m') == '01') {
|
||||
$month = 12;
|
||||
$year = date('Y') - 1;
|
||||
} else {
|
||||
$month = date('m') - 1;
|
||||
$year = date('Y');
|
||||
}
|
||||
}
|
||||
use Froxlor\Traffic\Traffic;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'traffic')) {
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
if (!is_null($month) && !is_null($year)) {
|
||||
$traf['byte'] = 0;
|
||||
$result_stmt = Database::prepare("SELECT SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail', `day`, `month`, `year`
|
||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||
WHERE `customerid`= :customerid
|
||||
AND `month` = :month
|
||||
AND `year` = :year
|
||||
GROUP BY `day`
|
||||
ORDER BY `day` DESC"
|
||||
);
|
||||
$params = array(
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"month" => $month,
|
||||
"year" => $year
|
||||
);
|
||||
Database::pexecute($result_stmt, $params);
|
||||
$traffic_complete['http'] = 0;
|
||||
$traffic_complete['ftp'] = 0;
|
||||
$traffic_complete['mail'] = 0;
|
||||
$show = '';
|
||||
$range = Request::any('range', 'currentyear');
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$http = $row['http'];
|
||||
$ftp = $row['ftp_up'] + $row['ftp_down'];
|
||||
$mail = $row['mail'];
|
||||
$traf['byte'] = $http + $ftp + $mail;
|
||||
$traffic_complete['http'] += $http;
|
||||
$traffic_complete['ftp'] += $ftp;
|
||||
$traffic_complete['mail'] += $mail;
|
||||
$traf['day'] = $row['day'] . '.';
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_month') . "\";");
|
||||
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
||||
}
|
||||
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
|
||||
eval("echo \"" . 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
|
||||
FROM `" . TABLE_PANEL_TRAFFIC . "`
|
||||
WHERE `customerid` = :customerid
|
||||
GROUP BY CONCAT(`year`,`month`)
|
||||
ORDER BY CONCAT(`year`,`month`) DESC
|
||||
LIMIT 12"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("customerid" => $userinfo['customerid']));
|
||||
$traffic_complete['http'] = 0;
|
||||
$traffic_complete['ftp'] = 0;
|
||||
$traffic_complete['mail'] = 0;
|
||||
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$http = $row['http'];
|
||||
$ftp_up = $row['ftp_up'];
|
||||
$ftp_down = $row['ftp_down'];
|
||||
$mail = $row['mail'];
|
||||
$traffic_complete['http'] += $http;
|
||||
$traffic_complete['ftp'] += $ftp_up + $ftp_down;
|
||||
$traffic_complete['mail'] += $mail;
|
||||
$traf['month'] = $row['month'];
|
||||
$traf['year'] = $row['year'];
|
||||
$traf['monthname'] = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
||||
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_traffic') . "\";");
|
||||
}
|
||||
|
||||
$traffic_complete['http'] = size_readable($traffic_complete['http'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['ftp'] = size_readable($traffic_complete['ftp'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
$traffic_complete['mail'] = size_readable($traffic_complete['mail'] * 1024, 'GiB', 'bi', '%01.'.(int)Settings::Get('panel.decimal_places').'f %s');
|
||||
|
||||
eval("echo \"" . getTemplate('traffic/traffic') . "\";");
|
||||
if ($page == 'current') {
|
||||
$range = 'currentmonth';
|
||||
}
|
||||
|
||||
try {
|
||||
$context = Traffic::getCustomerStats($userinfo, $range);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
// pass metrics to the view
|
||||
UI::view('user/traffic.html.twig', $context);
|
||||
|
||||
149
dns_editor.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
if (!defined('AREA')) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
use Froxlor\Api\Commands\DomainZones;
|
||||
use Froxlor\Dns\Dns;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
|
||||
// This file is being included in admin_domains and customer_domains
|
||||
// and therefore does not need to require lib/init.php
|
||||
|
||||
$domain_id = (int)Request::any('domain_id');
|
||||
|
||||
$record = isset($_POST['dns_record']) ? trim($_POST['dns_record']) : null;
|
||||
$type = isset($_POST['dns_type']) ? $_POST['dns_type'] : 'A';
|
||||
$prio = isset($_POST['dns_mxp']) ? (int)$_POST['dns_mxp'] : null;
|
||||
$content = isset($_POST['dns_content']) ? trim($_POST['dns_content']) : null;
|
||||
$ttl = isset($_POST['dns_ttl']) ? (int)$_POST['dns_ttl'] : 18000;
|
||||
|
||||
// get domain-name
|
||||
$domain = Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo);
|
||||
|
||||
$errors = "";
|
||||
$success_message = "";
|
||||
|
||||
// action for adding a new entry
|
||||
if ($action == 'add_record' && !empty($_POST)) {
|
||||
try {
|
||||
DomainZones::getLocal($userinfo, [
|
||||
'id' => $domain_id,
|
||||
'record' => $record,
|
||||
'type' => $type,
|
||||
'prio' => $prio,
|
||||
'content' => $content,
|
||||
'ttl' => $ttl
|
||||
])->add();
|
||||
$success_message = lng('success.dns_record_added');
|
||||
$record = $prio = $content = "";
|
||||
} catch (Exception $e) {
|
||||
$errors = str_replace("\n", "<br>", $e->getMessage());
|
||||
}
|
||||
} elseif ($action == 'delete') {
|
||||
$entry_id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
HTML::askYesNo('dnsentry_reallydelete', $filename, [
|
||||
'id' => $entry_id,
|
||||
'domain_id' => $domain_id,
|
||||
'page' => $page,
|
||||
'action' => 'deletesure'
|
||||
], '', [
|
||||
'section' => 'domains',
|
||||
'page' => $page,
|
||||
'domain_id' => $domain_id
|
||||
]);
|
||||
} elseif (isset($_POST['send']) && $_POST['send'] == 'send' && $action == 'deletesure' && !empty($_POST)) {
|
||||
$entry_id = isset($_POST['id']) ? (int)$_POST['id'] : 0;
|
||||
$domain_id = isset($_POST['domain_id']) ? (int)$_POST['domain_id'] : 0;
|
||||
// remove entry
|
||||
if ($entry_id > 0 && $domain_id > 0) {
|
||||
try {
|
||||
DomainZones::getLocal($userinfo, [
|
||||
'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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// select all entries
|
||||
try {
|
||||
$dns_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/tablelisting.dns.php';
|
||||
$collection = (new Collection(DomainZones::class, $userinfo, ['id' => $domain_id]))
|
||||
->withPagination($dns_list_data['dns_list']['columns'], $dns_list_data['dns_list']['default_sorting'], ['domain_id='.$domain_id]);
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
$json_result = DomainZones::getLocal($userinfo, [
|
||||
'id' => $domain_id
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
$zonefile = implode("\n", $result);
|
||||
|
||||
$dns_add_data = include_once dirname(__FILE__) . '/lib/formfields/formfield.dns_add.php';
|
||||
|
||||
UI::view('user/dns-editor.html.twig', [
|
||||
'listing' => Listing::format($collection, $dns_list_data, 'dns_list', ['domain_id' => $domain_id]),
|
||||
'actions_links' => [
|
||||
[
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'domains',
|
||||
'page' => 'domains',
|
||||
'action' => 'edit',
|
||||
'id' => $domain_id
|
||||
]),
|
||||
'label' => lng('admin.domain_edit'),
|
||||
'icon' => 'fa-solid fa-pen'
|
||||
],
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'domains', 'page' => 'domains']),
|
||||
'label' => lng('panel.backtooverview'),
|
||||
'icon' => 'fa-solid fa-reply'
|
||||
]
|
||||
],
|
||||
'formaction' => $linker->getLink(['section' => 'domains', 'action' => 'add_record', 'domain_id' => $domain_id]),
|
||||
'formdata' => $dns_add_data['dns_add'],
|
||||
// alert-box
|
||||
'type' => (!empty($errors) ? 'danger' : (!empty($success_message) ? 'success' : 'warning')),
|
||||
'alert_msg' => (!empty($errors) ? $errors : (!empty($success_message) ? $success_message : lng('dns.howitworks'))),
|
||||
'zonefile' => $zonefile,
|
||||
]);
|
||||
67
doc/example/FroxlorAPI.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
class FroxlorAPI
|
||||
{
|
||||
private string $url;
|
||||
private string $key;
|
||||
private string $secret;
|
||||
private ?array $lastError = null;
|
||||
private ?string $lastStatusCode = null;
|
||||
|
||||
public function __construct($url, $key, $secret)
|
||||
{
|
||||
$this->url = $url;
|
||||
$this->key = $key;
|
||||
$this->secret = $secret;
|
||||
}
|
||||
|
||||
public function request($command, array $data = [])
|
||||
{
|
||||
$payload = [
|
||||
'command' => $command,
|
||||
'params' => $data
|
||||
];
|
||||
|
||||
$ch = curl_init($this->url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_USERPWD, $this->key . ":" . $this->secret);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$result = curl_exec($ch);
|
||||
|
||||
$this->lastStatusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
return json_decode($result ?? curl_error($ch), true);
|
||||
}
|
||||
|
||||
public function getLastStatusCode(): ?string
|
||||
{
|
||||
return $this->lastStatusCode;
|
||||
}
|
||||
}
|
||||
46
doc/example/create_customer.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
// include FroxlorAPI helper class
|
||||
require __DIR__ . '/FroxlorAPI.php';
|
||||
|
||||
// create object of FroxlorAPI with URL, apikey and apisecret
|
||||
$fapi = new FroxlorAPI('http://127.0.0.1/api.php', 'your-api-key', 'your-api-secret');
|
||||
|
||||
// customer data
|
||||
$data = [
|
||||
'new_loginname' => 'test',
|
||||
'email' => 'test@froxlor.org',
|
||||
'firstname' => 'Test',
|
||||
'name' => 'Testman',
|
||||
'customernumber' => 1337,
|
||||
'new_customer_password' => 's0mEcRypt1cpassword' . uniqid()
|
||||
];
|
||||
// send request
|
||||
$response = $fapi->request('Customers.add', $data);
|
||||
|
||||
// check for error
|
||||
if ($fapi->getLastStatusCode() != 200) {
|
||||
echo "HTTP-STATUS: " . $fapi->getLastStatusCode() . PHP_EOL;
|
||||
echo "Description: " . $response['message'] . PHP_EOL;
|
||||
exit();
|
||||
}
|
||||
|
||||
// view response data
|
||||
var_dump($response);
|
||||
|
||||
/*
|
||||
array(60) {
|
||||
["customerid"]=>
|
||||
string(1) "1"
|
||||
["loginname"]=>
|
||||
string(4) "test"
|
||||
["password"]=>
|
||||
string(63) "$5$asdasdasd.asdasd"
|
||||
["adminid"]=>
|
||||
string(1) "1"
|
||||
["name"]=>
|
||||
string(7) "Testman"
|
||||
["firstname"]=>
|
||||
string(4) "Test"
|
||||
[...]
|
||||
*/
|
||||
0
doc/example/index.html
Normal file
20
doc/example/list_functions.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
// include FroxlorAPI helper class
|
||||
require __DIR__ . '/FroxlorAPI.php';
|
||||
|
||||
// create object of FroxlorAPI with URL, apikey and apisecret
|
||||
$fapi = new FroxlorAPI('http://localhost/api.php', 'your-api-key', 'your-api-secret');
|
||||
|
||||
// send request
|
||||
$response = $fapi->request('Froxlor.listFunctions');
|
||||
|
||||
// check for error
|
||||
if ($fapi->getLastStatusCode() != 200) {
|
||||
echo "HTTP-STATUS: " . $fapi->getLastStatusCode() . PHP_EOL;
|
||||
echo "Description: " . $response['message'] . PHP_EOL;
|
||||
exit();
|
||||
}
|
||||
|
||||
// view response data
|
||||
var_dump($response);
|
||||
0
doc/index.html
Normal file
117
error_report.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
if (!defined('AREA')) {
|
||||
header("Location: index.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\Froxlor;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Database\Database;
|
||||
|
||||
// This file is being included in admin_domains and customer_domains
|
||||
// and therefore does not need to require lib/init.php
|
||||
|
||||
$errid = Request::any('errorid');
|
||||
|
||||
if (!empty($errid)) {
|
||||
// read error file
|
||||
$err_dir = FileDir::makeCorrectDir(Froxlor::getInstallDir() . "/logs/");
|
||||
$err_file = FileDir::makeCorrectFile($err_dir . "/" . $errid . "_sql-error.log");
|
||||
|
||||
if (file_exists($err_file)) {
|
||||
$error_content = file_get_contents($err_file);
|
||||
$error = explode("|", $error_content);
|
||||
|
||||
$_error = [
|
||||
'code' => str_replace("\n", "", substr($error[1], 5)),
|
||||
'message' => str_replace("\n", "", substr($error[2], 4)),
|
||||
'file' => str_replace("\n", "", substr($error[3], 5 + strlen(Froxlor::getInstallDir()))),
|
||||
'line' => str_replace("\n", "", substr($error[4], 5)),
|
||||
'trace' => str_replace(Froxlor::getInstallDir(), "", substr($error[5], 6))
|
||||
];
|
||||
|
||||
// build mail-content
|
||||
$mail_body = "Dear froxlor-team,\n\n";
|
||||
$mail_body .= "the following error has been reported by a user:\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n";
|
||||
$mail_body .= $_error['code'] . ' ' . $_error['message'] . "\n\n";
|
||||
$mail_body .= "File: " . $_error['file'] . ':' . $_error['line'] . "\n\n";
|
||||
$mail_body .= "Trace:\n" . trim($_error['trace']) . "\n\n";
|
||||
$mail_body .= "-------------------------------------------------------------\n\n";
|
||||
$mail_body .= "User-Area: " . AREA . "\n";
|
||||
$mail_body .= "Froxlor-version: " . Froxlor::VERSION . "\n";
|
||||
$mail_body .= "DB-version: " . Froxlor::DBVERSION . "\n\n";
|
||||
try {
|
||||
$mail_body .= "Database: " . Database::getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
} catch (\Exception $e) {
|
||||
/* ignore */
|
||||
}
|
||||
$mail_body .= "End of report";
|
||||
$mail_html = nl2br($mail_body);
|
||||
|
||||
// send actual report to dev-team
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// send mail and say thanks
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = '[Froxlor] Error report by user';
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML($mail_html);
|
||||
$mail->AddAddress('error-reports@froxlor.org', 'Froxlor Developer Team');
|
||||
$mail->Send();
|
||||
} catch (\PHPMailer\PHPMailer\Exception $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
$_mailerror = true;
|
||||
} catch (Exception $e) {
|
||||
$mailerr_msg = $e->getMessage();
|
||||
$_mailerror = true;
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
// error when reporting an error...LOLFUQ
|
||||
Response::standardError('send_report_error', $mailerr_msg);
|
||||
}
|
||||
|
||||
// finally remove error from fs
|
||||
@unlink($err_file);
|
||||
Response::standardSuccess('sent_error_report', '', ['filename' => 'index.php']);
|
||||
}
|
||||
// show a nice summary of the error-report
|
||||
// before actually sending anything
|
||||
UI::view('user/error_report.html.twig', [
|
||||
'mail_html' => $mail_body,
|
||||
'errorid' => $errid
|
||||
]);
|
||||
} else {
|
||||
Response::redirectTo($filename);
|
||||
}
|
||||
} else {
|
||||
Response::redirectTo($filename);
|
||||
}
|
||||