Compare commits
1350 Commits
0.9.30-rc1
...
0.9.35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57f9c439f2 | ||
|
|
c14017c244 | ||
|
|
82cd5986a0 | ||
|
|
032a991b8f | ||
|
|
200f589252 | ||
|
|
3405c7e313 | ||
|
|
30bd81064c | ||
|
|
924a607183 | ||
|
|
f1460d169d | ||
|
|
f5e2afaa0a | ||
|
|
228d07ca66 | ||
|
|
3294bbf9b4 | ||
|
|
a849f35469 | ||
|
|
104383d31e | ||
|
|
1dd9bcbbe0 | ||
|
|
05d57a8af7 | ||
|
|
630ecfb148 | ||
|
|
d545734072 | ||
|
|
c903b759bb | ||
|
|
579854f5a5 | ||
|
|
6b032839ce | ||
|
|
be1d9a045a | ||
|
|
8bc19e3893 | ||
|
|
f9740ff545 | ||
|
|
2b2ca99a2b | ||
|
|
641ee1f8a6 | ||
|
|
52448571ea | ||
|
|
7bba4112b9 | ||
|
|
efd64300c4 | ||
|
|
1f3c208f95 | ||
|
|
4330b08c04 | ||
|
|
1c80118117 | ||
|
|
65fd6ac191 | ||
|
|
291fae1744 | ||
|
|
c458ed8b0c | ||
|
|
7ec62401e7 | ||
|
|
be83c99334 | ||
|
|
7c8dbd370f | ||
|
|
604f37bd17 | ||
|
|
9d6ee0d08f | ||
|
|
7dc2e6cb5f | ||
|
|
fb5fd5a279 | ||
|
|
d3bf80342d | ||
|
|
77502efce7 | ||
|
|
ca34f7a78a | ||
|
|
eae8b8835b | ||
|
|
58c6b4edb1 | ||
|
|
86252a22a0 | ||
|
|
964a1716d7 | ||
|
|
06862240f0 | ||
|
|
3119510ef4 | ||
|
|
b4a8ed8828 | ||
|
|
c182664167 | ||
|
|
4bba24801c | ||
|
|
274e556989 | ||
|
|
74758818e7 | ||
|
|
69a191d4e2 | ||
|
|
f9d949f90c | ||
|
|
130d3e7b16 | ||
|
|
f6e519d779 | ||
|
|
ca807583df | ||
|
|
e6df2d5d40 | ||
|
|
82c1f29eba | ||
|
|
fc78a51235 | ||
|
|
28b3eb9585 | ||
|
|
e9e9214910 | ||
|
|
03a1f9b9b1 | ||
|
|
bee529b7fa | ||
|
|
6e9615261e | ||
|
|
1fad30a43a | ||
|
|
3d5e6152cd | ||
|
|
24f7d88a5c | ||
|
|
d6f42dc88c | ||
|
|
42c28e6590 | ||
|
|
6d8d01058b | ||
|
|
2efe715aa0 | ||
|
|
4c4916a661 | ||
|
|
cf8fbe2224 | ||
|
|
573fd69c95 | ||
|
|
71f502f508 | ||
|
|
f4a9152d8f | ||
|
|
319668d384 | ||
|
|
101e791add | ||
|
|
088eef9728 | ||
|
|
aa592c7369 | ||
|
|
b67749bcdc | ||
|
|
b05105bfdf | ||
|
|
6a10020e9b | ||
|
|
9f85074876 | ||
|
|
45bf41db4c | ||
|
|
06f4907053 | ||
|
|
4f2ee129fd | ||
|
|
373cb912d8 | ||
|
|
f284d67843 | ||
|
|
75172f9e8d | ||
|
|
48a1b9489a | ||
|
|
2e0cb5050f | ||
|
|
6ddbb10b5a | ||
|
|
802e12cf7b | ||
|
|
82b43948b4 | ||
|
|
36cf003ed6 | ||
|
|
2286ea751e | ||
|
|
deb19f2625 | ||
|
|
83fd1ab0ca | ||
|
|
f00a1ca092 | ||
|
|
152b407cb7 | ||
|
|
5c5e736776 | ||
|
|
dc71a582fc | ||
|
|
fc92e2655c | ||
|
|
abe253bc31 | ||
|
|
0559f3c4d6 | ||
|
|
ae2bad5ab4 | ||
|
|
55df79a79c | ||
|
|
32c32a7e7a | ||
|
|
d7ca3a0f1c | ||
|
|
e8489e55a1 | ||
|
|
5c90c3aa97 | ||
|
|
b5e739620d | ||
|
|
a328a95c01 | ||
|
|
11b3ac67b0 | ||
|
|
b8e7122452 | ||
|
|
a6bd323a0e | ||
|
|
4bec449a26 | ||
|
|
2176482e4f | ||
|
|
9c7092292b | ||
|
|
46eeb65ff0 | ||
|
|
dd79a3a78a | ||
|
|
fef9e51c9a | ||
|
|
c27589e8c2 | ||
|
|
1ace011ad2 | ||
|
|
c269a3d363 | ||
|
|
387be846f1 | ||
|
|
a788660efe | ||
|
|
73c8643218 | ||
|
|
cd7b65395f | ||
|
|
1c467d71c7 | ||
|
|
a641dfbfc8 | ||
|
|
268b188133 | ||
|
|
4692d7ef2a | ||
|
|
3b9201fb91 | ||
|
|
6e0f18b200 | ||
|
|
dfee6873da | ||
|
|
50e7311390 | ||
|
|
1c4b88d014 | ||
|
|
0935a9c193 | ||
|
|
8a99bd1d51 | ||
|
|
be1a12821e | ||
|
|
bc9bc84f23 | ||
|
|
e5bb58cd91 | ||
|
|
074b425ee0 | ||
|
|
59e599a952 | ||
|
|
3f523a8b58 | ||
|
|
b4667c92e7 | ||
|
|
2ce488c03c | ||
|
|
e1448859c9 | ||
|
|
8abd041f36 | ||
|
|
dabd4a4a4e | ||
|
|
6ac274a706 | ||
|
|
3d2b672feb | ||
|
|
e621e02f92 | ||
|
|
e3a594f3e7 | ||
|
|
5982f86db4 | ||
|
|
b071b8c2d9 | ||
|
|
185178a91e | ||
|
|
9ca31c10ae | ||
|
|
8784efd063 | ||
|
|
c828e3b0d9 | ||
|
|
45c081990a | ||
|
|
51b2dc7c23 | ||
|
|
9f54e60056 | ||
|
|
5151f50d49 | ||
|
|
9b08d67ea7 | ||
|
|
b002d687c0 | ||
|
|
1d2b697742 | ||
|
|
ac52802caa | ||
|
|
ef3ab72082 | ||
|
|
aede590af0 | ||
|
|
c229c11bdf | ||
|
|
8356860945 | ||
|
|
dd5fa3bfff | ||
|
|
7b29d43c66 | ||
|
|
8d56478187 | ||
|
|
60740973d7 | ||
|
|
453f11dcc4 | ||
|
|
a090e44403 | ||
|
|
a68effe4e7 | ||
|
|
2fb091939f | ||
|
|
71248f0adf | ||
|
|
ca80b6372b | ||
|
|
e306425428 | ||
|
|
f86a115c6a | ||
|
|
ddaadf81d6 | ||
|
|
f65af0067d | ||
|
|
5109443346 | ||
|
|
29a2c78b3f | ||
|
|
9ee661d44c | ||
|
|
ea2fa3be15 | ||
|
|
d7ec7a42ba | ||
|
|
722aed5148 | ||
|
|
17100ad56a | ||
|
|
a76032f668 | ||
|
|
d8d244541a | ||
|
|
ba5d4f2f5d | ||
|
|
dce80c4611 | ||
|
|
eae9c4d78a | ||
|
|
3f606cd953 | ||
|
|
ae581c2da7 | ||
|
|
0fbbd8dae7 | ||
|
|
f4ef5af63b | ||
|
|
3244c968b5 | ||
|
|
dd0689c13f | ||
|
|
e327a39eac | ||
|
|
e2b908ed8b | ||
|
|
aac9ee3ba7 | ||
|
|
1cd776f660 | ||
|
|
427b7492dc | ||
|
|
627e22a2e6 | ||
|
|
7bf8b74693 | ||
|
|
c7f4dc9045 | ||
|
|
f8ed70c5f2 | ||
|
|
94f34aada6 | ||
|
|
2472a52fed | ||
|
|
172915b5be | ||
|
|
ae276a2a59 | ||
|
|
ae115216f6 | ||
|
|
5691b3a8db | ||
|
|
c9815be0c7 | ||
|
|
1814407bfd | ||
|
|
40f2fa432b | ||
|
|
e10732c058 | ||
|
|
cdb00a76ce | ||
|
|
efc5f37850 | ||
|
|
ba1181e8ff | ||
|
|
6023e65f7d | ||
|
|
eff978e5f6 | ||
|
|
daf32b8ac4 | ||
|
|
5228e0f3d6 | ||
|
|
9fc47f55b8 | ||
|
|
435edd53f2 | ||
|
|
c36fb7e809 | ||
|
|
e74a418405 | ||
|
|
7814499b87 | ||
|
|
b62f4ef911 | ||
|
|
b32c2bb994 | ||
|
|
dd9e540ca3 | ||
|
|
272ba3f74e | ||
|
|
d87fc4c717 | ||
|
|
c189ad759b | ||
|
|
f3a7a9c342 | ||
|
|
51d554ab14 | ||
|
|
cb97ff0dc7 | ||
|
|
7b5a425913 | ||
|
|
44d08d6aa9 | ||
|
|
e0e1085c73 | ||
|
|
67df9dbf6b | ||
|
|
2e7dd6f212 | ||
|
|
ed2837f1db | ||
|
|
d45e9e63e6 | ||
|
|
4f0c1894a3 | ||
|
|
a3032fc62a | ||
|
|
6eeaf66e2c | ||
|
|
7f82549e23 | ||
|
|
2bb8f707eb | ||
|
|
37176aa022 | ||
|
|
ad302fb5c2 | ||
|
|
da4ec3e1b5 | ||
|
|
ebedb97fae | ||
|
|
ddd4c2ad3d | ||
|
|
007242e341 | ||
|
|
0932b38364 | ||
|
|
5c0ba566e0 | ||
|
|
67b97dbefd | ||
|
|
4d2f72a814 | ||
|
|
9d1108c2f4 | ||
|
|
cd75bb843a | ||
|
|
fb6393ad8f | ||
|
|
1ba2800a30 | ||
|
|
9d78ad70e6 | ||
|
|
98c675792e | ||
|
|
39b50d05ec | ||
|
|
a6182e2def | ||
|
|
efdb3623e1 | ||
|
|
eef6102088 | ||
|
|
9fe55cb729 | ||
|
|
13870f3ae8 | ||
|
|
ca9670e832 | ||
|
|
29494b71fa | ||
|
|
f2c3b3f165 | ||
|
|
4e402b6378 | ||
|
|
6a22fbbf78 | ||
|
|
27f2217139 | ||
|
|
038bb803db | ||
|
|
67b85e5708 | ||
|
|
a21b1f7df5 | ||
|
|
eb6e66cbf2 | ||
|
|
778fe718ed | ||
|
|
ef080cd80e | ||
|
|
22a4a1824a | ||
|
|
56163f66d8 | ||
|
|
73a7e438ec | ||
|
|
27f4e226f3 | ||
|
|
7357029a28 | ||
|
|
accfd6fa14 | ||
|
|
77dcc37b33 | ||
|
|
5df4b3e7df | ||
|
|
997141efea | ||
|
|
6fe0f56e41 | ||
|
|
8c3b7b518f | ||
|
|
6996f6516c | ||
|
|
60cc071031 | ||
|
|
fe5ab0d8da | ||
|
|
0939d032a5 | ||
|
|
d21391e8ba | ||
|
|
0651dc28c8 | ||
|
|
5b8fea9378 | ||
|
|
eda055acca | ||
|
|
7fb3918773 | ||
|
|
4e38f614f2 | ||
|
|
c7d8cb6d33 | ||
|
|
e211fb891b | ||
|
|
05f3e8f433 | ||
|
|
b6949e12b1 | ||
|
|
0772952e71 | ||
|
|
dc4d5c6953 | ||
|
|
9d45f4d534 | ||
|
|
2b8a9a74be | ||
|
|
d226af5314 | ||
|
|
be5a13fbb1 | ||
|
|
94b43021ff | ||
|
|
0b901af0f0 | ||
|
|
5ead5e9c90 | ||
|
|
1cdaa1d727 | ||
|
|
2c38bca1b5 | ||
|
|
7c45ca220b | ||
|
|
bdb2115c16 | ||
|
|
e23bf72006 | ||
|
|
7c63b78bbb | ||
|
|
b611ebcccb | ||
|
|
722d17b211 | ||
|
|
afbfb810fd | ||
|
|
1d3ae4f2c8 | ||
|
|
9bf784f64e | ||
|
|
116c0e19b2 | ||
|
|
7939187916 | ||
|
|
9d40e0903b | ||
|
|
320adad154 | ||
|
|
c52df5b286 | ||
|
|
30a25c0e8c | ||
|
|
95035afe38 | ||
|
|
62559dd2b4 | ||
|
|
a6473695eb | ||
|
|
edd60d3331 | ||
|
|
c9e4819f3f | ||
|
|
7cf321b24a | ||
|
|
3b96efc04d | ||
|
|
8a17a90b1a | ||
|
|
4da3a87772 | ||
|
|
ab9b92112d | ||
|
|
161e11a8dd | ||
|
|
967bd45a63 | ||
|
|
e1b80b513d | ||
|
|
6abe0bdaec | ||
|
|
7b5069f1b9 | ||
|
|
4429c5e8b2 | ||
|
|
5136824844 | ||
|
|
918e9ed408 | ||
|
|
8e8c97f7f9 | ||
|
|
d86fb7ed23 | ||
|
|
819db2583b | ||
|
|
089fb25da7 | ||
|
|
3d01947f3d | ||
|
|
19d94471d9 | ||
|
|
8d26f583e9 | ||
|
|
12723d4941 | ||
|
|
0455cb96ca | ||
|
|
532c5d1b9f | ||
|
|
565bb55b13 | ||
|
|
744d85ec4c | ||
|
|
5e60b96cd6 | ||
|
|
8b6f708b7c | ||
|
|
5096e2d68d | ||
|
|
b0325983a1 | ||
|
|
7cd6651895 | ||
|
|
4ec376b296 | ||
|
|
8558533a91 | ||
|
|
de4a953bb7 | ||
|
|
26a41a0672 | ||
|
|
a1d38dc05f | ||
|
|
222841f09b | ||
|
|
fce9de7372 | ||
|
|
8332b77fcc | ||
|
|
f4f1315715 | ||
|
|
5d423c9e63 | ||
|
|
895be02237 | ||
|
|
95475f7b52 | ||
|
|
c3da264cfe | ||
|
|
89c4b969d1 | ||
|
|
9dbc04678c | ||
|
|
ed9e524e03 | ||
|
|
c2d75c7030 | ||
|
|
de84419035 | ||
|
|
d9e0854bb7 | ||
|
|
558b779944 | ||
|
|
628b45efeb | ||
|
|
92cf4c16e3 | ||
|
|
3cad16d2b7 | ||
|
|
e7503c3c7a | ||
|
|
db8e643c62 | ||
|
|
a1337df44f | ||
|
|
ee73eaee5c | ||
|
|
94f3b99ad0 | ||
|
|
d0c4d5616a | ||
|
|
38f36841e3 | ||
|
|
340f3bcf8c | ||
|
|
cd1e03c033 | ||
|
|
ba002a1683 | ||
|
|
457e378d1e | ||
|
|
9781674849 | ||
|
|
d9660e66a8 | ||
|
|
25f4f3900e | ||
|
|
83e904c9f7 | ||
|
|
9bbdb1b3b9 | ||
|
|
f6cdc0575b | ||
|
|
2017bc9cf6 | ||
|
|
7e8e28fc90 | ||
|
|
30c883c85d | ||
|
|
16568c11f1 | ||
|
|
f90982347a | ||
|
|
bd5647351e | ||
|
|
ec77e47cd6 | ||
|
|
565866c529 | ||
|
|
e4a262eb7b | ||
|
|
a3f2fa1b16 | ||
|
|
e0ef3e9984 | ||
|
|
bf30c1a3d7 | ||
|
|
c2c573902f | ||
|
|
d874ebf1b0 | ||
|
|
8ef6032570 | ||
|
|
b32a6951da | ||
|
|
b7bc347323 | ||
|
|
07e49e53c5 | ||
|
|
b87db2a82b | ||
|
|
c150d559c7 | ||
|
|
5dce0db661 | ||
|
|
27514d32de | ||
|
|
fe718ef67f | ||
|
|
e132723475 | ||
|
|
72fc9db38d | ||
|
|
1374e08cd4 | ||
|
|
03e48927a3 | ||
|
|
bbf05fa6fd | ||
|
|
6dad29cae7 | ||
|
|
52afba5a86 | ||
|
|
913a53e436 | ||
|
|
4fd68a4153 | ||
|
|
fae58078f8 | ||
|
|
1d319e001c | ||
|
|
927e6fe23a | ||
|
|
b85eb98303 | ||
|
|
643f124e8b | ||
|
|
6fe4027de5 | ||
|
|
f9d79ba5a6 | ||
|
|
2382f526b2 | ||
|
|
1581e08594 | ||
|
|
37ca78913c | ||
|
|
df3b97c5dd | ||
|
|
953e3f5ba6 | ||
|
|
74b73c6446 | ||
|
|
bc80fb71df | ||
|
|
b0279025d0 | ||
|
|
a45712198b | ||
|
|
704a0fce08 | ||
|
|
d6c708e6ee | ||
|
|
1f24ca9ba2 | ||
|
|
c482db8c89 | ||
|
|
c356639ce9 | ||
|
|
8b0572add1 | ||
|
|
61b1adfb3d | ||
|
|
2f5ea4b305 | ||
|
|
ccc321be8a | ||
|
|
b68861c175 | ||
|
|
2ffcba78cc | ||
|
|
855226d01a | ||
|
|
b8e548d1df | ||
|
|
095f1df947 | ||
|
|
4bd91a811d | ||
|
|
c3b45a62ca | ||
|
|
7b354eec0f | ||
|
|
677ed371a9 | ||
|
|
987caa632b | ||
|
|
3df581152d | ||
|
|
f0ca931dfc | ||
|
|
52541f18f1 | ||
|
|
4ee200e9f6 | ||
|
|
47ef9f74a7 | ||
|
|
92478d0e4f | ||
|
|
0fc73b2bbb | ||
|
|
909c6a8bdf | ||
|
|
be387ccf35 | ||
|
|
6f73afe265 | ||
|
|
65d548d4f9 | ||
|
|
682b27fdd8 | ||
|
|
d213d65a24 | ||
|
|
36780d53c2 | ||
|
|
5a3bbd928a | ||
|
|
69854a8e0c | ||
|
|
78667ce08b | ||
|
|
0ef5749925 | ||
|
|
218104e6e2 | ||
|
|
38b7d44e3a | ||
|
|
332cb64b71 | ||
|
|
f1360d8792 | ||
|
|
269c24a398 | ||
|
|
bad427bfba | ||
|
|
4256546115 | ||
|
|
67fb2e1f59 | ||
|
|
8fab2ae8f0 | ||
|
|
2f80477f7d | ||
|
|
71bb3ccc40 | ||
|
|
4d89dbfaa3 | ||
|
|
2b9d6dc9c4 | ||
|
|
75fb18bcec | ||
|
|
44bf843797 | ||
|
|
37cedafa8f | ||
|
|
09adbf8717 | ||
|
|
56b619b777 | ||
|
|
96e7a3ad8c | ||
|
|
859665fbd0 | ||
|
|
d6f3bf112b | ||
|
|
67c02dcc40 | ||
|
|
4fccc86b03 | ||
|
|
a5d041926a | ||
|
|
c971d3fafe | ||
|
|
7c153d5e76 | ||
|
|
7071b812b6 | ||
|
|
a0a2977b7f | ||
|
|
a63cc0759f | ||
|
|
4c10eed3b1 | ||
|
|
827b3cc5f6 | ||
|
|
ac34bfdad2 | ||
|
|
72ce20224d | ||
|
|
609bd557c5 | ||
|
|
87fe3669a1 | ||
|
|
6df6fc2361 | ||
|
|
48eaab89ba | ||
|
|
a0b0fa48bb | ||
|
|
6534dbf47b | ||
|
|
f4dff676d6 | ||
|
|
77ae3aa387 | ||
|
|
99bed23b95 | ||
|
|
5b012a33c3 | ||
|
|
28f26cce72 | ||
|
|
23b091ea82 | ||
|
|
e92b5e2c05 | ||
|
|
4d60b19194 | ||
|
|
7680cd441c | ||
|
|
d7f8586413 | ||
|
|
83e062c845 | ||
|
|
c6c950596a | ||
|
|
4714a458fe | ||
|
|
1672b01426 | ||
|
|
36c7527b2a | ||
|
|
00e74a05cb | ||
|
|
7904946862 | ||
|
|
88ace5785e | ||
|
|
614d9c127b | ||
|
|
f0551ac122 | ||
|
|
bdfbe4947a | ||
|
|
7b8341d826 | ||
|
|
9d008efabc | ||
|
|
6c3f6fd57f | ||
|
|
533279ec25 | ||
|
|
68d678aff8 | ||
|
|
6767edfaff | ||
|
|
b1acc9a8ef | ||
|
|
16dde03f96 | ||
|
|
5a7462972f | ||
|
|
4c60b40c64 | ||
|
|
90bcaee2c9 | ||
|
|
a4973c9c38 | ||
|
|
6c39ac80e6 | ||
|
|
979c5e7c0c | ||
|
|
2250b3c37a | ||
|
|
e578a29058 | ||
|
|
4c50d35945 | ||
|
|
7b8885c05e | ||
|
|
1e6df86b7b | ||
|
|
4e9b2d0e97 | ||
|
|
67f3263a2e | ||
|
|
f61567be81 | ||
|
|
3ee8f6ac25 | ||
|
|
5eb630d858 | ||
|
|
e7d07c7924 | ||
|
|
ab44d27914 | ||
|
|
1889958e2b | ||
|
|
b78729319c | ||
|
|
7d478fd378 | ||
|
|
1cb237e8e1 | ||
|
|
8a3745aee8 | ||
|
|
84ff476dfa | ||
|
|
b3935bfda8 | ||
|
|
2ae64d0abe | ||
|
|
e21b923194 | ||
|
|
9ab90aa3b9 | ||
|
|
797db9aa8b | ||
|
|
982421b9b3 | ||
|
|
d0d7e7f369 | ||
|
|
0b35c833f3 | ||
|
|
aef58921ce | ||
|
|
b681d9ba90 | ||
|
|
caedb34d00 | ||
|
|
251fa70228 | ||
|
|
ced2f0c3d4 | ||
|
|
25514e1030 | ||
|
|
196454c7ab | ||
|
|
331b65e384 | ||
|
|
794140f3c1 | ||
|
|
22eeeaf231 | ||
|
|
aff531a274 | ||
|
|
c1ff010283 | ||
|
|
bb3376d1aa | ||
|
|
bcd49186fb | ||
|
|
c0f2745d30 | ||
|
|
64959c75fe | ||
|
|
82fdb84e61 | ||
|
|
10acd16e17 | ||
|
|
21adfeed89 | ||
|
|
791f12401f | ||
|
|
55c7b2aedf | ||
|
|
40d51dc7ef | ||
|
|
378d66f36a | ||
|
|
fd26beb941 | ||
|
|
c7dc68c848 | ||
|
|
6ae3691f20 | ||
|
|
5d5062c262 | ||
|
|
509033e2b8 | ||
|
|
7584b0acc4 | ||
|
|
dd34ab8d9b | ||
|
|
c6f3b03891 | ||
|
|
d765cc8633 | ||
|
|
4b0507c4d3 | ||
|
|
4523ef87b7 | ||
|
|
2b55ceba7a | ||
|
|
b2eeef8d38 | ||
|
|
d674f4dd70 | ||
|
|
0406948c4b | ||
|
|
366e0f6061 | ||
|
|
3c12e825f5 | ||
|
|
925afbd03f | ||
|
|
bfa9478649 | ||
|
|
19f5f2a7a4 | ||
|
|
c1ca72dd3c | ||
|
|
495a48bc87 | ||
|
|
687c5cea08 | ||
|
|
b0c0918580 | ||
|
|
d78fde88ce | ||
|
|
56b652d185 | ||
|
|
c69d023685 | ||
|
|
99a249ac5c | ||
|
|
060f10f064 | ||
|
|
1e5f80ace6 | ||
|
|
cd5e8801e4 | ||
|
|
7dd6f9b97c | ||
|
|
28b7cd6e90 | ||
|
|
6bfa95f8a8 | ||
|
|
b0d5049e68 | ||
|
|
5a9fa8592a | ||
|
|
bc4cb480be | ||
|
|
897a8a084e | ||
|
|
afe2041e94 | ||
|
|
ad1d8d3cd2 | ||
|
|
4fe33a0b7a | ||
|
|
d927ede388 | ||
|
|
6f5f69db2b | ||
|
|
e64846b2c1 | ||
|
|
8842c02136 | ||
|
|
adbc4bc402 | ||
|
|
3be43c4848 | ||
|
|
e24e8297f1 | ||
|
|
c58446359c | ||
|
|
dc5e13d13c | ||
|
|
cf7c11a106 | ||
|
|
b0d1290e66 | ||
|
|
60d48f2002 | ||
|
|
9627238966 | ||
|
|
d89f2c87e5 | ||
|
|
242b42ba95 | ||
|
|
b1a9c2bf49 | ||
|
|
b6bc386072 | ||
|
|
a1625d1768 | ||
|
|
1e0cc86288 | ||
|
|
b4a8418e10 | ||
|
|
e4ceb962e9 | ||
|
|
c6ed0b63c9 | ||
|
|
4794c21fb4 | ||
|
|
e7f54503c1 | ||
|
|
bdc0a4caf1 | ||
|
|
5499388777 | ||
|
|
4cc3c01dcb | ||
|
|
f5f7bc449a | ||
|
|
0fbc2ab821 | ||
|
|
329197902e | ||
|
|
f303bfdbfd | ||
|
|
0156c3a59d | ||
|
|
6f9f5880ee | ||
|
|
29d755433f | ||
|
|
c63fa7ec97 | ||
|
|
dc2b690fa4 | ||
|
|
97ec269838 | ||
|
|
58ec17ce10 | ||
|
|
1b00a816e3 | ||
|
|
911d3769f6 | ||
|
|
3f3a02147b | ||
|
|
a7450dfe37 | ||
|
|
fe5eff890f | ||
|
|
539ec529c2 | ||
|
|
bc8e56e7da | ||
|
|
332a6bc550 | ||
|
|
480e3a8bfd | ||
|
|
34f20ffd1a | ||
|
|
cbab67a2fd | ||
|
|
559fb4d4a4 | ||
|
|
a47b1e7f5d | ||
|
|
141e728c0f | ||
|
|
024d01b300 | ||
|
|
cbf47f46ea | ||
|
|
74c493f39c | ||
|
|
37624a912e | ||
|
|
997135d7c0 | ||
|
|
31f3639c15 | ||
|
|
70a9ad2f3d | ||
|
|
b1fe737a03 | ||
|
|
6f974c035d | ||
|
|
3c091f9cce | ||
|
|
b2268861b0 | ||
|
|
4b5b9e8d1c | ||
|
|
c5c2f735cc | ||
|
|
ed6c78dd50 | ||
|
|
c303f8a683 | ||
|
|
1d27a27751 | ||
|
|
9776624c32 | ||
|
|
2ebb5259a0 | ||
|
|
ce88d1caae | ||
|
|
80a2b5da34 | ||
|
|
92eea6d7b2 | ||
|
|
25fa9a8121 | ||
|
|
4c4a39994c | ||
|
|
a7a971f444 | ||
|
|
946e5d28e9 | ||
|
|
addd70dfe8 | ||
|
|
6a14cb57e6 | ||
|
|
1c1affa7bd | ||
|
|
8b25ac1685 | ||
|
|
ff549a5ab0 | ||
|
|
74b71bb926 | ||
|
|
f1eb5420a7 | ||
|
|
0d04077d6e | ||
|
|
3fe10d8d3d | ||
|
|
9b0cc70542 | ||
|
|
38599ec4b9 | ||
|
|
7d4ea57381 | ||
|
|
538b99055c | ||
|
|
3acfcd4a95 | ||
|
|
fd3ab6221c | ||
|
|
e05369ffd9 | ||
|
|
2376200a73 | ||
|
|
7e1e7851cc | ||
|
|
7a8e345084 | ||
|
|
9b42200746 | ||
|
|
e8e2731c6f | ||
|
|
4167451da6 | ||
|
|
48f288789f | ||
|
|
0574a9733c | ||
|
|
67bee6d620 | ||
|
|
72dd7fb138 | ||
|
|
92f9cf3621 | ||
|
|
aafea237f3 | ||
|
|
a130013c5d | ||
|
|
9a1b0e6ea8 | ||
|
|
acbaedb44f | ||
|
|
ab667d0bc8 | ||
|
|
73acfb5d7c | ||
|
|
641c0a09e5 | ||
|
|
e053a22f1b | ||
|
|
8d3046269b | ||
|
|
14620d9b52 | ||
|
|
ca4dd8a75d | ||
|
|
41f971a4d5 | ||
|
|
3c8bf348d1 | ||
|
|
6e4ff4705b | ||
|
|
d73b069944 | ||
|
|
9c500f290e | ||
|
|
f82fe620dd | ||
|
|
de89610011 | ||
|
|
c15fb4043b | ||
|
|
7f5c74b502 | ||
|
|
0d1fc17db9 | ||
|
|
32ff9840b8 | ||
|
|
07e5385fa2 | ||
|
|
fb3d0269a1 | ||
|
|
fceffc05e7 | ||
|
|
4a3043e113 | ||
|
|
aa90a4aec8 | ||
|
|
2f9744fe9d | ||
|
|
8fe3945c4c | ||
|
|
db00ef83c0 | ||
|
|
40fd5cd41e | ||
|
|
4dc774c11c | ||
|
|
f48d97e132 | ||
|
|
b341228dd9 | ||
|
|
813a534b41 | ||
|
|
086cd21cea | ||
|
|
69ec85ef19 | ||
|
|
0336f7ccf8 | ||
|
|
4994a90be9 | ||
|
|
d73e5f8dc7 | ||
|
|
3d44d381bc | ||
|
|
39dd832c84 | ||
|
|
1ae58837db | ||
|
|
739c279526 | ||
|
|
8b7dc057e1 | ||
|
|
9c87792c63 | ||
|
|
31fa23a388 | ||
|
|
08ce6be3ff | ||
|
|
2d68216699 | ||
|
|
0002056e51 | ||
|
|
4636409724 | ||
|
|
3b7fa93e72 | ||
|
|
d10a2764af | ||
|
|
718a313673 | ||
|
|
d00cdec296 | ||
|
|
e650be3814 | ||
|
|
c59fe0e4ad | ||
|
|
b191b67f21 | ||
|
|
9c09cb874e | ||
|
|
b661547817 | ||
|
|
2d7ca2a7db | ||
|
|
d6fdf887ce | ||
|
|
4f4689c4e9 | ||
|
|
8ff2c930ee | ||
|
|
bad1183f42 | ||
|
|
20d54d5a04 | ||
|
|
938bb429d8 | ||
|
|
57a9f3747b | ||
|
|
8d601a065e | ||
|
|
125b648af7 | ||
|
|
97154d2065 | ||
|
|
b4b80dd0cf | ||
|
|
cdd1f0bb65 | ||
|
|
e3e4dba90d | ||
|
|
b726a8528b | ||
|
|
b5a3567238 | ||
|
|
dff26e68b9 | ||
|
|
d7c94726fd | ||
|
|
0aeadb37af | ||
|
|
ec7d006069 | ||
|
|
a1aa87940b | ||
|
|
031a80cd88 | ||
|
|
3f7819f6bb | ||
|
|
c5cb91a882 | ||
|
|
658a9288f1 | ||
|
|
b050e3dcd4 | ||
|
|
9dd63fd1e1 | ||
|
|
b5d56f9992 | ||
|
|
c69a05efa5 | ||
|
|
ff06513115 | ||
|
|
65bab15c7f | ||
|
|
fe5922c0a0 | ||
|
|
5991c5de30 | ||
|
|
c107652e9a | ||
|
|
397c6e9c50 | ||
|
|
d2a51b4bca | ||
|
|
019da862dd | ||
|
|
6d1899d72e | ||
|
|
abcdfb03d9 | ||
|
|
d66e375d8a | ||
|
|
2a72ae073a | ||
|
|
d4e856d437 | ||
|
|
b7cf58e167 | ||
|
|
00a0a4337e | ||
|
|
52536e0e45 | ||
|
|
7d8da2c399 | ||
|
|
f96a38f8d6 | ||
|
|
1448796fa7 | ||
|
|
5065f5e7e4 | ||
|
|
f4e2449822 | ||
|
|
4e095aaeb4 | ||
|
|
84eb3c64fd | ||
|
|
e671d01ff2 | ||
|
|
17255de669 | ||
|
|
4be52f76eb | ||
|
|
c5efe9fd7f | ||
|
|
7101655ed7 | ||
|
|
7fc3ac587a | ||
|
|
fdc29ee8c2 | ||
|
|
ba9d185eb4 | ||
|
|
ec69af7938 | ||
|
|
39b1980509 | ||
|
|
d6d40c8e12 | ||
|
|
d9a5f052a1 | ||
|
|
d5df53bb60 | ||
|
|
c288d31762 | ||
|
|
11adf4b196 | ||
|
|
30add37bd6 | ||
|
|
666bc5b036 | ||
|
|
f320daa93c | ||
|
|
e20b083f0b | ||
|
|
2bbfd47ac2 | ||
|
|
d596eb754a | ||
|
|
ba3d342e2b | ||
|
|
f252f134b2 | ||
|
|
63d5547d1e | ||
|
|
0c2aa8de45 | ||
|
|
15515f2840 | ||
|
|
2d1fd0c8c5 | ||
|
|
93d60e4305 | ||
|
|
e98792a6af | ||
|
|
7f1b696edd | ||
|
|
25649c2aa9 | ||
|
|
a2f7025940 | ||
|
|
3e5e4790bf | ||
|
|
41263ab031 | ||
|
|
e006a69535 | ||
|
|
41b7724d7e | ||
|
|
db5a80a7e1 | ||
|
|
ffac6e38dc | ||
|
|
e97e377723 | ||
|
|
18547929ca | ||
|
|
813c76d55b | ||
|
|
3621effb36 | ||
|
|
3d8fa8e7ea | ||
|
|
b4a345d182 | ||
|
|
675e93b99a | ||
|
|
34b4aaa828 | ||
|
|
5b7fe8cf88 | ||
|
|
0fb0d3b2db | ||
|
|
01d825fc2a | ||
|
|
9d5d60fa88 | ||
|
|
f3b61ce87c | ||
|
|
5cb0256a58 | ||
|
|
1539ad1344 | ||
|
|
b2ab5629e8 | ||
|
|
166d75454e | ||
|
|
0c9d62977c | ||
|
|
d34515b9e0 | ||
|
|
da371fa560 | ||
|
|
44ae470d7e | ||
|
|
2dc0bf2104 | ||
|
|
3b9727942a | ||
|
|
cffd16a6a1 | ||
|
|
9fca6a7953 | ||
|
|
1ec41d0f77 | ||
|
|
0031e19c70 | ||
|
|
99c0bda7f2 | ||
|
|
d831d06da9 | ||
|
|
429f748ad8 | ||
|
|
82f3d8d18c | ||
|
|
308cc0cfb9 | ||
|
|
9acaa94895 | ||
|
|
a92cdb2926 | ||
|
|
7969edf1b4 | ||
|
|
7af7842fe9 | ||
|
|
70dc53db6e | ||
|
|
05dad04384 | ||
|
|
261d6e7d76 | ||
|
|
119eb5a4b8 | ||
|
|
18d93fb07d | ||
|
|
984624bdc4 | ||
|
|
d1211bdb1a | ||
|
|
996f53786f | ||
|
|
0fee9a3480 | ||
|
|
ec59d3a8e8 | ||
|
|
c7d00d4d11 | ||
|
|
7267c2dec9 | ||
|
|
23a1a55bf2 | ||
|
|
7a5be5456d | ||
|
|
6902868e58 | ||
|
|
7256d4ff91 | ||
|
|
bdf03486d2 | ||
|
|
baac572666 | ||
|
|
6a8cd15456 | ||
|
|
41d33ae538 | ||
|
|
5be5787afd | ||
|
|
8ad3c79589 | ||
|
|
dc886c9fc5 | ||
|
|
7c0ab217ee | ||
|
|
28fbd2487e | ||
|
|
6ed02e593c | ||
|
|
37a242a679 | ||
|
|
164b40fef3 | ||
|
|
cd3554eecf | ||
|
|
14311eb8b0 | ||
|
|
f12428f80d | ||
|
|
2f707974e2 | ||
|
|
1af06b2413 | ||
|
|
121669ee69 | ||
|
|
e7c53e4abb | ||
|
|
352749c798 | ||
|
|
1e87fb8d94 | ||
|
|
7f565c305c | ||
|
|
bcf187761c | ||
|
|
fd0a2bea2f | ||
|
|
528082b49f | ||
|
|
d5e0484de3 | ||
|
|
52aaedd33a | ||
|
|
558108008a | ||
|
|
eb33493c79 | ||
|
|
276d6b30d1 | ||
|
|
4667ccbe43 | ||
|
|
b8f963cd29 | ||
|
|
b18afacedb | ||
|
|
e4142571d7 | ||
|
|
40dbf85f77 | ||
|
|
491ac02c0d | ||
|
|
eb7d7d7316 | ||
|
|
7688f83134 | ||
|
|
36b6b6b857 | ||
|
|
296b8b36ab | ||
|
|
83b615bc37 | ||
|
|
682defcbcf | ||
|
|
810399d337 | ||
|
|
26b57e2d4d | ||
|
|
fcaa2f8aa9 | ||
|
|
06cff22caa | ||
|
|
aa7d1d3f48 | ||
|
|
18933ad118 | ||
|
|
8516cbb64d | ||
|
|
73f5547a5e | ||
|
|
0e6da344ba | ||
|
|
ce28cb1f0e | ||
|
|
911de0727f | ||
|
|
e7678b8b6a | ||
|
|
7eedf6e694 | ||
|
|
7bf0299d33 | ||
|
|
3e54fd765c | ||
|
|
220fb17824 | ||
|
|
be6c8462f0 | ||
|
|
8822067311 | ||
|
|
a5b1065195 | ||
|
|
904f412495 | ||
|
|
2fa6c5cd97 | ||
|
|
7bf4cc73b6 | ||
|
|
bafcf07300 | ||
|
|
dc666e96b3 | ||
|
|
15bb78d447 | ||
|
|
0771ccc9a6 | ||
|
|
3b0387901f | ||
|
|
2b13ae3ad8 | ||
|
|
2e9310daf1 | ||
|
|
e7ce62c7ff | ||
|
|
bf4c16b063 | ||
|
|
0f80e66a01 | ||
|
|
dde6581f9c | ||
|
|
0c0c8c63a7 | ||
|
|
ecb9fe9d5c | ||
|
|
56f8ca47dc | ||
|
|
29bf2e473d | ||
|
|
6a6c5db88d | ||
|
|
9f8a6a6f5e | ||
|
|
2035739131 | ||
|
|
b762cce94d | ||
|
|
a325eb921f | ||
|
|
ce1608ab2c | ||
|
|
14074d066c | ||
|
|
7b1b2ce9d7 | ||
|
|
49b2cf68e9 | ||
|
|
bc1b64a688 | ||
|
|
c3336b7d0f | ||
|
|
3064477066 | ||
|
|
93d1e1f24d | ||
|
|
ab4f589816 | ||
|
|
85ee0751bd | ||
|
|
eca5265735 | ||
|
|
188baaf180 | ||
|
|
29ae767c17 | ||
|
|
429be9f774 | ||
|
|
69ac6c0d73 | ||
|
|
50bd0302b6 | ||
|
|
84ab0e5daa | ||
|
|
d618ef2759 | ||
|
|
cd464ed01e | ||
|
|
34dd96ec68 | ||
|
|
ab7e271f1d | ||
|
|
f855bb7f4e | ||
|
|
2800ca05a1 | ||
|
|
0fc77dddd6 | ||
|
|
47b1675dea | ||
|
|
83a77acc02 | ||
|
|
6c424dff6a | ||
|
|
9c8ebdd1d3 | ||
|
|
419fb1bb81 | ||
|
|
61c04d5e31 | ||
|
|
2853d6e1a4 | ||
|
|
64137f68a8 | ||
|
|
cf23980f0b | ||
|
|
dfeefc2e6f | ||
|
|
84f973ce26 | ||
|
|
30f7d0a070 | ||
|
|
ede732417e | ||
|
|
31f2ececa8 | ||
|
|
96bcb34d81 | ||
|
|
de05bdc968 | ||
|
|
b551c931e9 | ||
|
|
f50268c806 | ||
|
|
073c5824bb | ||
|
|
f74ed8ed93 | ||
|
|
e5e0ae7527 | ||
|
|
2a36a0c22f | ||
|
|
cd342691ca | ||
|
|
f8e7f1a975 | ||
|
|
f278b42353 | ||
|
|
1e87c21956 | ||
|
|
b1ae352d88 | ||
|
|
cf3de1c657 | ||
|
|
380d358a54 | ||
|
|
87bc9432f3 | ||
|
|
7731d69929 | ||
|
|
d1cb2625ca | ||
|
|
9986c3405e | ||
|
|
b38479f92d | ||
|
|
21f7c82a95 | ||
|
|
88ec1a15f1 | ||
|
|
3774b967f8 | ||
|
|
defdaeee2e | ||
|
|
6f61c7b5e7 | ||
|
|
4426ab52d3 | ||
|
|
990e39cadb | ||
|
|
4cbd92abf3 | ||
|
|
7b3937af11 | ||
|
|
fc363925cd | ||
|
|
34c6ab3e06 | ||
|
|
b748270249 | ||
|
|
25687953c5 | ||
|
|
4381eff384 | ||
|
|
87fae7f2e4 | ||
|
|
0e977b45cb | ||
|
|
e47cc86259 | ||
|
|
2d1e7f7756 | ||
|
|
35c3f3d71e | ||
|
|
567f789dab | ||
|
|
84ed13d791 | ||
|
|
81c0771f3b | ||
|
|
a2dbf56d2e | ||
|
|
589e422767 | ||
|
|
fc5c4658d1 | ||
|
|
c5937077c4 | ||
|
|
7297ce88b5 | ||
|
|
7a3d696c6a | ||
|
|
ae4bc4471e | ||
|
|
c4fc03d7af | ||
|
|
94e63e78d1 | ||
|
|
02f7a56aeb | ||
|
|
000bf6aebc | ||
|
|
fcd537b091 | ||
|
|
a9a2d296bf | ||
|
|
df95189e87 | ||
|
|
dc09840f99 | ||
|
|
b8952259ba | ||
|
|
37e6158b57 | ||
|
|
254672f2dd | ||
|
|
59e9af11fc | ||
|
|
ee19c268cc | ||
|
|
cf2eea43c9 | ||
|
|
de5f85dacf | ||
|
|
0abd2df357 | ||
|
|
88382d2856 | ||
|
|
7a45a534fc | ||
|
|
60ba3f9127 | ||
|
|
345ba3a202 | ||
|
|
55185aab5c | ||
|
|
f5940db7b1 | ||
|
|
e128f3484b | ||
|
|
74faad408e | ||
|
|
fa027863a2 | ||
|
|
7c9d5ef8dc | ||
|
|
48de5d7c22 | ||
|
|
87ccff6a7b | ||
|
|
0db0b3bd88 | ||
|
|
ca38e20345 | ||
|
|
2069d150a3 | ||
|
|
e2ca3873a8 | ||
|
|
bb1561b628 | ||
|
|
3527177ea9 | ||
|
|
a4ee4be2b4 | ||
|
|
17de0ab19e | ||
|
|
c6c87fe55a | ||
|
|
38ebfa364f | ||
|
|
5b7920c788 | ||
|
|
c86a3af042 | ||
|
|
00375949b5 | ||
|
|
ed1c87c521 | ||
|
|
7e383fcc10 | ||
|
|
5d29ce2ad0 | ||
|
|
464ca7a61b | ||
|
|
4aa23f1e12 | ||
|
|
0b3df4c7d7 | ||
|
|
97c6385c36 | ||
|
|
cf4865828c | ||
|
|
50b9eec6c1 | ||
|
|
006505b32c | ||
|
|
057e8d5f8e | ||
|
|
401dd7c96c | ||
|
|
38563a443c | ||
|
|
a431cbcf9e | ||
|
|
c2bae1f25a | ||
|
|
f1cfe41d07 | ||
|
|
e25597106e | ||
|
|
12800b730d | ||
|
|
868b472b98 | ||
|
|
11393abfbe | ||
|
|
c21b767654 | ||
|
|
5f7ab0330a | ||
|
|
e07596b642 | ||
|
|
0d7a16ad46 | ||
|
|
268bb10d1e | ||
|
|
cbb03b3f44 | ||
|
|
d2c363cd81 | ||
|
|
d5a958353f | ||
|
|
af86e0945f | ||
|
|
6a2b81bc17 | ||
|
|
e5bc565d7e | ||
|
|
101d972a14 | ||
|
|
a97c24634b | ||
|
|
7af2ddca86 | ||
|
|
abadb69443 | ||
|
|
50bd15c5a8 | ||
|
|
3f793e8c18 | ||
|
|
7f0a70a070 | ||
|
|
3eebf840f2 | ||
|
|
d2a8877069 | ||
|
|
f85c0ce495 | ||
|
|
e1253413d5 | ||
|
|
a152ae3e06 | ||
|
|
d9952f7401 | ||
|
|
fa5f1900f0 | ||
|
|
fb8b233560 | ||
|
|
26d9aa570c | ||
|
|
b56b149bdb | ||
|
|
aec5eb9161 | ||
|
|
f8d2a76784 | ||
|
|
d251509beb | ||
|
|
635681b634 | ||
|
|
cb1f6307dc | ||
|
|
3e4697eb51 | ||
|
|
f2643103b3 | ||
|
|
941a391c0e | ||
|
|
04012e5fff | ||
|
|
74bb3ccb7e | ||
|
|
8a9ed3d9f1 | ||
|
|
94a5edc1eb | ||
|
|
2e42ef2043 | ||
|
|
849da2a423 | ||
|
|
388156b7b8 | ||
|
|
96525584e2 | ||
|
|
864e6c6139 | ||
|
|
661c081a77 | ||
|
|
4b900f9b8f | ||
|
|
9765799bc7 | ||
|
|
3e7df9cb7a | ||
|
|
222e304c93 | ||
|
|
9a187b8e82 | ||
|
|
2614c86079 | ||
|
|
af2c068970 | ||
|
|
8638952afe | ||
|
|
e3750a2988 | ||
|
|
80ebbc9228 | ||
|
|
36d65bf7ac | ||
|
|
e549ab2cbb | ||
|
|
c9d91d178b | ||
|
|
3ec08a8f48 | ||
|
|
111804b665 | ||
|
|
a05fae7b75 | ||
|
|
d9903e1be2 | ||
|
|
36d40f8312 | ||
|
|
08c219a291 | ||
|
|
316b132ac5 | ||
|
|
b4a2124d1b | ||
|
|
256a714d55 | ||
|
|
1b03a55dae | ||
|
|
c21bf7014e | ||
|
|
bf0b443d4b | ||
|
|
e8e6471f02 | ||
|
|
77af777b89 | ||
|
|
4735d92a0f | ||
|
|
2057864116 | ||
|
|
122c43c18a | ||
|
|
97cd522726 | ||
|
|
7e5c8bd596 | ||
|
|
16989a077d | ||
|
|
2852589598 | ||
|
|
b618dd4e00 | ||
|
|
8172cb8fc0 | ||
|
|
5d8906f1d8 | ||
|
|
87867edfca | ||
|
|
a14f04c25b | ||
|
|
8b06c897f6 | ||
|
|
8f7ab2a243 | ||
|
|
23da3259c4 | ||
|
|
5b7f68f77d | ||
|
|
2368267bb8 | ||
|
|
09b50b2b48 | ||
|
|
59c0207301 | ||
|
|
b618e86512 | ||
|
|
5d4448b659 | ||
|
|
89877f7ff2 | ||
|
|
32636359e1 | ||
|
|
9d3f2deef1 | ||
|
|
fc69afcffc | ||
|
|
af17373afa | ||
|
|
c233fbfffb | ||
|
|
2c08bfcfd1 | ||
|
|
be9bf3fd34 | ||
|
|
9d5851e9be | ||
|
|
3e73f6ccb4 | ||
|
|
33414f4c68 | ||
|
|
6ac4b87a84 | ||
|
|
d15242ced7 | ||
|
|
b81d163e1d | ||
|
|
d0315b7ed3 | ||
|
|
3c76594abb | ||
|
|
db5aa1a98c | ||
|
|
4a61df8ae7 | ||
|
|
95da4e9eab | ||
|
|
510c429956 | ||
|
|
55d09ac569 | ||
|
|
d2923228da | ||
|
|
a86d2d2df3 | ||
|
|
67c8953a84 | ||
|
|
d4c4e31804 | ||
|
|
78807a8ea8 | ||
|
|
fa4fbdc7c4 | ||
|
|
036bd61ded | ||
|
|
cb556093c1 | ||
|
|
729b52cf0a | ||
|
|
0e6aec2533 | ||
|
|
993d5114e3 | ||
|
|
4312ed9181 | ||
|
|
0eb8e0c55c | ||
|
|
6a47752665 | ||
|
|
5231ae2383 | ||
|
|
03ba127fab | ||
|
|
6b93b973e2 | ||
|
|
64e646b526 | ||
|
|
9d66507050 | ||
|
|
b10b8df791 | ||
|
|
e40c7289c4 | ||
|
|
e38e4532b3 | ||
|
|
7bd0fdfa6a | ||
|
|
0b6518a751 | ||
|
|
96faf31618 |
7
.gitignore
vendored
@@ -1,10 +1,11 @@
|
||||
packages/*
|
||||
lib/classes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/*/
|
||||
temp/*
|
||||
templates/*
|
||||
logs/*
|
||||
install/update.log
|
||||
.buildpath
|
||||
.project
|
||||
.settings/
|
||||
*.diff
|
||||
*~
|
||||
.well-known
|
||||
.idea
|
||||
*.iml
|
||||
74
README.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# Froxlor
|
||||
|
||||
The server administration software for your needs.
|
||||
Developed by experienced server administrators, this panel simplifies the effort of managing your hosting platform.
|
||||
|
||||
## Installation
|
||||
|
||||
### Fast install
|
||||
1. Ensure that your webserver serves /var/www
|
||||
2. Extract froxlor into /var/www
|
||||
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!
|
||||
|
||||
### Detailed installation
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki/Installationtarball
|
||||
|
||||
## Help
|
||||
|
||||
You may find help in the following places:
|
||||
|
||||
### IRC
|
||||
|
||||
froxlor may be found on freenode.net, channel #froxlor:
|
||||
irc://chat.freenode.net/froxlor
|
||||
|
||||
### Forum
|
||||
|
||||
The community is located on http://forum.froxlor.org
|
||||
|
||||
### Wiki
|
||||
|
||||
More documentation may be found in the froxlor - wiki:
|
||||
http://redmine.froxlor.org/projects/froxlor/wiki
|
||||
|
||||
## License
|
||||
|
||||
May be found in COPYING
|
||||
|
||||
## Downloads
|
||||
|
||||
### Tarball
|
||||
http://files.froxlor.org/releases/froxlor-latest.tar.gz [MD5](http://files.froxlor.org/releases/froxlor-latest.tar.gz.md5) [SHA1](http://files.froxlor.org/releases/froxlor-latest.tar.gz.sha1)
|
||||
|
||||
### Debian repository
|
||||
|
||||
[HowTo](http://redmine.froxlor.org/projects/froxlor/wiki/Installationdebian)
|
||||
|
||||
/etc/apt/sources.list.d/froxlor.list
|
||||
> deb http://debian.froxlor.org {wheezy|jessie} main
|
||||
|
||||
### Gentoo repository
|
||||
|
||||
[HowTo](http://redmine.froxlor.org/projects/froxlor/wiki/Installationgentoo)
|
||||
|
||||
http://files.froxlor.org/gentoo/repositories.xml
|
||||
|
||||
## Let's Encrypt support
|
||||
|
||||
This version of Froxlor contains a test implementation of support for [Let's Encrypt](https://letsencrypt.org). This is (as Let's Encrypt is in itself)
|
||||
still a beta version and may break your system. The way it currently works is by creating a (sub-)domain with the default system - certificate,
|
||||
after which the Let's Encrypt cronjob orders the certificate for this (sub-)domain and inserts the certificates in the database. With the next run
|
||||
of the default cronjob, the certificates will be updated on the disk and the webserver reloaded.
|
||||
|
||||
This has 2 known side-effects at the moment:
|
||||
* The basic ip/port combinations don't work with the Froxlor - integration of Let's Encrypt, since it needs a certificate for the very first creation
|
||||
* After creating a domain, it will have the default certificate for a short time (by default 5 minutes until the cronjob runs the next time)
|
||||
|
||||
It may be possible to fix these issues, but they are not a priority at the moment
|
||||
|
||||
@@ -93,23 +93,6 @@ return array(
|
||||
'option_options' => array('Manual' => $lng['serversettings']['manual'], 'Dropdown' => $lng['serversettings']['dropdown']),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'use_webfonts' => array(
|
||||
'label' => $lng['serversettings']['enablewebfonts'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'use_webfonts',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'webfont' => array(
|
||||
'label' => $lng['serversettings']['definewebfont']['title'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'webfont',
|
||||
'type' => 'string',
|
||||
'default' => 'Numans',
|
||||
'string_emptyallowed' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_adminmail' => array(
|
||||
'label' => $lng['serversettings']['adminmail'],
|
||||
'settinggroup' => 'panel',
|
||||
@@ -194,6 +177,32 @@ return array(
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'admin_show_news_feed' => array(
|
||||
'label' => $lng['admin']['show_news_feed'],
|
||||
'settinggroup' => 'admin',
|
||||
'varname' => 'show_news_feed',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_show_news_feed' => array(
|
||||
'label' => $lng['admin']['customer_show_news_feed'],
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'show_news_feed',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'customer_news_feed_url' => array(
|
||||
'label' => $lng['admin']['customer_news_feed_url'],
|
||||
'settinggroup' => 'customer',
|
||||
'varname' => 'news_feed_url',
|
||||
'type' => 'string',
|
||||
'string_type' => 'url',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_domain_change_admin' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_domain_change_admin'],
|
||||
'settinggroup' => 'panel',
|
||||
|
||||
@@ -70,6 +70,46 @@ return array(
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_alpha_lower' => array(
|
||||
'label' => $lng['serversettings']['panel_password_alpha_lower'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_alpha_lower',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_alpha_upper' => array(
|
||||
'label' => $lng['serversettings']['panel_password_alpha_upper'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_alpha_upper',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_numeric' => array(
|
||||
'label' => $lng['serversettings']['panel_password_numeric'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_numeric',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_special_char_required' => array(
|
||||
'label' => $lng['serversettings']['panel_password_special_char_required'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_special_char_required',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_special_char' => array(
|
||||
'label' => $lng['serversettings']['panel_password_special_char'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'password_special_char',
|
||||
'type' => 'string',
|
||||
'default' => '!?<>§$%+#=@',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_password_regex' => array(
|
||||
'label' => $lng['serversettings']['panel_password_regex'],
|
||||
'settinggroup' => 'panel',
|
||||
|
||||
@@ -55,7 +55,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'defaultip',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options_method' => 'getIpPortCombinations',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingDefaultIp',
|
||||
@@ -160,17 +160,7 @@ return array(
|
||||
'default' => 90,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_debug_cron' => array(
|
||||
'label' => $lng['serversettings']['cron']['debug'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'debug_cron',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
67
actions/admin/settings/125.cronjob.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2014 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(
|
||||
'crond' => array(
|
||||
'title' => $lng['admin']['cronsettings'],
|
||||
'fields' => array(
|
||||
'system_cronconfig' => array(
|
||||
'label' => $lng['serversettings']['system_cronconfig'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'cronconfig',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/cron.d/froxlor',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_croncmdline' => array(
|
||||
'label' => $lng['serversettings']['system_croncmdline'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'croncmdline',
|
||||
'type' => 'string',
|
||||
'default' => '/usr/bin/nice -n 5 /usr/bin/php -q',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_crondreload' => array(
|
||||
'label' => $lng['serversettings']['system_crondreload'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'crondreload',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/cron reload',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_cron_allowautoupdate' => array(
|
||||
'label' => $lng['serversettings']['system_cron_allowautoupdate'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'cron_allowautoupdate',
|
||||
'type' => 'bool',
|
||||
'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',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -31,6 +31,7 @@ return array(
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('apache2' => 'Apache 2', 'lighttpd' => 'ligHTTPd', 'nginx' => 'Nginx'),
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkPhpInterfaceSetting',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_apache_24' => array(
|
||||
@@ -42,13 +43,23 @@ return array(
|
||||
'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'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'www-data',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
),
|
||||
'system_httpgroup' => array(
|
||||
'label' => $lng['admin']['webserver_group'],
|
||||
@@ -81,7 +92,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apacheconf_htpasswddir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/apache2/htpasswd/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
@@ -99,8 +110,8 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'customer_ssl_path',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/apache2/ssl/',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/ssl/froxlor-custom/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpappendopenbasedir' => array(
|
||||
|
||||
@@ -31,6 +31,15 @@ return array(
|
||||
'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',
|
||||
@@ -51,6 +60,16 @@ return array(
|
||||
'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',
|
||||
@@ -61,16 +80,69 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_cert_chainfile' => array(
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile'],
|
||||
'system_leenabled' => array(
|
||||
'label' => $lng['serversettings']['leenabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_chainfile',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'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',
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_configdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/var/www/php-fcgi-scripts/',
|
||||
'plausibility_check_method' => 'checkPathConflicts',
|
||||
'save_method' => 'storeSettingField',
|
||||
@@ -112,7 +112,7 @@ return array(
|
||||
'varname' => 'mod_fcgid_httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_mod_fcgid_httpgroup' => array(
|
||||
@@ -129,7 +129,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_defaultini_ownvhost',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'default' => '2',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
|
||||
@@ -44,7 +44,7 @@ return array(
|
||||
'varname' => 'vhost_httpuser',
|
||||
'type' => 'string',
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField'
|
||||
'save_method' => 'storeSettingWebserverFcgidFpmUser'
|
||||
),
|
||||
'system_phpfpm_httpgroup' => array(
|
||||
'label' => $lng['phpfpm']['vhost_httpgroup'],
|
||||
@@ -62,35 +62,35 @@ return array(
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'vhost_defaultini',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'default' => '2',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_configdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'configdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_aliasconfigdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'aliasconfigdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'string_type' => 'confdir',
|
||||
'default' => '/var/www/php-fpm/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
@@ -99,7 +99,7 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/tmp/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_peardir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['peardir'],
|
||||
@@ -108,7 +108,16 @@ return array(
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/usr/share/php/:/usr/share/php5/',
|
||||
'save_method' => 'storeSettingField',
|
||||
'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'],
|
||||
@@ -116,7 +125,7 @@ return array(
|
||||
'varname' => 'reload',
|
||||
'type' => 'string',
|
||||
'default' => '/etc/init.d/php-fpm restart',
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_pm' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['pm'],
|
||||
@@ -126,7 +135,7 @@ return array(
|
||||
'default' => 'static',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand'),
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_children' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_children'],
|
||||
@@ -134,7 +143,7 @@ return array(
|
||||
'varname' => 'max_children',
|
||||
'type' => 'int',
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_start_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['start_servers'],
|
||||
@@ -142,7 +151,7 @@ return array(
|
||||
'varname' => 'start_servers',
|
||||
'type' => 'int',
|
||||
'default' => 20,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_min_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['min_spare_servers'],
|
||||
@@ -150,7 +159,7 @@ return array(
|
||||
'varname' => 'min_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_spare_servers' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_spare_servers'],
|
||||
@@ -158,7 +167,7 @@ return array(
|
||||
'varname' => 'max_spare_servers',
|
||||
'type' => 'int',
|
||||
'default' => 35,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_max_requests' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['max_requests'],
|
||||
@@ -166,7 +175,7 @@ return array(
|
||||
'varname' => 'max_requests',
|
||||
'type' => 'int',
|
||||
'default' => 0,
|
||||
'save_method' => 'storeSettingField',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'system_phpfpm_idle_timeout' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['idle_timeout'],
|
||||
@@ -176,9 +185,16 @@ return array(
|
||||
'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'
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -85,21 +85,6 @@ return array(
|
||||
'default' => 100,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_autoresponder_enabled' => array(
|
||||
'label' => $lng['serversettings']['autoresponder_active'],
|
||||
'settinggroup' => 'autoresponder',
|
||||
'varname' => 'autoresponder_active',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/autoresponder',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_last_autoresponder_run' => array(
|
||||
'settinggroup' => 'autoresponder',
|
||||
'varname' => 'last_autoresponder_run',
|
||||
'type' => 'hidden',
|
||||
'default' => 0,
|
||||
),
|
||||
'system_catchall_enabled' => array(
|
||||
'label' => $lng['serversettings']['catchall_enabled'],
|
||||
'settinggroup' => 'catchall',
|
||||
@@ -108,6 +93,54 @@ return array(
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingResetCatchall',
|
||||
),
|
||||
'system_mailtraffic_enabled' => array(
|
||||
'label' => $lng['serversettings']['mailtraffic_enabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mailtraffic_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mdaserver' => array(
|
||||
'label' => $lng['serversettings']['mdaserver'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mdaserver',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'default' => 'dovecot',
|
||||
'option_options' => array('courier' => 'Courier', 'dovecot' => 'Dovecot'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mdalog' => array(
|
||||
'label' => $lng['serversettings']['mdalog'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mdalog',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/var/log/mail.log',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mtaserver' => array(
|
||||
'label' => $lng['serversettings']['mtaserver'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mtaserver',
|
||||
'type' => 'option',
|
||||
'option_mode' => 'one',
|
||||
'default' => 'postfix',
|
||||
'option_options' => array('exim4' => 'Exim4', 'postfix' => 'Postfix'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_mtalog' => array(
|
||||
'label' => $lng['serversettings']['mtalog'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mtalog',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/var/log/mail.log',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -73,11 +73,20 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'axfrservers',
|
||||
'type' => 'string',
|
||||
'string_type' => 'validate_ip',
|
||||
'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'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -65,8 +65,14 @@ return array(
|
||||
'label' => $lng['serversettings']['logger']['logcron'],
|
||||
'settinggroup' => 'logger',
|
||||
'varname' => 'log_cron',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'type' => 'option',
|
||||
'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',
|
||||
),
|
||||
),
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
global $settings;
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'dkim' => array(
|
||||
@@ -83,7 +81,7 @@ return array(
|
||||
'dkim_keylength' => array(
|
||||
'label' => array(
|
||||
'title' => $lng['dkim']['dkim_keylength']['title'],
|
||||
'description' => sprintf($lng['dkim']['dkim_keylength']['description'],$settings['dkim']['dkim_prefix'])
|
||||
'description' => sprintf($lng['dkim']['dkim_keylength']['description'], Settings::Get('dkim.dkim_prefix'))
|
||||
),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_keylength',
|
||||
|
||||
@@ -1,102 +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(
|
||||
'aps' => array(
|
||||
'title' => $lng['admin']['aps'],
|
||||
'fields' => array(
|
||||
'aps_enable' => array(
|
||||
'label' => $lng['aps']['activate_aps'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'aps_active',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/aps',
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'aps_items_per_page' => array(
|
||||
'label' => $lng['aps']['packages_per_page'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'items_per_page',
|
||||
'type' => 'int',
|
||||
'default' => 20,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'aps_upload_fields' => array(
|
||||
'label' => $lng['aps']['upload_fields'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'upload_fields',
|
||||
'type' => 'int',
|
||||
'default' => 5,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'aps_exceptions' => array(
|
||||
'label' => $lng['aps']['exceptions'],
|
||||
'type' => 'label',
|
||||
),
|
||||
'aps_php-extension' => array(
|
||||
'label' => $lng['aps']['settings_php_extensions'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'php-extension',
|
||||
'type' => 'option',
|
||||
'default' => '',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array('gd' => 'GD Library', 'pcre' => 'PCRE', 'ioncube' => 'ionCube', 'ioncube loader' => 'ionCube Loader', 'curl' => 'curl', 'mcrypt' => 'mcrypt', 'imap' => 'imap', 'json' => 'json', 'ldap' => 'LDAP', 'hash' => 'hash', 'mbstring' => 'mbstring', 'Zend Optimizer' => 'Zend Guard'),
|
||||
'save_method' => 'storeSettingApsPhpExtensions',
|
||||
),
|
||||
'aps_php-function' => array(
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'php-function',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
'aps_php-configuration' => array(
|
||||
'label' => $lng['aps']['settings_php_configuration'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'php-configuration',
|
||||
'type' => 'option',
|
||||
'default' => '',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array('short_open_tag' => 'short_open_tag', 'file_uploads' => 'file_uploads', 'magic_quotes_gpc' => 'magic_quotes_gpc', 'register_globals' => 'register_globals', 'allow_url_fopen' => 'allow_url_fopen', 'safe_mode' => 'safe_mode', 'post_max_size' => 'post_max_size', 'memory_limit' => 'memory_limit', 'max_execution_time' => 'max_execution_time'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'aps_webserver-module' => array(
|
||||
'label' => $lng['aps']['settings_webserver_modules'],
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'webserver-module',
|
||||
'type' => 'option',
|
||||
'default' => '',
|
||||
'option_mode' => 'multiple',
|
||||
'option_options' => array('mod_perl' => 'mod_perl', 'mod_rewrite' => 'mod_rewrite', 'mod_access' => 'mod_access', 'fcgid-any' => 'FastCGI/mod_fcgid', 'htaccess' => '.htaccess'),
|
||||
'save_method' => 'storeSettingApsWebserverModules',
|
||||
),
|
||||
'aps_webserver-htaccess' => array(
|
||||
'settinggroup' => 'aps',
|
||||
'varname' => 'webserver-htaccess',
|
||||
'type' => 'hidden',
|
||||
'default' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -45,7 +45,23 @@ return array(
|
||||
'type' => 'option',
|
||||
'default' => 0,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(0 => $lng['serversettings']['systemdefault'], 1 => 'MD5', 2 => 'BLOWFISH', 3 => 'SHA-256', 4 => 'SHA-512'),
|
||||
'option_options_method' => 'getAvailablePasswordHashes',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_allow_error_report_admin' => array(
|
||||
'label' => $lng['serversettings']['allow_error_report_admin'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'allow_error_report_admin',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_allow_error_report_customer' => array(
|
||||
'label' => $lng['serversettings']['allow_error_report_customer'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'allow_error_report_customer',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,118 +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(
|
||||
'backup' => array(
|
||||
'title' => $lng['backup'],
|
||||
'fields' => array(
|
||||
'backup_enabled' => array(
|
||||
'label' => $lng['serversettings']['backup_enabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/backup',
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'backup_dir' => array(
|
||||
'label' => $lng['serversettings']['backupdir']['description'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_dir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/customers/backups/',
|
||||
'string_regexp' => '#^/.*/$#',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'backup_mysqldump_path' => array(
|
||||
'label' => $lng['serversettings']['mysqldump_path']['description'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_mysqldump_path',
|
||||
'type' => 'string',
|
||||
'default' => '/usr/bin/mysqldump',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'backup_count' => array(
|
||||
'label' => $lng['serversettings']['backup_count'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_count',
|
||||
'type' => 'bool',
|
||||
'default' => 'true',
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => false
|
||||
),
|
||||
'backup_bigfile' => array(
|
||||
'label' => $lng['serversettings']['backup_bigfile'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_bigfile',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => false
|
||||
),
|
||||
'backup_ftp_enabled_' => array(
|
||||
'label' => $lng['serversettings']['backup_ftp_enabled'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_ftp_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => false
|
||||
),
|
||||
'backup_server' => array(
|
||||
'label' => $lng['serversettings']['backup_ftp_server'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_ftp_server',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'backup_user' => array(
|
||||
'label' => $lng['serversettings']['backup_ftp_user'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_ftp_user',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'backup_pass' => array(
|
||||
'label' => $lng['serversettings']['backup_ftp_pass'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_ftp_pass',
|
||||
'type' => 'hiddenstring',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'backup_passive_mode' => array(
|
||||
'label' => $lng['serversettings']['backup_ftp_passive_mode'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'backup_ftp_passive',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => false,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
887
admin_admins.php
415
admin_apcuinfo.php
Normal file
@@ -0,0 +1,415 @@
|
||||
<?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>
|
||||
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './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 (!function_exists('apcu_cache_info') ||
|
||||
!function_exists('apcu_sma_info')
|
||||
) {
|
||||
standard_error($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");
|
||||
|
||||
$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'];
|
||||
}
|
||||
|
||||
if (!isset($cache['num_expunges'])) {
|
||||
$cache['num_expunges'] = $lng['logger']['unknown'];
|
||||
}
|
||||
|
||||
$runtimelines = '';
|
||||
foreach (ini_get_all('apcu') as $name => $v) {
|
||||
$value = $v['local_value'];
|
||||
eval("\$runtimelines.=\"" . getTemplate("settings/apcuinfo/runtime_line") . "\";");
|
||||
}
|
||||
|
||||
$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']));
|
||||
|
||||
// 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%";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +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
|
||||
*
|
||||
*/
|
||||
|
||||
// Required code
|
||||
|
||||
define('AREA', 'admin');
|
||||
require ("./lib/init.php");
|
||||
$Id = 0;
|
||||
|
||||
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
||||
|
||||
if(isset($_POST['id']))$Id = (int)$_POST['id'];
|
||||
eval("echo \"" . getTemplate("aps/header") . "\";");
|
||||
$Aps = new ApsParser($userinfo, $settings, $db);
|
||||
$Aps->MainHandler($action);
|
||||
eval("echo \"" . getTemplate("aps/footer") . "\";");
|
||||
|
||||
?>
|
||||
209
admin_autoupdate.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2016 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Frontend
|
||||
*
|
||||
* @since 0.9.35
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './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");
|
||||
|
||||
// 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));
|
||||
}
|
||||
|
||||
// display initial version check
|
||||
if ($page == 'overview') {
|
||||
|
||||
// log our actions
|
||||
$log->logAction(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');
|
||||
}
|
||||
}
|
||||
}
|
||||
// error (something weird came from version.froxlor.org)
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 5));
|
||||
}
|
||||
// download the new archive
|
||||
elseif ($page == 'getdownload') {
|
||||
|
||||
// retrieve the new version from the form
|
||||
$newversion = isset($_POST['newversion']) ? $_POST['newversion'] : null;
|
||||
|
||||
// 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/');
|
||||
}
|
||||
|
||||
// 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
|
||||
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 {
|
||||
// error
|
||||
redirectTo($filename, array('s' => $s, 'page' => 'error', 'errno' => 8));
|
||||
}
|
||||
|
||||
// redirect to update-page?
|
||||
redirectTo('admin_updates.php', array('s' => $s));
|
||||
}
|
||||
|
||||
if (!file_exists($localArchive)) {
|
||||
redirectTo($filename, array('s' => $s, '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) . "\";");
|
||||
}
|
||||
|
||||
// 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
|
||||
// 5 = some weird value came from version.froxlor.org
|
||||
// 6 = download without valid version
|
||||
// 7 = local archive does not exist
|
||||
// 8 = could not extract archive
|
||||
// 9 = checksum mismatch
|
||||
standard_error ('autoupdate_'.$errno);
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -10,176 +9,209 @@
|
||||
* 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
|
||||
*
|
||||
* @since 0.9.34
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
if ($userinfo['change_serversettings'] == '1') {
|
||||
|
||||
$need_db_sql_data = true;
|
||||
require ("./lib/init.php");
|
||||
require ("./lib/configfiles_index.inc.php");
|
||||
$distribution = '';
|
||||
$distributions_select = '';
|
||||
$service = '';
|
||||
$services_select = '';
|
||||
$daemon = '';
|
||||
$daemons_select = '';
|
||||
|
||||
if($userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if(isset($_GET['distribution'])
|
||||
&& $_GET['distribution'] != ''
|
||||
&& isset($configfiles[$_GET['distribution']])
|
||||
&& is_array($configfiles[$_GET['distribution']]))
|
||||
{
|
||||
$distribution = $_GET['distribution'];
|
||||
|
||||
if(isset($_GET['service'])
|
||||
&& $_GET['service'] != ''
|
||||
&& isset($configfiles[$distribution]['services'][$_GET['service']])
|
||||
&& is_array($configfiles[$distribution]['services'][$_GET['service']]))
|
||||
{
|
||||
$service = $_GET['service'];
|
||||
|
||||
if(isset($_GET['daemon'])
|
||||
&& $_GET['daemon'] != ''
|
||||
&& isset($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']])
|
||||
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']]))
|
||||
{
|
||||
$daemon = $_GET['daemon'];
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($configfiles[$distribution]['services'][$service]['daemons'] as $daemon_name => $daemon_details)
|
||||
{
|
||||
$daemons_select.= makeoption($daemon_details['label'], $daemon_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($configfiles[$distribution]['services'] as $service_name => $service_details)
|
||||
{
|
||||
$services_select.= makeoption($service_details['label'], $service_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($configfiles as $distribution_name => $distribution_details)
|
||||
{
|
||||
$distributions_select.= makeoption($distribution_details['label'], $distribution_name);
|
||||
}
|
||||
}
|
||||
|
||||
if($distribution != ''
|
||||
&& $service != ''
|
||||
&& $daemon != '')
|
||||
{
|
||||
$replace_arr = Array(
|
||||
'<SQL_UNPRIVILEGED_USER>' => $sql['user'],
|
||||
'<SQL_UNPRIVILEGED_PASSWORD>' => 'MYSQL_PASSWORD',
|
||||
'<SQL_DB>' => $sql['db'],
|
||||
'<SQL_HOST>' => $sql['host'],
|
||||
'<SERVERNAME>' => $settings['system']['hostname'],
|
||||
'<SERVERIP>' => $settings['system']['ipaddress'],
|
||||
'<NAMESERVERS>' => $settings['system']['nameservers'],
|
||||
'<VIRTUAL_MAILBOX_BASE>' => $settings['system']['vmail_homedir'],
|
||||
'<VIRTUAL_UID_MAPS>' => $settings['system']['vmail_uid'],
|
||||
'<VIRTUAL_GID_MAPS>' => $settings['system']['vmail_gid'],
|
||||
'<SSLPROTOCOLS>' => ($settings['system']['use_ssl'] == '1') ? 'imaps pop3s' : '',
|
||||
'<CUSTOMER_TMP>' => ($settings['system']['mod_fcgid_tmpdir'] != '') ? makeCorrectDir($settings['system']['mod_fcgid_tmpdir']) : '/tmp/',
|
||||
'<BASE_PATH>' => makeCorrectDir(dirname(__FILE__)),
|
||||
'<BIND_CONFIG_PATH>' => makeCorrectDir($settings['system']['bindconf_directory']),
|
||||
'<WEBSERVER_RELOAD_CMD>' => $settings['system']['apachereload_command'],
|
||||
'<CUSTOMER_LOGS>' => makeCorrectDir($settings['system']['logfiles_directory'])
|
||||
'<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')
|
||||
);
|
||||
$files = '';
|
||||
|
||||
// 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 = '';
|
||||
foreach($configfiles[$distribution]['services'][$service]['daemons'][$daemon] as $action => $value)
|
||||
{
|
||||
if(substr($action, 0, 8) == 'commands')
|
||||
{
|
||||
|
||||
$distro_editor = $configfiles->distributionEditor;
|
||||
|
||||
$commands_pre = "";
|
||||
$commands_file = "";
|
||||
$commands_post = "";
|
||||
|
||||
$lasttype = '';
|
||||
$commands = '';
|
||||
|
||||
if(is_array($value))
|
||||
{
|
||||
$commands = implode("\n", $value);
|
||||
$commands = str_replace("\n\n", "\n", $commands);
|
||||
|
||||
if($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") . "\";");
|
||||
}
|
||||
}
|
||||
elseif(substr($action, 0, 5) == 'files')
|
||||
{
|
||||
$files = '';
|
||||
} else {
|
||||
die('not allowed to see this page');
|
||||
// redirect or similar here
|
||||
}
|
||||
|
||||
if(is_array($value))
|
||||
{
|
||||
while(list($filename, $realname) = each($value))
|
||||
{
|
||||
$file_content = file_get_contents('./templates/misc/configfiles/' . $distribution . '/' . $daemon . '/' . $filename);
|
||||
// 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") . "\";");
|
||||
}
|
||||
|
||||
eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_files") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart'])
|
||||
&& is_array($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']))
|
||||
{
|
||||
$restart = implode("\n", $configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$restart = '';
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("configfiles/configfiles") . "\";");
|
||||
}
|
||||
elseif($page == 'overview')
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_configfiles");
|
||||
$distributions = '';
|
||||
foreach($configfiles as $distribution_name => $distribution_details)
|
||||
{
|
||||
$services = '';
|
||||
foreach($distribution_details['services'] as $service_name => $service_details)
|
||||
{
|
||||
$daemons = '';
|
||||
foreach($service_details['daemons'] as $daemon_name => $daemon_details)
|
||||
{
|
||||
eval("\$daemons.=\"" . getTemplate("configfiles/choose_daemon") . "\";");
|
||||
}
|
||||
|
||||
eval("\$services.=\"" . getTemplate("configfiles/choose_service") . "\";");
|
||||
}
|
||||
|
||||
eval("\$distributions.=\"" . getTemplate("configfiles/choose_distribution") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("configfiles/choose") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
eval("echo \"" . getTemplate("configfiles/wizard") . "\";");
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require_once('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
@@ -33,14 +33,12 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
'c.interval' => $lng['cron']['interval'],
|
||||
'c.isactive' => $lng['cron']['isactive']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_CRONRUNS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_CRONRUNS, $fields);
|
||||
|
||||
/*
|
||||
* @TODO Fix sorting
|
||||
*/
|
||||
$crons = '';
|
||||
$result = $db->query("SELECT `c`.* FROM `" . TABLE_PANEL_CRONRUNS . "` `c` ORDER BY `cronfile` ASC");
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -48,8 +46,15 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
$cmod = '';
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
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);
|
||||
|
||||
@@ -72,7 +77,9 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
* @TODO later
|
||||
*/
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`='" . (int)$id . "'");
|
||||
$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);
|
||||
if ($result['cronfile'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$isactive = isset($_POST['isactive']) ? 1 : 0;
|
||||
@@ -85,20 +92,24 @@ if ($page == 'cronjobs' || $page == 'overview') {
|
||||
|
||||
$interval = $interval_value . ' ' . strtoupper($interval_interval);
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||
SET `isactive` = '".(int)$isactive."',
|
||||
`interval` = '".$interval."'
|
||||
WHERE `id` = '" . (int)$id . "'");
|
||||
$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));
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
// insert task to re-generate the cron.d-file
|
||||
inserttask('99');
|
||||
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
//$isactive = makeyesno('isactive', '1', '0', $result['isactive']);
|
||||
|
||||
// interval
|
||||
$interval_nfo = explode(' ', $result['interval']);
|
||||
$interval_value = $interval_nfo[0];
|
||||
|
||||
$interval_interval = '';
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['seconds'], 'SECOND', $interval_nfo[1]);
|
||||
$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]);
|
||||
|
||||
1762
admin_customers.php
1841
admin_domains.php
404
admin_index.php
@@ -18,88 +18,84 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
if ($action == 'logout') {
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if($action == 'logout')
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "logged out");
|
||||
|
||||
if($settings['session']['allow_multiple_login'] == '1')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1' AND `hash` = '" . $s . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
|
||||
$params = array('adminid' => (int)$userinfo['adminid']);
|
||||
|
||||
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;
|
||||
} else {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :adminid
|
||||
AND `adminsession` = '1'"
|
||||
);
|
||||
}
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if($page == 'overview')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_index");
|
||||
$overview = $db->query_first("SELECT COUNT(*) AS `number_customers`,
|
||||
$overview_stmt = Database::prepare("SELECT COUNT(*) AS `number_customers`,
|
||||
SUM(`diskspace_used`) AS `diskspace_used`,
|
||||
SUM(`mysqls_used`) AS `mysqls_used`,
|
||||
SUM(`emails_used`) AS `emails_used`,
|
||||
SUM(`email_accounts_used`) AS `email_accounts_used`,
|
||||
SUM(`email_forwarders_used`) AS `email_forwarders_used`,
|
||||
SUM(`email_quota_used`) AS `email_quota_used`,
|
||||
SUM(`email_autoresponder_used`) AS `email_autoresponder_used`,
|
||||
SUM(`ftps_used`) AS `ftps_used`,
|
||||
SUM(`tickets_used`) AS `tickets_used`,
|
||||
SUM(`subdomains_used`) AS `subdomains_used`,
|
||||
SUM(`traffic_used`) AS `traffic_used`,
|
||||
SUM(`aps_packages_used`) AS `aps_packages_used`
|
||||
FROM `" . TABLE_PANEL_CUSTOMERS . "`" . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||
$overview['traffic_used'] = round($overview['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$overview['diskspace_used'] = round($overview['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||
$number_domains = $db->query_first("SELECT COUNT(*) AS `number_domains` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `parentdomainid`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||
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']));
|
||||
|
||||
$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);
|
||||
|
||||
$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']));
|
||||
|
||||
$overview['number_domains'] = $number_domains['number_domains'];
|
||||
|
||||
$phpversion = phpversion();
|
||||
$phpmemorylimit = @ini_get("memory_limit");
|
||||
|
||||
if($phpmemorylimit == "")
|
||||
{
|
||||
$phpmemorylimit = $lng['admin']['memorylimitdisabled'];
|
||||
}
|
||||
|
||||
$mysqlserverversion = mysql_get_server_info();
|
||||
$mysqlclientversion = mysql_get_client_info();
|
||||
$mysqlserverversion = Database::getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$webserverinterface = strtoupper(@php_sapi_name());
|
||||
|
||||
if((isset($_GET['lookfornewversion']) && $_GET['lookfornewversion'] == 'yes')
|
||||
|| (isset($lookfornewversion) && $lookfornewversion == 'yes'))
|
||||
{
|
||||
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'))
|
||||
{
|
||||
if (ini_get('allow_url_fopen')) {
|
||||
$latestversion = @file($update_check_uri);
|
||||
|
||||
if (isset($latestversion[0]))
|
||||
{
|
||||
if (isset($latestversion[0])) {
|
||||
$latestversion = explode('|', $latestversion[0]);
|
||||
|
||||
if(is_array($latestversion)
|
||||
&& count($latestversion) >= 1)
|
||||
{
|
||||
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');
|
||||
@@ -110,94 +106,73 @@ if($page == 'overview')
|
||||
$lookfornewversion_link = $_link;
|
||||
$lookfornewversion_addinfo = $_message;
|
||||
|
||||
if (version_compare2($version, $_version) == -1) {
|
||||
// not numeric -> error-message
|
||||
if (!preg_match('/^((\d+\\.)(\d+\\.)(\d+\\.)?(\d+)?(\-(svn|dev|rc)(\d+))?)$/', $_version)) {
|
||||
// check for customized version to not output
|
||||
// "There is a newer version of froxlor" besides the error-message
|
||||
$isnewerversion = 2;
|
||||
} elseif (version_compare2($version, $_version) == -1) {
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
$isnewerversion = 0;
|
||||
}
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($update_check_uri.'/pretty', NULL);
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
}
|
||||
} else {
|
||||
redirectTo($update_check_uri.'/pretty', NULL, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($update_check_uri.'/pretty', NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($update_check_uri.'/pretty', NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$lookfornewversion_lable = $lng['admin']['lookfornewversion']['clickhere'];
|
||||
$lookfornewversion_link = htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
$lookfornewversion_addinfo = '';
|
||||
$isnewerversion = 0;
|
||||
}
|
||||
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota email_autoresponder ftps tickets subdomains aps_packages');
|
||||
$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');
|
||||
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
$cron_last_runs = getCronjobsLastRun();
|
||||
$outstanding_tasks = getOutstandingTasks();
|
||||
|
||||
$opentickets = 0;
|
||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `answerto` = "0" AND (`status` = "0" OR `status` = "1")
|
||||
AND `lastreplier`="0" AND `adminid` = "' . $userinfo['adminid'] . '"');
|
||||
$awaitingtickets = $opentickets['count'];
|
||||
$awaitingtickets_text = '';
|
||||
|
||||
if($opentickets > 0)
|
||||
{
|
||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="admin_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||
}
|
||||
|
||||
if(function_exists('sys_getloadavg'))
|
||||
{
|
||||
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
|
||||
{
|
||||
} else {
|
||||
$load = @file_get_contents('/proc/loadavg');
|
||||
|
||||
if(!$load)
|
||||
{
|
||||
if (!$load) {
|
||||
$load = $lng['admin']['noloadavailable'];
|
||||
}
|
||||
}
|
||||
|
||||
if(function_exists('posix_uname'))
|
||||
{
|
||||
if (function_exists('posix_uname')) {
|
||||
$showkernel = 1;
|
||||
$kernel_nfo = posix_uname();
|
||||
$kernel = $kernel_nfo['release'] . ' (' . $kernel_nfo['machine'] . ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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)
|
||||
if (is_array($uptime_array)
|
||||
&& isset($uptime_array[0])
|
||||
&& is_numeric($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;
|
||||
$hours = $minutes / 60;
|
||||
@@ -208,123 +183,224 @@ if($page == 'overview')
|
||||
$uptime = "{$days}d, {$hours}h, {$minutes}m, {$seconds}s";
|
||||
|
||||
// Just cleanup
|
||||
|
||||
unset($uptime_array, $seconds, $minutes, $hours, $days);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// Nothing of the above worked, show an error :/
|
||||
|
||||
$uptime = '';
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/index") . "\";");
|
||||
}
|
||||
elseif($page == 'change_password')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} elseif($page == 'change_password') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$old_password = validate($_POST['old_password'], 'old password');
|
||||
|
||||
if(md5($old_password) != $userinfo['password'])
|
||||
{
|
||||
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_ADMINS,'adminid')) {
|
||||
standard_error('oldpasswordnotcorrect');
|
||||
exit;
|
||||
}
|
||||
|
||||
$new_password = validate($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
||||
|
||||
if($old_password == '')
|
||||
{
|
||||
if ($old_password == '') {
|
||||
standard_error(array('stringisempty', 'oldpassword'));
|
||||
}
|
||||
elseif($new_password == '')
|
||||
{
|
||||
} elseif($new_password == '') {
|
||||
standard_error(array('stringisempty', 'newpassword'));
|
||||
}
|
||||
elseif($new_password_confirm == '')
|
||||
{
|
||||
} elseif($new_password_confirm == '') {
|
||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||
}
|
||||
elseif($new_password != $new_password_confirm)
|
||||
{
|
||||
} elseif($new_password != $new_password_confirm) {
|
||||
standard_error('newpasswordconfirmerror');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($new_password) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `password`='" . md5($old_password) . "'");
|
||||
} 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));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
eval("echo \"" . getTemplate("index/change_password") . "\";");
|
||||
}
|
||||
}
|
||||
elseif($page == 'change_language')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} elseif($page == 'change_language') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$def_language = validate($_POST['def_language'], 'default language');
|
||||
|
||||
if(isset($languages[$def_language]))
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||
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
|
||||
));
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "changed his/her default language to '" . $def_language . "'");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
} else {
|
||||
|
||||
$language_options = '';
|
||||
|
||||
$default_lang = $settings['panel']['standardlanguage'];
|
||||
if($userinfo['def_language'] != '') {
|
||||
$default_lang = Settings::Get('panel.standardlanguage');
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
|
||||
while(list($language_file, $language_name) = each($languages))
|
||||
{
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
||||
}
|
||||
}
|
||||
elseif($page == 'change_theme')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
|
||||
} elseif ($page == 'change_theme') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$theme = validate($_POST['theme'], 'theme');
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('s' => $s));
|
||||
|
||||
} else {
|
||||
|
||||
$theme_options = '';
|
||||
|
||||
$default_theme = $settings['panel']['default_theme'];
|
||||
if($userinfo['theme'] != '') {
|
||||
$default_theme = Settings::Get('panel.default_theme');
|
||||
if ($userinfo['theme'] != '') {
|
||||
$default_theme = $userinfo['theme'];
|
||||
}
|
||||
|
||||
$themes_avail = getThemes();
|
||||
foreach($themes_avail as $t)
|
||||
{
|
||||
$theme_options.= makeoption($t, $t, $default_theme, true);
|
||||
foreach ($themes_avail as $t => $d) {
|
||||
$theme_options.= makeoption($d, $t, $default_theme, true);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,36 +18,34 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if($page == 'ipsandports'
|
||||
|| $page == 'overview')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
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');
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$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, $db, TABLE_PANEL_IPSANDPORTS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging = new paging($userinfo, TABLE_PANEL_IPSANDPORTS, $fields);
|
||||
$ipsandports = '';
|
||||
$result = $db->query("SELECT `id`, `ip`, `port`, `listen_statement`, `namevirtualhost_statement`, `vhostcontainer`, `vhostcontainer_servername_statement`, `specialsettings`, `ssl` FROM `" . TABLE_PANEL_IPSANDPORTS . "` " . $paging->getSqlWhere(false) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -55,92 +53,99 @@ if($page == 'ipsandports'
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
$row = htmlentities_array($row);
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if(filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||
{
|
||||
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++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int)$id . "'");
|
||||
|
||||
if(isset($result['id'])
|
||||
&& $result['id'] == $id)
|
||||
{
|
||||
$result_checkdomain = $db->query_first("SELECT `id_domain` as `id` FROM `" . TABLE_DOMAINTOIP . "` WHERE `id_ipandports`='" . (int)$id . "'");
|
||||
} 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($result_checkdomain['id'] == '')
|
||||
{
|
||||
if($result['id'] != $settings['system']['defaultip'])
|
||||
{
|
||||
$result_sameipotherport = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($result['ip']) . "' AND `id`!='" . (int)$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['ip'] != $settings['system']['ipaddress'])
|
||||
|| ($result['ip'] == $settings['system']['ipaddress'] && $result_sameipotherport['id'] != ''))
|
||||
{
|
||||
$result = $db->query_first("SELECT `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int)$id . "'");
|
||||
if ($result_checkdomain['id'] == '') {
|
||||
if (!in_array($result['id'], explode(',', Settings::Get('system.defaultip')))) {
|
||||
|
||||
if($result['ip'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int)$id . "'");
|
||||
$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)
|
||||
$db->query("DELETE FROM `".TABLE_DOMAINTOIP."` WHERE `id_ipandports`='".(int)$id."'");
|
||||
$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
|
||||
{
|
||||
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
|
||||
{
|
||||
} else {
|
||||
standard_error('cantdeletesystemip');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('cantdeletedefaultip');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('ipstillhasdomains');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} 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;
|
||||
@@ -150,9 +155,9 @@ if($page == 'ipsandports'
|
||||
$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['system']['use_ssl'] == 1)
|
||||
{
|
||||
$ssl = intval($_POST['ssl']);
|
||||
|
||||
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');
|
||||
@@ -165,109 +170,98 @@ if($page == 'ipsandports'
|
||||
$ssl_cert_chainfile = '';
|
||||
}
|
||||
|
||||
if($listen_statement != '1')
|
||||
{
|
||||
if ($listen_statement != '1') {
|
||||
$listen_statement = '0';
|
||||
}
|
||||
|
||||
if($namevirtualhost_statement != '1')
|
||||
{
|
||||
if ($namevirtualhost_statement != '1') {
|
||||
$namevirtualhost_statement = '0';
|
||||
}
|
||||
|
||||
if($vhostcontainer != '1')
|
||||
{
|
||||
if ($vhostcontainer != '1') {
|
||||
$vhostcontainer = '0';
|
||||
}
|
||||
|
||||
if($vhostcontainer_servername_statement != '1')
|
||||
{
|
||||
if ($vhostcontainer_servername_statement != '1') {
|
||||
$vhostcontainer_servername_statement = '0';
|
||||
}
|
||||
|
||||
if($ssl != '1')
|
||||
{
|
||||
if ($ssl != '1') {
|
||||
$ssl = '0';
|
||||
}
|
||||
|
||||
if($ssl_cert_file != '')
|
||||
{
|
||||
if ($ssl_cert_file != '') {
|
||||
$ssl_cert_file = makeCorrectFile($ssl_cert_file);
|
||||
}
|
||||
|
||||
if($ssl_key_file != '')
|
||||
{
|
||||
if ($ssl_key_file != '') {
|
||||
$ssl_key_file = makeCorrectFile($ssl_key_file);
|
||||
}
|
||||
|
||||
if($ssl_ca_file != '')
|
||||
{
|
||||
if ($ssl_ca_file != '') {
|
||||
$ssl_ca_file = makeCorrectFile($ssl_ca_file);
|
||||
}
|
||||
|
||||
if($ssl_cert_chainfile != '')
|
||||
{
|
||||
if ($ssl_cert_chainfile != '') {
|
||||
$ssl_cert_chainfile = makeCorrectFile($ssl_cert_chainfile);
|
||||
}
|
||||
|
||||
if(strlen(trim($docroot)) > 0)
|
||||
{
|
||||
if (strlen(trim($docroot)) > 0) {
|
||||
$docroot = makeCorrectDir($docroot);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$docroot = '';
|
||||
}
|
||||
|
||||
$result_checkfordouble = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($ip) . "' AND `port`='" . (int)$port . "'");
|
||||
$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'] != '')
|
||||
{
|
||||
if ($result_checkfordouble['id'] != '') {
|
||||
standard_error('myipnotdouble');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
} else {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
SET
|
||||
`ip` = '" . $db->escape($ip) . "',
|
||||
`port` = '" . (int)$port . "',
|
||||
`listen_statement` = '" . (int)$listen_statement . "',
|
||||
`namevirtualhost_statement` = '" . (int)$namevirtualhost_statement . "',
|
||||
`vhostcontainer` = '" . (int)$vhostcontainer . "',
|
||||
`vhostcontainer_servername_statement` = '" . (int)$vhostcontainer_servername_statement . "',
|
||||
`specialsettings` = '" . $db->escape($specialsettings) . "',
|
||||
`ssl` = '" . (int)$ssl . "',
|
||||
`ssl_cert_file` = '" . $db->escape($ssl_cert_file) . "',
|
||||
`ssl_key_file` = '" . $db->escape($ssl_key_file) . "',
|
||||
`ssl_ca_file` = '" . $db->escape($ssl_ca_file) . "',
|
||||
`ssl_cert_chainfile` = '" . $db->escape($ssl_cert_chainfile) . "',
|
||||
`default_vhostconf_domain` = '" . $db->escape($default_vhostconf_domain) . "',
|
||||
`docroot` = '" . $db->escape($docroot) . "';
|
||||
`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))
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
$enable_ssl = makeyesno('ssl', '1', '0', '0');
|
||||
$listen_statement = makeyesno('listen_statement', '1', '0', '1');
|
||||
$namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', '1');
|
||||
$vhostcontainer = makeyesno('vhostcontainer', '1', '0', '1');
|
||||
$vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', '1');
|
||||
*/
|
||||
|
||||
} else {
|
||||
|
||||
$ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
|
||||
$ipsandports_add_form = htmlform::genHTMLForm($ipsandports_add_data);
|
||||
@@ -277,21 +271,23 @@ if($page == 'ipsandports'
|
||||
|
||||
eval("echo \"" . getTemplate("ipsandports/ipsandports_add") . "\";");
|
||||
}
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int)$id . "'");
|
||||
|
||||
if($result['ip'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} 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));
|
||||
|
||||
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'));
|
||||
$result_checkfordouble = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($ip) . "' AND `port`='" . (int)$port . "'");
|
||||
$result_sameipotherport = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($result['ip']) . "' AND `id`!='" . (int)$id . "'");
|
||||
$listen_statement = isset($_POST['listen_statement']) ? 1 : 0;
|
||||
$namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0;
|
||||
$vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0;
|
||||
@@ -300,11 +296,19 @@ if($page == 'ipsandports'
|
||||
$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['system']['use_ssl'] == 1
|
||||
/*
|
||||
* check here if ssl is even checked, cause if not, we don't need
|
||||
* to validate and set all the $ssl_*_file vars
|
||||
*/
|
||||
$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
|
||||
) {
|
||||
@@ -321,92 +325,91 @@ if($page == 'ipsandports'
|
||||
$ssl_cert_chainfile = '';
|
||||
}
|
||||
|
||||
if($listen_statement != '1')
|
||||
{
|
||||
if ($listen_statement != '1') {
|
||||
$listen_statement = '0';
|
||||
}
|
||||
|
||||
if($namevirtualhost_statement != '1')
|
||||
{
|
||||
if ($namevirtualhost_statement != '1') {
|
||||
$namevirtualhost_statement = '0';
|
||||
}
|
||||
|
||||
if($vhostcontainer != '1')
|
||||
{
|
||||
if ($vhostcontainer != '1') {
|
||||
$vhostcontainer = '0';
|
||||
}
|
||||
|
||||
if($vhostcontainer_servername_statement != '1')
|
||||
{
|
||||
if ($vhostcontainer_servername_statement != '1') {
|
||||
$vhostcontainer_servername_statement = '0';
|
||||
}
|
||||
|
||||
if($ssl != '1')
|
||||
{
|
||||
if ($ssl != '1') {
|
||||
$ssl = '0';
|
||||
}
|
||||
|
||||
if($ssl_cert_file != '')
|
||||
{
|
||||
if ($ssl_cert_file != '') {
|
||||
$ssl_cert_file = makeCorrectFile($ssl_cert_file);
|
||||
}
|
||||
|
||||
if($ssl_key_file != '')
|
||||
{
|
||||
if ($ssl_key_file != '') {
|
||||
$ssl_key_file = makeCorrectFile($ssl_key_file);
|
||||
}
|
||||
|
||||
if($ssl_ca_file != '')
|
||||
{
|
||||
if ($ssl_ca_file != '') {
|
||||
$ssl_ca_file = makeCorrectFile($ssl_ca_file);
|
||||
}
|
||||
|
||||
if($ssl_cert_chainfile != '')
|
||||
{
|
||||
if ($ssl_cert_chainfile != '') {
|
||||
$ssl_cert_chainfile = makeCorrectFile($ssl_cert_chainfile);
|
||||
}
|
||||
|
||||
if(strlen(trim($docroot)) > 0)
|
||||
{
|
||||
if (strlen(trim($docroot)) > 0) {
|
||||
$docroot = makeCorrectDir($docroot);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$docroot = '';
|
||||
}
|
||||
|
||||
if($result['ip'] != $ip
|
||||
&& $result['ip'] == $settings['system']['ipaddress']
|
||||
&& $result_sameipotherport['id'] == '')
|
||||
{
|
||||
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
|
||||
{
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
} elseif($result_checkfordouble['id'] != ''
|
||||
&& $result_checkfordouble['id'] != $id
|
||||
) {
|
||||
standard_error('myipnotdouble');
|
||||
|
||||
} else {
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_IPSANDPORTS . "`
|
||||
SET
|
||||
`ip` = '" . $db->escape($ip) . "',
|
||||
`port` = '" . (int)$port . "',
|
||||
`listen_statement` = '" . (int)$listen_statement . "',
|
||||
`namevirtualhost_statement` = '" . (int)$namevirtualhost_statement . "',
|
||||
`vhostcontainer` = '" . (int)$vhostcontainer . "',
|
||||
`vhostcontainer_servername_statement` = '" . (int)$vhostcontainer_servername_statement . "',
|
||||
`specialsettings` = '" . $db->escape($specialsettings) . "',
|
||||
`ssl` = '" . (int)$ssl . "',
|
||||
`ssl_cert_file` = '" . $db->escape($ssl_cert_file) . "',
|
||||
`ssl_key_file` = '" . $db->escape($ssl_key_file) . "',
|
||||
`ssl_ca_file` = '" . $db->escape($ssl_ca_file) . "',
|
||||
`ssl_cert_chainfile` = '" . $db->escape($ssl_cert_chainfile) . "',
|
||||
`default_vhostconf_domain` = '" . $db->escape($default_vhostconf_domain) . "',
|
||||
`docroot` = '" . $db->escape($docroot) . "'
|
||||
WHERE `id`='" . (int)$id . "'
|
||||
`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');
|
||||
@@ -416,17 +419,10 @@ if($page == 'ipsandports'
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
/*
|
||||
$enable_ssl = makeyesno('ssl', '1', '0', $result['ssl']);
|
||||
$listen_statement = makeyesno('listen_statement', '1', '0', $result['listen_statement']);
|
||||
$namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', $result['namevirtualhost_statement']);
|
||||
$vhostcontainer = makeyesno('vhostcontainer', '1', '0', $result['vhostcontainer']);
|
||||
$vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', $result['vhostcontainer_servername_statement']);
|
||||
*/
|
||||
|
||||
$ipsandports_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php';
|
||||
$ipsandports_edit_form = htmlform::genHTMLForm($ipsandports_edit_data);
|
||||
@@ -439,5 +435,3 @@ if($page == 'ipsandports'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -18,11 +18,7 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if ($page == 'log'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
@@ -34,24 +30,25 @@ if ($page == 'log'
|
||||
'user' => $lng['logger']['user'],
|
||||
'text' => $lng['logger']['action']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_LOG, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging->sortfield = 'date';
|
||||
$paging->sortorder = 'desc';
|
||||
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_LOG . '` ' . $paging->getSqlWhere(false) . ' ' . $paging->getSqlOrderBy() . ' ' . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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 = $db->fetch_array($result)) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -80,19 +77,22 @@ if ($page == 'log'
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
case RES_ACTION:
|
||||
$_action = 'Reseller';
|
||||
$_action = $lng['logger']['reseller'];
|
||||
break;
|
||||
case ADM_ACTION:
|
||||
$_action = 'Administrator';
|
||||
$_action = $lng['logger']['admin'];
|
||||
break;
|
||||
case CRON_ACTION:
|
||||
$_action = 'Cronjob';
|
||||
$_action = $lng['logger']['cron'];
|
||||
break;
|
||||
case LOGIN_ACTION:
|
||||
$_action = $lng['logger']['login'];
|
||||
break;
|
||||
case LOG_ERROR:
|
||||
$_action = 'Internal';
|
||||
$_action = $lng['logger']['intern'];
|
||||
break;
|
||||
default:
|
||||
$_action = 'Unknown';
|
||||
$_action = $lng['logger']['unknown'];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -101,51 +101,30 @@ if ($page == 'log'
|
||||
}
|
||||
|
||||
$log_count++;
|
||||
$type = $row['type'];
|
||||
$_type = 'unknown';
|
||||
|
||||
switch ($type) {
|
||||
case LOG_INFO:
|
||||
$_type = 'Information';
|
||||
break;
|
||||
case LOG_NOTICE:
|
||||
$_type = 'Notice';
|
||||
break;
|
||||
case LOG_WARNING:
|
||||
$_type = 'Warning';
|
||||
break;
|
||||
case LOG_ERR:
|
||||
$_type = 'Error';
|
||||
break;
|
||||
case LOG_CRIT:
|
||||
$_type = 'Critical';
|
||||
break;
|
||||
default:
|
||||
$_type = 'Unknown';
|
||||
break;
|
||||
}
|
||||
|
||||
$row['type'] = $_type;
|
||||
$row['type'] = getLogLevelDesc($row['type']);
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('logger/logger') . "\";");
|
||||
|
||||
} elseif ($action == 'truncate') {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$yesterday = time() - (60 * 10);
|
||||
|
||||
/* (60*60*24); */
|
||||
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_LOG . "` WHERE `date` < '" . $yesterday . "'");
|
||||
$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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
ask_yesno('logger_reallytruncate', $filename, array('page' => $page, 'action' => $action), TABLE_PANEL_LOG);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,7 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
@@ -41,14 +37,18 @@ if ($page == 'message') {
|
||||
&& $userinfo['customers_see_all'] == '1'
|
||||
) {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to admins');
|
||||
$result = $db->query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
||||
$result = Database::query('SELECT `name`, `email` FROM `' . TABLE_PANEL_ADMINS . "`");
|
||||
} elseif ($_POST['receipient'] == 1) {
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to ALL customers');
|
||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
||||
$result = Database::query('SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`");
|
||||
} else {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'sending messages to customers');
|
||||
$result = $db->query('SELECT `firstname`, `name`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "` WHERE `adminid`='" . $userinfo['adminid'] . "'");
|
||||
$result = Database::prepare('
|
||||
SELECT `firstname`, `name`, `company`, `email` FROM `' . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `adminid` = :adminid"
|
||||
);
|
||||
Database::pexecute($result, array('adminid' => $userinfo['adminid']));
|
||||
}
|
||||
} else {
|
||||
standard_error('noreceipientsgiven');
|
||||
@@ -62,8 +62,11 @@ if ($page == 'message') {
|
||||
$mail->Body = $message;
|
||||
$mail->Subject = $subject;
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$mail->AddAddress($row['email'], (isset($row['firstname']) ? $row['firstname'] . ' ' : '') . $row['name']);
|
||||
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->From = $userinfo['email'];
|
||||
$mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
|
||||
|
||||
@@ -82,7 +85,7 @@ if ($page == 'message') {
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
||||
} else {
|
||||
standard_error('nomessagetosend');
|
||||
}
|
||||
@@ -90,6 +93,7 @@ if ($page == 'message') {
|
||||
}
|
||||
|
||||
if ($action == 'showsuccess') {
|
||||
|
||||
$success = 1;
|
||||
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
|
||||
|
||||
@@ -98,13 +102,14 @@ if ($page == 'message') {
|
||||
} else {
|
||||
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
||||
}
|
||||
|
||||
} else {
|
||||
$success = 0;
|
||||
$sentitems = 0;
|
||||
$successmessage = '';
|
||||
}
|
||||
$action = '';
|
||||
|
||||
$action = '';
|
||||
$receipients = '';
|
||||
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
|
||||
158
admin_opcacheinfo.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?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 Janos Muzsi <muzsij@hypernics.hu> (2016)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
*
|
||||
* Based on https://github.com/amnuts/opcache-gui
|
||||
*
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
|
||||
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 (!function_exists('opcache_get_configuration')
|
||||
) {
|
||||
standard_error($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,'.',' '),
|
||||
);
|
||||
}
|
||||
|
||||
$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") . "\";");
|
||||
|
||||
}
|
||||
|
||||
function bsize($s) {
|
||||
foreach (array('', 'K', 'M', 'G') as $i => $k) {
|
||||
if ($s < 1024)
|
||||
break;
|
||||
$s/=1024;
|
||||
}
|
||||
return sprintf("%5.1f %sBytes", $s, $k);
|
||||
}
|
||||
@@ -18,12 +18,7 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
require ("./lib/init.php");
|
||||
require './lib/init.php';
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
@@ -37,27 +32,29 @@ if ($page == 'overview') {
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
$result = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$domainresult = false;
|
||||
$query_params = array('id' => $row['id']);
|
||||
|
||||
$query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."`
|
||||
WHERE `phpsettingid` = '".(int)$row['id']."'
|
||||
WHERE `phpsettingid` = :id
|
||||
AND `parentdomainid` = '0'";
|
||||
|
||||
if ((int)$userinfo['domains_see_all'] == 0) {
|
||||
$query .= " AND `adminid` = '".(int)$userinfo['userid']."'";
|
||||
$query .= " AND `adminid` = :adminid";
|
||||
$query_params['adminid'] = $userinfo['adminid'];
|
||||
}
|
||||
|
||||
if ((int)$settings['panel']['phpconfigs_hidestdsubdomain'] == 1) {
|
||||
$query2 = "SELECT DISTINCT `standardsubdomain`
|
||||
FROM `".TABLE_PANEL_CUSTOMERS."`
|
||||
WHERE `standardsubdomain` > 0 ORDER BY `standardsubdomain` ASC;";
|
||||
$ssdids_res = $db->query($query2);
|
||||
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 = $db->fetch_array($ssdids_res)) {
|
||||
while ($ssd = $ssdids_res->fetch(PDO::FETCH_ASSOC)) {
|
||||
$ssdids[] = $ssd['standardsubdomain'];
|
||||
}
|
||||
if (count($ssdids) > 0) {
|
||||
@@ -65,17 +62,36 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
|
||||
$domainresult = $db->query($query);
|
||||
$domainresult_stmt = Database::prepare($query);
|
||||
Database::pexecute($domainresult_stmt, $query_params);
|
||||
|
||||
$domains = '';
|
||||
if ($db->num_rows($domainresult) > 0) {
|
||||
while ($row2 = $db->fetch_array($domainresult)) {
|
||||
if (Database::num_rows() > 0) {
|
||||
while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains.= $row2['domain'] . '<br/>';
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
// 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") . "\";");
|
||||
}
|
||||
@@ -84,34 +100,80 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . getTemplate("phpconfig/overview") . "\";");
|
||||
}
|
||||
|
||||
if($action == 'add')
|
||||
{
|
||||
if((int)$userinfo['change_serversettings'] == 1)
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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]*$/');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
$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;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "'");
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = 1");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$phpconfig_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_add.php';
|
||||
$phpconfig_add_form = htmlform::genHTMLForm($phpconfig_add_data);
|
||||
@@ -121,73 +183,151 @@ if ($page == 'overview') {
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_add") . "\";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if($action == 'delete')
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||
if ($action == 'delete') {
|
||||
|
||||
if($result['id'] != 0
|
||||
$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');
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `phpsettingid` = 1 WHERE `phpsettingid` = " . (int)$id);
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||
&& $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));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
ask_yesno('phpsetting_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['description']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
|
||||
if($action == 'edit')
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$id);
|
||||
if ($action == 'edit') {
|
||||
|
||||
if($result['id'] != 0
|
||||
$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')
|
||||
{
|
||||
&& (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]*$/');
|
||||
$phpsettings = validate(str_replace("\r\n", "\n", $_POST['phpsettings']), 'phpsettings', '/^[^\0]*$/');
|
||||
$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;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (strlen($description) == 0
|
||||
|| strlen($description) > 50
|
||||
) {
|
||||
standard_error('descriptioninvalid');
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_PHPCONFIGS . "` SET `description` = '" . $db->escape($description) . "', `binary` = '" . $db->escape($binary) . "', `file_extensions` = '" . $db->escape($file_extensions) . "', `mod_fcgid_starter` = '" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests` = '" . $db->escape($mod_fcgid_maxrequests) . "', `phpsettings` = '" . $db->escape($phpsettings) . "' WHERE `id` = " . (int)$id);
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
|
||||
$phpconfig_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/phpconfig/formfield.phpconfig_edit.php';
|
||||
$phpconfig_edit_form = htmlform::genHTMLForm($phpconfig_edit_data);
|
||||
|
||||
@@ -196,12 +336,9 @@ if ($page == 'overview') {
|
||||
|
||||
eval("echo \"" . getTemplate("phpconfig/overview_edit") . "\";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
standard_error('nopermissionsorinvalidid');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,59 +18,51 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
// get sql-root access data
|
||||
Database::needRoot(true);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
$need_db_sql_data = true;
|
||||
$need_root_db_sql_data = true;
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(($page == 'settings' || $page == 'overview')
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if ($page == 'overview' && $userinfo['change_serversettings'] == '1') {
|
||||
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
|
||||
$settings = loadSettings($settings_data, $db);
|
||||
$settings = loadSettings($settings_data);
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
|
||||
if($_part == '')
|
||||
{
|
||||
if ($_part == '') {
|
||||
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||
}
|
||||
|
||||
if($_part != '')
|
||||
{
|
||||
if($_part == 'all')
|
||||
{
|
||||
if ($_part != '') {
|
||||
if ($_part == 'all') {
|
||||
$settings_all = true;
|
||||
$settings_part = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$settings_all = false;
|
||||
$settings_part = true;
|
||||
}
|
||||
|
||||
$only_enabledisable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
$settings_all = false;
|
||||
$settings_part = false;
|
||||
$only_enabledisable = true;
|
||||
}
|
||||
|
||||
// check if the session timeout is too low #815
|
||||
if (isset($_POST['session_sessiontimeout']) && $_POST['session_sessiontimeout'] <= 60) {
|
||||
if (isset($_POST['session_sessiontimeout'])
|
||||
&& $_POST['session_sessiontimeout'] < 60
|
||||
) {
|
||||
standard_error($lng['error']['session_timeout'], $lng['error']['session_timeout_desc']);
|
||||
}
|
||||
|
||||
if(processFormEx(
|
||||
if (processFormEx(
|
||||
$settings_data,
|
||||
$_POST,
|
||||
array('filename' => $filename, 'action' => $action, 'page' => $page),
|
||||
@@ -87,25 +79,20 @@ if(($page == 'settings' || $page == 'overview')
|
||||
|
||||
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
|
||||
if($_part == '')
|
||||
{
|
||||
} else {
|
||||
|
||||
$_part = isset($_GET['part']) ? $_GET['part'] : '';
|
||||
if ($_part == '') {
|
||||
$_part = isset($_POST['part']) ? $_POST['part'] : '';
|
||||
}
|
||||
|
||||
$fields = buildFormEx($settings_data, $_part);
|
||||
|
||||
$settings_page = '';
|
||||
if($_part == '')
|
||||
{
|
||||
if ($_part == '') {
|
||||
eval("\$settings_page .= \"" . getTemplate("settings/settings_overview") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
eval("\$settings_page .= \"" . getTemplate("settings/settings") . "\";");
|
||||
}
|
||||
|
||||
@@ -114,8 +101,8 @@ if(($page == 'settings' || $page == 'overview')
|
||||
eval("echo \"" . getTemplate("settings/settings_form_end") . "\";");
|
||||
|
||||
}
|
||||
}
|
||||
elseif($page == 'phpinfo'
|
||||
|
||||
} elseif($page == 'phpinfo'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
ob_start();
|
||||
@@ -156,15 +143,18 @@ elseif($page == 'phpinfo'
|
||||
eval("\$phpinfohtml .= \"" . getTemplate("settings/phpinfo/phpinfo_table") . "\";");
|
||||
}
|
||||
$phpinfo = $phpinfohtml;
|
||||
} else {
|
||||
standard_error($lng['error']['no_phpinfo']);
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/phpinfo") . "\";");
|
||||
}
|
||||
elseif($page == 'rebuildconfigs'
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} 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');
|
||||
@@ -172,102 +162,129 @@ elseif($page == 'rebuildconfigs'
|
||||
inserttask('4');
|
||||
|
||||
standard_success('rebuildingconfigs', '', array('filename' => 'admin_index.php'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page));
|
||||
}
|
||||
}
|
||||
elseif($page == 'updatecounters'
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} 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)
|
||||
{
|
||||
foreach ($updatecounters['customers'] as $customerid => $customer) {
|
||||
eval("\$customers.=\"" . getTemplate("settings/updatecounters_row_customer") . "\";");
|
||||
}
|
||||
|
||||
$admins = '';
|
||||
foreach($updatecounters['admins'] as $adminid => $admin)
|
||||
{
|
||||
foreach ($updatecounters['admins'] as $adminid => $admin) {
|
||||
eval("\$admins.=\"" . getTemplate("settings/updatecounters_row_admin") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("settings/updatecounters") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
ask_yesno('admin_counters_reallyupdate', $filename, array('page' => $page));
|
||||
}
|
||||
}
|
||||
elseif($page == 'wipecleartextmailpws'
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} 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");
|
||||
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `password`='' ");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='0' WHERE `settinggroup`='system' AND `varname`='mailpwcleartext'");
|
||||
redirectTo('admin_settings.php', array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
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));
|
||||
|
||||
} else {
|
||||
ask_yesno('admin_cleartextmailpws_reallywipe', $filename, array('page' => $page));
|
||||
}
|
||||
}
|
||||
elseif($page == 'wipequotas'
|
||||
&& $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
|
||||
} elseif($page == 'wipequotas'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$log->logAction(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));
|
||||
|
||||
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `quota`='0' ");
|
||||
$db->query("UPDATE " . TABLE_PANEL_CUSTOMERS . " SET `email_quota_used` = 0");
|
||||
redirectTo('admin_settings.php', array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ask_yesno('admin_quotas_reallywipe', $filename, array('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 . "`");
|
||||
|
||||
$result = $db->query("SELECT `quota`, `customerid` FROM " . TABLE_MAIL_USERS);
|
||||
if (Database::num_rows() > 0) {
|
||||
|
||||
while($array = $db->fetch_array($result))
|
||||
{
|
||||
$difference = $settings['system']['mail_quota'] - $array['quota'];
|
||||
$db->query("UPDATE " . TABLE_PANEL_CUSTOMERS . " SET `email_quota_used` = `email_quota_used` + " . (int)$difference . " WHERE `customerid` = '" . $array['customerid'] . "'");
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET
|
||||
`email_quota_used` = `email_quota_used` + :diff
|
||||
WHERE `customerid` = :customerid
|
||||
");
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
// Set the new quota
|
||||
|
||||
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `quota`='" . $settings['system']['mail_quota'] . "'");
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_MAIL_USERS . "` SET `quota` = :quota
|
||||
");
|
||||
Database::pexecute($upd_stmt, array('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));
|
||||
|
||||
$db->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['system']['mail_quota'] . ' MB');
|
||||
redirectTo('admin_settings.php', array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ask_yesno('admin_quotas_reallyenforce', $filename, array('page' => $page));
|
||||
}
|
||||
} elseif ($page == 'integritycheck'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
$integrity = new IntegrityCheck();
|
||||
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));
|
||||
}
|
||||
|
||||
$integritycheck = '';
|
||||
foreach ($integrity->available as $id => $check) {
|
||||
$displayid = $id + 1;
|
||||
$result = $integrity->$check();
|
||||
$checkdesc = $lng['integrity_check'][$check];
|
||||
eval("\$integritycheck.=\"" . getTemplate("settings/integritycheck_row") . "\";");
|
||||
}
|
||||
eval("echo \"" . getTemplate("settings/integritycheck") . "\";");
|
||||
}
|
||||
|
||||
@@ -18,30 +18,21 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(isset($_POST['subjectid']))
|
||||
{
|
||||
if (isset($_POST['subjectid'])) {
|
||||
$subjectid = intval($_POST['subjectid']);
|
||||
$mailbodyid = intval($_POST['mailbodyid']);
|
||||
}
|
||||
elseif(isset($_GET['subjectid']))
|
||||
{
|
||||
|
||||
} elseif(isset($_GET['subjectid'])) {
|
||||
$subjectid = intval($_GET['subjectid']);
|
||||
$mailbodyid = intval($_GET['mailbodyid']);
|
||||
}
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
@@ -54,13 +45,14 @@ $available_templates = array(
|
||||
);
|
||||
|
||||
// only show templates of features that are enabled #1191
|
||||
if ((int)$settings['system']['report_enable'] == 1) {
|
||||
if ((int)Settings::Get('system.report_enable') == 1) {
|
||||
array_push($available_templates,
|
||||
'trafficmaxpercent',
|
||||
'diskmaxpercent'
|
||||
);
|
||||
}
|
||||
if ((int)$settings['ticket']['enabled'] == 1) {
|
||||
|
||||
if ((int)Settings::Get('ticket.enabled') == 1) {
|
||||
array_push($available_templates,
|
||||
'new_ticket_by_customer',
|
||||
'new_ticket_for_customer',
|
||||
@@ -74,32 +66,31 @@ $file_templates = array(
|
||||
'index_html'
|
||||
);
|
||||
|
||||
if($action == '')
|
||||
{
|
||||
if ($action == '') {
|
||||
//email templates
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
||||
|
||||
if($settings['panel']['sendalternativemail'] == 1)
|
||||
{
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$available_templates[] = 'pop_success_alternative';
|
||||
}
|
||||
|
||||
$templates_array = array();
|
||||
$result = $db->query("SELECT `id`, `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='mails' ORDER BY `language`, `varname`");
|
||||
$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']));
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$parts = array();
|
||||
preg_match('/^([a-z]([a-z_]+[a-z])*)_(mailbody|subject)$/', $row['varname'], $parts);
|
||||
$templates_array[$row['language']][$parts[1]][$parts[3]] = $row['id'];
|
||||
}
|
||||
|
||||
$templates = '';
|
||||
foreach($templates_array as $language => $template_defs)
|
||||
{
|
||||
foreach($template_defs as $action => $email)
|
||||
{
|
||||
foreach ($templates_array as $language => $template_defs) {
|
||||
foreach ($template_defs as $action => $email) {
|
||||
$subjectid = $email['subject'];
|
||||
$mailbodyid = $email['mailbody'];
|
||||
$template = $lng['admin']['templates'][$action];
|
||||
@@ -108,117 +99,137 @@ if($action == '')
|
||||
}
|
||||
|
||||
$add = false;
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
|
||||
while(list($language_file, $language_name) = each($languages))
|
||||
{
|
||||
$templates_done = array();
|
||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||
$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));
|
||||
|
||||
while(($row = $db->fetch_array($result)) != false)
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templates_done[] = str_replace('_subject', '', $row['varname']);
|
||||
}
|
||||
|
||||
if(count(array_diff($available_templates, $templates_done)) > 0)
|
||||
{
|
||||
if (count(array_diff($available_templates, $templates_done)) > 0) {
|
||||
$add = true;
|
||||
}
|
||||
}
|
||||
|
||||
//filetemplates
|
||||
|
||||
$filetemplates = '';
|
||||
$filetemplateadd = false;
|
||||
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
||||
$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($db->num_rows($result) != count($file_templates))$filetemplateadd = true;
|
||||
if (Database::num_rows() != count($file_templates)) {
|
||||
$filetemplateadd = true;
|
||||
}
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
eval("\$filetemplates.=\"" . getTemplate("templates/templates_filetemplate") . "\";");
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("templates/templates") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
|
||||
} elseif($action == 'delete'
|
||||
&& $subjectid != 0
|
||||
&& $mailbodyid != 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));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$result = $db->query_first("SELECT `language`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||
|
||||
if($result['varname'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND (`id`='" . (int)$subjectid . "' OR `id`='" . (int)$mailbodyid . "')");
|
||||
if ($result['varname'] != '') {
|
||||
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(
|
||||
'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));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} 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'])]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'deletef'
|
||||
&& $id != 0)
|
||||
{
|
||||
|
||||
} 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));
|
||||
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||
if (Database::num_rows() > 0) {
|
||||
|
||||
if($db->num_rows($result) > 0)
|
||||
{
|
||||
$row = $db->fetch_array($result);
|
||||
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`=" . (int)$userinfo['adminid'] . " AND `id`=" . (int)$id . "");
|
||||
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));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
ask_yesno('admin_template_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $lng['admin']['templates'][$row['varname']]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
standard_error('templatenotfound');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if($settings['panel']['sendalternativemail'] == 1)
|
||||
{
|
||||
|
||||
} elseif($action == 'add') {
|
||||
|
||||
if (Settings::Get('panel.sendalternativemail') == 1) {
|
||||
$available_templates[] = 'pop_success_alternative';
|
||||
}
|
||||
|
||||
if(isset($_POST['prepare'])
|
||||
&& $_POST['prepare'] == 'prepare')
|
||||
{
|
||||
if (isset($_POST['prepare'])
|
||||
&& $_POST['prepare'] == 'prepare'
|
||||
) {
|
||||
//email templates
|
||||
$language = htmlentities(validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect'));
|
||||
$template = validate($_POST['template'], 'template');
|
||||
|
||||
$language = validate($_POST['language'], 'language');
|
||||
$templates = array();
|
||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||
|
||||
while(($row = $db->fetch_array($result)) != false)
|
||||
{
|
||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||
$lng_bak = $lng;
|
||||
foreach ($langs['English'] as $key => $value) {
|
||||
include_once makeSecurePath($value['file']);
|
||||
}
|
||||
if ($language != 'English') {
|
||||
foreach ($langs[$language] as $key => $value) {
|
||||
include makeSecurePath($value['file']);
|
||||
}
|
||||
}
|
||||
|
||||
$templates = array_diff($available_templates, $templates);
|
||||
$template_options = '';
|
||||
foreach($templates as $template)
|
||||
{
|
||||
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true);
|
||||
}
|
||||
$subject = $lng['mails'][$template]['subject'];
|
||||
$body = str_replace('\n', "\n", $lng['mails'][$template]['mailbody']);
|
||||
|
||||
$lng = $lng_bak;
|
||||
|
||||
$template_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.template_add.php';
|
||||
$template_add_form = htmlform::genHTMLForm($template_add_data);
|
||||
@@ -227,105 +238,148 @@ elseif($action == 'add')
|
||||
$image = $template_add_data['template_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("templates/templates_add_2") . "\";");
|
||||
}
|
||||
elseif(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
//email templates
|
||||
|
||||
$language = validate($_POST['language'], 'language', '/^[^\r\n\0"\']+$/', 'nolanguageselect');
|
||||
} 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();
|
||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||
$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));
|
||||
|
||||
while(($row = $db->fetch_array($result)) != false)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (array_search($template, $templates) === false) {
|
||||
standard_error('templatenotfound');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_subject','" . $db->escape($subject) . "')");
|
||||
$result = $db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||
VALUES ('" . (int)$userinfo['adminid'] . "', '" . $db->escape($language) . "', 'mails', '" . $db->escape($template) . "_mailbody','" . $db->escape($mailbody) . "')");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $language . ' - ' . $template . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend')
|
||||
{
|
||||
//file templates
|
||||
|
||||
} else {
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`adminid` = :adminid,
|
||||
`language` = :lang,
|
||||
`templategroup` = 'mails',
|
||||
`varname` = :var,
|
||||
`value` = :value"
|
||||
);
|
||||
|
||||
// mail-subject
|
||||
$ins_data = array(
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language,
|
||||
'var' => $template.'_subject',
|
||||
'value' => $subject
|
||||
);
|
||||
Database::pexecute($ins_stmt, $ins_data);
|
||||
|
||||
// mail-body
|
||||
$ins_data = array(
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'lang' => $language,
|
||||
'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));
|
||||
}
|
||||
|
||||
} elseif(isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend'
|
||||
) {
|
||||
//file templates
|
||||
$template = validate($_POST['template'], 'template');
|
||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` (`adminid`, `language`, `templategroup`, `varname`, `value`)
|
||||
VALUES ('" . (int)$userinfo['adminid'] . "', '', 'files', '" . $db->escape($template) . "','" . $db->escape($filecontent) . "')");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added template '" . $template . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
elseif(!isset($_GET['files']))
|
||||
{
|
||||
//email templates
|
||||
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`adminid` = :adminid,
|
||||
`language` = '',
|
||||
`templategroup` = 'files',
|
||||
`varname` = :var,
|
||||
`value` = :value"
|
||||
);
|
||||
|
||||
$ins_data = array(
|
||||
'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
|
||||
$add = false;
|
||||
$language_options = '';
|
||||
$template_options = '';
|
||||
|
||||
while(list($language_file, $language_name) = each($languages))
|
||||
{
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$templates = array();
|
||||
$result = $db->query('SELECT `varname` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($language_name) . '\' AND `templategroup`=\'mails\' AND `varname` LIKE \'%_subject\'');
|
||||
$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));
|
||||
|
||||
while(($row = $db->fetch_array($result)) != false)
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$templates[] = str_replace('_subject', '', $row['varname']);
|
||||
}
|
||||
|
||||
if(count(array_diff($available_templates, $templates)) > 0)
|
||||
{
|
||||
if (count(array_diff($available_templates, $templates)) > 0) {
|
||||
$add = true;
|
||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true);
|
||||
$language_options.= makeoption($language_name, $language_file, $userinfo['language'], true, true);
|
||||
|
||||
$templates = array_diff($available_templates, $templates);
|
||||
|
||||
foreach ($templates as $template) {
|
||||
$template_options.= makeoption($lng['admin']['templates'][$template], $template, NULL, true, true, $language_file) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($add)
|
||||
{
|
||||
if ($add) {
|
||||
eval("echo \"" . getTemplate("templates/templates_add_1") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('alltemplatesdefined');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
//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']));
|
||||
|
||||
$result = $db->query("SELECT `id`, `varname` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `templategroup`='files'");
|
||||
|
||||
if($db->num_rows($result) == count($file_templates))
|
||||
{
|
||||
if (Database::num_rows() == count($file_templates)) {
|
||||
standard_error('alltemplatesdefined');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
|
||||
$templatesdefined = array();
|
||||
$free_templates = '';
|
||||
|
||||
while($row = $db->fetch_array($result))$templatesdefined[] = $row['varname'];
|
||||
foreach(array_diff($file_templates, $templatesdefined) as $template)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -338,33 +392,65 @@ elseif($action == 'add')
|
||||
eval("echo \"" . getTemplate("templates/filetemplates_add") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
|
||||
} elseif($action == 'edit'
|
||||
&& $subjectid != 0
|
||||
&& $mailbodyid != 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));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||
if ($result['varname'] != '') {
|
||||
|
||||
if($result['varname'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$subject = validate($_POST['subject'], 'subject', '/^[^\r\n\0]+$/', 'nosubjectcreate');
|
||||
$mailbody = validate($_POST['mailbody'], 'mailbody', '/^[^\0]+$/', 'nomailbodycreate');
|
||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($subject) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$subjectid . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($mailbody) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$mailbodyid . "'");
|
||||
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`value` = :value
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
// subject
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'value' => $subject,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $subjectid
|
||||
));
|
||||
// same query but mailbody
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'value' => $mailbody,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $mailbodyid
|
||||
));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $result['varname'] . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
$template = $lng['admin']['templates'][str_replace('_subject', '', $result['varname'])];
|
||||
$subject = $result['value'];
|
||||
$result = $db->query_first("SELECT `language`, `varname`, `value` FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `id`='$mailbodyid'");
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `language`, `varname`, `value`
|
||||
FROM `" . TABLE_PANEL_TEMPLATES . "`
|
||||
WHERE `id` = :id"
|
||||
);
|
||||
Database::pexecute($result_stmt, array('id' => $mailbodyid));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$template_name = 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);
|
||||
$mailbody = $result['value'];
|
||||
|
||||
@@ -377,30 +463,41 @@ elseif($action == 'edit'
|
||||
eval("echo \"" . getTemplate("templates/templates_edit") . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'editf'
|
||||
&& $id != 0)
|
||||
{
|
||||
|
||||
} 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));
|
||||
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_TEMPLATES . "` WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||
if(Database::num_rows() > 0) {
|
||||
|
||||
if($db->num_rows($result) > 0)
|
||||
{
|
||||
$row = $db->fetch_array($result);
|
||||
$row = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
//filetemplates
|
||||
|
||||
if(isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend')
|
||||
{
|
||||
if (isset($_POST['filesend'])
|
||||
&& $_POST['filesend'] == 'filesend'
|
||||
) {
|
||||
$filecontent = validate($_POST['filecontent'], 'filecontent', '/^[^\0]+$/', 'filecontentnotset');
|
||||
$db->query("UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET `value`='" . $db->escape($filecontent) . "' WHERE `adminid`='" . (int)$userinfo['adminid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$upd_stmt = Database::prepare("
|
||||
UPDATE `" . TABLE_PANEL_TEMPLATES . "` SET
|
||||
`value` = :value
|
||||
WHERE `adminid` = :adminid AND `id` = :id"
|
||||
);
|
||||
Database::pexecute($upd_stmt, array(
|
||||
'value' => $filecontent,
|
||||
'adminid' => $userinfo['adminid'],
|
||||
'id' => $id
|
||||
));
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited template '" . $row['varname'] . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
|
||||
} else {
|
||||
$row = htmlentities_array($row);
|
||||
|
||||
$filetemplate_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/templates/formfield.filetemplate_edit.php';
|
||||
@@ -411,10 +508,8 @@ elseif($action == 'editf'
|
||||
|
||||
eval("echo \"" . getTemplate("templates/filetemplates_edit") . "\";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
standard_error('templatenotfound');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,26 +17,21 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if($action == 'logout')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
|
||||
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');
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
} elseif(isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
@@ -56,44 +51,24 @@ $months = array(
|
||||
'12' => 'dec',
|
||||
);
|
||||
|
||||
if($page == 'overview' || $page == 'customers')
|
||||
{
|
||||
if($action == 'su' && $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$id . "' " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' "));
|
||||
if ($page == 'overview' || $page == 'customers') {
|
||||
|
||||
if($result['loginname'] != '')
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid`='" . (int)$userinfo['userid'] . "'");
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`) VALUES ('" . $db->escape($s) . "', '" . (int)$id . "', '" . $db->escape($result['ipaddress']) . "', '" . $db->escape($result['useragent']) . "', '" . time() . "', '" . $db->escape($result['language']) . "', '0')");
|
||||
redirectTo('customer_traffic.php', Array(
|
||||
's' => $s
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
redirectTo('index.php', Array(
|
||||
'action' => 'login'
|
||||
));
|
||||
}
|
||||
}
|
||||
$customerview = 1;
|
||||
$stats_tables = '';
|
||||
$minyear = $db->query_first("SELECT `year` FROM `". TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");
|
||||
if (!isset($minyear['year']) || $minyear['year'] == 0)
|
||||
{
|
||||
$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
|
||||
{
|
||||
} else {
|
||||
$maxyears = date("Y") - $minyear['year'];
|
||||
}
|
||||
for($years = 0; $years<=$maxyears; $years++) {
|
||||
|
||||
for ($years = 0; $years<=$maxyears; $years++) {
|
||||
|
||||
$overview['year'] = date("Y")-$years;
|
||||
$overview['type'] = $lng['traffic']['customer'];
|
||||
$domain_list = '';
|
||||
$customer_name_list = $db->query("SELECT `customerid`,`company`,`name`,`firstname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `deactivated`='0'" . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ORDER BY name");
|
||||
$totals = array(
|
||||
'jan' => 0,
|
||||
'feb' => 0,
|
||||
@@ -108,7 +83,18 @@ if($page == 'overview' || $page == 'customers')
|
||||
'nov' => 0,
|
||||
'dec' => 0,
|
||||
);
|
||||
while($customer_name = $db->fetch_array($customer_name_list)) {
|
||||
|
||||
$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'],
|
||||
@@ -126,9 +112,16 @@ if($page == 'overview' || $page == 'customers')
|
||||
'dec' => '-',
|
||||
);
|
||||
|
||||
$traffic_list = $db->query("SELECT month, SUM(http+ftp_up+ftp_down+mail)*1024 AS traffic FROM `" . TABLE_PANEL_TRAFFIC . "` WHERE year = " . (date("Y")-$years) . " AND `customerid` = '" . $customer_name['customerid'] . "' GROUP BY month ORDER BY month");
|
||||
while($traffic_month = $db->fetch_array($traffic_list)) {
|
||||
$virtual_host[$months[(int)$traffic_month['month']]] = size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$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") . "\");");
|
||||
@@ -137,8 +130,8 @@ if($page == 'overview' || $page == 'customers')
|
||||
$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['panel']['decimal_places'].'f %s'));
|
||||
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") . "\");");
|
||||
|
||||
@@ -16,25 +16,24 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
||||
|
||||
/**
|
||||
* this is a dirty hack but syscp 1.4.2.1 does not
|
||||
* has any version/dbversion in the database (don't know why)
|
||||
* 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 (!isset($settings['panel']['version'])
|
||||
|| $settings['panel']['version'] == ''
|
||||
if (Settings::Get('panel.version') == null
|
||||
|| Settings::Get('panel.version') == ''
|
||||
) {
|
||||
$settings['panel']['version'] = '1.4.2.1';
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel','version','".$settings['panel']['version']."')");
|
||||
Settings::Set('panel.version', '1.4.2.1');
|
||||
}
|
||||
if (!isset($settings['system']['dbversion'])
|
||||
|| $settings['system']['dbversion'] == ''
|
||||
if (Settings::Get('system.dbversion') == null
|
||||
|| Settings::Get('system.dbversion') == ''
|
||||
) {
|
||||
/**
|
||||
* for syscp-stable (1.4.2.1) this value has to be 0
|
||||
@@ -42,17 +41,20 @@ if ($page == 'overview') {
|
||||
* and the svn-version has its value in the database
|
||||
* -> bug #54
|
||||
*/
|
||||
$result = $db->query_first("SELECT `value` FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `varname` = 'dbversion'");
|
||||
$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['system']['dbversion'] = (int)$result['value'];
|
||||
Settings::Set('system.dbversion', (int)$result['value'], false);
|
||||
} else {
|
||||
$settings['system']['dbversion'] = 0;
|
||||
Settings::Set('system.dbversion', 0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasUpdates($version)) {
|
||||
if (hasDbUpdates($dbversion)) {
|
||||
$successful_update = false;
|
||||
$message = '';
|
||||
|
||||
@@ -77,21 +79,32 @@ if ($page == 'overview') {
|
||||
|
||||
$successful_update = true;
|
||||
} else {
|
||||
$message = '<br /><strong style="color: red">You have to agree that you have read the update notifications.</strong>';
|
||||
$message = '<br /><strong class="red">You have to agree that you have read the update notifications.</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$successful_update) {
|
||||
$current_version = $settings['panel']['version'];
|
||||
$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);
|
||||
$preconfig = getPreConfig($current_version, $current_db_version);
|
||||
if ($preconfig != '') {
|
||||
$update_information .= '<br />' . $preconfig . $message;
|
||||
}
|
||||
@@ -101,9 +114,6 @@ if ($page == 'overview') {
|
||||
eval("echo \"" . getTemplate('update/index') . "\";");
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* @TODO version-webcheck check here
|
||||
*/
|
||||
$success_message = $lng['update']['noupdatesavail'];
|
||||
$redirect_url = 'admin_index.php?s=' . $s;
|
||||
eval("echo \"" . getTemplate('update/noupdatesavail') . "\";");
|
||||
|
||||
1
cache/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
*
|
||||
BIN
css/images/animated-overlay.gif
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Normal file
|
After Width: | Height: | Size: 369 B |
BIN
css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
css/images/ui-bg_flat_10_000000_40x100.png
Normal file
|
After Width: | Height: | Size: 278 B |
BIN
css/images/ui-bg_glass_100_f6f6f6_1x400.png
Normal file
|
After Width: | Height: | Size: 232 B |
BIN
css/images/ui-bg_glass_100_fdf5ce_1x400.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
css/images/ui-bg_glass_65_ffffff_1x400.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Normal file
|
After Width: | Height: | Size: 287 B |
BIN
css/images/ui-icons_222222_256x240.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
css/images/ui-icons_228ef1_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ef8c08_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ffd27a_256x240.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
css/images/ui-icons_ffffff_256x240.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
8
css/jquery-ui.min.css
vendored
1
css/jquery.jqplot.min.css
vendored
@@ -1 +0,0 @@
|
||||
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}
|
||||
@@ -1,34 +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');
|
||||
|
||||
$Id = 0;
|
||||
if (isset($_GET['id'])) {
|
||||
$Id = (int)$_GET['id'];
|
||||
}
|
||||
if (isset($_POST['id'])) {
|
||||
$Id = (int)$_POST['id'];
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('aps/header') . "\";");
|
||||
$Aps = new ApsParser($userinfo, $settings, $db);
|
||||
$Aps->MainHandler($action);
|
||||
eval("echo \"" . getTemplate('aps/footer') . "\";");
|
||||
@@ -1,252 +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 ($action == 'add') {
|
||||
// Create new autoresponder
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$account = trim($_POST['account']);
|
||||
$subject = trim($_POST['subject']);
|
||||
$message = trim($_POST['message']);
|
||||
|
||||
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||
$date_until_off = isset($_POST['date_until_off']) ? -1 : 0;
|
||||
|
||||
/*
|
||||
* @TODO validate date (DD-MM-YYYY)
|
||||
*/
|
||||
$ts_from = -1;
|
||||
$ts_until = -1;
|
||||
|
||||
if ($date_from_off > -1) {
|
||||
$date_from = $_POST['date_from'];
|
||||
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
||||
}
|
||||
if ($date_until_off > -1) {
|
||||
$date_until = $_POST['date_until'];
|
||||
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
||||
}
|
||||
|
||||
if (empty($account)
|
||||
|| empty($subject)
|
||||
|| empty($message)
|
||||
) {
|
||||
standard_error('missingfields');
|
||||
}
|
||||
|
||||
// Does account exist?
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('accountnotexisting');
|
||||
}
|
||||
|
||||
// Does autoresponder exist?
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 1) {
|
||||
standard_error('autoresponderalreadyexists');
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||
SET `email` = '" . $db->escape($account) . "',
|
||||
`message` = '" . $db->escape($message) . "',
|
||||
`enabled` = '" . (int)$_POST['active'] . "',
|
||||
`date_from` = '" . (int)$ts_from . "',
|
||||
`date_until` = '" . (int)$ts_until . "',
|
||||
`subject` = '" . $db->escape($subject) . "',
|
||||
`customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||
");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_autoresponder_used` = `email_autoresponder_used` + 1 WHERE `customerid` = '" . $db->escape((int)$userinfo['customerid']). "'");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
|
||||
// Get accounts
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` NOT IN (SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "`) ORDER BY email ASC");
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('noemailaccount');
|
||||
}
|
||||
|
||||
$accounts = '';
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$accounts .= '<option value="' . $row['email'] . '">' . $row['email'] . '</option>';
|
||||
}
|
||||
|
||||
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
|
||||
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true);
|
||||
|
||||
//$isactive = makeyesno('active', '1', '0', '1');
|
||||
|
||||
$autoresponder_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/autoresponder/formfield.autoresponder_add.php';
|
||||
$autoresponder_add_form = htmlform::genHTMLForm($autoresponder_add_data);
|
||||
|
||||
$title = $autoresponder_add_data['autoresponder_add']['title'];
|
||||
$image = $autoresponder_add_data['autoresponder_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('autoresponder/autoresponder_add') . "\";");
|
||||
} elseif ($action == 'edit') {
|
||||
// Edit autoresponder
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$account = trim($_POST['account']);
|
||||
$subject = trim($_POST['subject']);
|
||||
$message = trim($_POST['message']);
|
||||
|
||||
$date_from_off = isset($_POST['date_from_off']) ? -1 : 0;
|
||||
$date_until_off = isset($_POST['date_until_off']) ? -1 : 0;
|
||||
|
||||
/*
|
||||
* @TODO validate date (DD-MM-YYYY)
|
||||
*/
|
||||
$ts_from = -1;
|
||||
$ts_until = -1;
|
||||
|
||||
if ($date_from_off > -1) {
|
||||
$date_from = $_POST['date_from'];
|
||||
$ts_from = mktime(0, 0, 0, substr($date_from, 3, 2), substr($date_from, 0, 2), substr($date_from, 6, 4));
|
||||
}
|
||||
if ($date_until_off > -1) {
|
||||
$date_until = $_POST['date_until'];
|
||||
$ts_until = mktime(0, 0, 0, substr($date_until, 3, 2), substr($date_until, 0, 2), substr($date_until, 6, 4));
|
||||
}
|
||||
|
||||
if (empty($account)
|
||||
|| empty($subject)
|
||||
|| empty($message)
|
||||
) {
|
||||
standard_error('missingfields');
|
||||
}
|
||||
|
||||
// Does account exist?
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_USERS . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 0)
|
||||
{
|
||||
standard_error('accountnotexisting');
|
||||
}
|
||||
|
||||
// Does autoresponder exist?
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
$ResponderActive = (isset($_POST['active']) && $_POST['active'] == '1') ? 1 : 0;
|
||||
|
||||
$db->query("UPDATE `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||
SET `message` = '" . $db->escape($message) . "',
|
||||
`enabled` = '" . (int)$ResponderActive . "',
|
||||
`date_from` = '" . (int)$ts_from . "',
|
||||
`date_until` = '" . (int)$ts_until . "',
|
||||
`subject` = '" . $db->escape($subject) . "'
|
||||
WHERE `email` = '" . $db->escape($account) . "'
|
||||
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||
");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
|
||||
$email = trim(htmlspecialchars($_GET['email']));
|
||||
|
||||
// Get account data
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($email) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
$row = $db->fetch_array($result);
|
||||
$subject = htmlspecialchars($row['subject']);
|
||||
$message = htmlspecialchars($row['message']);
|
||||
|
||||
$date_from = (int)$row['date_from'];
|
||||
$date_until = (int)$row['date_until'];
|
||||
|
||||
if ($date_from == -1) {
|
||||
$deactivated = '-1';
|
||||
$date_from = '';
|
||||
} else {
|
||||
$deactivated = '0';
|
||||
$date_from = date('d-m-Y', $date_from);
|
||||
}
|
||||
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
|
||||
|
||||
if ($date_until == -1) {
|
||||
$deactivated = '-1';
|
||||
$date_until = '';
|
||||
} else {
|
||||
$deactivated = '0';
|
||||
$date_until = date('d-m-Y', $date_until);
|
||||
}
|
||||
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
|
||||
|
||||
//$isactive = makeyesno('active', '1', '0', $row['enabled']);
|
||||
|
||||
$autoresponder_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/autoresponder/formfield.autoresponder_edit.php';
|
||||
$autoresponder_edit_form = htmlform::genHTMLForm($autoresponder_edit_data);
|
||||
|
||||
$title = $autoresponder_edit_data['autoresponder_edit']['title'];
|
||||
$image = $autoresponder_edit_data['autoresponder_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate('autoresponder/autoresponder_edit') . "\";");
|
||||
} elseif ($action == 'delete') {
|
||||
// Delete autoresponder
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$account = trim($_POST['account']);
|
||||
|
||||
// Does autoresponder exist?
|
||||
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||
WHERE `email` = '" . $db->escape($account) . "'
|
||||
AND `customerid` = '" . $db->escape((int)$userinfo['customerid']) . "'
|
||||
");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_autoresponder_used` = `email_autoresponder_used` - 1 WHERE `customerid` = '" . $db->escape((int)$userinfo['customerid']). "'");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
|
||||
$email = trim(htmlspecialchars($_GET['email']));
|
||||
ask_yesno('autoresponderdelete', $filename, array('action' => $action, 'account' => $email));
|
||||
} else {
|
||||
// List existing autoresponders
|
||||
$autoresponder = '';
|
||||
$count = 0;
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int)$userinfo['customerid'] . "' ORDER BY email ASC");
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
if ($row['date_from'] == -1 && $row['date_until'] == -1) {
|
||||
$activated_date = $lng['panel']['not_activated'];
|
||||
} elseif($row['date_from'] == -1 && $row['date_until'] != -1) {
|
||||
$activated_date = $lng['autoresponder']['date_until'].': '.date('d-m-Y', $row['date_until']);
|
||||
} elseif($row['date_from'] != -1 && $row['date_until'] == -1) {
|
||||
$activated_date = $lng['autoresponder']['date_from'].': '.date('d-m-Y', $row['date_from']);
|
||||
} else {
|
||||
$activated_date = date('d-m-Y', $row['date_from']) . ' - ' . date('d-m-Y', $row['date_until']);
|
||||
}
|
||||
eval("\$autoresponder.=\"" . getTemplate('autoresponder/autoresponder_autoresponder') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('autoresponder/autoresponder') . "\";");
|
||||
}
|
||||
@@ -18,63 +18,30 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if($page == 'overview')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras");
|
||||
eval("echo \"" . getTemplate("extras/extras") . "\";");
|
||||
}
|
||||
elseif($page == 'backup')
|
||||
{
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras_backup");
|
||||
|
||||
$result = $db->query("SELECT `backup_enabled` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$row = $db->fetch_array($result);
|
||||
|
||||
$backup_enabled = makeyesno('backup_enabled', '1', '0', $row['backup_enabled']);
|
||||
|
||||
if(isset($_POST['send']) && $_POST['send'] == 'send'){
|
||||
$backup_enabled = ($_POST['backup_enabled'] == '1' ? '1' : '0');
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `backup_enabled`='" . $backup_enabled . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
|
||||
$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") . "\";");
|
||||
}
|
||||
elseif($page == 'htpasswds')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
} elseif ($page == 'htpasswds') {
|
||||
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, $db, TABLE_PANEL_HTPASSWDS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -83,15 +50,12 @@ elseif($page == 'htpasswds')
|
||||
$count = 0;
|
||||
$htpasswds = '';
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
if(strpos($row['path'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
$row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
|
||||
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++;
|
||||
@@ -101,90 +65,98 @@ elseif($page == 'htpasswds')
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htpasswds") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
} 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);
|
||||
|
||||
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));
|
||||
|
||||
if(isset($result['username'])
|
||||
&& $result['username'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='$id'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htpasswd for '" . $result['username'] . " (" . $result['path'] . ")'");
|
||||
inserttask('1');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($result['path'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
ask_yesno('extras_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username'] . ' (' . $result['path'] . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} 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 = $db->query_first("SELECT `id`, `username`, `path` FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `username`='" . $db->escape($username) . "' AND `path`='" . $db->escape($path) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
if(CRYPT_STD_DES == 1)
|
||||
{
|
||||
$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
|
||||
{
|
||||
} else {
|
||||
$password = crypt($_POST['directory_password']);
|
||||
}
|
||||
|
||||
if(!$_POST['path'])
|
||||
{
|
||||
if (!$_POST['path']) {
|
||||
standard_error('invalidpath');
|
||||
}
|
||||
|
||||
if($username == '')
|
||||
{
|
||||
if ($username == '') {
|
||||
standard_error(array('stringisempty', 'myloginname'));
|
||||
}
|
||||
elseif($username_path_check['username'] == $username
|
||||
&& $username_path_check['path'] == $path)
|
||||
{
|
||||
} elseif ($username_path_check['username'] == $username && $username_path_check['path'] == $path) {
|
||||
standard_error('userpathcombinationdupe');
|
||||
}
|
||||
elseif($_POST['directory_password'] == '')
|
||||
{
|
||||
} elseif ($_POST['directory_password'] == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
}
|
||||
elseif($path == '')
|
||||
{
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_HTPASSWDS . "` (`customerid`, `username`, `password`, `path`, `authname`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($password) . "', '" . $db->escape($path) . "', '" . $db->escape($authname) . "')");
|
||||
} 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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
} else {
|
||||
$pathSelect = 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);
|
||||
@@ -194,60 +166,65 @@ elseif($page == 'htpasswds')
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htpasswds_add") . "\";");
|
||||
}
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTPASSWDS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
} 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);
|
||||
|
||||
if(isset($result['username'])
|
||||
&& $result['username'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (CRYPT_STD_DES == 1) {
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
$password = crypt($_POST['directory_password'], $saltfordescrypt);
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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`='" . $db->escape($password) . "' ";
|
||||
if ($_POST['directory_password'] != '') {
|
||||
$pwd_sql = "`password`= :password ";
|
||||
$params["password"] = $password;
|
||||
}
|
||||
|
||||
$auth_sql = '';
|
||||
if($authname != $result['authname'])
|
||||
{
|
||||
$auth_sql = "`authname`='" . $db->escape($authname) . "' ";
|
||||
if ($authname != $result['authname']) {
|
||||
$auth_sql = "`authname`= :authname ";
|
||||
$params["authname"] = $authname;
|
||||
}
|
||||
|
||||
if($pwd_sql != '' || $auth_sql != '')
|
||||
{
|
||||
if($pwd_sql !='' && $auth_sql != '') {
|
||||
if ($pwd_sql != '' || $auth_sql != '') {
|
||||
if ($pwd_sql !='' && $auth_sql != '') {
|
||||
$pwd_sql.= ', ';
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET ".$pwd_sql.$auth_sql." WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($result['path'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
@@ -262,11 +239,8 @@ elseif($page == 'htpasswds')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($page == 'htaccess')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
} elseif ($page == 'htaccess') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_extras::htaccess");
|
||||
$fields = array(
|
||||
'path' => $lng['panel']['path'],
|
||||
@@ -276,9 +250,12 @@ elseif($page == 'htaccess')
|
||||
'error500path' => $lng['extras']['error500path'],
|
||||
'options_cgi' => $lng['extras']['execute_perl']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_HTACCESS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -289,17 +266,12 @@ elseif($page == 'htaccess')
|
||||
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
if(strpos($row['path'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
$row['path'] = substr($row['path'], strlen($userinfo['documentroot']));
|
||||
// don't show nothing wehn it's the docroot, show slash
|
||||
if ($row['path'] == '') { $row['path'] = '/'; }
|
||||
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']);
|
||||
@@ -313,52 +285,63 @@ elseif($page == 'htaccess')
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htaccess") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
} 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);
|
||||
|
||||
if(isset($result['customerid'])
|
||||
&& $result['customerid'] != ''
|
||||
&& $result['customerid'] == $userinfo['customerid'])
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
|
||||
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 . "'");
|
||||
}
|
||||
}
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
ask_yesno('extras_reallydelete_pathoptions', $filename, array('id' => $id, 'page' => $page, 'action' => $action), str_replace($userinfo['documentroot'], '', $result['path']));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
ask_yesno('extras_reallydelete_pathoptions', $filename, array('id' => $id, 'page' => $page, 'action' => $action), str_replace($userinfo['documentroot'], '/', $result['path']));
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} 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 = $db->query_first("SELECT `id`, `path` FROM `" . TABLE_PANEL_HTACCESS . "` WHERE `path`='" . $db->escape($path) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$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'])
|
||||
{
|
||||
if (!$_POST['path']) {
|
||||
standard_error('invalidpath');
|
||||
}
|
||||
|
||||
if(isset($_POST['options_cgi'])
|
||||
&& (int)$_POST['options_cgi'] != 0
|
||||
) {
|
||||
if (isset($_POST['options_cgi']) && (int)$_POST['options_cgi'] != 0) {
|
||||
$options_cgi = '1';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$options_cgi = '0';
|
||||
}
|
||||
|
||||
@@ -366,47 +349,49 @@ elseif($page == 'htaccess')
|
||||
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)
|
||||
{
|
||||
if ($path_dupe_check['path'] == $path) {
|
||||
standard_error('errordocpathdupe', $userpath);
|
||||
}
|
||||
elseif($path == '')
|
||||
{
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query('INSERT INTO `' . TABLE_PANEL_HTACCESS . '` SET
|
||||
`customerid` = "'.(int)$userinfo['customerid'].'",
|
||||
`path` = "'.$db->escape($path).'",
|
||||
`options_indexes` = "'.$db->escape($_POST['options_indexes'] == '1' ? '1' : '0').'",
|
||||
`error404path` = "'.$db->escape($error404path).'",
|
||||
`error403path` = "'.$db->escape($error403path).'",
|
||||
`error500path` = "'.$db->escape($error500path).'",
|
||||
`options_cgi` = "'.$db->escape($options_cgi).'"');
|
||||
} 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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid']);
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
/*
|
||||
$options_indexes = makeyesno('options_indexes', '1', '0', '0');
|
||||
$options_cgi = makeyesno('options_cgi', '1', '0', '0');
|
||||
*/
|
||||
|
||||
$htaccess_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htaccess_add.php';
|
||||
$htaccess_add_form = htmlform::genHTMLForm($htaccess_add_data);
|
||||
@@ -416,29 +401,24 @@ elseif($page == 'htaccess')
|
||||
|
||||
eval("echo \"" . getTemplate("extras/htaccess_add") . "\";");
|
||||
}
|
||||
}
|
||||
elseif(($action == 'edit')
|
||||
&& ($id != 0))
|
||||
{
|
||||
$result = $db->query_first('SELECT * FROM `' . TABLE_PANEL_HTACCESS . '` WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
|
||||
} 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);
|
||||
|
||||
if((isset($result['customerid']))
|
||||
&& ($result['customerid'] != '')
|
||||
&& ($result['customerid'] == $userinfo['customerid']))
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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')
|
||||
{
|
||||
if ($option_indexes != '1') {
|
||||
$option_indexes = '0';
|
||||
}
|
||||
|
||||
if($options_cgi != '1')
|
||||
{
|
||||
if ($options_cgi != '1') {
|
||||
$options_cgi = '0';
|
||||
}
|
||||
|
||||
@@ -446,26 +426,39 @@ elseif($page == 'htaccess')
|
||||
$error403path = correctErrorDocument($_POST['error403path']);
|
||||
$error500path = correctErrorDocument($_POST['error500path']);
|
||||
|
||||
if(($option_indexes != $result['options_indexes'])
|
||||
if (($option_indexes != $result['options_indexes'])
|
||||
|| ($error404path != $result['error404path'])
|
||||
|| ($error403path != $result['error403path'])
|
||||
|| ($error500path != $result['error500path'])
|
||||
|| ($options_cgi != $result['options_cgi']))
|
||||
{
|
||||
|| ($options_cgi != $result['options_cgi'])
|
||||
) {
|
||||
inserttask('1');
|
||||
$db->query('UPDATE `' . TABLE_PANEL_HTACCESS . '` SET `options_indexes` = "' . $db->escape($option_indexes) . '", `error404path` = "' . $db->escape($error404path) . '", `error403path` = "' . $db->escape($error403path) . '", `error500path` = "' . $db->escape($error500path) . '", `options_cgi` = "' . $db->escape($options_cgi) . '" WHERE `customerid` = "' . (int)$userinfo['customerid'] . '" AND `id` = "' . (int)$id . '"');
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited htaccess for '" . str_replace($userinfo['documentroot'], '', $result['path']) . "'");
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($result['path'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
$result['path'] = substr($result['path'], strlen($userinfo['documentroot']));
|
||||
// don't show nothing wehn it's the docroot, show slash
|
||||
if ($result['path'] == '') { $result['path'] = '/'; }
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
} else {
|
||||
if (strpos($result['path'], $userinfo['documentroot']) === 0) {
|
||||
$result['path'] = str_replace($userinfo['documentroot'], "/", $result['path']);
|
||||
}
|
||||
|
||||
$result['error404path'] = $result['error404path'];
|
||||
@@ -489,5 +482,3 @@ elseif($page == 'htaccess')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
283
customer_ftp.php
@@ -18,16 +18,12 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
$id = 0;
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
@@ -39,11 +35,17 @@ if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
|
||||
$fields = array(
|
||||
'username' => $lng['login']['username'],
|
||||
'homedir' => $lng['panel']['path']
|
||||
'homedir' => $lng['panel']['path'],
|
||||
'description' => $lng['panel']['ftpdesc']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_FTP_USERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT `id`, `username`, `homedir` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . $userinfo['customerid'] . "' AND `username` NOT LIKE '%_backup'" . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -52,10 +54,10 @@ if ($page == 'overview') {
|
||||
$count = 0;
|
||||
$accounts = '';
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = substr($row['homedir'], strlen($userinfo['documentroot']));
|
||||
$row['documentroot'] = str_replace($userinfo['documentroot'], "/", $row['homedir']);
|
||||
} else {
|
||||
$row['documentroot'] = $row['homedir'];
|
||||
}
|
||||
@@ -70,35 +72,72 @@ if ($page == 'overview') {
|
||||
$i++;
|
||||
}
|
||||
|
||||
$ftps_count = $db->num_rows($result);
|
||||
eval("echo \"" . getTemplate('ftp/accounts') . "\";");
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
$result = $db->query_first("SELECT `id`, `username`, `homedir`, `up_count`, `up_bytes`, `down_count`, `down_bytes` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$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);
|
||||
|
||||
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']));
|
||||
|
||||
if (isset($result['username'])
|
||||
&& $result['username'] != $userinfo['loginname']
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `up_count`=`up_count`+'" . (int)$result['up_count'] . "', `up_bytes`=`up_bytes`+'" . (int)$result['up_bytes'] . "', `down_count`=`down_count`+'" . (int)$result['down_count'] . "', `down_bytes`=`down_bytes`+'" . (int)$result['down_bytes'] . "' WHERE `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||
$result = $db->query_first("SELECT `username`, `homedir` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$db->query("DELETE FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $db->escape($result['username']) . "'");
|
||||
$db->query("DELETE FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted ftp-account '" . $result['username'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=REPLACE(`members`,'," . $db->escape($result['username']) . "','') WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
$resetaccnumber = ($userinfo['ftps_used'] == '1') ? " , `ftp_lastaccountnumber`='0'" : '';
|
||||
|
||||
// refs #293
|
||||
if (isset($_POST['delete_userfiles'])
|
||||
&& (int)$_POST['delete_userfiles'] == 1
|
||||
) {
|
||||
if (isset($_POST['delete_userfiles']) && (int)$_POST['delete_userfiles'] == 1) {
|
||||
inserttask('8', $userinfo['loginname'], $result['homedir']);
|
||||
}
|
||||
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`-1 $resetaccnumber WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
$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));
|
||||
} else {
|
||||
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
|
||||
}
|
||||
@@ -106,12 +145,10 @@ if ($page == 'overview') {
|
||||
standard_error('ftp_cantdeletemainaccount');
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['ftps_used'] < $userinfo['ftps']
|
||||
|| $userinfo['ftps'] == '-1'
|
||||
) {
|
||||
if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == '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');
|
||||
@@ -122,22 +159,32 @@ if ($page == 'overview') {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
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 = $db->query_first("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `domain`='" . $db->escape($ftpdomain) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$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['customer']['ftpprefix'] . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
$username = $userinfo['loginname'] . Settings::Get('customer.ftpprefix') . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
}
|
||||
|
||||
$username_check = $db->query_first('SELECT * FROM `' . TABLE_FTP_USERS .'` WHERE `username` = \'' . $db->escape($username) . '\'');
|
||||
$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);
|
||||
@@ -145,17 +192,58 @@ if ($page == 'overview') {
|
||||
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);
|
||||
$db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', '" . $db->escape($cryptPassword) . "', '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')");
|
||||
$result = $db->query("SELECT `bytes_in_used` FROM `" . TABLE_FTP_QUOTATALLIES . "` WHERE `name` = '" . $userinfo['loginname'] . "'");
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$db->query("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 ('" . $db->escape($username) . "', 'user', '" . $db->escape($row['bytes_in_used']) . "', '0', '0', '0', '0', '0')");
|
||||
|
||||
$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']));
|
||||
}
|
||||
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
$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);
|
||||
@@ -166,14 +254,30 @@ if ($page == 'overview') {
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||
'USR_NAME' => $username,
|
||||
'USR_PASS' => $password,
|
||||
'USR_PATH' => makeCorrectDir(substr($path, strlen($userinfo['documentroot'])))
|
||||
'USR_PATH' => makeCorrectDir(str_replace($userinfo['documentroot'], "/", $path))
|
||||
);
|
||||
|
||||
$def_language = $userinfo['def_language'];
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_subject\'');
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_subject']), $replace_arr));
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_ftpaccount_by_customer_mailbody\'');
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['ftp_add']['infomail_body']['main']), $replace_arr));
|
||||
$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 {
|
||||
@@ -198,18 +302,21 @@ if ($page == 'overview') {
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], '/');
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], '/');
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domainlist = array();
|
||||
$domains = '';
|
||||
|
||||
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$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 = $db->fetch_array($result_domains)) {
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domainlist[] = $row_domain['domain'];
|
||||
}
|
||||
|
||||
@@ -234,14 +341,15 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result = $db->query_first("SELECT `id`, `username`, `homedir`, `uid`, `gid` FROM `" . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$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);
|
||||
|
||||
if (isset($result['username'])
|
||||
&& $result['username'] != ''
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
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');
|
||||
|
||||
@@ -255,16 +363,18 @@ if ($page == 'overview') {
|
||||
if ($_setnewpass) {
|
||||
if ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
exit;
|
||||
} elseif ($result['username'] == $password) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`='" . $db->escape($cryptPassword) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
|
||||
// also update customers backup user password if password of main ftp user is changed
|
||||
if(!preg_match('/' . $settings['customer']['ftpprefix'] . '/', $result['username'])){
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`='" . $db->escape($cryptPassword) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $result['username'] . "_backup'");
|
||||
}
|
||||
$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 != '') {
|
||||
@@ -278,27 +388,50 @@ if ($page == 'overview') {
|
||||
}
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account homdir for '" . $result['username'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `homedir`= '" . $db->escape($path) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
$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));
|
||||
} else {
|
||||
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$homedir = substr($result['homedir'], strlen($userinfo['documentroot']));
|
||||
$homedir = str_replace($userinfo['documentroot'], "/", $result['homedir']);
|
||||
} else {
|
||||
$homedir = $result['homedir'];
|
||||
}
|
||||
$homedir = makeCorrectDir($homedir);
|
||||
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $homedir);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $homedir);
|
||||
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
if (Settings::Get('customer.ftpatdomain') == '1') {
|
||||
$domains = '';
|
||||
|
||||
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$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 = $db->fetch_array($result_domains)) {
|
||||
while ($row_domain = $result_domains_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,68 +18,88 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if ($action == 'logout') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'logged out');
|
||||
|
||||
$query = "DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'";
|
||||
if ($settings['session']['allow_multiple_login'] == '1') {
|
||||
$query .= " AND `hash` = '" . $s . "'";
|
||||
$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;
|
||||
} else {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :customerid
|
||||
AND `adminsession` = '0'"
|
||||
);
|
||||
}
|
||||
$db->query($query);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(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 = '';
|
||||
$result = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `parentdomainid`='0' AND `id` <> '" . (int)$userinfo['standardsubdomain'] . "' ");
|
||||
$domainArray = array();
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
while ($row = $domain_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domainArray[] = $idna_convert->decode($row['domain']);
|
||||
}
|
||||
|
||||
natsort($domainArray);
|
||||
$domains = implode(',<br />', $domainArray);
|
||||
|
||||
// standard-subdomain
|
||||
$stdsubdomain = '';
|
||||
if ($userinfo['standardsubdomain'] != '0') {
|
||||
$std_domain_stmt = Database::prepare("
|
||||
SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid` = :customerid
|
||||
AND `id` = :standardsubdomain
|
||||
");
|
||||
$std_domain = Database::pexecute_first($std_domain_stmt, array("customerid" => $userinfo['customerid'], "standardsubdomain" => $userinfo['standardsubdomain']));
|
||||
$stdsubdomain = $std_domain['domain'];
|
||||
}
|
||||
|
||||
$userinfo['email'] = $idna_convert->decode($userinfo['email']);
|
||||
$yesterday = time() - (60 * 60 * 24);
|
||||
$month = date('M Y', $yesterday);
|
||||
|
||||
/* $traffic=$db->query_first("SELECT SUM(http) AS http_sum, SUM(ftp_up) AS ftp_up_sum, SUM(ftp_down) AS ftp_down_sum, SUM(mail) AS mail_sum FROM ".TABLE_PANEL_TRAFFIC." WHERE year='".date('Y')."' AND month='".date('m')."' AND day<='".date('d')."' AND customerid='".$userinfo['customerid']."'");
|
||||
$userinfo['traffic_used']=$traffic['http_sum']+$traffic['ftp_up_sum']+$traffic['ftp_down_sum']+$traffic['mail_sum'];*/
|
||||
$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');
|
||||
|
||||
$userinfo['diskspace'] = round($userinfo['diskspace'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['diskspace_used'] = round($userinfo['diskspace_used'] / 1024, $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic'] = round($userinfo['traffic'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo['traffic_used'] = round($userinfo['traffic_used'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$userinfo = str_replace_array('-1', $lng['customer']['unlimited'], $userinfo, 'diskspace traffic mysqls emails email_accounts email_forwarders email_quota email_autoresponder ftps tickets subdomains aps_packages');
|
||||
$opentickets = 0;
|
||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||
AND `answerto` = "0"
|
||||
AND (`status` = "0" OR `status` = "2")
|
||||
AND `lastreplier`="1"');
|
||||
$awaitingtickets = $opentickets['count'];
|
||||
$awaitingtickets_text = '';
|
||||
$userinfo['custom_notes'] = ($userinfo['custom_notes'] != '') ? nl2br($userinfo['custom_notes']) : '';
|
||||
|
||||
if ($opentickets > 0) {
|
||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||
}
|
||||
$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);
|
||||
|
||||
eval("echo \"" . getTemplate('index/index') . "\";");
|
||||
} elseif ($page == 'change_password') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$old_password = validate($_POST['old_password'], 'old password');
|
||||
if (md5($old_password) != $userinfo['password']) {
|
||||
if (!validatePasswordLogin($userinfo,$old_password,TABLE_PANEL_CUSTOMERS,'customerid')) {
|
||||
standard_error('oldpasswordnotcorrect');
|
||||
exit;
|
||||
}
|
||||
|
||||
$new_password = validatePassword($_POST['new_password'], 'new password');
|
||||
@@ -87,27 +107,44 @@ if ($page == 'overview') {
|
||||
|
||||
if ($old_password == '') {
|
||||
standard_error(array('stringisempty', 'oldpassword'));
|
||||
} elseif($new_password == '') {
|
||||
} elseif ($new_password == '') {
|
||||
standard_error(array('stringisempty', 'newpassword'));
|
||||
} elseif($new_password_confirm == '') {
|
||||
} elseif ($new_password_confirm == '') {
|
||||
standard_error(array('stringisempty', 'newpasswordconfirm'));
|
||||
} elseif($new_password != $new_password_confirm) {
|
||||
} elseif ($new_password != $new_password_confirm) {
|
||||
standard_error('newpasswordconfirmerror');
|
||||
} else {
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($new_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `password`='" . md5($old_password) . "'");
|
||||
// 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');
|
||||
|
||||
if (isset($_POST['change_main_ftp'])
|
||||
&& $_POST['change_main_ftp'] == 'true'
|
||||
) {
|
||||
// Update ftp password
|
||||
if (isset($_POST['change_main_ftp']) && $_POST['change_main_ftp'] == 'true') {
|
||||
$cryptPassword = makeCryptPassword($new_password);
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`='" . $db->escape($cryptPassword) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_FTP_USERS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
AND `username` = :username"
|
||||
);
|
||||
$params = array(
|
||||
"password" => $cryptPassword,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $userinfo['loginname']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
||||
}
|
||||
|
||||
if (isset($_POST['change_webalizer'])
|
||||
&& $_POST['change_webalizer'] == 'true'
|
||||
) {
|
||||
// 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);
|
||||
@@ -115,10 +152,20 @@ if ($page == 'overview') {
|
||||
$new_webalizer_password = crypt($new_password);
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($new_webalizer_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_HTPASSWDS . "`
|
||||
SET `password` = :password
|
||||
WHERE `customerid` = :customerid
|
||||
AND `username` = :username"
|
||||
);
|
||||
$params = array(
|
||||
"password" => $new_webalizer_password,
|
||||
"customerid" => $userinfo['customerid'],
|
||||
"username" => $userinfo['loginname']
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate('index/change_password') . "\";");
|
||||
@@ -127,14 +174,24 @@ if ($page == 'overview') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$def_language = validate($_POST['def_language'], 'default language');
|
||||
if (isset($languages[$def_language])) {
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||
$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 . "'");
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
} else {
|
||||
$default_lang = $settings['panel']['standardlanguage'];
|
||||
$default_lang = Settings::Get('panel.standardlanguage');
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
@@ -150,22 +207,107 @@ if ($page == 'overview') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$theme = validate($_POST['theme'], 'theme');
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `hash`='" . $db->escape($s) . "'");
|
||||
$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));
|
||||
redirectTo($filename, array('s' => $s));
|
||||
} else {
|
||||
$default_theme = $settings['panel']['default_theme'];
|
||||
$default_theme = Settings::Get('panel.default_theme');
|
||||
if ($userinfo['theme'] != '') {
|
||||
$default_theme = $userinfo['theme'];
|
||||
}
|
||||
|
||||
$theme_options = '';
|
||||
$themes_avail = getThemes();
|
||||
foreach ($themes_avail as $t) {
|
||||
$theme_options .= makeoption($t, $t, $default_theme, true);
|
||||
foreach ($themes_avail as $t => $d) {
|
||||
$theme_options.= makeoption($d, $t, $default_theme, true);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('index/change_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));
|
||||
}
|
||||
}
|
||||
|
||||
117
customer_logger.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?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 ($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;
|
||||
}
|
||||
|
||||
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') . "\";");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -18,34 +18,41 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
$need_db_sql_data = true;
|
||||
$need_root_db_sql_data = true;
|
||||
require('./lib/init.php');
|
||||
// get sql-root access data
|
||||
Database::needRoot(true);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
if (isset($_POST['id'])) {
|
||||
$id = intval($_POST['id']);
|
||||
} elseif(isset($_GET['id'])) {
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['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') {
|
||||
} elseif ($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, $db, TABLE_PANEL_DATABASES, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DATABASES . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$searchcode = $paging->getHtmlSearchCode($lng);
|
||||
@@ -54,61 +61,75 @@ if ($page == 'overview') {
|
||||
$count = 0;
|
||||
$mysqls = '';
|
||||
|
||||
$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
|
||||
$db_root = new db($sql_root[0]['host'], $sql_root[0]['user'], $sql_root[0]['password'], '');
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
Database::needRoot(true);
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
$mbdata = $db_root->query_first("SELECT SUM( data_length + index_length) / 1024 / 1024 'MB' FROM information_schema.TABLES WHERE table_schema = '" . $db_root->escape($row['databasename']) . "' GROUP BY table_schema ;");
|
||||
$row['size'] = number_format($mbdata['MB'], 3, '.', '');
|
||||
$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++;
|
||||
}
|
||||
$db_root->close();
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
|
||||
$mysqls_count = $db->num_rows($result);
|
||||
eval("echo \"" . getTemplate('mysql/mysqls') . "\";");
|
||||
} elseif($action == 'delete' && $id != 0) {
|
||||
$result = $db->query_first('SELECT `id`, `databasename`, `description`, `dbserver` FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int)$userinfo['customerid'] . '" AND `id`="' . (int)$id . '"');
|
||||
|
||||
if (isset($result['databasename'])
|
||||
&& $result['databasename'] != ''
|
||||
) {
|
||||
} 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);
|
||||
|
||||
if (isset($result['databasename']) && $result['databasename'] != '') {
|
||||
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
|
||||
if (!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']])) {
|
||||
$result['dbserver'] = 0;
|
||||
}
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
// Begin root-session
|
||||
$db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], '');
|
||||
Database::needRoot(true, $result['dbserver']);
|
||||
$dbm = new DbManager($log);
|
||||
$dbm->getManager()->deleteDatabase($result['databasename']);
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "deleted database '" . $result['databasename'] . "'");
|
||||
if (mysql_get_server_info() < '5.0.2') {
|
||||
// Revoke privileges (only required for MySQL 4.1.2 - 5.0.1)
|
||||
$db_root->query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM \'' . $db_root->escape($result['databasename']) .'\'',false,true);
|
||||
}
|
||||
|
||||
$host_res = $db_root->query("SELECT `Host` FROM `mysql`.`user` WHERE `User`='" . $db_root->escape($result['databasename']) . "'");
|
||||
while ($host = $db_root->fetch_array($host_res)) {
|
||||
// as of MySQL 5.0.2 this also revokes privileges. (requires MySQL 4.1.2+)
|
||||
$db_root->query('DROP USER \'' . $db_root->escape($result['databasename']). '\'@\'' . $db_root->escape($host['Host']) . '\'', false, true);
|
||||
}
|
||||
|
||||
$db_root->query('DROP DATABASE IF EXISTS `' . $db_root->escape($result['databasename']) . '`');
|
||||
$db_root->query('FLUSH PRIVILEGES');
|
||||
$db_root->close();
|
||||
Database::needRoot(false);
|
||||
// End root-session
|
||||
|
||||
$db->query('DELETE FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int)$userinfo['customerid'] . '" AND `id`="' . (int)$id . '"');
|
||||
$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' " : '';
|
||||
$resetaccnumber = ($userinfo['mysqls_used'] == '1') ? " , `mysql_lastaccountnumber` = '0' " : '';
|
||||
|
||||
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`-1 ' . $resetaccnumber . 'WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
$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));
|
||||
} else {
|
||||
$dbnamedesc = $result['databasename'];
|
||||
if (isset($result['description']) && $result['description'] != '') {
|
||||
@@ -118,12 +139,8 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['mysqls_used'] < $userinfo['mysqls']
|
||||
|| $userinfo['mysqls'] == '-1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
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);
|
||||
|
||||
@@ -136,9 +153,16 @@ if ($page == 'overview') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
} else {
|
||||
$dbserver = 0;
|
||||
if (count($sql_root) > 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'];
|
||||
if ($count_mysqlservers > 1) {
|
||||
$dbserver = validate($_POST['mysql_server'], html_entity_decode($lng['mysql']['mysql_server']), '', '', 0);
|
||||
if (!isset($sql_root[$dbserver]) || !is_array($sql_root[$dbserver])) {
|
||||
Database::needRoot(true, $dbserver);
|
||||
Database::needSqlData();
|
||||
$sql_root = Database::getSqlData();
|
||||
Database::needRoot(false);
|
||||
if (!isset($sql_root) || !is_array($sql_root)) {
|
||||
$dbserver = 0;
|
||||
}
|
||||
}
|
||||
@@ -146,59 +170,79 @@ if ($page == 'overview') {
|
||||
// validate description before actual adding the database, #1052
|
||||
$databasedescription = validate(trim($_POST['description']), 'description');
|
||||
|
||||
// Begin root-session
|
||||
$db_root = new db($sql_root[$dbserver]['host'], $sql_root[$dbserver]['user'], $sql_root[$dbserver]['password'], '');
|
||||
// create database, user, set permissions, etc.pp.
|
||||
$dbm = new DbManager($log);
|
||||
$username = $dbm->createDatabase(
|
||||
$userinfo['loginname'],
|
||||
$password,
|
||||
$userinfo['mysql_lastaccountnumber']
|
||||
);
|
||||
|
||||
if (strtoupper($settings['customer']['mysqlprefix']) == 'RANDOM') {
|
||||
$result = $db_root->query('SELECT `User` FROM mysql.user');
|
||||
while ($row = $db_root->fetch_array($result)) {
|
||||
$allsqlusers[] = $row[User];
|
||||
// we've checked against the password in dbm->createDatabase
|
||||
if ($username == false) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
$username = $userinfo['loginname'] . '-' . substr(md5(uniqid(microtime(), 1)), 20, 3);
|
||||
while (in_array($username , $allsqlusers)) {
|
||||
$username = $userinfo['loginname'] . '-' . substr(md5(uniqid(microtime(), 1)), 20, 3);
|
||||
}
|
||||
} else {
|
||||
$username = $userinfo['loginname'] . $settings['customer']['mysqlprefix'] . (intval($userinfo['mysql_lastaccountnumber']) + 1);
|
||||
}
|
||||
|
||||
$db_root->query('CREATE DATABASE `' . $db_root->escape($username) . '`');
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "created database '" . $username . "'");
|
||||
foreach (array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) {
|
||||
$db_root->query('GRANT ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($username)) . '`.* TO `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` IDENTIFIED BY \'password\'');
|
||||
$db_root->query('SET PASSWORD FOR `' . $db_root->escape($username) . '`@`' . $db_root->escape($mysql_access_host) . '` = PASSWORD(\'' . $db_root->escape($password) . '\')');
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "grant all privileges for '" . $username . "'@'" . $mysql_access_host . "'");
|
||||
}
|
||||
|
||||
$db_root->query('FLUSH PRIVILEGES');
|
||||
$db_root->close();
|
||||
// End root-session
|
||||
|
||||
// Statement modified for Database description -- PH 2004-11-29
|
||||
$result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`) VALUES ("' . (int)$userinfo['customerid'] . '", "' . $db->escape($username) . '", "' . $db->escape($databasedescription) . '", "' . $db->escape($dbserver) . '")');
|
||||
$result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1, `mysql_lastaccountnumber`=`mysql_lastaccountnumber`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
||||
$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['panel']['phpmyadmin_url'] != '') {
|
||||
$pma = $settings['panel']['phpmyadmin_url'];
|
||||
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[$dbserver]['host'],
|
||||
'DB_SRV' => $sql_root['host'],
|
||||
'PMA_URI' => $pma
|
||||
);
|
||||
|
||||
$def_language = $userinfo['def_language'];
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_subject\'');
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_subject']), $replace_arr));
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'new_database_by_customer_mailbody\'');
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['customer']['mysql_add']['infomail_body']['main']), $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_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 {
|
||||
@@ -223,16 +267,21 @@ if ($page == 'overview') {
|
||||
$mail->ClearAddresses();
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
} else {
|
||||
|
||||
$dbservers_stmt = Database::query("SELECT DISTINCT `dbserver` FROM `".TABLE_PANEL_DATABASES."`");
|
||||
$mysql_servers = '';
|
||||
|
||||
foreach ($sql_root as $mysql_server => $mysql_server_details) {
|
||||
$mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
|
||||
$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++;
|
||||
}
|
||||
|
||||
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
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);
|
||||
@@ -244,41 +293,68 @@ if ($page == 'overview') {
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result = $db->query_first('SELECT `id`, `databasename`, `description`, `dbserver` FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . $userinfo['customerid'] . '" AND `id`="' . $id . '"');
|
||||
$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);
|
||||
|
||||
if (isset($result['databasename'])
|
||||
&& $result['databasename'] != ''
|
||||
) {
|
||||
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'
|
||||
) {
|
||||
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);
|
||||
|
||||
// Begin root-session
|
||||
$db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], '');
|
||||
foreach (array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) {
|
||||
$db_root->query('SET PASSWORD FOR `' . $db_root->escape($result['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '` = PASSWORD(\'' . $db_root->escape($password) . '\')');
|
||||
if ($password == $result['databasename']) {
|
||||
standard_error('passwordshouldnotbeusername');
|
||||
}
|
||||
|
||||
$db_root->query('FLUSH PRIVILEGES');
|
||||
$db_root->close();
|
||||
// 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
|
||||
}
|
||||
|
||||
// Update the Database description -- PH 2004-11-29
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited database '" . $result['databasename'] . "'");
|
||||
$databasedescription = validate($_POST['description'], 'description');
|
||||
$result = $db->query('UPDATE `' . TABLE_PANEL_DATABASES . '` SET `description`="' . $db->escape($databasedescription) . '" WHERE `customerid`="' . (int)$userinfo['customerid'] . '" AND `id`="' . (int)$id . '"');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
$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 {
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
@@ -18,56 +18,47 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
require './lib/init.php';
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
if (isset($_POST['id'])) {
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
$id = intval($_POST['id']);
|
||||
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$sql = "SELECT `id` FROM `panel_tickets` WHERE `id` = '".$id."' AND `customerid` = '".$userinfo['customerid']."'";
|
||||
//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']));
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
}
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
} elseif (isset($_GET['id'])) {
|
||||
$id = intval($_GET['id']);
|
||||
}
|
||||
|
||||
if($page == 'overview')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets");
|
||||
eval("echo \"" . getTemplate("tickets/ticket") . "\";");
|
||||
}
|
||||
elseif($page == 'tickets')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
} elseif ($page == 'tickets') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_tickets::tickets");
|
||||
$fields = array(
|
||||
'status' => $lng['ticket']['status'],
|
||||
'priority' => $lng['ticket']['priority'],
|
||||
'lastchange' => $lng['ticket']['lastchange'],
|
||||
'ticket_answers' => $lng['ticket']['ticket_answers'],
|
||||
'subject' => $lng['ticket']['subject'],
|
||||
'lastreplier' => $lng['ticket']['lastreplier']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKETS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$paging->sortfield = 'lastchange';
|
||||
$paging->sortorder = 'desc';
|
||||
$result = $db->query('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`="' . (int)$userinfo['customerid'] . '" ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$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);
|
||||
@@ -77,42 +68,34 @@ elseif($page == 'tickets')
|
||||
$tickets = '';
|
||||
$tickets_count = 0;
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
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)
|
||||
{
|
||||
if ($row['status'] >= 0 && $row['status'] <= 2) {
|
||||
$reopen = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$reopen = 1;
|
||||
}
|
||||
|
||||
$row['status'] = ticket::getStatusText($lng, $row['status']);
|
||||
$row['priority'] = ticket::getPriorityText($lng, $row['priority']);
|
||||
|
||||
if($row['lastreplier'] == '1')
|
||||
{
|
||||
if ($row['lastreplier'] == '1') {
|
||||
$row['lastreplier'] = $lng['ticket']['staff'];
|
||||
$cananswer = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$row['lastreplier'] = $lng['ticket']['customer'];
|
||||
$cananswer = 0;
|
||||
}
|
||||
|
||||
$row['subject'] = html_entity_decode($row['subject']);
|
||||
if(strlen($row['subject']) > 20)
|
||||
{
|
||||
$row['subject'] = substr($row['subject'], 0, 17) . '...';
|
||||
if (strlen($row['subject']) > 30) {
|
||||
$ts = wordwrap($row['subject'], 30, "|");
|
||||
$ts = explode("|", $ts);
|
||||
$row['subject'] = $ts[0]. '...';
|
||||
}
|
||||
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_tickets") . "\";");
|
||||
@@ -125,60 +108,46 @@ elseif($page == 'tickets')
|
||||
$supportavailable = 0;
|
||||
$time = date("Hi", time());
|
||||
$day = date("w", time());
|
||||
$start = substr($settings['ticket']['worktime_begin'], 0, 2) . substr($settings['ticket']['worktime_begin'], 3, 2);
|
||||
$end = substr($settings['ticket']['worktime_end'], 0, 2) . substr($settings['ticket']['worktime_end'], 3, 2);
|
||||
$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)
|
||||
{
|
||||
if ($time >= $start && $time <= $end) {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_sat'] == "0"
|
||||
&& $day == "6")
|
||||
{
|
||||
if (Settings::Get('ticket.worktime_sat') == "0" && $day == "6") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_sun'] == "0"
|
||||
&& $day == "0")
|
||||
{
|
||||
if (Settings::Get('ticket.worktime_sun') == "0" && $day == "0") {
|
||||
$supportavailable = 0;
|
||||
}
|
||||
|
||||
if($settings['ticket']['worktime_all'] == "1")
|
||||
{
|
||||
if (Settings::Get('ticket.worktime_all') == "1") {
|
||||
$supportavailable = 1;
|
||||
}
|
||||
|
||||
$ticketsopen = 0;
|
||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||
$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")');
|
||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")'
|
||||
);
|
||||
$opentickets = Database::pexecute_first($stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if($settings['ticket']['concurrently_open'] != - 1
|
||||
&& $settings['ticket']['concurrently_open'] != '')
|
||||
{
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||
}
|
||||
else
|
||||
{
|
||||
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, $db, $settings, -1);
|
||||
|
||||
} 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);
|
||||
@@ -186,16 +155,11 @@ elseif($page == 'tickets')
|
||||
$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)
|
||||
{
|
||||
if ($newticket->Get('subject') == null) {
|
||||
standard_error(array('stringisempty', 'mysubject'));
|
||||
}
|
||||
elseif($newticket->Get('message') == null)
|
||||
{
|
||||
} elseif ($newticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$now = time();
|
||||
$newticket->Set('dt', $now, true, true);
|
||||
$newticket->Set('lastchange', $now, true, true);
|
||||
@@ -205,55 +169,56 @@ elseif($page == 'tickets')
|
||||
$newticket->Set('by', '0', true, true);
|
||||
$newticket->Insert();
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "opened support-ticket '" . $newticket->Get('subject') . "'");
|
||||
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
SET `tickets_used`=`tickets_used`+1 WHERE `customerid`="' . (int)$userinfo['customerid'] . '"');
|
||||
|
||||
$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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$categories = '';
|
||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||
$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 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||
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 = $db->fetch_array($result2))
|
||||
{
|
||||
while ($row = $result2_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$categories.= makeoption($row['name'], $row['id']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$categories = makeoption($lng['ticket']['no_cat'], '0');
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', $settings['ticket']['default_priority']);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', $settings['ticket']['default_priority']);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', $settings['ticket']['default_priority']);
|
||||
$priorities = makeoption($lng['ticket']['high'], '1');
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2');
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3');
|
||||
$ticketsopen = 0;
|
||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||
$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")');
|
||||
AND (`status` = "0" OR `status` = "1" OR `status` = "2")'
|
||||
);
|
||||
$opentickets = Database::pexecute_first($opentickets_stmt, array("customerid" => $userinfo['customerid']));
|
||||
|
||||
if($settings['ticket']['concurrently_open'] != - 1
|
||||
&& $settings['ticket']['concurrently_open'] != '')
|
||||
{
|
||||
$notmorethanxopentickets = strtr($lng['ticket']['notmorethanxopentickets'], array('%s' => $settings['ticket']['concurrently_open']));
|
||||
}
|
||||
else
|
||||
{
|
||||
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 = '';
|
||||
}
|
||||
|
||||
@@ -267,31 +232,21 @@ elseif($page == 'tickets')
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_new") . "\";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('nomoreticketsavailable');
|
||||
}
|
||||
}
|
||||
elseif($action == 'answer'
|
||||
&& $id != 0)
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$replyticket = ticket::getInstanceOf($userinfo, $db, $settings, -1);
|
||||
} 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)
|
||||
{
|
||||
if ($replyticket->Get('message') == null) {
|
||||
standard_error(array('stringisempty', 'mymessage'));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$now = time();
|
||||
$replyticket->Set('customerid', (int)$userinfo['customerid'], true, true);
|
||||
$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);
|
||||
@@ -300,11 +255,9 @@ elseif($page == 'tickets')
|
||||
$replyticket->Insert();
|
||||
|
||||
// Update priority if changed
|
||||
$mainticket = ticket::getInstanceOf($userinfo, (int)$id);
|
||||
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||
|
||||
if($replyticket->Get('priority') != $mainticket->Get('priority'))
|
||||
{
|
||||
if ($replyticket->Get('priority') != $mainticket->Get('priority')) {
|
||||
$mainticket->Set('priority', $replyticket->Get('priority'), true);
|
||||
}
|
||||
|
||||
@@ -314,77 +267,78 @@ elseif($page == 'tickets')
|
||||
$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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$ticket_replies = '';
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||
$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)
|
||||
{
|
||||
if ($mainticket->Get('status') >= 0 && $mainticket->Get('status') <= 2) {
|
||||
$isclosed = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$isclosed = 1;
|
||||
}
|
||||
|
||||
if($mainticket->Get('by') == '1')
|
||||
{
|
||||
if ($mainticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
$usr_stmt = Database::prepare('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
WHERE `customerid` = :customerid '
|
||||
);
|
||||
$usr = Database::pexecute_first($usr_stmt, array("customerid" => $cid));
|
||||
$by = getCorrectFullUserDetails($usr);
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
$message = $mainticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_main") . "\";");
|
||||
$result = $db->query('SELECT `name` FROM `' . TABLE_PANEL_TICKET_CATS . '`
|
||||
WHERE `id`="' . (int)$mainticket->Get('category') . '"');
|
||||
$row = $db->fetch_array($result);
|
||||
$andere = $db->query('SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `answerto`="' . (int)$id . '" ORDER BY `lastchange` ASC');
|
||||
$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')));
|
||||
|
||||
while($row2 = $db->fetch_array($andere))
|
||||
{
|
||||
$subticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$row2['id']);
|
||||
$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')
|
||||
{
|
||||
if ($subticket->Get('by') == '1') {
|
||||
$by = $lng['ticket']['staff'];
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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);
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$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 = $mainticket->Get('subject');
|
||||
$ticket_replies_count = $db->num_rows($andere) + 1;
|
||||
$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);
|
||||
|
||||
@@ -393,54 +347,41 @@ elseif($page == 'tickets')
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_reply") . "\";");
|
||||
}
|
||||
}
|
||||
elseif($action == 'close'
|
||||
&& $id != 0)
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} elseif ($action == 'close' && $id != 0) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$now = time();
|
||||
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int)$id);
|
||||
$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, $db, $settings, (int)$id);
|
||||
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)
|
||||
{
|
||||
} elseif ($action == 'reopen' && $id != 0) {
|
||||
$ticketsopen = 0;
|
||||
$opentickets = $db->query_first('SELECT COUNT(`id`) as `count` FROM `' . TABLE_PANEL_TICKETS . '`
|
||||
WHERE `customerid` = "' . $userinfo['customerid'] . '"
|
||||
$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")');
|
||||
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['ticket']['concurrently_open']
|
||||
&& $settings['ticket']['concurrently_open'] != - 1
|
||||
&& $settings['ticket']['concurrently_open'] != '')
|
||||
{
|
||||
standard_error('notmorethanxopentickets', $settings['ticket']['concurrently_open']);
|
||||
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, $db, $settings, (int)$id);
|
||||
$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));
|
||||
redirectTo($filename, array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -18,33 +18,21 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'customer');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
$intrafficpage = 1;
|
||||
require('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
$traffic = '';
|
||||
$month = null;
|
||||
$year = null;
|
||||
|
||||
if (isset($_POST['month'])
|
||||
&& isset($_POST['year'])
|
||||
) {
|
||||
if (isset($_POST['month']) && isset($_POST['year'])) {
|
||||
$month = intval($_POST['month']);
|
||||
$year = intval($_POST['year']);
|
||||
} elseif (isset($_GET['month'])
|
||||
&& isset($_GET['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'
|
||||
) {
|
||||
elseif (isset($_GET['page']) && $_GET['page'] == 'current') {
|
||||
if (date('d') != '01') {
|
||||
$month = date('m');
|
||||
$year = date('Y');
|
||||
@@ -59,22 +47,28 @@ elseif (isset($_GET['page'])
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($month)
|
||||
&& !is_null($year)) {
|
||||
if (!is_null($month) && !is_null($year)) {
|
||||
$traf['byte'] = 0;
|
||||
$result = $db->query("SELECT
|
||||
SUM(`http`) as 'http', SUM(`ftp_up`) AS 'ftp_up', SUM(`ftp_down`) as 'ftp_down', SUM(`mail`) as 'mail',
|
||||
`day`, `month`, `year`
|
||||
$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`='" . $userinfo['customerid'] . "'
|
||||
AND `month` = '" . $month . "' AND `year` = '" . $year . "'
|
||||
GROUP BY `day` ORDER BY `day` ASC");
|
||||
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 = '';
|
||||
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$http = $row['http'];
|
||||
$ftp = $row['ftp_up'] + $row['ftp_down'];
|
||||
$mail = $row['mail'];
|
||||
@@ -85,47 +79,46 @@ if (!is_null($month)
|
||||
$traf['day'] = $row['day'] . '.';
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($row['ftp_up'], 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($row['ftp_down'], 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||
$traf['ftp'] = bcdiv($ftp, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024, $settings['panel']['decimal_places']);
|
||||
$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['panel']['decimal_places']) . " MB up/ " . round($row['ftp_down'] / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||
$traf['http'] = round($http, $settings['panel']['decimal_places']);
|
||||
$traf['ftp'] = round($ftp, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = round($mail, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = round($traf['byte'] / 1024, $settings['panel']['decimal_places']);
|
||||
$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'];
|
||||
}
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024, $settings['panel']['decimal_places']);
|
||||
} else {
|
||||
$traffic_complete['http'] = round($traffic_complete['http'] / 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['mail'] = round($traffic_complete['mail'] / 1024, $settings['panel']['decimal_places']);
|
||||
}
|
||||
$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 = $db->query("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` = '" . $userinfo['customerid'] . "'
|
||||
GROUP BY CONCAT(`year`,`month`) ORDER BY CONCAT(`year`,`month`) DESC LIMIT 12");
|
||||
$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 = $db->fetch_array($result)) {
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$http = $row['http'];
|
||||
$ftp_up = $row['ftp_up'];
|
||||
$ftp_down = $row['ftp_down'];
|
||||
@@ -139,35 +132,29 @@ if (!is_null($month)
|
||||
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traf['ftptext'] = bcdiv($ftp_up, 1024, $settings['panel']['decimal_places']) . " MB up/ " . bcdiv($ftp_down, 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||
$traf['httptext'] = bcdiv($http, 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||
$traf['mailtext'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||
$traf['ftp'] = bcdiv(($ftp_up + $ftp_down), 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = bcdiv($http, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = bcdiv($mail, 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = bcdiv($traf['byte'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||
$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['panel']['decimal_places']) . " MB up/ " . round($ftp_down / 1024, $settings['panel']['decimal_places']) . " MB down (FTP)";
|
||||
$traf['httptext'] = round($http / 1024, $settings['panel']['decimal_places']) . " MB (HTTP)";
|
||||
$traf['mailtext'] = round($mail / 1024, $settings['panel']['decimal_places']) . " MB (Mail)";
|
||||
$traf['ftp'] = round(($ftp_up + $ftp_down) / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['http'] = round($http / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['mail'] = round($mail / 1024, $settings['panel']['decimal_places']);
|
||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$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') . "\";");
|
||||
}
|
||||
|
||||
if (extension_loaded('bcmath')) {
|
||||
$traffic_complete['http'] = bcdiv($traffic_complete['http'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['ftp'] = bcdiv($traffic_complete['ftp'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||
$traffic_complete['mail'] = bcdiv($traffic_complete['mail'], 1024 * 1024, $settings['panel']['decimal_places']);
|
||||
} else {
|
||||
$traffic_complete['http'] = round($traffic_complete['http'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$traffic_complete['ftp'] = round($traffic_complete['ftp'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
$traffic_complete['mail'] = round($traffic_complete['mail'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
}
|
||||
$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') . "\";");
|
||||
}
|
||||
|
||||
442
index.php
@@ -18,24 +18,22 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'login');
|
||||
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require ('./lib/init.php');
|
||||
require './lib/init.php';
|
||||
|
||||
if ($action == '') {
|
||||
$action = 'login';
|
||||
}
|
||||
|
||||
if ($action == 'login') {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$loginname = validate($_POST['loginname'], 'loginname');
|
||||
$password = validate($_POST['password'], 'password');
|
||||
|
||||
$row = $db->query_first("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
$stmt = Database::prepare("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `loginname`= :loginname"
|
||||
);
|
||||
Database::pexecute($stmt, array("loginname" => $loginname));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($row['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
@@ -44,17 +42,22 @@ if ($action == 'login') {
|
||||
$is_admin = false;
|
||||
} else {
|
||||
$is_admin = true;
|
||||
if ((int)$settings['login']['domain_login'] == 1) {
|
||||
/**
|
||||
* check if the customer tries to login with a domain, #374
|
||||
*/
|
||||
$domainname = $idna_convert->encode(preg_replace(Array('/\:(\d)+$/', '/^https?\:\/\//'), '', $loginname));
|
||||
$row2 = $db->query_first("SELECT `customerid` FROM `".TABLE_PANEL_DOMAINS."` WHERE `domain` = '".$db->escape($domainname)."'");
|
||||
if ((int)Settings::Get('login.domain_login') == 1) {
|
||||
$domainname = $idna_convert->encode(preg_replace(array('/\:(\d)+$/', '/^https?\:\/\//'), '', $loginname));
|
||||
$stmt = Database::prepare("SELECT `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `domain` = :domain"
|
||||
);
|
||||
Database::pexecute($stmt, array("domain" => $domainname));
|
||||
$row2 = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (isset($row2['customerid']) && $row2['customerid'] > 0) {
|
||||
$loginname = getCustomerDetail($row2['customerid'], 'loginname');
|
||||
if ($loginname !== false) {
|
||||
$row3 = $db->query_first("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
$stmt = Database::prepare("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `loginname`= :loginname"
|
||||
);
|
||||
Database::pexecute($stmt, array("loginname" => $loginname));
|
||||
$row3 = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row3['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
$uid = 'customerid';
|
||||
@@ -66,23 +69,30 @@ if ($action == 'login') {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasUpdates($version) && $is_admin == false) {
|
||||
if ((hasUpdates($version) || hasDbUpdates($dbversion)) && $is_admin == false) {
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($is_admin) {
|
||||
if (hasUpdates($version)) {
|
||||
$row = $db->query_first("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `loginname`='" . $db->escape($loginname) . "' AND `change_serversettings` = '1'");
|
||||
/*
|
||||
* not an admin who can see updates
|
||||
*/
|
||||
if (hasUpdates($version) || hasDbUpdates($dbversion)) {
|
||||
$stmt = Database::prepare("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `loginname`= :loginname
|
||||
AND `change_serversettings` = '1'"
|
||||
);
|
||||
Database::pexecute($stmt, array("loginname" => $loginname));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
if (!isset($row['admin'])) {
|
||||
// not an admin who can see updates
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$row = $db->query_first("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
$stmt = Database::prepare("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `loginname`= :loginname"
|
||||
);
|
||||
Database::pexecute($stmt, array("loginname" => $loginname));
|
||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
if ($row['admin'] == $loginname) {
|
||||
@@ -90,83 +100,150 @@ if ($action == 'login') {
|
||||
$uid = 'adminid';
|
||||
$adminsession = '1';
|
||||
} else {
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
// Log failed login
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "Unknown user '" . $loginname . "' tried to login.");
|
||||
|
||||
redirectTo('index.php', array('showmessage' => '2'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$userinfo = $db->query_first("SELECT * FROM $table WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
$userinfo_stmt = Database::prepare("SELECT * FROM $table
|
||||
WHERE `loginname`= :loginname"
|
||||
);
|
||||
Database::pexecute($userinfo_stmt, array("loginname" => $loginname));
|
||||
$userinfo = $userinfo_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($userinfo['loginfail_count'] >= $settings['login']['maxloginattempts']
|
||||
&& $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
|
||||
) {
|
||||
redirectTo('index.php', Array('showmessage' => '3'), true);
|
||||
if ($userinfo['loginfail_count'] >= Settings::Get('login.maxloginattempts') && $userinfo['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime'))) {
|
||||
redirectTo('index.php', array('showmessage' => '3'));
|
||||
exit;
|
||||
} elseif($userinfo['password'] == md5($password)) {
|
||||
} elseif (validatePasswordLogin($userinfo, $password, $table, $uid)) {
|
||||
// only show "you're banned" if the login was successful
|
||||
// because we don't want to publish that the user does exist
|
||||
if ($userinfo['deactivated']) {
|
||||
unset($userinfo);
|
||||
redirectTo('index.php', array('showmessage' => '5'));
|
||||
exit;
|
||||
} else {
|
||||
// login correct
|
||||
// reset loginfail_counter, set lastlogin_succ
|
||||
$db->query("UPDATE $table SET `lastlogin_succ`='" . time() . "', `loginfail_count`='0' WHERE `$uid`='" . (int)$userinfo[$uid] . "'");
|
||||
$stmt = Database::prepare("UPDATE $table
|
||||
SET `lastlogin_succ`= :lastlogin_succ, `loginfail_count`='0'
|
||||
WHERE `$uid`= :uid"
|
||||
);
|
||||
Database::pexecute($stmt, array("lastlogin_succ" => time(), "uid" => $userinfo[$uid]));
|
||||
$userinfo['userid'] = $userinfo[$uid];
|
||||
$userinfo['adminsession'] = $adminsession;
|
||||
}
|
||||
} else {
|
||||
// login incorrect
|
||||
$db->query("UPDATE $table SET `lastlogin_fail`='" . time() . "', `loginfail_count`=`loginfail_count`+1 WHERE `$uid`='" . (int)$userinfo[$uid] . "'");
|
||||
$stmt = Database::prepare("UPDATE $table
|
||||
SET `lastlogin_fail`= :lastlogin_fail, `loginfail_count`=`loginfail_count`+1
|
||||
WHERE `$uid`= :uid"
|
||||
);
|
||||
Database::pexecute($stmt, array("lastlogin_fail" => time(), "uid" => $userinfo[$uid]));
|
||||
|
||||
// Log failed login
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => $_SERVER['REMOTE_ADDR']));
|
||||
$rstlog->logAction(LOGIN_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to login with wrong password.");
|
||||
|
||||
unset($userinfo);
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
redirectTo('index.php', array('showmessage' => '2'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($userinfo['userid'])
|
||||
&& $userinfo['userid'] != ''
|
||||
) {
|
||||
if (isset($userinfo['userid']) && $userinfo['userid'] != '') {
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
|
||||
if (isset($_POST['language'])) {
|
||||
$language = validate($_POST['language'], 'language');
|
||||
if ($language == 'profile') {
|
||||
$language = $userinfo['def_language'];
|
||||
} elseif(!isset($languages[$language])) {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
} elseif (!isset($languages[$language])) {
|
||||
$language = Settings::Get('panel.standardlanguage');
|
||||
}
|
||||
} else {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
$language = Settings::Get('panel.standardlanguage');
|
||||
}
|
||||
|
||||
if (isset($userinfo['theme']) && $userinfo['theme'] != '') {
|
||||
$theme = $userinfo['theme'];
|
||||
} else {
|
||||
$theme = $settings['panel']['default_theme'];
|
||||
$theme = Settings::Get('panel.default_theme');
|
||||
}
|
||||
|
||||
if ($settings['session']['allow_multiple_login'] != '1') {
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['userid'] . "' AND `adminsession` = '" . $db->escape($userinfo['adminsession']) . "'");
|
||||
if (Settings::Get('session.allow_multiple_login') != '1') {
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_SESSIONS . "`
|
||||
WHERE `userid` = :uid
|
||||
AND `adminsession` = :adminsession"
|
||||
);
|
||||
Database::pexecute($stmt, array("uid" => $userinfo['userid'], "adminsession" => $userinfo['adminsession']));
|
||||
}
|
||||
|
||||
// check for field 'theme' in session-table, refs #607
|
||||
$fields = mysql_list_fields($db->getDbName(), TABLE_PANEL_SESSIONS);
|
||||
$columns = mysql_num_fields($fields);
|
||||
$field_array = array();
|
||||
for ($i = 0; $i < $columns; $i++) {
|
||||
$field_array[] = mysql_field_name($fields, $i);
|
||||
// Changed with #1287 to new method
|
||||
$theme_field = false;
|
||||
$stmt = Database::query("SHOW COLUMNS FROM panel_sessions LIKE 'theme'");
|
||||
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($row['Field'] == "theme") {
|
||||
$has_theme = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array('theme', $field_array)) {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "')");
|
||||
$params = array(
|
||||
"hash" => $s,
|
||||
"userid" => $userinfo['userid'],
|
||||
"ipaddress" => $remote_addr,
|
||||
"useragent" => $http_user_agent,
|
||||
"lastactivity" => time(),
|
||||
"language" => $language,
|
||||
"adminsession" => $userinfo['adminsession']
|
||||
);
|
||||
|
||||
if ($has_theme) {
|
||||
$params["theme"] = $theme;
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_SESSIONS . "`
|
||||
(`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`, `theme`)
|
||||
VALUES (:hash, :userid, :ipaddress, :useragent, :lastactivity, :language, :adminsession, :theme)"
|
||||
);
|
||||
} else {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`, `theme`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "', '" . $db->escape($theme) . "')");
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_SESSIONS . "`
|
||||
(`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`)
|
||||
VALUES (:hash, :userid, :ipaddress, :useragent, :lastactivity, :language, :adminsession)"
|
||||
);
|
||||
}
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$qryparams = array();
|
||||
if (isset($_POST['qrystr']) && $_POST['qrystr'] != "") {
|
||||
parse_str(urldecode($_POST['qrystr']), $qryparams);
|
||||
}
|
||||
$qryparams['s'] = $s;
|
||||
|
||||
if ($userinfo['adminsession'] == '1') {
|
||||
if (hasUpdates($version)) {
|
||||
redirectTo('admin_updates.php', Array('s' => $s), true);
|
||||
if (hasUpdates($version) || hasDbUpdates($dbversion)) {
|
||||
redirectTo('admin_updates.php', array('s' => $s));
|
||||
} else {
|
||||
redirectTo('admin_index.php', Array('s' => $s), true);
|
||||
if (isset($_POST['script']) && $_POST['script'] != "") {
|
||||
if (preg_match("/customer\_/", $_POST['script']) === 1) {
|
||||
redirectTo('admin_customers.php', array("page" => "customers"));
|
||||
} else {
|
||||
redirectTo($_POST['script'], $qryparams);
|
||||
}
|
||||
} else {
|
||||
redirectTo('customer_index.php', Array('s' => $s), true);
|
||||
redirectTo('admin_index.php', $qryparams);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
if (isset($_POST['script']) && $_POST['script'] != "") {
|
||||
redirectTo($_POST['script'], $qryparams);
|
||||
} else {
|
||||
redirectTo('customer_index.php', $qryparams);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
redirectTo('index.php', array('showmessage' => '2'));
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
@@ -189,7 +266,7 @@ if ($action == 'login') {
|
||||
$message = $lng['error']['login'];
|
||||
break;
|
||||
case 3:
|
||||
$message = sprintf($lng['error']['login_blocked'],$settings['login']['deactivatetime']);
|
||||
$message = sprintf($lng['error']['login_blocked'], Settings::Get('login.deactivatetime'));
|
||||
break;
|
||||
case 4:
|
||||
$cmail = isset($_GET['customermail']) ? $_GET['customermail'] : 'unknown';
|
||||
@@ -198,13 +275,36 @@ if ($action == 'login') {
|
||||
case 5:
|
||||
$message = $lng['error']['user_banned'];
|
||||
break;
|
||||
case 6:
|
||||
$successmessage = $lng['pwdreminder']['changed'];
|
||||
break;
|
||||
case 7:
|
||||
$message = $lng['pwdreminder']['wrongcode'];
|
||||
break;
|
||||
case 8:
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
break;
|
||||
}
|
||||
|
||||
$update_in_progress = '';
|
||||
if (hasUpdates($version)) {
|
||||
if (hasUpdates($version) || hasDbUpdates($dbversion)) {
|
||||
$update_in_progress = $lng['update']['updateinprogress_onlyadmincanlogin'];
|
||||
}
|
||||
|
||||
// Pass the last used page if needed
|
||||
$lastscript = "";
|
||||
if (isset($_REQUEST['script']) && $_REQUEST['script'] != "") {
|
||||
$lastscript = $_REQUEST['script'];
|
||||
|
||||
if (!file_exists(__DIR__."/".$lastscript)) {
|
||||
$lastscript = "";
|
||||
}
|
||||
}
|
||||
$lastqrystr = "";
|
||||
if (isset($_REQUEST['qrystr']) && $_REQUEST['qrystr'] != "") {
|
||||
$lastqrystr = strip_tags($_REQUEST['qrystr']);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('login') . "\";");
|
||||
}
|
||||
}
|
||||
@@ -213,82 +313,122 @@ if ($action == 'forgotpwd') {
|
||||
$adminchecked = false;
|
||||
$message = '';
|
||||
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$loginname = validate($_POST['loginname'], 'loginname');
|
||||
$email = validateEmail($_POST['loginemail'], 'email');
|
||||
$sql = "SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `loginname`='" . $db->escape($loginname) . "'
|
||||
AND `email`='" . $db->escape($email) . "'";
|
||||
$result = $db->query($sql);
|
||||
$result_stmt = Database::prepare("SELECT `adminid`, `customerid`, `firstname`, `name`, `company`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
WHERE `loginname`= :loginname
|
||||
AND `email`= :email"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("loginname" => $loginname, "email" => $email));
|
||||
|
||||
if ($db->num_rows() == 0) {
|
||||
$sql = "SELECT `adminid`, `name`, `email`, `loginname`, `def_language` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `loginname`='" . $db->escape($loginname) . "'
|
||||
AND `email`='" . $db->escape($email) . "'";
|
||||
$result = $db->query($sql);
|
||||
if (Database::num_rows() == 0) {
|
||||
$result_stmt = Database::prepare("SELECT `adminid`, `name`, `email`, `loginname`, `def_language`, `deactivated` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `loginname`= :loginname
|
||||
AND `email`= :email"
|
||||
);
|
||||
Database::pexecute($result_stmt, array("loginname" => $loginname, "email" => $email));
|
||||
|
||||
if ($db->num_rows() > 0) {
|
||||
if (Database::num_rows() > 0) {
|
||||
$adminchecked = true;
|
||||
} else {
|
||||
$result = null;
|
||||
$result_stmt = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result !== null) {
|
||||
$user = $db->fetch_array($result);
|
||||
if ($result_stmt !== null) {
|
||||
$user = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
/* Check whether user is banned */
|
||||
if ($user['deactivated']) {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
redirectTo('index.php', Array('showmessage' => '5'), true);
|
||||
redirectTo('index.php', array('showmessage' => '8'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|
||||
|| $adminchecked == false
|
||||
) {
|
||||
if (($adminchecked && Settings::Get('panel.allow_preset_admin') == '1') || $adminchecked == false) {
|
||||
if ($user !== false) {
|
||||
if ($settings['panel']['password_min_length'] <= 6) {
|
||||
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
||||
} else {
|
||||
// make it two times larger than password_min_length
|
||||
$rnd = '';
|
||||
$minlength = $settings['panel']['password_min_length'];
|
||||
while (strlen($rnd) < ($minlength * 2)) {
|
||||
$rnd .= md5(uniqid(microtime(), 1));
|
||||
}
|
||||
$password = substr($rnd, (int)($minlength / 2), $minlength);
|
||||
}
|
||||
// build a activation code
|
||||
$timestamp = time();
|
||||
$first = substr(md5($user['loginname'] . $timestamp . randomStr(16)), 0, 15);
|
||||
$third = substr(md5($user['email'] . $timestamp . randomStr(16)), -15);
|
||||
$activationcode = $first . $timestamp . $third . substr(md5($third . $timestamp), 0, 10);
|
||||
|
||||
$passwordTable = $adminchecked ? TABLE_PANEL_ADMINS : TABLE_PANEL_CUSTOMERS;
|
||||
$db->query("UPDATE `" . $passwordTable . "` SET `password`='" . md5($password) . "'
|
||||
WHERE `loginname`='" . $user['loginname'] . "'
|
||||
AND `email`='" . $user['email'] . "'");
|
||||
// Drop all existing activation codes for this user
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_ACTIVATION . "`
|
||||
WHERE `userid` = :userid
|
||||
AND `admin` = :admin"
|
||||
);
|
||||
$params = array(
|
||||
"userid" => $adminchecked ? $user['adminid'] : $user['customerid'],
|
||||
"admin" => $adminchecked ? 1 : 0
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
|
||||
// Add new activation code to database
|
||||
$stmt = Database::prepare("INSERT INTO `" . TABLE_PANEL_ACTIVATION . "`
|
||||
(userid, admin, creation, activationcode)
|
||||
VALUES (:userid, :admin, :creation, :activationcode)"
|
||||
);
|
||||
$params = array(
|
||||
"userid" => $adminchecked ? $user['adminid'] : $user['customerid'],
|
||||
"admin" => $adminchecked ? 1 : 0,
|
||||
"creation" => $timestamp,
|
||||
"activationcode" => $activationcode
|
||||
);
|
||||
Database::pexecute($stmt, $params);
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $user['loginname'] . "' requested a link for setting a new password.");
|
||||
|
||||
// Set together our activation link
|
||||
$protocol = empty( $_SERVER['HTTPS'] ) ? 'http' : 'https';
|
||||
// this can be a fixed value to avoid potential exploiting by modifying headers
|
||||
$host = Settings::Get('system.hostname'); // $_SERVER['HTTP_HOST'];
|
||||
$port = $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '';
|
||||
// don't add :443 when https is used, as it is default (and just looks weird!)
|
||||
if ($protocol == 'https' && $_SERVER['SERVER_PORT'] == '443') {
|
||||
$port = '';
|
||||
}
|
||||
// there can be only one script to handle this so we can use a fixed value here
|
||||
$script = "/index.php"; // $_SERVER['SCRIPT_NAME'];
|
||||
if (Settings::Get('system.froxlordirectlyviahostname') == 0) {
|
||||
$script = makeCorrectFile("/".basename(__DIR__)."/".$script);
|
||||
}
|
||||
$activationlink = $protocol . '://' . $host . $port . $script . '?action=resetpwd&resetcode=' . $activationcode;
|
||||
|
||||
$replace_arr = array(
|
||||
'SALUTATION' => getCorrectUserSalutation($user),
|
||||
'USERNAME' => $user['loginname'],
|
||||
'PASSWORD' => $password
|
||||
'USERNAME' => $loginname,
|
||||
'LINK' => $activationlink
|
||||
);
|
||||
|
||||
$body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
|
||||
$def_language = ($user['def_language'] != '') ? $user['def_language'] : Settings::Get('panel.standardlanguage');
|
||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||
WHERE `adminid`= :adminid
|
||||
AND `language`= :lang
|
||||
AND `templategroup`=\'mails\'
|
||||
AND `varname`=\'password_reset_subject\''
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['subject']), $replace_arr));
|
||||
|
||||
$def_language = ($user['def_language'] != '') ? $user['def_language'] : $settings['panel']['standardlanguage'];
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_subject\'');
|
||||
$mail_subject = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['pwdreminder']['subject']), $replace_arr));
|
||||
$result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int)$user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_mailbody\'');
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $body), $replace_arr));
|
||||
$result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
|
||||
WHERE `adminid`= :adminid
|
||||
AND `language`= :lang
|
||||
AND `templategroup`=\'mails\'
|
||||
AND `varname`=\'password_reset_mailbody\''
|
||||
);
|
||||
Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
$mail_body = html_entity_decode(replace_variables((($result['value'] != '') ? $result['value'] : $lng['mails']['password_reset']['mailbody']), $replace_arr));
|
||||
|
||||
$_mailerror = false;
|
||||
try {
|
||||
$mail->Subject = $mail_subject;
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
|
||||
$mail->AddAddress($user['email'], getCorrectUserSalutation($user));
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
@@ -299,18 +439,18 @@ if ($action == 'forgotpwd') {
|
||||
}
|
||||
|
||||
if ($_mailerror) {
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||
redirectTo('index.php', Array('showmessage' => '4', 'customermail' => $user['email']), true);
|
||||
redirectTo('index.php', array('showmessage' => '4', 'customermail' => $user['email']));
|
||||
exit;
|
||||
}
|
||||
|
||||
$mail->ClearAddresses();
|
||||
redirectTo('index.php', Array('showmessage' => '1'), true);
|
||||
redirectTo('index.php', array('showmessage' => '1'));
|
||||
exit;
|
||||
} else {
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' tried to reset pwd but wasn't found in database!");
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $loginname . "' requested to set a new password, but was not found in database!");
|
||||
$message = $lng['login']['combination_not_found'];
|
||||
}
|
||||
|
||||
@@ -322,15 +462,95 @@ if ($action == 'forgotpwd') {
|
||||
}
|
||||
|
||||
if ($adminchecked) {
|
||||
if ($settings['panel']['allow_preset_admin'] != '1') {
|
||||
if (Settings::Get('panel.allow_preset_admin') != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
unset ($adminchecked);
|
||||
}
|
||||
} else {
|
||||
if ($settings['panel']['allow_preset'] != '1') {
|
||||
if (Settings::Get('panel.allow_preset') != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
}
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('fpwd') . "\";");
|
||||
}
|
||||
|
||||
if ($action == 'resetpwd') {
|
||||
$message = '';
|
||||
|
||||
// Remove old activation codes
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_ACTIVATION . "`
|
||||
WHERE creation < :oldest"
|
||||
);
|
||||
Database::pexecute($stmt, array("oldest" => time() - 86400));
|
||||
|
||||
if (isset($_GET['resetcode']) && strlen($_GET['resetcode']) == 50) {
|
||||
// Check if activation code is valid
|
||||
$activationcode = $_GET['resetcode'];
|
||||
$timestamp = substr($activationcode, 15, 10);
|
||||
$third = substr($activationcode, 25, 15);
|
||||
$check = substr($activationcode, 40, 10);
|
||||
|
||||
if (substr(md5($third . $timestamp), 0, 10) == $check && $timestamp >= time() - 86400) {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$stmt = Database::prepare("SELECT `userid`, `admin` FROM `" . TABLE_PANEL_ACTIVATION . "`
|
||||
WHERE `activationcode` = :activationcode"
|
||||
);
|
||||
$result = Database::pexecute_first($stmt, array("activationcode" => $activationcode));
|
||||
|
||||
if ($result !== false) {
|
||||
if ($result['admin'] == 1) {
|
||||
$new_password = validate($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validate($_POST['new_password_confirm'], 'new password confirm');
|
||||
} else {
|
||||
$new_password = validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validatePassword($_POST['new_password_confirm'], 'new password confirm');
|
||||
}
|
||||
|
||||
if ($new_password == '') {
|
||||
$message = $new_password;
|
||||
} elseif ($new_password_confirm == '') {
|
||||
$message = $new_password_confirm;
|
||||
} elseif ($new_password != $new_password_confirm) {
|
||||
$message = $new_password . " != " . $new_password_confirm;
|
||||
} else {
|
||||
// Update user password
|
||||
if ($result['admin'] == 1) {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_ADMINS . "`
|
||||
SET `password` = :newpassword
|
||||
WHERE `adminid` = :userid"
|
||||
);
|
||||
} else {
|
||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
SET `password` = :newpassword
|
||||
WHERE `customerid` = :userid"
|
||||
);
|
||||
}
|
||||
Database::pexecute($stmt, array("newpassword" => makeCryptPassword($new_password), "userid" => $result['userid']));
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
|
||||
$rstlog->logAction(USR_ACTION, LOG_NOTICE, "changed password using password reset.");
|
||||
|
||||
// Remove activation code from DB
|
||||
$stmt = Database::prepare("DELETE FROM `" . TABLE_PANEL_ACTIVATION . "`
|
||||
WHERE `activationcode` = :activationcode
|
||||
AND `userid` = :userid"
|
||||
);
|
||||
Database::pexecute($stmt, array("activationcode" => $activationcode, "userid" => $result['userid']));
|
||||
redirectTo('index.php', array("showmessage" => '6'));
|
||||
}
|
||||
} else {
|
||||
redirectTo('index.php', array("showmessage" => '7'));
|
||||
}
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate('rpwd') . "\";");
|
||||
|
||||
} else {
|
||||
redirectTo('index.php', array("showmessage" => '7'));
|
||||
}
|
||||
|
||||
} else {
|
||||
redirectTo('index.php');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
DROP TABLE IF EXISTS `ftp_groups`;
|
||||
CREATE TABLE `ftp_groups` (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`groupname` varchar(60) NOT NULL default '',
|
||||
@@ -28,6 +29,7 @@ CREATE TABLE `ftp_users` (
|
||||
`down_count` int(15) NOT NULL default '0',
|
||||
`down_bytes` bigint(30) NOT NULL default '0',
|
||||
`customerid` int(11) NOT NULL default '0',
|
||||
`description` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `customerid` (`customerid`)
|
||||
@@ -74,12 +76,22 @@ CREATE TABLE `mail_virtual` (
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_activation`;
|
||||
CREATE TABLE `panel_activation` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`userid` int(11) unsigned NOT NULL default '0',
|
||||
`admin` tinyint(1) unsigned NOT NULL default '0',
|
||||
`creation` int(11) unsigned NOT NULL default '0',
|
||||
`activationcode` varchar(50) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_admins`;
|
||||
CREATE TABLE `panel_admins` (
|
||||
`adminid` int(11) unsigned NOT NULL auto_increment,
|
||||
`loginname` varchar(50) NOT NULL default '',
|
||||
`password` varchar(50) NOT NULL default '',
|
||||
`password` varchar(255) NOT NULL default '',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`def_language` varchar(255) NOT NULL default '',
|
||||
@@ -118,12 +130,9 @@ CREATE TABLE `panel_admins` (
|
||||
`lastlogin_fail` int(11) unsigned NOT NULL default '0',
|
||||
`loginfail_count` int(11) unsigned NOT NULL default '0',
|
||||
`reportsent` tinyint(4) unsigned NOT NULL default '0',
|
||||
`can_manage_aps_packages` tinyint(1) NOT NULL default '1',
|
||||
`aps_packages` int(5) NOT NULL default '0',
|
||||
`aps_packages_used` int(5) NOT NULL default '0',
|
||||
`email_autoresponder` int(5) NOT NULL default '0',
|
||||
`email_autoresponder_used` int(5) NOT NULL default '0',
|
||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||
`custom_notes` text,
|
||||
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`adminid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -134,7 +143,7 @@ DROP TABLE IF EXISTS `panel_customers`;
|
||||
CREATE TABLE `panel_customers` (
|
||||
`customerid` int(11) unsigned NOT NULL auto_increment,
|
||||
`loginname` varchar(50) NOT NULL default '',
|
||||
`password` varchar(50) NOT NULL default '',
|
||||
`password` varchar(255) NOT NULL default '',
|
||||
`adminid` int(11) unsigned NOT NULL default '0',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`firstname` varchar(255) NOT NULL default '',
|
||||
@@ -181,14 +190,12 @@ CREATE TABLE `panel_customers` (
|
||||
`reportsent` tinyint(4) unsigned NOT NULL default '0',
|
||||
`pop3` tinyint(1) NOT NULL default '1',
|
||||
`imap` tinyint(1) NOT NULL default '1',
|
||||
`aps_packages` int(5) NOT NULL default '0',
|
||||
`aps_packages_used` int(5) NOT NULL default '0',
|
||||
`perlenabled` tinyint(1) NOT NULL default '0',
|
||||
`email_autoresponder` int(5) NOT NULL default '0',
|
||||
`email_autoresponder_used` int(5) NOT NULL default '0',
|
||||
`theme` varchar(255) NOT NULL default 'Sparkle',
|
||||
`backup_allowed` TINYINT( 1 ) NOT NULL DEFAULT '1',
|
||||
`backup_enabled` TINYINT( 1 ) NOT NULL DEFAULT '0',
|
||||
`custom_notes` text,
|
||||
`custom_notes_show` tinyint(1) NOT NULL default '0',
|
||||
`lepublickey` mediumtext DEFAULT NULL,
|
||||
`leprivatekey` mediumtext DEFAULT NULL,
|
||||
PRIMARY KEY (`customerid`),
|
||||
UNIQUE KEY `loginname` (`loginname`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -202,7 +209,6 @@ CREATE TABLE `panel_databases` (
|
||||
`databasename` varchar(255) NOT NULL default '',
|
||||
`description` varchar(255) NOT NULL default '',
|
||||
`dbserver` int(11) unsigned NOT NULL default '0',
|
||||
`apsdb` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -217,7 +223,6 @@ CREATE TABLE `panel_domains` (
|
||||
`customerid` int(11) unsigned NOT NULL default '0',
|
||||
`aliasdomain` int(11) unsigned NULL,
|
||||
`documentroot` varchar(255) NOT NULL default '',
|
||||
`ipandport` int(11) unsigned NOT NULL default '1',
|
||||
`isbinddomain` tinyint(1) NOT NULL default '0',
|
||||
`isemaildomain` tinyint(1) NOT NULL default '0',
|
||||
`email_only` tinyint(1) NOT NULL default '0',
|
||||
@@ -226,26 +231,29 @@ CREATE TABLE `panel_domains` (
|
||||
`caneditdomain` tinyint(1) NOT NULL default '1',
|
||||
`zonefile` varchar(255) NOT NULL default '',
|
||||
`dkim` tinyint(1) NOT NULL default '0',
|
||||
`dkim_id` int(11) unsigned NOT NULL,
|
||||
`dkim_privkey` text NOT NULL,
|
||||
`dkim_pubkey` text NOT NULL,
|
||||
`dkim_id` int(11) unsigned NOT NULL default '0',
|
||||
`dkim_privkey` text,
|
||||
`dkim_pubkey` text,
|
||||
`wwwserveralias` tinyint(1) NOT NULL default '1',
|
||||
`parentdomainid` int(11) unsigned NOT NULL default '0',
|
||||
`parentdomainid` int(11) NOT NULL default '0',
|
||||
`openbasedir` tinyint(1) NOT NULL default '0',
|
||||
`openbasedir_path` tinyint(1) NOT NULL default '0',
|
||||
`speciallogfile` tinyint(1) NOT NULL default '0',
|
||||
`ssl` tinyint(4) NOT NULL default '0',
|
||||
`ssl_redirect` tinyint(4) NOT NULL default '0',
|
||||
`ssl_ipandport` tinyint(4) NOT NULL default '0',
|
||||
`specialsettings` text NOT NULL,
|
||||
`specialsettings` text,
|
||||
`deactivated` tinyint(1) NOT NULL default '0',
|
||||
`bindserial` varchar(10) NOT NULL default '2000010100',
|
||||
`add_date` int( 11 ) NOT NULL default '0',
|
||||
`registration_date` date NOT NULL,
|
||||
`termination_date` date NOT NULL,
|
||||
`phpsettingid` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
|
||||
`mod_fcgid_starter` int(4) default '-1',
|
||||
`mod_fcgid_maxrequests` int(4) default '-1',
|
||||
`ismainbutsubto` int(11) unsigned NOT NULL default '0',
|
||||
`letsencrypt` tinyint(1) NOT NULL default '0',
|
||||
`hsts` varchar(10) NOT NULL default '0',
|
||||
`hsts_sub` tinyint(1) NOT NULL default '0',
|
||||
`hsts_preload` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `customerid` (`customerid`),
|
||||
KEY `parentdomain` (`parentdomainid`),
|
||||
@@ -263,12 +271,12 @@ CREATE TABLE `panel_ipsandports` (
|
||||
`namevirtualhost_statement` tinyint(1) NOT NULL default '0',
|
||||
`vhostcontainer` tinyint(1) NOT NULL default '0',
|
||||
`vhostcontainer_servername_statement` tinyint(1) NOT NULL default '0',
|
||||
`specialsettings` text NOT NULL default '',
|
||||
`specialsettings` text,
|
||||
`ssl` tinyint(4) NOT NULL default '0',
|
||||
`ssl_cert_file` varchar(255) NOT NULL,
|
||||
`ssl_key_file` varchar(255) NOT NULL,
|
||||
`ssl_ca_file` varchar(255) NOT NULL,
|
||||
`default_vhostconf_domain` text NOT NULL,
|
||||
`default_vhostconf_domain` text,
|
||||
`ssl_cert_chainfile` varchar(255) NOT NULL,
|
||||
`docroot` varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
@@ -333,8 +341,6 @@ CREATE TABLE `panel_settings` (
|
||||
PRIMARY KEY (`settingid`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('catchall', 'catchall_enabled', '1'),
|
||||
('session', 'allow_multiple_login', '0'),
|
||||
@@ -343,6 +349,8 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('customer', 'ftpprefix', 'ftp'),
|
||||
('customer', 'mysqlprefix', 'sql'),
|
||||
('customer', 'ftpatdomain', '0'),
|
||||
('customer', 'show_news_feed', '0'),
|
||||
('customer', 'news_feed_url', ''),
|
||||
('ticket', 'noreply_email', 'NO-REPLY@SERVERNAME'),
|
||||
('ticket', 'worktime_all', '1'),
|
||||
('ticket', 'worktime_begin', '00:00'),
|
||||
@@ -364,18 +372,9 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('dkim', 'dkim_domains', 'domains'),
|
||||
('dkim', 'dkim_dkimkeys', 'dkim-keys.conf'),
|
||||
('dkim', 'dkimrestart_command', '/etc/init.d/dkim-filter restart'),
|
||||
('autoresponder', 'autoresponder_active', '0'),
|
||||
('autoresponder', 'last_autoresponder_run', '0'),
|
||||
('admin', 'show_news_feed', '0'),
|
||||
('admin', 'show_version_login', '0'),
|
||||
('admin', 'show_version_footer', '0'),
|
||||
('aps', 'items_per_page', '20'),
|
||||
('aps', 'upload_fields', '5'),
|
||||
('aps', 'aps_active', '0'),
|
||||
('aps', 'php-extension', ''),
|
||||
('aps', 'php-configuration', ''),
|
||||
('aps', 'webserver-htaccess', ''),
|
||||
('aps', 'php-function', ''),
|
||||
('aps', 'webserver-module', ''),
|
||||
('spf', 'use_spf', '0'),
|
||||
('spf', 'spf_entry', '@ IN TXT "v=spf1 a mx -all"'),
|
||||
('dkim', 'dkim_algorithm', 'all'),
|
||||
@@ -414,14 +413,16 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('phpfpm', 'idle_timeout', '30'),
|
||||
('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/'),
|
||||
('phpfpm', 'defaultini', '1'),
|
||||
('phpfpm', 'vhost_defaultini', '1'),
|
||||
('phpfpm', 'vhost_defaultini', '2'),
|
||||
('phpfpm', 'fastcgi_ipcdir', '/var/lib/apache2/fastcgi/'),
|
||||
('phpfpm', 'use_mod_proxy', '0'),
|
||||
('nginx', 'fastcgiparams', '/etc/nginx/fastcgi_params'),
|
||||
('system', 'lastaccountnumber', '0'),
|
||||
('system', 'lastguid', '9999'),
|
||||
('system', 'documentroot_prefix', '/var/customers/webs/'),
|
||||
('system', 'logfiles_directory', '/var/customers/logs/'),
|
||||
('system', 'ipaddress', 'SERVERIP'),
|
||||
('system', 'apachereload_command', '/etc/init.d/apache reload'),
|
||||
('system', 'apachereload_command', '/etc/init.d/apache2 reload'),
|
||||
('system', 'last_traffic_run', '000000'),
|
||||
('system', 'vmail_uid', '2000'),
|
||||
('system', 'vmail_gid', '2000'),
|
||||
@@ -441,16 +442,15 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'nameservers', ''),
|
||||
('system', 'mxservers', ''),
|
||||
('system', 'mod_fcgid', '0'),
|
||||
('system', 'apacheconf_vhost', '/etc/apache/vhosts.conf'),
|
||||
('system', 'apacheconf_diroptions', '/etc/apache/diroptions.conf'),
|
||||
('system', 'apacheconf_htpasswddir', '/etc/apache/htpasswd/'),
|
||||
('system', 'apacheconf_vhost', '/etc/apache2/sites-enabled/'),
|
||||
('system', 'apacheconf_diroptions', '/etc/apache2/sites-enabled/'),
|
||||
('system', 'apacheconf_htpasswddir', '/etc/apache2/htpasswd/'),
|
||||
('system', 'webalizer_quiet', '2'),
|
||||
('system', 'last_archive_run', '000000'),
|
||||
('system', 'mod_fcgid_configdir', '/var/www/php-fcgi-scripts'),
|
||||
('system', 'mod_fcgid_tmpdir', '/var/customers/tmp'),
|
||||
('system', 'ssl_cert_file', '/etc/apache2/apache2.pem'),
|
||||
('system', 'use_ssl', '0'),
|
||||
('system', 'openssl_cnf', '[ req ]\r\ndefault_bits = 1024\r\ndistinguished_name = req_distinguished_name\r\nattributes = req_attributes\r\nprompt = no\r\noutput_password =\r\ninput_password =\r\n[ req_distinguished_name ]\r\nC = DE\r\nST = froxlor\r\nL = froxlor \r\nO = Testcertificate\r\nOU = froxlor \r\nCN = @@domain_name@@\r\nemailAddress = @@email@@ \r\n[ req_attributes ]\r\nchallengePassword =\r\n'),
|
||||
('system', 'default_vhostconf', ''),
|
||||
('system', 'mail_quota_enabled', '0'),
|
||||
('system', 'mail_quota', '100'),
|
||||
@@ -480,16 +480,6 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'report_webmax', '90'),
|
||||
('system', 'report_trafficmax', '90'),
|
||||
('system', 'validate_domain', '1'),
|
||||
('system', 'backup_enabled', '0'),
|
||||
('system', 'backup_dir', '/var/customers/backups/'),
|
||||
('system', 'backup_mysqldump_path', '/usr/bin/mysqldump'),
|
||||
('system', 'backup_count', '1'),
|
||||
('system', 'backup_bigfile', '1'),
|
||||
('system', 'backup_ftp_enabled', '0'),
|
||||
('system', 'backup_ftp_server', ''),
|
||||
('system', 'backup_ftp_user', ''),
|
||||
('system', 'backup_ftp_pass', ''),
|
||||
('system', 'backup_ftp_passive', '1'),
|
||||
('system', 'diskquota_enabled', '0'),
|
||||
('system', 'diskquota_repquota_path', '/usr/sbin/repquota'),
|
||||
('system', 'diskquota_quotatool_path', '/usr/bin/quotatool'),
|
||||
@@ -500,17 +490,41 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('system', 'mod_fcgid_httpuser', 'froxlorlocal'),
|
||||
('system', 'mod_fcgid_httpgroup', 'froxlorlocal'),
|
||||
('system', 'awstats_awstatspath', '/usr/bin/'),
|
||||
('system', 'mod_fcgid_defaultini_ownvhost', '1'),
|
||||
('system', 'mod_fcgid_defaultini_ownvhost', '2'),
|
||||
('system', 'awstats_icons', '/usr/share/awstats/icon/'),
|
||||
('system', 'ssl_cert_chainfile', ''),
|
||||
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
||||
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
||||
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
||||
('system', 'phpreload_command', ''),
|
||||
('system', 'apache24', '0'),
|
||||
('system', 'documentroot_use_default_value', '0'),
|
||||
('system', 'passwordcryptfunc', '1'),
|
||||
('system', 'passwordcryptfunc', '3'),
|
||||
('system', 'axfrservers', ''),
|
||||
('system', 'customer_ssl_path', '/etc/apache2/ssl/'),
|
||||
('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'),
|
||||
('system', 'allow_error_report_admin', '1'),
|
||||
('system', 'allow_error_report_customer', '0'),
|
||||
('system', 'mdalog', '/var/log/mail.log'),
|
||||
('system', 'mtalog', '/var/log/mail.log'),
|
||||
('system', 'mdaserver', 'dovecot'),
|
||||
('system', 'mtaserver', 'postfix'),
|
||||
('system', 'mailtraffic_enabled', '1'),
|
||||
('system', 'cronconfig', '/etc/cron.d/froxlor'),
|
||||
('system', 'crondreload', '/etc/init.d/cron reload'),
|
||||
('system', 'croncmdline', '/usr/bin/nice -n 5 /usr/bin/php -q'),
|
||||
('system', 'cron_allowautoupdate', '0'),
|
||||
('system', 'dns_createhostnameentry', '0'),
|
||||
('system', 'send_cron_errors', '0'),
|
||||
('system', 'apacheitksupport', '0'),
|
||||
('system', 'leprivatekey', 'unset'),
|
||||
('system', 'lepublickey', 'unset'),
|
||||
('system', 'letsencryptca', 'production'),
|
||||
('system', 'letsencryptcountrycode', 'DE'),
|
||||
('system', 'letsencryptstate', 'Germany'),
|
||||
('system', 'letsencryptchallengepath', '/var/www/froxlor'),
|
||||
('system', 'letsencryptkeysize', '4096'),
|
||||
('system', 'letsencryptreuseold', 0),
|
||||
('system', 'leenabled', '0'),
|
||||
('panel', 'decimal_places', '4'),
|
||||
('panel', 'adminmail', 'admin@SERVERNAME'),
|
||||
('panel', 'phpmyadmin_url', ''),
|
||||
@@ -533,12 +547,16 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
||||
('panel', 'allow_preset', '1'),
|
||||
('panel', 'allow_preset_admin', '0'),
|
||||
('panel', 'password_regex', ''),
|
||||
('panel', 'use_webfonts', '0'),
|
||||
('panel', 'webfont', 'Numans'),
|
||||
('panel', 'phpconfigs_hidestdsubdomain', '0'),
|
||||
('panel', 'allow_theme_change_admin', '1'),
|
||||
('panel', 'allow_theme_change_customer', '1'),
|
||||
('panel', 'version', '0.9.30-rc1');
|
||||
('panel', 'password_alpha_lower', '1'),
|
||||
('panel', 'password_alpha_upper', '1'),
|
||||
('panel', 'password_numeric', '0'),
|
||||
('panel', 'password_special_char_required', '0'),
|
||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||
('panel', 'version', '0.9.35'),
|
||||
('panel', 'db_version', '201603150');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_tasks`;
|
||||
@@ -549,6 +567,7 @@ CREATE TABLE `panel_tasks` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
INSERT INTO `panel_tasks` (`type`) VALUES ('99');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_templates`;
|
||||
@@ -649,21 +668,11 @@ CREATE TABLE `panel_languages` (
|
||||
INSERT INTO `panel_languages` (`id`, `language`, `iso`, `file`) VALUES
|
||||
(1, 'Deutsch', 'de', 'lng/german.lng.php'),
|
||||
(2, 'English', 'en', 'lng/english.lng.php'),
|
||||
(3, 'Français', 'fr', 'lng/french.lng.php'),
|
||||
(4, 'Chinese', 'zh', 'lng/zh-cn.lng.php'),
|
||||
(5, 'Catalan', 'ca', 'lng/catalan.lng.php'),
|
||||
(6, 'Español', 'es', 'lng/spanish.lng.php'),
|
||||
(7, 'Português', 'pt', 'lng/portugues.lng.php'),
|
||||
(8, 'Russian', 'ru', 'lng/russian.lng.php'),
|
||||
(9, 'Danish', 'da', 'lng/danish.lng.php'),
|
||||
(10, 'Italian', 'it', 'lng/italian.lng.php'),
|
||||
(11, 'Bulgarian', 'bg', 'lng/bulgarian.lng.php'),
|
||||
(12, 'Slovak', 'sk', 'lng/slovak.lng.php'),
|
||||
(13, 'Dutch', 'nl', 'lng/dutch.lng.php'),
|
||||
(14, 'Hungarian', 'hu', 'lng/hungarian.lng.php'),
|
||||
(15, 'Swedish', 'sv', 'lng/swedish.lng.php'),
|
||||
(16, 'Czech', 'cz', 'lng/czech.lng.php'),
|
||||
(17, 'Polski', 'pl', 'lng/polish.lng.php');
|
||||
(3, 'Français', 'fr', 'lng/french.lng.php'),
|
||||
(4, 'Português', 'pt', 'lng/portugues.lng.php'),
|
||||
(5, 'Italiano', 'it', 'lng/italian.lng.php'),
|
||||
(6, 'Nederlands', 'nl', 'lng/dutch.lng.php'),
|
||||
(7, 'Svenska', 'sv', 'lng/swedish.lng.php');
|
||||
|
||||
|
||||
|
||||
@@ -713,23 +722,6 @@ CREATE TABLE IF NOT EXISTS `panel_syslog` (
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `mail_autoresponder`;
|
||||
CREATE TABLE `mail_autoresponder` (
|
||||
`email` varchar(255) NOT NULL default '',
|
||||
`message` text NOT NULL,
|
||||
`enabled` tinyint(1) NOT NULL default '0',
|
||||
`date_from` int(15) NOT NULL default '-1',
|
||||
`date_until` int(15) NOT NULL default '-1',
|
||||
`subject` varchar(255) NOT NULL default '',
|
||||
`customerid` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`email`),
|
||||
KEY `customerid` (`customerid`),
|
||||
FULLTEXT KEY `message` (`message`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `panel_phpconfigs`;
|
||||
CREATE TABLE `panel_phpconfigs` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
@@ -738,6 +730,10 @@ CREATE TABLE `panel_phpconfigs` (
|
||||
`file_extensions` varchar(255) NOT NULL,
|
||||
`mod_fcgid_starter` int(4) NOT NULL DEFAULT '-1',
|
||||
`mod_fcgid_maxrequests` int(4) NOT NULL DEFAULT '-1',
|
||||
`mod_fcgid_umask` varchar(15) NOT NULL DEFAULT '022',
|
||||
`fpm_slowlog` tinyint(1) NOT NULL default '0',
|
||||
`fpm_reqterm` varchar(15) NOT NULL default '60s',
|
||||
`fpm_reqslow` varchar(15) NOT NULL default '5s',
|
||||
`phpsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
@@ -745,64 +741,8 @@ CREATE TABLE `panel_phpconfigs` (
|
||||
|
||||
|
||||
INSERT INTO `panel_phpconfigs` (`id`, `description`, `binary`, `file_extensions`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `phpsettings`) VALUES
|
||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 16M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `aps_instances`;
|
||||
CREATE TABLE IF NOT EXISTS `aps_instances` (
|
||||
`ID` int(4) NOT NULL auto_increment,
|
||||
`CustomerID` int(4) NOT NULL,
|
||||
`PackageID` int(4) NOT NULL,
|
||||
`Status` int(4) NOT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `aps_packages`;
|
||||
CREATE TABLE IF NOT EXISTS `aps_packages` (
|
||||
`ID` int(4) NOT NULL auto_increment,
|
||||
`Path` varchar(500) NOT NULL,
|
||||
`Name` varchar(500) NOT NULL,
|
||||
`Version` varchar(20) NOT NULL,
|
||||
`Release` int(4) NOT NULL,
|
||||
`Status` int(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `aps_settings`;
|
||||
CREATE TABLE IF NOT EXISTS `aps_settings` (
|
||||
`ID` int(4) NOT NULL auto_increment,
|
||||
`InstanceID` int(4) NOT NULL,
|
||||
`Name` varchar(250) NOT NULL,
|
||||
`Value` varchar(250) NOT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `aps_tasks`;
|
||||
CREATE TABLE IF NOT EXISTS `aps_tasks` (
|
||||
`ID` int(4) NOT NULL auto_increment,
|
||||
`InstanceID` int(4) NOT NULL,
|
||||
`Task` int(4) NOT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `aps_temp_settings`;
|
||||
CREATE TABLE IF NOT EXISTS `aps_temp_settings` (
|
||||
`ID` int(4) NOT NULL auto_increment,
|
||||
`PackageID` int(4) NOT NULL,
|
||||
`CustomerID` int(4) NOT NULL,
|
||||
`Name` varchar(250) NOT NULL,
|
||||
`Value` varchar(250) NOT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
(1, 'Default Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = Off\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_exec,curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 30\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\n{OPEN_BASEDIR_C}open_basedir = "{OPEN_BASEDIR}"\r\noutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = "{DOCUMENT_ROOT}"\r\n'),
|
||||
(2, 'Froxlor Vhost Config', '/usr/bin/php-cgi', 'php', '-1', '-1', 'allow_call_time_pass_reference = Off\r\nallow_url_fopen = On\r\nasp_tags = Off\r\ndisable_classes =\r\ndisable_functions = curl_multi_exec,exec,parse_ini_file,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system\r\ndisplay_errors = Off\r\ndisplay_startup_errors = Off\r\nenable_dl = Off\r\nerror_reporting = E_ALL & ~E_NOTICE\r\nexpose_php = Off\r\nfile_uploads = On\r\ncgi.force_redirect = 1\r\ngpc_order = "GPC"\r\nhtml_errors = Off\r\nignore_repeated_errors = Off\r\nignore_repeated_source = Off\r\ninclude_path = ".:{PEAR_DIR}"\r\nlog_errors = On\r\nlog_errors_max_len = 1024\r\nmagic_quotes_gpc = Off\r\nmagic_quotes_runtime = Off\r\nmagic_quotes_sybase = Off\r\nmax_execution_time = 60\r\nmax_input_time = 60\r\nmemory_limit = 128M\r\nnoutput_buffering = 4096\r\npost_max_size = 16M\r\nprecision = 14\r\nregister_argc_argv = Off\r\nregister_globals = Off\r\nreport_memleaks = On\r\nsendmail_path = "/usr/sbin/sendmail -t -i -f {CUSTOMER_EMAIL}"\r\nsession.auto_start = 0\r\nsession.bug_compat_42 = 0\r\nsession.bug_compat_warn = 1\r\nsession.cache_expire = 180\r\nsession.cache_limiter = nocache\r\nsession.cookie_domain =\r\nsession.cookie_lifetime = 0\r\nsession.cookie_path = /\r\nsession.entropy_file = /dev/urandom\r\nsession.entropy_length = 16\r\nsession.gc_divisor = 1000\r\nsession.gc_maxlifetime = 1440\r\nsession.gc_probability = 1\r\nsession.name = PHPSESSID\r\nsession.referer_check =\r\nsession.save_handler = files\r\nsession.save_path = "{TMP_DIR}"\r\nsession.serialize_handler = php\r\nsession.use_cookies = 1\r\nsession.use_trans_sid = 0\r\nshort_open_tag = On\r\nsuhosin.mail.protect = 1\r\nsuhosin.simulation = Off\r\ntrack_errors = Off\r\nupload_max_filesize = 32M\r\nupload_tmp_dir = "{TMP_DIR}"\r\nvariables_order = "GPCS"\r\n;mail.add_x_header = On\r\n;mail.log = "/var/log/phpmail.log"\r\nopcache.restrict_api = ""\r\n');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `cronjobs_run`;
|
||||
@@ -818,18 +758,14 @@ CREATE TABLE IF NOT EXISTS `cronjobs_run` (
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
INSERT INTO `cronjobs_run` (`id`, `module`, `cronfile`, `interval`, `isactive`, `desc_lng_key`) VALUES
|
||||
(1, 'froxlor/core', 'cron_tasks.php', '5 MINUTE', '1', 'cron_tasks'),
|
||||
(2, 'froxlor/aps', 'cron_apsinstaller.php', '5 MINUTE', '0', 'cron_apsinstaller'),
|
||||
(3, 'froxlor/autoresponder', 'cron_autoresponder.php', '5 MINUTE', '0', 'cron_autoresponder'),
|
||||
(4, 'froxlor/aps', 'cron_apsupdater.php', '1 HOUR', '0', 'cron_apsupdater'),
|
||||
(5, 'froxlor/core', 'cron_traffic.php', '1 DAY', '1', 'cron_traffic'),
|
||||
(6, 'froxlor/ticket', 'cron_used_tickets_reset.php', '1 DAY', '1', 'cron_ticketsreset'),
|
||||
(7, 'froxlor/ticket', 'cron_ticketarchive.php', '1 MONTH', '1', 'cron_ticketarchive'),
|
||||
(8, 'froxlor/reports', 'cron_usage_report.php', '1 DAY', '1', 'cron_usage_report'),
|
||||
(9, 'froxlor/backup', 'cron_backup.php', '1 DAY', '1', 'cron_backup'),
|
||||
(10, 'froxlor/core', 'cron_mailboxsize.php', '6 HOUR', '1', 'cron_mailboxsize');
|
||||
(1, 'froxlor/core', 'tasks', '5 MINUTE', '1', 'cron_tasks'),
|
||||
(2, 'froxlor/core', 'traffic', '1 DAY', '1', 'cron_traffic'),
|
||||
(3, 'froxlor/ticket', 'used_tickets_reset', '1 DAY', '1', 'cron_ticketsreset'),
|
||||
(4, 'froxlor/ticket', 'ticketarchive', '1 MONTH', '1', 'cron_ticketarchive'),
|
||||
(5, 'froxlor/reports', 'usage_report', '1 DAY', '1', 'cron_usage_report'),
|
||||
(6, 'froxlor/core', 'mailboxsize', '6 HOUR', '1', 'cron_mailboxsize'),
|
||||
(7, 'froxlor/letsencrypt', 'letsencrypt', '5 MINUTE', '0', 'cron_letsencrypt');
|
||||
|
||||
|
||||
|
||||
@@ -896,33 +832,16 @@ CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `ipsandports_docrootsettings`;
|
||||
CREATE TABLE IF NOT EXISTS `ipsandports_docrootsettings` (
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`fid` int(11) NOT NULL,
|
||||
`docrootsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `domain_docrootsettings`;
|
||||
CREATE TABLE IF NOT EXISTS `domain_docrootsettings` (
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`fid` int(11) NOT NULL,
|
||||
`docrootsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `domain_ssl_settings`;
|
||||
CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`domainid` int(11) NOT NULL,
|
||||
`ssl_cert_file` text NOT NULL,
|
||||
`ssl_key_file` text NOT NULL,
|
||||
`ssl_ca_file` text NOT NULL,
|
||||
`ssl_cert_chainfile` text NOT NULL,
|
||||
`ssl_cert_file` mediumtext NOT NULL,
|
||||
`ssl_key_file` mediumtext NOT NULL,
|
||||
`ssl_ca_file` mediumtext,
|
||||
`ssl_cert_chainfile` mediumtext,
|
||||
`ssl_csr_file` mediumtext,
|
||||
`expirationdate` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
@@ -933,3 +852,4 @@ CREATE TABLE IF NOT EXISTS `panel_domaintoip` (
|
||||
`id_ipandports` int(11) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_domain`,`id_ipandports`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ class FroxlorInstall {
|
||||
*/
|
||||
private $_languages = array(
|
||||
'german' => 'Deutsch',
|
||||
'english' => 'English'
|
||||
'english' => 'English',
|
||||
'french' => 'Français'
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -159,6 +160,7 @@ class FroxlorInstall {
|
||||
$this->_getPostField('admin_user', 'admin');
|
||||
$this->_getPostField('admin_pass1');
|
||||
$this->_getPostField('admin_pass2');
|
||||
$this->_getPostField('activate_newsfeed', 1);
|
||||
$posixusername = posix_getpwuid(posix_getuid());
|
||||
$this->_getPostField('httpuser', $posixusername['name']);
|
||||
$posixgroup = posix_getgrgid(posix_getgid());
|
||||
@@ -207,43 +209,84 @@ class FroxlorInstall {
|
||||
// check for mysql-root-connection
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_mysql']);
|
||||
|
||||
$db_root = new db(
|
||||
$this->_data['mysql_host'],
|
||||
$this->_data['mysql_root_user'],
|
||||
$this->_data['mysql_root_pass'],
|
||||
''
|
||||
$options = array('PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8');
|
||||
$dsn = "mysql:host=".$this->_data['mysql_host'].";";
|
||||
$fatal_fail = false;
|
||||
try {
|
||||
$db_root = new PDO(
|
||||
$dsn, $this->_data['mysql_root_user'], $this->_data['mysql_root_pass'], $options
|
||||
);
|
||||
// ok, if we are here, the database class is build up
|
||||
// (otherwise it would have already die'd this script)
|
||||
} catch (PDOException $e) {
|
||||
// possibly without passwd?
|
||||
try {
|
||||
$db_root = new PDO(
|
||||
$dsn, $this->_data['mysql_root_user'], '', $options
|
||||
);
|
||||
// set the given password
|
||||
$passwd_stmt = $db_root->prepare("
|
||||
SET PASSWORD = PASSWORD(:passwd)
|
||||
");
|
||||
$passwd_stmt->execute(array('passwd' => $this->_data['mysql_root_pass']));
|
||||
} catch (PDOException $e) {
|
||||
// nope
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$fatal_fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fatal_fail) {
|
||||
|
||||
// ok, if we are here, the database connection is up and running
|
||||
$content .= $this->_status_message('green', "OK");
|
||||
// check for existing db
|
||||
// check for existing db and create backup if so
|
||||
$content .= $this->_backupExistingDatabase($db_root);
|
||||
// create unprivileged user and the database itself
|
||||
$content .= $this->_createDatabaseAndUser($db_root);
|
||||
// importing data to new database
|
||||
$content .= $this->_importDatabaseData();
|
||||
// create DB object for new database
|
||||
$db = new db(
|
||||
$this->_data['mysql_host'],
|
||||
$this->_data['mysql_unpriv_user'],
|
||||
$this->_data['mysql_unpriv_pass'],
|
||||
$this->_data['mysql_database']
|
||||
$options = array('PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8');
|
||||
$dsn = "mysql:host=".$this->_data['mysql_host'].";dbname=".$this->_data['mysql_database'].";";
|
||||
$another_fail = false;
|
||||
try {
|
||||
$db = new PDO(
|
||||
$dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
// dafuq? this should have happened in _importDatabaseData()
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$another_fail = true;
|
||||
};
|
||||
|
||||
if (!$another_fail) {
|
||||
// change settings accordingly
|
||||
$content .= $this->_doSettings($db);
|
||||
// create entries
|
||||
$content .= $this->_doDataEntries($db);
|
||||
$db = null;
|
||||
// create config-file
|
||||
$content .= $this->_createUserdataConf($db);
|
||||
$content .= $this->_createUserdataConf();
|
||||
}
|
||||
}
|
||||
|
||||
$content .= "</table>";
|
||||
|
||||
// check if we have unrecoverable errors
|
||||
if ($fatal_fail || $another_fail) {
|
||||
// D'oh
|
||||
$navigation = '';
|
||||
$msgcolor = 'red';
|
||||
$message = $this->_lng['install']['testing_mysql_fail'];
|
||||
$link = 'install.php?check=1';
|
||||
$linktext = $this->_lng['click_here_to_goback'];
|
||||
} else {
|
||||
// all good
|
||||
$navigation = '';
|
||||
$msgcolor = 'green';
|
||||
$message = $this->_lng['install']['froxlor_succ_installed'];
|
||||
$link = '../index.php';
|
||||
$linktext = $this->_lng['click_here_to_login'];
|
||||
}
|
||||
|
||||
eval("\$navigation .= \"" . $this->_getTemplate("pagebottom") . "\";");
|
||||
|
||||
@@ -305,31 +348,43 @@ class FroxlorInstall {
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['creating_entries']);
|
||||
|
||||
// and lets insert the default ip and port
|
||||
$query = "INSERT INTO `".TABLE_PANEL_IPSANDPORTS."`
|
||||
SET `ip`= '".$db->escape($this->_data['serverip'])."',
|
||||
$stmt = $db->prepare("
|
||||
INSERT INTO `".TABLE_PANEL_IPSANDPORTS."` SET
|
||||
`ip`= :serverip,
|
||||
`port` = '80',
|
||||
`namevirtualhost_statement` = '1',
|
||||
`vhostcontainer` = '1',
|
||||
`vhostcontainer_servername_statement` = '1'";
|
||||
$db->query($query);
|
||||
$defaultip = $db->insert_id();
|
||||
`vhostcontainer_servername_statement` = '1'
|
||||
");
|
||||
$stmt->execute(array('serverip' => $this->_data['serverip']));
|
||||
$defaultip = $db->lastInsertId();
|
||||
|
||||
// insert the defaultip
|
||||
$query = "UPDATE `".TABLE_PANEL_SETTINGS."`
|
||||
SET `value` = '".$defaultip."'
|
||||
WHERE `settinggroup` = 'system' AND `varname` = 'defaultip'";
|
||||
$db->query($query);
|
||||
$upd_stmt = $db->prepare("
|
||||
UPDATE `".TABLE_PANEL_SETTINGS."` SET
|
||||
`value` = :defaultip
|
||||
WHERE `settinggroup` = 'system' AND `varname` = 'defaultip'
|
||||
");
|
||||
$upd_stmt->execute(array('defaultip' => $defaultip));
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
//last but not least create the main admin
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['adding_admin_user']);
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET
|
||||
`loginname` = '" . $db->escape($this->_data['admin_user']) . "',
|
||||
`password` = '" . md5($this->_data['admin_pass1']) . "',
|
||||
$ins_data = array(
|
||||
'loginname' => $this->_data['admin_user'],
|
||||
/* use SHA256 default crypt */
|
||||
'password' => crypt($this->_data['admin_pass1'], '$5$'. md5(uniqid(microtime(), 1)) . md5(uniqid(microtime(), 1))),
|
||||
'email' => 'admin@' . $this->_data['servername'],
|
||||
'deflang' => $this->_languages[$this->_activelng]
|
||||
);
|
||||
$ins_stmt = $db->prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET
|
||||
`loginname` = :loginname,
|
||||
`password` = :password,
|
||||
`name` = 'Froxlor-Administrator',
|
||||
`email` = 'admin@" . $db->escape($this->_data['servername']) . "',
|
||||
`def_language` = '". $db->escape($this->_languages[$this->_activelng]) . "',
|
||||
`email` = :email,
|
||||
`def_language` = :deflang,
|
||||
`customers` = -1,
|
||||
`customers_see_all` = 1,
|
||||
`caneditphpsettings` = 1,
|
||||
@@ -346,17 +401,32 @@ class FroxlorInstall {
|
||||
`tickets` = -1,
|
||||
`tickets_see_all` = 1,
|
||||
`subdomains` = -1,
|
||||
`traffic` = -1048576,
|
||||
`can_manage_aps_packages` = 1,
|
||||
`aps_packages` = -1,
|
||||
`email_autoresponder` = -1
|
||||
`traffic` = -1048576
|
||||
");
|
||||
|
||||
$ins_stmt->execute($ins_data);
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* execute prepared statement to update settings
|
||||
*
|
||||
* @param PDOStatement $stmt
|
||||
* @param string $group
|
||||
* @param string $varname
|
||||
* @param string $value
|
||||
*/
|
||||
private function _updateSetting(&$stmt = null, $value = null, $group = null, $varname = null) {
|
||||
$stmt->execute(array(
|
||||
'group' => $group,
|
||||
'varname' => $varname,
|
||||
'value' => $value
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* change settings according to users input
|
||||
*
|
||||
@@ -369,34 +439,46 @@ class FroxlorInstall {
|
||||
$content = "";
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['changing_data']);
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = 'admin@" . $db->escape($this->_data['servername']) . "' WHERE `settinggroup` = 'panel' AND `varname` = 'adminmail'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['serverip']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'ipaddress'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['servername']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'hostname'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_languages[$this->_activelng]) . "' WHERE `settinggroup` = 'panel' AND `varname` = 'standardlanguage'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['mysql_access_host']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'mysql_access_host'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['webserver']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['httpuser']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($this->_data['httpgroup']) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
$upd_stmt = $db->prepare("
|
||||
UPDATE `" . TABLE_PANEL_SETTINGS . "` SET
|
||||
`value` = :value
|
||||
WHERE `settinggroup` = :group AND `varname` = :varname
|
||||
");
|
||||
|
||||
$this->_updateSetting($upd_stmt, 'admin@' . $this->_data['servername'], 'panel', 'adminmail');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['serverip'], 'system', 'ipaddress');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['servername'], 'system', 'hostname');
|
||||
$this->_updateSetting($upd_stmt, $this->_languages[$this->_activelng], 'panel', 'standardlanguage');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['mysql_access_host'], 'system', 'mysql_access_host');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['webserver'], 'system', 'webserver');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['httpuser'], 'system', 'httpuser');
|
||||
$this->_updateSetting($upd_stmt, $this->_data['httpgroup'], 'system', 'httpgroup');
|
||||
|
||||
// necessary changes for webservers != apache2
|
||||
if ($this->_data['webserver'] == "lighttpd") {
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/conf-enabled/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_vhost'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-diroptions/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_diroptions'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/lighttpd reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/lighttpd/lighttpd.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'");
|
||||
if ($this->_data['webserver'] == "apache24") {
|
||||
$this->_updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
||||
$this->_updateSetting($upd_stmt, '1', 'system', 'apache24');
|
||||
} elseif ($this->_data['webserver'] == "lighttpd") {
|
||||
$this->_updateSetting($upd_stmt, '/etc/lighttpd/conf-enabled/', 'system', 'apacheconf_vhost');
|
||||
$this->_updateSetting($upd_stmt, '/etc/lighttpd/froxlor-diroptions/', 'system', 'apacheconf_diroptions');
|
||||
$this->_updateSetting($upd_stmt, '/etc/lighttpd/froxlor-htpasswd/', 'system', 'apacheconf_htpasswddir');
|
||||
$this->_updateSetting($upd_stmt, '/etc/init.d/lighttpd reload', 'system', 'apachereload_command');
|
||||
$this->_updateSetting($upd_stmt, '/etc/lighttpd/lighttpd.pem', 'system', 'ssl_cert_file');
|
||||
$this->_updateSetting($upd_stmt, '/var/run/lighttpd/', 'phpfpm', 'fastcgi_ipcdir');
|
||||
} elseif ($this->_data['webserver'] == "nginx") {
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/sites-enabled/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_vhost'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/sites-enabled/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_diroptions'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/froxlor-htpasswd/' WHERE `settinggroup` = 'system' AND `varname` = 'apacheconf_htpasswddir'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/init.d/nginx reload' WHERE `settinggroup` = 'system' AND `varname` = 'apachereload_command'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/etc/nginx/nginx.pem' WHERE `settinggroup` = 'system' AND `varname` = 'ssl_cert_file'");
|
||||
$this->_updateSetting($upd_stmt, '/etc/nginx/sites-enabled/', 'system', 'apacheconf_vhost');
|
||||
$this->_updateSetting($upd_stmt, '/etc/nginx/sites-enabled/', 'system', 'apacheconf_diroptions');
|
||||
$this->_updateSetting($upd_stmt, '/etc/nginx/froxlor-htpasswd/', 'system', 'apacheconf_htpasswddir');
|
||||
$this->_updateSetting($upd_stmt, '/etc/init.d/nginx reload', 'system', 'apachereload_command');
|
||||
$this->_updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file');
|
||||
$this->_updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
|
||||
}
|
||||
|
||||
$this->_updateSetting($upd_stmt, $this->_data['activate_newsfeed'], 'admin', 'show_news_feed');
|
||||
$this->_updateSetting($upd_stmt, dirname(dirname(dirname(__FILE__))), 'system', 'letsencryptchallengepath');
|
||||
|
||||
// insert the lastcronrun to be the installation date
|
||||
$query = "UPDATE `".TABLE_PANEL_SETTINGS."` SET `value` = UNIX_TIMESTAMP()
|
||||
WHERE `settinggroup` = 'system' AND `varname` = 'lastcronrun'";
|
||||
$db->query($query);
|
||||
$this->_updateSetting($upd_stmt, time(), 'system', 'lastcronrun');
|
||||
|
||||
// set specific times for some crons (traffic only at night, etc.)
|
||||
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
@@ -405,6 +487,9 @@ class FroxlorInstall {
|
||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_used_tickets_reset.php';");
|
||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||
|
||||
// insert task 99 to generate a correct cron.d-file automatically
|
||||
$db->query("INSERT INTO `".TABLE_PANEL_TASKS."` SET `type` = '99';");
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
return $content;
|
||||
@@ -418,15 +503,23 @@ class FroxlorInstall {
|
||||
* @return string status messages
|
||||
*/
|
||||
private function _importDatabaseData() {
|
||||
$content = "";
|
||||
|
||||
$content = "";
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['testing_new_db']);
|
||||
$db = new db(
|
||||
$this->_data['mysql_host'],
|
||||
$this->_data['mysql_unpriv_user'],
|
||||
$this->_data['mysql_unpriv_pass'],
|
||||
$this->_data['mysql_database']
|
||||
$options = array('PDO::MYSQL_ATTR_INIT_COMMAND' => 'set names utf8');
|
||||
$dsn = "mysql:host=".$this->_data['mysql_host'].";dbname=".$this->_data['mysql_database'].";";
|
||||
$fatal_fail = false;
|
||||
try {
|
||||
$db = new PDO(
|
||||
$dsn, $this->_data['mysql_unpriv_user'], $this->_data['mysql_unpriv_pass'], $options
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
$content .= $this->_status_message('red', $e->getMessage());
|
||||
$fatal_fail = true;
|
||||
};
|
||||
|
||||
if (!$fatal_fail) {
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['importing_data']);
|
||||
@@ -439,11 +532,14 @@ class FroxlorInstall {
|
||||
$result = $db->query($sql_query[$i]);
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
$db = null;
|
||||
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create database and database-user
|
||||
*
|
||||
@@ -458,17 +554,30 @@ class FroxlorInstall {
|
||||
// so first we have to delete the database and
|
||||
// the user given for the unpriv-user if they exit
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['prepare_db']);
|
||||
$db_root->query("DELETE FROM `mysql`.`user` WHERE `User` = '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "' AND `Host` = '" . $db_root->escape($this->_data['mysql_access_host']) . "'");
|
||||
$db_root->query("DELETE FROM `mysql`.`db` WHERE `User` = '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "' AND `Host` = '" . $db_root->escape($this->_data['mysql_access_host']) . "'");
|
||||
$db_root->query("DELETE FROM `mysql`.`tables_priv` WHERE `User` = '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "' AND `Host` = '" . $db_root->escape($this->_data['mysql_access_host']) . "'");
|
||||
$db_root->query("DELETE FROM `mysql`.`columns_priv` WHERE `User` = '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "' AND `Host` = '" . $db_root->escape($this->_data['mysql_access_host']) . "'");
|
||||
$db_root->query("DROP DATABASE IF EXISTS `" . $db_root->escape(str_replace('`', '', $this->_data['mysql_database'])) . "` ;");
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`user` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array('user' => $this->_data['mysql_unpriv_user'], 'accesshost' => $this->_data['mysql_access_host']));
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`db` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array('user' => $this->_data['mysql_unpriv_user'], 'accesshost' => $this->_data['mysql_access_host']));
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`tables_priv` WHERE `User` = :user AND `Host` =:accesshost");
|
||||
$del_stmt->execute(array('user' => $this->_data['mysql_unpriv_user'], 'accesshost' => $this->_data['mysql_access_host']));
|
||||
|
||||
$del_stmt = $db_root->prepare("DELETE FROM `mysql`.`columns_priv` WHERE `User` = :user AND `Host` = :accesshost");
|
||||
$del_stmt->execute(array('user' => $this->_data['mysql_unpriv_user'], 'accesshost' => $this->_data['mysql_access_host']));
|
||||
|
||||
$del_stmt = $db_root->prepare("DROP DATABASE IF EXISTS `".str_replace('`', '', $this->_data['mysql_database'])."`;");
|
||||
$del_stmt->execute();
|
||||
|
||||
$db_root->query("FLUSH PRIVILEGES;");
|
||||
$content .= $this->_status_message('green', 'OK');
|
||||
|
||||
// we have to create a new user and database for the froxlor unprivileged mysql access
|
||||
$content .= $this->_status_message('begin', $this->_lng['install']['create_mysqluser_and_db']);
|
||||
$db_root->query("CREATE DATABASE `" . $db_root->escape(str_replace('`', '', $this->_data['mysql_database'])) . "`");
|
||||
$ins_stmt = $db_root->prepare("CREATE DATABASE `".str_replace('`', '', $this->_data['mysql_database'])."` CHARACTER SET=utf8 COLLATE=utf8_general_ci");
|
||||
$ins_stmt->execute();
|
||||
|
||||
$mysql_access_host_array = array_map('trim', explode(',', $this->_data['mysql_access_host']));
|
||||
|
||||
if (in_array('127.0.0.1', $mysql_access_host_array)
|
||||
@@ -485,8 +594,15 @@ class FroxlorInstall {
|
||||
|
||||
$mysql_access_host_array[] = $this->_data['serverip'];
|
||||
foreach ($mysql_access_host_array as $mysql_access_host) {
|
||||
$db_root->query("GRANT ALL PRIVILEGES ON `" . $db_root->escape(str_replace('`', '', $this->_data['mysql_database'])) . "`.* TO '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "'@'" . $db_root->escape($mysql_access_host) . "' IDENTIFIED BY 'password'");
|
||||
$db_root->query("SET PASSWORD FOR '" . $db_root->escape($this->_data['mysql_unpriv_user']) . "'@'" . $db_root->escape($mysql_access_host) . "' = PASSWORD('" . $db_root->escape($this->_data['mysql_unpriv_pass']) . "')");
|
||||
$_db = str_replace('`', '', $this->_data['mysql_database']);
|
||||
$stmt = $db_root->prepare("
|
||||
GRANT ALL PRIVILEGES ON `" . $_db . "`.*
|
||||
TO :username@:host
|
||||
IDENTIFIED BY 'password'"
|
||||
);
|
||||
$stmt->execute(array("username" => $this->_data['mysql_unpriv_user'], "host" => $mysql_access_host));
|
||||
$stmt = $db_root->prepare("SET PASSWORD FOR :username@:host = PASSWORD(:password)");
|
||||
$stmt->execute(array("username" => $this->_data['mysql_unpriv_user'], "host" => $mysql_access_host, "password" => $this->_data['mysql_unpriv_pass']));
|
||||
}
|
||||
|
||||
$db_root->query("FLUSH PRIVILEGES;");
|
||||
@@ -509,11 +625,13 @@ class FroxlorInstall {
|
||||
|
||||
// check for existing of former database
|
||||
$tables_exist = false;
|
||||
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '".$this->_data['mysql_database']."'";
|
||||
$result = $db_root->query($sql);
|
||||
$sql = "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = :database";
|
||||
$result_stmt = $db_root->prepare($sql);
|
||||
$result_stmt->execute(array('database' => $this->_data['mysql_database']));
|
||||
$rows = $db_root->query("SELECT FOUND_ROWS()")->fetchColumn();
|
||||
|
||||
// check result
|
||||
if ($result !== false && $db_root->num_rows($result) > 0) {
|
||||
if ($result_stmt !== false && $rows > 0) {
|
||||
$tables_exist = true;
|
||||
}
|
||||
|
||||
@@ -535,7 +653,7 @@ class FroxlorInstall {
|
||||
}
|
||||
|
||||
if ($do_backup) {
|
||||
$command = $mysql_dump." ".$this->_data['mysql_database']." -u " . $this->_data['mysql_root_user'] . " -password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
||||
$command = $mysql_dump." ".$this->_data['mysql_database']." -u " . $this->_data['mysql_root_user'] . " --password='" . $this->_data['mysql_root_pass'] . "' --result-file=" . $filename;
|
||||
$output = exec($command);
|
||||
if (stristr($output, "error")) {
|
||||
$content .= $this->_status_message('red', $this->_lng['install']['backup_failed']);
|
||||
@@ -582,25 +700,25 @@ class FroxlorInstall {
|
||||
$formdata .= $this->_getSectionItemString('mysql_database', true);
|
||||
// unpriv-user has to be different from root
|
||||
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
||||
$style = 'color:blue;';
|
||||
$style = 'blue';
|
||||
} else { $style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_unpriv_user', true, $style);
|
||||
// is we posted and no password was given -> red
|
||||
if (!empty($_POST['installstep']) && $this->_data['mysql_unpriv_pass'] == '') {
|
||||
$style = 'color:red;';
|
||||
$style = 'red';
|
||||
} else { $style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_unpriv_pass', true, $style, 'password');
|
||||
// unpriv-user has to be different from root
|
||||
if ($this->_data['mysql_unpriv_user'] == $this->_data['mysql_root_user']) {
|
||||
$style = 'color:blue;';
|
||||
$style = 'blue';
|
||||
} else { $style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_root_user', true, $style);
|
||||
// is we posted and no password was given -> red
|
||||
if (!empty($_POST['installstep']) && $this->_data['mysql_root_pass'] == '') {
|
||||
$style = 'color:red;';
|
||||
$style = 'red';
|
||||
} else { $style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('mysql_root_pass', true, $style, 'password');
|
||||
@@ -630,6 +748,8 @@ class FroxlorInstall {
|
||||
} else { $style = '';
|
||||
}
|
||||
$formdata .= $this->_getSectionItemString('admin_pass2', true, $style, 'password');
|
||||
// activate newsfeed?
|
||||
$formdata .= $this->_getSectionItemYesNo('activate_newsfeed', true);
|
||||
|
||||
/**
|
||||
* Server data
|
||||
@@ -655,6 +775,7 @@ class FroxlorInstall {
|
||||
}
|
||||
// apache
|
||||
$formdata .= $this->_getSectionItemCheckbox('apache2', ($this->_data['webserver'] == 'apache2'), $websrvstyle);
|
||||
$formdata .= $this->_getSectionItemCheckbox('apache24', ($this->_data['webserver'] == 'apache24'), $websrvstyle);
|
||||
// lighttpd
|
||||
$formdata .= $this->_getSectionItemCheckbox('lighttpd', ($this->_data['webserver'] == 'lighttpd'), $websrvstyle);
|
||||
// nginx
|
||||
@@ -702,10 +823,10 @@ class FroxlorInstall {
|
||||
}
|
||||
|
||||
/**
|
||||
* generate form checkbox field
|
||||
* generate form radio field for webserver-selection
|
||||
*
|
||||
* @param string $fieldname
|
||||
* @param boolean $required
|
||||
* @param boolean $checked
|
||||
* @param string $style
|
||||
*
|
||||
* @return string
|
||||
@@ -720,6 +841,25 @@ class FroxlorInstall {
|
||||
return $sectionitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate form checkbox field
|
||||
*
|
||||
* @param string $fieldname
|
||||
* @param boolean $checked
|
||||
* @param string $style
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _getSectionItemYesNo($fieldname = null, $checked = false, $style = "") {
|
||||
$fieldlabel = $this->_lng['install'][$fieldname];
|
||||
if ($checked) {
|
||||
$checked = 'checked="checked"';
|
||||
}
|
||||
$sectionitem = "";
|
||||
eval("\$sectionitem .= \"" . $this->_getTemplate("dataitemyesno") . "\";");
|
||||
return $sectionitem;
|
||||
}
|
||||
|
||||
/**
|
||||
* check for requirements froxlor needs
|
||||
*/
|
||||
@@ -733,14 +873,15 @@ class FroxlorInstall {
|
||||
// check for correct php version
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpversion']);
|
||||
|
||||
if (version_compare("5.2.0", PHP_VERSION, ">=")) {
|
||||
if (version_compare("5.3.0", PHP_VERSION, ">=")) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notfound'].' ('.PHP_VERSION.')');
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', PHP_VERSION);
|
||||
}
|
||||
|
||||
// Check if magic_quotes_runtime is active
|
||||
// Check if magic_quotes_runtime is active | get_magic_quotes_runtime() is always FALSE since 5.4
|
||||
if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
|
||||
if (get_magic_quotes_runtime()) {
|
||||
// deactivate it
|
||||
@@ -749,12 +890,12 @@ class FroxlorInstall {
|
||||
} else {
|
||||
$content .= $this->_status_message('green', 'off');
|
||||
}
|
||||
}
|
||||
|
||||
// check for mysql-extension
|
||||
// @FIXME mysql extension will soon be deprecated and removed!!!
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmysql']);
|
||||
// check for php_pdo and pdo_mysql
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phppdo']);
|
||||
|
||||
if (!extension_loaded('mysql') && !extension_loaded('mysqlnd')) {
|
||||
if (!extension_loaded('pdo') || in_array("mysql", PDO::getAvailableDrivers()) == false) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
@@ -791,6 +932,16 @@ class FroxlorInstall {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for bstring-extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmbstring']);
|
||||
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$content .= $this->_status_message('red', $this->_lng['requirements']['notinstalled']);
|
||||
$_die = true;
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for bcmath extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpbcmath']);
|
||||
|
||||
@@ -800,6 +951,15 @@ class FroxlorInstall {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for curl extension
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpcurl']);
|
||||
|
||||
if (!extension_loaded('curl')) {
|
||||
$content .= $this->_status_message('orange', $this->_lng['requirements']['notinstalled'] . "<br />" . $this->_lng['requirements']['curldescription']);
|
||||
} else {
|
||||
$content .= $this->_status_message('green', $this->_lng['requirements']['installed']);
|
||||
}
|
||||
|
||||
// check for open_basedir
|
||||
$content .= $this->_status_message('begin', $this->_lng['requirements']['openbasedir']);
|
||||
$php_ob = @ini_get("open_basedir");
|
||||
@@ -862,6 +1022,7 @@ class FroxlorInstall {
|
||||
) {
|
||||
// use sparkle theme for the notice
|
||||
$installed_hint = file_get_contents($this->_basepath.'/templates/Sparkle/misc/alreadyinstalledhint.tpl');
|
||||
$installed_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $installed_hint);
|
||||
die($installed_hint);
|
||||
}
|
||||
}
|
||||
@@ -917,7 +1078,7 @@ class FroxlorInstall {
|
||||
private function _getTemplate($template = null) {
|
||||
// build filename
|
||||
$filename = $this->_basepath.'/install/templates/' . $template . '.tpl';
|
||||
// check existance
|
||||
// check existence
|
||||
if(file_exists($filename)
|
||||
&& is_readable($filename)
|
||||
) {
|
||||
@@ -943,9 +1104,9 @@ class FroxlorInstall {
|
||||
*/
|
||||
private function _status_message($case, $text) {
|
||||
if ($case == 'begin') {
|
||||
return '<tr><td style="width: 250px;">'.$text;
|
||||
return '<tr><td class="install-step">'.$text;
|
||||
} else {
|
||||
return '</td><td><span style="color:'.$case.';">'.$text.'</span></td></tr>';
|
||||
return '</td><td><span class="'.$case.'">'.$text.'</span></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1100,10 +1261,10 @@ class FroxlorInstall {
|
||||
// we don't actually care about the matches preg gives us.
|
||||
$matches = array();
|
||||
|
||||
// this is faster than calling count($oktens) every time thru the loop.
|
||||
// this is faster than calling count($tokens) every time through the loop.
|
||||
$token_count = count($tokens);
|
||||
for ($i = 0; $i < $token_count; $i++) {
|
||||
// Don't wanna add an empty string as the last thing in the array.
|
||||
// Don't want to add an empty string as the last thing in the array.
|
||||
if (($i != ($token_count - 1))
|
||||
|| (strlen($tokens[$i] > 0))
|
||||
) {
|
||||
|
||||
@@ -23,21 +23,24 @@ $lng['requirements']['not_true'] = 'no';
|
||||
$lng['requirements']['notfound'] = 'not found';
|
||||
$lng['requirements']['notinstalled'] = 'not installed';
|
||||
$lng['requirements']['activated'] = 'enabled';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 5.2';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 5.3';
|
||||
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime...';
|
||||
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'PHP setting "magic_quotes_runtime" must be set to "Off". We have disabled it temporary for now please fix the coresponding php.ini.';
|
||||
$lng['requirements']['phpmysql'] = 'MySQL-extension...';
|
||||
$lng['requirements']['phppdo'] = 'PHP PDO extension and PDO-MySQL driver...';
|
||||
$lng['requirements']['phpxml'] = 'PHP XML-extension...';
|
||||
$lng['requirements']['phpfilter'] = 'PHP filter-extension...';
|
||||
$lng['requirements']['phpposix'] = 'PHP posix-extension...';
|
||||
$lng['requirements']['phpbcmath'] = 'PHP bcmath-extension...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-extension...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-extension...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-calculation related functions will not work correctly!';
|
||||
$lng['requirements']['curldescription'] = 'Version-check and news-feed may not work correctly!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor in the coresponding php.ini';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Cannot install Froxlor without these requirements! Try to fix them and retry.';
|
||||
$lng['requirements']['froxlor_succ_checks'] = 'All requirements are satisfied';
|
||||
|
||||
$lng['install']['title'] = 'Froxlor install - chose language';
|
||||
$lng['install']['lngtitle'] = 'Froxlor install - choose language';
|
||||
$lng['install']['language'] = 'Installation language';
|
||||
$lng['install']['lngbtn_go'] = 'Change language';
|
||||
$lng['install']['title'] = 'Froxlor install - setup';
|
||||
@@ -53,17 +56,20 @@ $lng['install']['admin_account'] = 'Administrator Account';
|
||||
$lng['install']['admin_user'] = 'Administrator Username';
|
||||
$lng['install']['admin_pass1'] = 'Administrator Password';
|
||||
$lng['install']['admin_pass2'] = 'Administrator-Password (confirm)';
|
||||
$lng['install']['activate_newsfeed'] = 'Enable the official newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||
$lng['install']['serversettings'] = 'Server settings';
|
||||
$lng['install']['servername'] = 'Server name (FQDN, no ip-address)';
|
||||
$lng['install']['serverip'] = 'Server IP';
|
||||
$lng['install']['webserver'] = 'Webserver';
|
||||
$lng['install']['apache2'] = 'Apache 2';
|
||||
$lng['install']['apache24'] = 'Apache 2.4';
|
||||
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||
$lng['install']['nginx'] = 'NGINX';
|
||||
$lng['install']['httpuser'] = 'HTTP username';
|
||||
$lng['install']['httpgroup'] = 'HTTP groupname';
|
||||
|
||||
$lng['install']['testing_mysql'] = 'Checking MySQL-root access...';
|
||||
$lng['install']['testing_mysql_fail'] = 'There seems to be a problem with the database-connection. Cannot continue. Please go back and check your credentials.';
|
||||
$lng['install']['backup_old_db'] = 'Creating backup of old database...';
|
||||
$lng['install']['backup_binary_missing'] = 'Could not find mysqldump';
|
||||
$lng['install']['backup_failed'] = 'Could not backup database';
|
||||
@@ -80,5 +86,6 @@ $lng['install']['creating_configfile_failed'] = 'Could not create lib/userdata.i
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor was installed successfully.';
|
||||
|
||||
$lng['click_here_to_refresh'] = 'Click here to check again';
|
||||
$lng['click_here_to_goback'] = 'Click here to go back';
|
||||
$lng['click_here_to_continue'] = 'Click here to continue';
|
||||
$lng['click_here_to_login'] = 'Click here to login.';
|
||||
|
||||
90
install/lng/french.lng.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?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 Language
|
||||
*
|
||||
*/
|
||||
|
||||
$lng['requirements']['title'] = 'Vérification des prérequis système...';
|
||||
$lng['requirements']['installed'] = 'installé';
|
||||
$lng['requirements']['not_true'] = 'non';
|
||||
$lng['requirements']['notfound'] = 'introuvable';
|
||||
$lng['requirements']['notinstalled'] = 'non installé';
|
||||
$lng['requirements']['activated'] = 'activé';
|
||||
$lng['requirements']['phpversion'] = 'PHP version >= 5.3';
|
||||
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime...';
|
||||
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'Le réglage PHP "magic_quotes_runtime" doit être positionné à "Off". Nous l\'avons désactivé temporairement pour l\'instant; merci de corriger le php.ini correspondant.';
|
||||
$lng['requirements']['phppdo'] = 'extension PHP PDO et pilote PDO-MySQL ...';
|
||||
$lng['requirements']['phpxml'] = 'extension PHP XML...';
|
||||
$lng['requirements']['phpfilter'] = 'extension PHP filter ...';
|
||||
$lng['requirements']['phpposix'] = 'extension PHP posix ...';
|
||||
$lng['requirements']['phpbcmath'] = 'extension PHP bcmath ...';
|
||||
$lng['requirements']['phpcurl'] = 'extension PHP curl...';
|
||||
$lng['requirements']['phpmbstring'] = 'extension PHP mbstring...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Les fonctions de calcul de traffic ne fonctionneront pas correctement!';
|
||||
$lng['requirements']['curldescription'] = 'Les vérifications de version et les flux d\'information peuvent ne pas fonctionner correctement!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor ne fonctionnera pas correctement avec open_basedir activé. Merci de désactiver open_basedir pour Froxlor dans le php.ini correspondant';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Impossible d\'installer Froxlor sans ces prérequis! Essayez de les corriger et essayez à nouveau.';
|
||||
$lng['requirements']['froxlor_succ_checks'] = 'Tous les prérequis sont vérifiés';
|
||||
|
||||
$lng['install']['lngtitle'] = 'Installation de Froxlor - choisisez la langue';
|
||||
$lng['install']['language'] = 'Langue d\'installation';
|
||||
$lng['install']['lngbtn_go'] = 'Changer la langue';
|
||||
$lng['install']['title'] = 'Installation de Froxlor - paramètrage';
|
||||
$lng['install']['welcometext'] = 'Merci d\'avoir choisi Froxlor. Merci de remplir les champs suivant avec les informations nécessaires pour démarrer l\'installation.<br /><b>Attention:</b> Si la base de données que vous choisissez existe déjà sur votre système, elle sera écrasée ainsi que les données contenues!';
|
||||
$lng['install']['database'] = 'Connexion à la base de données';
|
||||
$lng['install']['mysql_host'] = 'Nom d\'hôte MySQL';
|
||||
$lng['install']['mysql_database'] = 'Nom de la base de données';
|
||||
$lng['install']['mysql_unpriv_user'] = 'Nom d\'utilisateur pour le compte non priviligié MySQL';
|
||||
$lng['install']['mysql_unpriv_pass'] = 'Mot de passe pour le compte non priviligié MySQL';
|
||||
$lng['install']['mysql_root_user'] = 'Nom d\'utilisateur pour le compte MySQL root';
|
||||
$lng['install']['mysql_root_pass'] = 'Mot de passe pour le compte MySQL root';
|
||||
$lng['install']['admin_account'] = 'Compte administrateur';
|
||||
$lng['install']['admin_user'] = 'Nom d\'utilisateur administrateur';
|
||||
$lng['install']['admin_pass1'] = 'Mot de passe administrateur';
|
||||
$lng['install']['admin_pass2'] = 'Mot de passe administrateur (confirmez)';
|
||||
$lng['install']['serversettings'] = 'Réglages serveur';
|
||||
$lng['install']['servername'] = 'Nom du serveur (FQDN, pas d\'adresse IP)';
|
||||
$lng['install']['serverip'] = 'Adresse IP du serveur';
|
||||
$lng['install']['webserver'] = 'Serveur Web';
|
||||
$lng['install']['apache2'] = 'Apache 2';
|
||||
$lng['install']['apache24'] = 'Apache 2.4';
|
||||
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||
$lng['install']['nginx'] = 'NGINX';
|
||||
$lng['install']['httpuser'] = 'Nom d\'utilisateur HTTP';
|
||||
$lng['install']['httpgroup'] = 'Nom de groupe HTTP';
|
||||
|
||||
$lng['install']['testing_mysql'] = 'Vérification de l\'accès root MySQL...';
|
||||
$lng['install']['testing_mysql_fail'] = 'Il semble y avoir un problème avec la connexion à la base de données. Impossible de continuer. Merci de revenir en arrière et de vérifier les informations d\'identification.';
|
||||
$lng['install']['backup_old_db'] = 'Création des sauvegardes de l\'ancienne base de données...';
|
||||
$lng['install']['backup_binary_missing'] = 'Impossible de trouver mysqldump';
|
||||
$lng['install']['backup_failed'] = 'Impossible de sauvegarde la base de données';
|
||||
$lng['install']['prepare_db'] = 'Préparation de la base de données...';
|
||||
$lng['install']['create_mysqluser_and_db'] = 'Création de la base de données et l\'utilisateur...';
|
||||
$lng['install']['testing_new_db'] = 'Teste si la base de données et l\'utilisateur ont été créés correctement...';
|
||||
$lng['install']['importing_data'] = 'Import des données...';
|
||||
$lng['install']['changing_data'] = 'Ajustement des paramètres...';
|
||||
$lng['install']['creating_entries'] = 'Insertion des nouvelles valeurs...';
|
||||
$lng['install']['adding_admin_user'] = 'Création du compte administrateur...';
|
||||
$lng['install']['creating_configfile'] = 'Création du fichier de configuration...';
|
||||
$lng['install']['creating_configfile_temp'] = 'Le fichier a été enregistré dans /tmp/userdata.inc.php, merci de le déplacer dans lib/.';
|
||||
$lng['install']['creating_configfile_failed'] = 'Impossible de créer lib/userdata.inc.php, merci de le créer manuellement avec le contenu suivant:';
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor a été installé avec succès.';
|
||||
|
||||
$lng['click_here_to_refresh'] = 'Cliquez ici pour vérifier à nouveau';
|
||||
$lng['click_here_to_goback'] = 'Cliquez ici pour revenir';
|
||||
$lng['click_here_to_continue'] = 'Cliquez ici pour continuer';
|
||||
$lng['click_here_to_login'] = 'Cliquez ici pour vous connecter.';
|
||||
@@ -23,18 +23,21 @@ $lng['requirements']['not_true'] = 'nein';
|
||||
$lng['requirements']['notfound'] = 'nicht gefunden';
|
||||
$lng['requirements']['notinstalled'] = 'nicht installiert';
|
||||
$lng['requirements']['activated'] = 'ist aktiviert.';
|
||||
$lng['requirements']['phpversion'] = 'PHP Version >= 5.2';
|
||||
$lng['requirements']['phpversion'] = 'PHP Version >= 5.3';
|
||||
$lng['requirements']['phpmagic_quotes_runtime'] = 'magic_quotes_runtime';
|
||||
$lng['requirements']['phpmagic_quotes_runtime_description'] = 'Die PHP Einstellung "magic_quotes_runtime" muss deaktiviert sein ("Off"). Die Einstellung wurde temporär deaktiviert, bitte ändern Sie diese in der entsprechenden php.ini.';
|
||||
$lng['requirements']['phpmysql'] = 'PHP MySQL-Erweiterung...';
|
||||
$lng['requirements']['phppdo'] = 'PHP PDO Erweiterung und PDO-MySQL Treiber...';
|
||||
$lng['requirements']['phpxml'] = 'PHP XML-Erweiterung...';
|
||||
$lng['requirements']['phpfilter'] = 'PHP filter-Erweiterung...';
|
||||
$lng['requirements']['phpposix'] = 'PHP posix-Erweiterung...';
|
||||
$lng['requirements']['phpbcmath'] = 'PHP bcmath-Erweiterung...';
|
||||
$lng['requirements']['phpcurl'] = 'PHP curl-Erweiterung...';
|
||||
$lng['requirements']['phpmbstring'] = 'PHP mbstring-Erweiterung...';
|
||||
$lng['requirements']['bcmathdescription'] = 'Traffic-Berechnungs bezogene Funktionen stehen nicht vollständig zur Verfügung!';
|
||||
$lng['requirements']['curldescription'] = 'Versions-Prüfung und News-Feed stehen nicht vollständig zur Verfügung!';
|
||||
$lng['requirements']['openbasedir'] = 'open_basedir genutzt wird...';
|
||||
$lng['requirements']['openbasedirenabled'] = 'Froxlor wird mit aktiviertem open_basedir nicht vollständig funktionieren. Bitte deaktivieren Sie open_basedir für Froxlor in der entsprechenden php.ini';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Versuchen Sie die angezeigten Problem zu beheben und versuchen Sie es erneut.';
|
||||
$lng['requirements']['diedbecauseofrequirements'] = 'Kann Froxlor ohne diese Voraussetzungen nicht installieren! Beheben Sie die angezeigten Probleme und versuchen Sie es erneut.';
|
||||
$lng['requirements']['froxlor_succ_checks'] = 'Alle Vorraussetzungen sind erfüllt';
|
||||
|
||||
$lng['install']['lngtitle'] = 'Froxlor Installation - Sprache auswählen';
|
||||
@@ -53,17 +56,20 @@ $lng['install']['admin_account'] = 'Admin-Zugang';
|
||||
$lng['install']['admin_user'] = 'Administrator-Benutzername';
|
||||
$lng['install']['admin_pass1'] = 'Administrator-Passwort';
|
||||
$lng['install']['admin_pass2'] = 'Administrator-Passwort (Bestätigung)';
|
||||
$lng['install']['activate_newsfeed'] = 'Aktiviere das offizielle Newsfeed<br><small>(https://inside.froxlor.org/news/)</small>';
|
||||
$lng['install']['serversettings'] = 'Servereinstellungen';
|
||||
$lng['install']['servername'] = 'Servername (FQDN, keine IP-Adresse)';
|
||||
$lng['install']['serverip'] = 'Server-IP';
|
||||
$lng['install']['webserver'] = 'Webserver';
|
||||
$lng['install']['apache2'] = 'Apache 2';
|
||||
$lng['install']['apache24'] = 'Apache 2.4';
|
||||
$lng['install']['lighttpd'] = 'LigHTTPd';
|
||||
$lng['install']['nginx'] = 'NGINX';
|
||||
$lng['install']['httpuser'] = 'HTTP Username';
|
||||
$lng['install']['httpgroup'] = 'HTTP Gruppenname';
|
||||
|
||||
$lng['install']['testing_mysql'] = 'Teste MySQL-Root Zugang...';
|
||||
$lng['install']['testing_mysql_fail'] = 'Bei der Verwendung der Datenbank gibt es scheinbar Probleme. Installation kann nicht fortgesetzt werden. Bitte Zugangsdaten prüfen und erneut versuchen.';
|
||||
$lng['install']['backup_old_db'] = 'Sicherung vorheriger Datenbank...';
|
||||
$lng['install']['backup_binary_missing'] = 'Konnte mysqldump nicht finden';
|
||||
$lng['install']['backup_failed'] = 'Sicherung fehlgeschlagen';
|
||||
@@ -80,5 +86,6 @@ $lng['install']['creating_configfile_failed'] = 'Konnte lib/userdata.inc.php nic
|
||||
$lng['install']['froxlor_succ_installed'] = 'Froxlor wurde erfolgreich installiert.';
|
||||
|
||||
$lng['click_here_to_refresh'] = 'Hier klicken, um erneut zu prüfen';
|
||||
$lng['click_here_to_goback'] = 'Einen Schritt zurück';
|
||||
$lng['click_here_to_continue'] = 'Installation fortführen';
|
||||
$lng['click_here_to_login'] = 'Hier geht es weiter zum Login-Fenster.';
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the SysCP project.
|
||||
* Copyright (c) 2003-2007 the SysCP 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.syscp.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Michael Duergner <michael@duergner.com>
|
||||
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
|
||||
* @package System
|
||||
*
|
||||
*/
|
||||
|
||||
if(@php_sapi_name() != 'cli'
|
||||
&& @php_sapi_name() != 'cgi'
|
||||
&& @php_sapi_name() != 'cgi-fcgi')
|
||||
{
|
||||
die('This script will only work in the shell.');
|
||||
}
|
||||
|
||||
$pathtophpfiles = '/var/www/syscp';
|
||||
$filename = 'htpasswd-htaccess-remover.php';
|
||||
|
||||
/**
|
||||
* Includes the Usersettings eg. MySQL-Username/Passwort etc.
|
||||
*/
|
||||
|
||||
require ("$pathtophpfiles/lib/userdata.inc.php");
|
||||
|
||||
/**
|
||||
* Includes the MySQL-Tabledefinitions etc.
|
||||
*/
|
||||
|
||||
require ("$pathtophpfiles/lib/tables.inc.php");
|
||||
|
||||
/**
|
||||
* Includes the MySQL-Connection-Class
|
||||
*/
|
||||
|
||||
require ("$pathtophpfiles/lib/class_mysqldb.php");
|
||||
$debugMsg[] = 'Database Class has been loaded';
|
||||
$db = new db($sql['host'], $sql['user'], $sql['password'], $sql['db']);
|
||||
$db_root = new db($sql['host'], $sql['root_user'], $sql['root_password'], '');
|
||||
|
||||
if($db->link_id == 0
|
||||
|| $db_root->link_id == 0)
|
||||
{
|
||||
/**
|
||||
* Do not proceed further if no database connection could be established (either normal or root)
|
||||
*/
|
||||
|
||||
die('Cant connect to mysqlserver. Please check userdata.inc.php! Exiting...');
|
||||
}
|
||||
|
||||
unset($sql['password']);
|
||||
unset($db->password);
|
||||
$result = $db->query("SELECT `settingid`, `settinggroup`, `varname`, `value` FROM `" . TABLE_PANEL_SETTINGS . "`");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$settings["$row[settinggroup]"]["$row[varname]"] = $row['value'];
|
||||
}
|
||||
|
||||
unset($row);
|
||||
unset($result);
|
||||
|
||||
if(!isset($settings['panel']['version'])
|
||||
|| $settings['panel']['version'] != $version)
|
||||
{
|
||||
/**
|
||||
* Do not proceed further if the Database version is not the same as the script version
|
||||
*/
|
||||
|
||||
die('Version of File doesnt match Version of Database. Exiting...');
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the Functions
|
||||
*/
|
||||
|
||||
require ("$pathtophpfiles/lib/functions.php");
|
||||
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTACCESS . '` ');
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(file_exists($row['path'] . '.htaccess'))
|
||||
{
|
||||
unlink($row['path'] . '.htaccess');
|
||||
}
|
||||
}
|
||||
|
||||
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_HTPASSWDS . '` ');
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(file_exists($row['path'] . '.htpasswd'))
|
||||
{
|
||||
unlink($row['path'] . '.htpasswd');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -16,106 +16,93 @@
|
||||
*/
|
||||
|
||||
// some configs
|
||||
|
||||
$baseLanguage = 'english.lng.php';
|
||||
|
||||
// Check if we're in the CLI
|
||||
|
||||
if(@php_sapi_name() != 'cli')
|
||||
{
|
||||
if(@php_sapi_name() != 'cli'
|
||||
&& @php_sapi_name() != 'cgi'
|
||||
&& @php_sapi_name() != 'cgi-fcgi'
|
||||
) {
|
||||
die('This script will only work in the shell.');
|
||||
}
|
||||
|
||||
// Check argument count
|
||||
|
||||
if(sizeof($argv) != 2)
|
||||
{
|
||||
/*
|
||||
if (sizeof($argv) != 2) {
|
||||
print_help($argv);
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
|
||||
// Load the contents of the given path
|
||||
|
||||
$path = $argv[1];
|
||||
$_f = isset($argv[2]) ? $argv[2] : null;
|
||||
$files = array();
|
||||
|
||||
if($dh = opendir($path))
|
||||
{
|
||||
while(false !== ($file = readdir($dh)))
|
||||
{
|
||||
if($file != "."
|
||||
if ($dh = opendir($path)) {
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
if ($file != "."
|
||||
&& $file != ".."
|
||||
&& !is_dir($file)
|
||||
&& preg_match('/(.+)\.lng\.php/i', $file))
|
||||
{
|
||||
&& preg_match('/(.+)\.lng\.php/i', $file)
|
||||
) {
|
||||
if (is_null($_f) || (!is_null($_f) && ($file == $_f || $file == $baseLanguage))) {
|
||||
$files[$file] = str_replace('//', '/', $path . '/' . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print "ERROR: The path you requested cannot be read! \n ";
|
||||
print "\n";
|
||||
print_help();
|
||||
print_help($argv);
|
||||
exit;
|
||||
}
|
||||
|
||||
// check if there is the default language defined
|
||||
|
||||
if(!isset($files[$baseLanguage]))
|
||||
{
|
||||
if (!isset($files[$baseLanguage])) {
|
||||
print "ERROR: The baselanguage cannot be found! \n";
|
||||
print "\n";
|
||||
print_help();
|
||||
print_help($argv);
|
||||
exit;
|
||||
}
|
||||
|
||||
// import the baselanguage
|
||||
|
||||
$base = import($files[$baseLanguage]);
|
||||
|
||||
// and unset it in the files, because we don't need to compare base to base
|
||||
|
||||
unset($files[$baseLanguage]);
|
||||
|
||||
// compare each language with the baselanguage
|
||||
|
||||
foreach($files as $key => $file)
|
||||
{
|
||||
foreach ($files as $key => $file) {
|
||||
$comp = import($file);
|
||||
|
||||
print "\n\nComparing " . $baseLanguage . " to " . $key . "\n";
|
||||
$result = compare($base, $comp);
|
||||
|
||||
if(is_array($result)
|
||||
&& sizeof($result) > 0)
|
||||
{
|
||||
if (is_array($result)
|
||||
&& sizeof($result) > 0
|
||||
) {
|
||||
print " found missing strings: \n";
|
||||
foreach($result as $value)
|
||||
{
|
||||
foreach ($result as $value) {
|
||||
print " " . $value . "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print " no missing strings found! \n ";
|
||||
}
|
||||
|
||||
print "\nReverse Checking " . $key . " to " . $baseLanguage . "\n";
|
||||
$result = compare($comp, $base);
|
||||
|
||||
if(is_array($result)
|
||||
&& sizeof($result) > 0)
|
||||
{
|
||||
if (is_array($result)
|
||||
&& sizeof($result) > 0
|
||||
) {
|
||||
print " found strings not in basefile: \n";
|
||||
foreach($result as $key => $value)
|
||||
{
|
||||
foreach ($result as $key => $value) {
|
||||
print " " . $value . "\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print " There are no strings which are not in the basefile! \n ";
|
||||
}
|
||||
}
|
||||
@@ -129,56 +116,45 @@ foreach($files as $key => $file)
|
||||
*
|
||||
* @param array $argv
|
||||
*/
|
||||
|
||||
function print_help($argv)
|
||||
{
|
||||
function print_help($argv) {
|
||||
print "Usage: php " . $argv[0] . " /PATH/TO/LNG \n";
|
||||
print " \n ";
|
||||
}
|
||||
|
||||
function import($file)
|
||||
{
|
||||
function import($file) {
|
||||
|
||||
$input = file($file);
|
||||
$return = array();
|
||||
foreach($input as $key => $value)
|
||||
{
|
||||
if(!preg_match('/^\$/', $value))
|
||||
{
|
||||
unset($input[$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// generate the key
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
|
||||
if (!preg_match('/^\$/', $value)) {
|
||||
unset($input[$key]);
|
||||
} else {
|
||||
// generate the key
|
||||
$key = preg_replace('/^\$lng\[\'(.*)=(.*)$/U', '\\1', $value);
|
||||
$key = str_replace('[\'', '/', $key);
|
||||
$key = trim(str_replace('\']', '', $key));
|
||||
|
||||
//generate the value
|
||||
|
||||
$value = trim($value);
|
||||
|
||||
// set the result
|
||||
|
||||
$return[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
function compare($array1, $array2)
|
||||
{
|
||||
function compare($array1, $array2) {
|
||||
|
||||
$result = array();
|
||||
foreach($array1 as $key => $value)
|
||||
{
|
||||
if(!isset($array2[$key]))
|
||||
{
|
||||
|
||||
foreach ($array1 as $key => $value) {
|
||||
|
||||
if (!isset($array2[$key])) {
|
||||
$result[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
130
install/templates/assets/css/install.css
Executable file → Normal file
@@ -1,5 +1,4 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
/* RESET */
|
||||
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input { margin:0; padding:0; }
|
||||
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th { font-size:1em; font-weight:400; font-style:normal; }
|
||||
@@ -11,10 +10,10 @@ article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
|
||||
|
||||
/* TYPE */
|
||||
html,body {
|
||||
font:12px/18px Helvetica,Arial,Verdana,sans-serif;
|
||||
background-color:#f2f2f2;
|
||||
color:#333;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font:12px/18px 'Lucida Grande','Lucida Sans Unicode',Helvetica,Arial,Verdana,sans-serif;
|
||||
background-color: #f5f5f5;
|
||||
color:#444;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -131,9 +130,8 @@ p {
|
||||
|
||||
.installsec label {
|
||||
float:left;
|
||||
width:26em;
|
||||
margin-right:1em;
|
||||
margin-top:6px;
|
||||
margin-right:0;
|
||||
margin-top:8px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
@@ -416,81 +414,87 @@ table tfoot td {
|
||||
/* input elements */
|
||||
input {
|
||||
background: #fff url(../img/text_align_left.png) no-repeat 5px 4px;
|
||||
color: #333;
|
||||
padding:2px 4px 2px 24px;
|
||||
height:22px;
|
||||
border: 1px solid #d9d9d9;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
background:#fff url(../img/text_align_left.png) no-repeat 5px 4px;
|
||||
color: #333;
|
||||
padding:4px 4px 2px 24px;
|
||||
border:1px solid #d9d9d9;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
input[type="password"] {
|
||||
background:#fff url(../img/password.png) no-repeat 5px 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
* BUTTONS
|
||||
*/
|
||||
input[type="button"],input[type="submit"],input[type="reset"] {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5) );
|
||||
background:-moz-linear-gradient( center top, #79bbff 5%, #378de5 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
|
||||
background-color:#79bbff;
|
||||
-moz-border-radius:5px;
|
||||
-webkit-border-radius:5px;
|
||||
border-radius:5px;
|
||||
display:inline-block;
|
||||
color:#ffffff;
|
||||
padding:2px 24px 2px 24px;
|
||||
text-decoration:none;
|
||||
text-shadow:1px 1px 0px #528ecc;
|
||||
margin: 0 5px;
|
||||
padding: 5px 14px;
|
||||
outline: 0;
|
||||
border: 0;
|
||||
background-color: #eee;
|
||||
min-width: 80px;
|
||||
height: 26px;
|
||||
margin: 0 3px 0 3px;
|
||||
background-image: none;
|
||||
border-width: 0px;
|
||||
}
|
||||
.loginsec input[type="button"], .loginsec input[type="submit"], .loginsec input[type="reset"] {
|
||||
margin: 0 1px;
|
||||
}
|
||||
input[type="button"]:hover,input[type="submit"]:hover,input[type="reset"]:hover {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff) );
|
||||
background:-moz-linear-gradient( center top, #378de5 5%, #79bbff 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff');
|
||||
background-color:#378de5;
|
||||
color: #333;
|
||||
background-color: #dcdcdc;
|
||||
}
|
||||
input[type="button"]:active,input[type="submit"]:active,input[type="reset"]:active {
|
||||
-webkit-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
|
||||
-moz-box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: inset 0 1px 8px rgba(0, 0, 0, 0.25);
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
input[type="submit"],input[class="yesbutton"] {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #9dce2c), color-stop(1, #8cb82b) );
|
||||
background:-moz-linear-gradient( center top, #9dce2c 5%, #8cb82b 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9dce2c', endColorstr='#8cb82b');
|
||||
background-color:#9dce2c;
|
||||
text-shadow:1px 1px 0px #aade7c;
|
||||
color: white;
|
||||
background-color: #35aa47;
|
||||
}
|
||||
input[type="submit"]:hover,input[class="yesbutton"]:hover {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #8cb82b), color-stop(1, #9dce2c) );
|
||||
background:-moz-linear-gradient( center top, #8cb82b 5%, #9dce2c 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8cb82b', endColorstr='#9dce2c');
|
||||
background-color:#8cb82b;
|
||||
color: white;
|
||||
background-color: #1d943b;
|
||||
}
|
||||
input[class="submit"]:active,input[class="yesbutton"]:active {
|
||||
background-color: #35aa47;
|
||||
}
|
||||
|
||||
input[class="nobutton"],input[type="reset"] {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #fe1a00), color-stop(1, #ce0100) );
|
||||
background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
|
||||
background-color:#fe1a00;
|
||||
text-shadow:1px 1px 0px #b23e35;
|
||||
color: white;
|
||||
background-color: #d84a38;
|
||||
}
|
||||
input[class="nobutton"]:hover,input[type="reset"]:hover {
|
||||
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ce0100), color-stop(1, #fe1a00) );
|
||||
background:-moz-linear-gradient( center top, #ce0100 5%, #fe1a00 100% );
|
||||
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ce0100', endColorstr='#fe1a00');
|
||||
background-color:#ce0100;
|
||||
color: white;
|
||||
background-color: #c53727;
|
||||
}
|
||||
input[class="nobutton"]:active,input[type="reset"]:active {
|
||||
background-color: #dd4b39;
|
||||
}
|
||||
|
||||
|
||||
input[type="checkbox"] {
|
||||
background:#dae7ee;
|
||||
padding: 0;
|
||||
margin: 0 20px 0 0;
|
||||
margin: 0 5px 0 0;
|
||||
vertical-align: middle;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
input[type="radio"] { /*the span element that immediately follow the radio button */
|
||||
input[type="radio"] {
|
||||
margin: 0 10px 0 10px;
|
||||
height:22px;
|
||||
}
|
||||
@@ -498,8 +502,21 @@ input[type="radio"] { /*the span element that immediately follow the radio butto
|
||||
select {
|
||||
background:#fff;
|
||||
padding:4px;
|
||||
color: #333;
|
||||
border:1px solid #d9d9d9;
|
||||
margin-bottom: 5px;
|
||||
min-width: 100px;
|
||||
}
|
||||
select.dropdown {
|
||||
padding: 2px 4px 2px 24px;
|
||||
height: 26px;
|
||||
border: 1px solid #d9d9d9;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 3px;
|
||||
background: url(../../../../templates/Sparkle/assets/img/icons/down.png) no-repeat 9px;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.maintable {
|
||||
@@ -529,3 +546,22 @@ select {
|
||||
margin-bottom:.5em;
|
||||
font-size:120%;
|
||||
}
|
||||
.installprogress {
|
||||
width: 100%;
|
||||
background-color:#e4e4e4;
|
||||
height:5px;
|
||||
border-bottom:1px solid #d1d5d8;
|
||||
}
|
||||
.installprogress .bar {
|
||||
background-color: #35aa47;
|
||||
height:5px;
|
||||
}
|
||||
|
||||
.red { color: #ff0000; }
|
||||
.green { color: green; }
|
||||
.orange { color: orange; }
|
||||
.blue { color: blue; }
|
||||
.install-block { width: 65%; }
|
||||
.install-step { width: 250px; }
|
||||
.install-h3 { text-align: center; }
|
||||
.install-text { margin: 20px 20px 0 !important; }
|
||||
|
||||
0
install/templates/assets/img/favicon.ico
Executable file → Normal file
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
install/templates/assets/img/logo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
BIN
install/templates/assets/img/password.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
0
install/templates/assets/img/text_align_left.png
Executable file → Normal file
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 198 B |
2
install/templates/dataform.tpl
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
<p style="margin: 20px 20px 0 !important">{$this->_lng['install']['title']}</p>
|
||||
<p class="install-text">{$this->_lng['install']['title']}</p>
|
||||
<form action="{$formaction}" method="get">
|
||||
<fieldset>
|
||||
{$formdata}
|
||||
|
||||
2
install/templates/dataform2.tpl
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
<p style="margin: 20px 20px 0 !important">{$this->_lng['install']['welcometext']}</p>
|
||||
<p class="install-text">{$this->_lng['install']['welcometext']}</p>
|
||||
<form action="{$formaction}" method="post">
|
||||
<hr class="line">
|
||||
<fieldset>
|
||||
|
||||
2
install/templates/dataitem.tpl
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" style="width:65%;{$style}">{$fieldlabel}:</label>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
|
||||
<input type="{$type}" name="{$fieldname}" id="{$fieldname}" value="{$fieldvalue}" {$required} />
|
||||
</p>
|
||||
|
||||
2
install/templates/dataitemchk.tpl
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" style="width:65%;{$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$this->_lng['install']['webserver']} {$fieldlabel}:</label>
|
||||
<input type="radio" name="webserver" id="{$fieldname}" value="{$fieldname}" {$checked} /><span>{$fieldlabel}<span>
|
||||
</p>
|
||||
|
||||
4
install/templates/dataitemyesno.tpl
Normal file
@@ -0,0 +1,4 @@
|
||||
<p>
|
||||
<label for="{$fieldname}" class="install-block {$style}">{$fieldlabel}:</label>
|
||||
<input type="checkbox" name="{$fieldname}" id="{$fieldname}" value="1" {$checked} />
|
||||
</p>
|
||||
0
install/templates/datasection.tpl
Executable file → Normal file
0
install/templates/footer.tpl
Executable file → Normal file
7
install/templates/header.tpl
Executable file → Normal file
@@ -3,16 +3,11 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Default-Style" content="text/css" />
|
||||
<!--[if lt IE 9]><script src="../js/html5shiv.js"></script><![endif]-->
|
||||
<!--[if lt IE 9]><script src="../js/html5shiv.min.js"></script><![endif]-->
|
||||
<link href="templates/assets/css/install.css" rel="stylesheet" type="text/css" />
|
||||
<!--[if IE]><link rel="stylesheet" href="../templates/{$theme}/css/main_ie.css" type="text/css" /><![endif]-->
|
||||
<link href="templates/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||
<title>Froxlor Server Management Panel - Installation</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="installsec">
|
||||
|
||||
14
install/templates/lngform.tpl
Executable file → Normal file
@@ -1,14 +1,20 @@
|
||||
<form action="{$formaction}" method="get">
|
||||
<fieldset>
|
||||
<legend>{$this->_lng['install']['lngtitle']}</legend>
|
||||
<p>
|
||||
<label for="language">{$this->_lng['install']['language']}:</label>
|
||||
<select name="language" id="language">
|
||||
<table class="noborder">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="language">{$this->_lng['install']['language']}:</label>
|
||||
</td>
|
||||
<td align="right">
|
||||
<select name="language" id="language" class="dropdown">
|
||||
{$language_options}
|
||||
</select>
|
||||
<input type="hidden" name="check" value="1" />
|
||||
<input type="submit" name="chooselang" value="{$this->_lng['install']['lngbtn_go']}" />
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
<hr class="line">
|
||||
0
install/templates/page.tpl
Executable file → Normal file
2
install/templates/pagebottom.tpl
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
<h3 style="color:{$msgcolor};text-align: center">{$message}</h3>
|
||||
<h3 class="install-h3 {$msgcolor}">{$message}</h3>
|
||||
<aside>
|
||||
<a href="{$link}">{$linktext}</a>
|
||||
</aside>
|
||||
|
||||
0
install/templates/textarea.tpl
Executable file → Normal file
@@ -1,124 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/**
|
||||
* tsmarty2c.php - rips gettext strings from smarty template
|
||||
*
|
||||
* ------------------------------------------------------------------------- *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Lesser General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2.1 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library 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 *
|
||||
* Lesser General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Lesser General Public *
|
||||
* License along with this library; if not, write to the Free Software *
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
||||
* ------------------------------------------------------------------------- *
|
||||
*
|
||||
* This command line script rips gettext strings from smarty file,
|
||||
* and prints them to stdout in C format, that can later be used with the
|
||||
* standard gettext tools.
|
||||
*
|
||||
* Usage:
|
||||
* ./tsmarty2c.php <filename or directory> <file2> <..> > smarty.c
|
||||
*
|
||||
* If a parameter is a directory, the template files within will be parsed.
|
||||
*
|
||||
* @package smarty-gettext
|
||||
* @version $Id: tsmarty2c.php,v 1.3 2005/07/27 17:59:39 sagi Exp $
|
||||
* @link http://smarty-gettext.sf.net/
|
||||
* @author Sagi Bashari <sagi@boom.org.il>
|
||||
* @copyright 2004-2005 Sagi Bashari
|
||||
*/
|
||||
|
||||
// smarty open tag
|
||||
$ldq = preg_quote('{');
|
||||
|
||||
// smarty close tag
|
||||
$rdq = preg_quote('}');
|
||||
|
||||
// smarty command
|
||||
$cmd = preg_quote('t');
|
||||
|
||||
// extensions of smarty files, used when going through a directory
|
||||
$extensions = array('tpl');
|
||||
|
||||
// "fix" string - strip slashes, escape and convert new lines to \n
|
||||
function fs($str)
|
||||
{
|
||||
$str = stripslashes($str);
|
||||
$str = str_replace('"', '\"', $str);
|
||||
$str = str_replace("\n", '\n', $str);
|
||||
return $str;
|
||||
}
|
||||
|
||||
// rips gettext strings from $file and prints them in C format
|
||||
function do_file($file)
|
||||
{
|
||||
$content = @file_get_contents($file);
|
||||
|
||||
if (empty($content)) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $ldq, $rdq, $cmd;
|
||||
|
||||
preg_match_all(
|
||||
"/{$ldq}\s*({$cmd})\s*([^{$rdq}]*){$rdq}([^{$ldq}]*){$ldq}\/\\1{$rdq}/",
|
||||
$content,
|
||||
$matches
|
||||
);
|
||||
|
||||
for ($i=0; $i < count($matches[0]); $i++) {
|
||||
// TODO: add line number
|
||||
echo "/* $file */\n"; // credit: Mike van Lammeren 2005-02-14
|
||||
|
||||
if (preg_match('/plural\s*=\s*["\']?\s*(.[^\"\']*)\s*["\']?/', $matches[2][$i], $match)) {
|
||||
echo 'ngettext("'.fs($matches[3][$i]).'","'.fs($match[1]).'",x);'."\n";
|
||||
} else {
|
||||
echo 'gettext("'.fs($matches[3][$i]).'");'."\n";
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// go through a directory
|
||||
function do_dir($dir)
|
||||
{
|
||||
$d = dir($dir);
|
||||
|
||||
while (false !== ($entry = $d->read())) {
|
||||
if ($entry == '.' || $entry == '..') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$entry = $dir.'/'.$entry;
|
||||
|
||||
if (is_dir($entry)) { // if a directory, go through it
|
||||
do_dir($entry);
|
||||
} else { // if file, parse only if extension is matched
|
||||
$pi = pathinfo($entry);
|
||||
|
||||
if (isset($pi['extension']) && in_array($pi['extension'], $GLOBALS['extensions'])) {
|
||||
do_file($entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$d->close();
|
||||
}
|
||||
|
||||
for ($ac=1; $ac < $_SERVER['argc']; $ac++) {
|
||||
if (is_dir($_SERVER['argv'][$ac])) { // go through directory
|
||||
do_dir($_SERVER['argv'][$ac]);
|
||||
} else { // do file
|
||||
do_file($_SERVER['argv'][$ac]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -15,14 +15,25 @@
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('AREA')
|
||||
|| (defined('AREA') && AREA != 'admin')
|
||||
|| !isset($userinfo['loginname'])
|
||||
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||
) {
|
||||
header('Location: ../../../index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$updateto = '0.9-r0';
|
||||
$frontend = 'froxlor';
|
||||
|
||||
showUpdateStep("Upgrading SysCP ".$settings['panel']['version']." to Froxlor ". $updateto, false);
|
||||
showUpdateStep("Upgrading SysCP ".Settings::Get('panel.version')." to Froxlor ". $updateto, false);
|
||||
updateToVersion($updateto);
|
||||
|
||||
// add field frontend
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel','frontend','".$frontend."')");
|
||||
$settings['panel']['frontend'] = $frontend;
|
||||
|
||||
?>
|
||||
Database::query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` SET
|
||||
`settinggroup` = 'panel',
|
||||
`varname` = 'frontend',
|
||||
`value` = 'froxlor'"
|
||||
);
|
||||
Settings::Set('panel.frontend', $frontend);
|
||||
|
||||
@@ -21,17 +21,18 @@
|
||||
* outputs various content before the update process
|
||||
* can be continued (askes for agreement whatever is being asked)
|
||||
*
|
||||
* @param string version
|
||||
* @param string $current_version
|
||||
* @param int $current_db_version
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getPreConfig($current_version)
|
||||
function getPreConfig($current_version, $current_db_version)
|
||||
{
|
||||
$has_preconfig = false;
|
||||
$return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>';
|
||||
$return = '<div class="preconfig"><h3 class="red">PLEASE NOTE - Important update notifications</h3>';
|
||||
|
||||
include_once makeCorrectFile(dirname(__FILE__).'/preconfig/0.9/preconfig_0.9.inc.php');
|
||||
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
|
||||
parseAndOutputPreconfig($has_preconfig, $return, $current_version, $current_db_version);
|
||||
|
||||
$return .= '<br /><br />'.makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
|
||||
$return .= '</div>';
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
{
|
||||
global $settings, $lng, $db, $theme;
|
||||
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $current_db_version) {
|
||||
|
||||
global $lng;
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
||||
{
|
||||
@@ -42,11 +42,11 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.6-svn2'))
|
||||
{
|
||||
if(!PHPMailer::ValidateAddress($settings['panel']['adminmail']))
|
||||
if(!PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
|
||||
$question = '<strong>Please specify a new admin-email address:</strong> <input type="text" class="text" name="update_adminmail" value="'.$settings['panel']['adminmail'].'" />';
|
||||
$question = '<strong>Please specify a new admin-email address:</strong> <input type="text" class="text" name="update_adminmail" value="'.Settings::Get('panel.adminmail').'" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
|
||||
$question = '<strong>Do you want to enable default error-documents?:</strong> ';
|
||||
$question .= makeyesno('update_deferr_enable', '1', '0', '0').'<br /><br />';
|
||||
if($settings['system']['webserver'] == 'apache2')
|
||||
if(Settings::Get('system.webserver') == 'apache2')
|
||||
{
|
||||
$question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />';
|
||||
$question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />';
|
||||
@@ -127,10 +127,9 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.7-svn2'))
|
||||
{
|
||||
$result = $db->query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||
$result = Database::query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
|
||||
$wrongOpenBasedirDomain = array();
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
|
||||
$wrongOpenBasedirDomain[] = $row['domain'];
|
||||
}
|
||||
|
||||
@@ -164,7 +163,9 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$has_nouser = false;
|
||||
$has_nogroup = false;
|
||||
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if(!isset($result) || !isset($result['value']))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
@@ -178,7 +179,9 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
}
|
||||
}
|
||||
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if(!isset($result) || !isset($result['value']))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
@@ -241,7 +244,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.12-svn1'))
|
||||
{
|
||||
if($settings['system']['mod_fcgid'] == 1)
|
||||
if(Settings::Get('system.mod_fcgid') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
|
||||
@@ -270,19 +273,19 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.12-svn4'))
|
||||
{
|
||||
if((int)$settings['system']['awstats_enabled'] == 1)
|
||||
if((int)Settings::Get('system.awstats_enabled') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
|
||||
$question = '<strong>Path to \'awstats.pl\'?:</strong> ';
|
||||
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.$settings['system']['awstats_path'].'" /><br />';
|
||||
$question.= '<input type="text" class="text" name="update_awstats_awstatspath" value="'.Settings::Get('system.awstats_path').'" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.13-svn1'))
|
||||
{
|
||||
if((int)$settings['autoresponder']['autoresponder_active'] == 1)
|
||||
if((int)Settings::Get('autoresponder.autoresponder_active') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor can now limit the number of autoresponder-entries for each user. Here you can set the value which will be available for each customer (Of course you can change the value for each customer separately after the update).';
|
||||
@@ -294,7 +297,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.13.1'))
|
||||
{
|
||||
if((int)$settings['system']['mod_fcgid_ownvhost'] == 1)
|
||||
if((int)Settings::Get('system.mod_fcgid_ownvhost') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'You have FCGID for Froxlor itself activated. You can now specify a PHP-configuration for this.';
|
||||
@@ -313,24 +316,24 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.14-svn3'))
|
||||
{
|
||||
if((int)$settings['system']['awstats_enabled'] == 1)
|
||||
if((int)Settings::Get('system.awstats_enabled') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'To have icons in AWStats statistic-pages please enter the path to AWStats icons folder.';
|
||||
$question = '<strong>Path to AWSTats icons folder:</strong> ';
|
||||
$question.= '<input type="text" class="text" name="update_awstats_icons" value="'.$settings['system']['awstats_icons'].'" />';
|
||||
$question.= '<input type="text" class="text" name="update_awstats_icons" value="'.Settings::Get('system.awstats_icons').'" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.14-svn4'))
|
||||
{
|
||||
if((int)$settings['system']['use_ssl'] == 1)
|
||||
if((int)Settings::Get('system.use_ssl') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now has the possibility to set \'SSLCertificateChainFile\' for the apache webserver.';
|
||||
$question = '<strong>Enter filename (leave empty for none):</strong> ';
|
||||
$question.= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="'.$settings['system']['ssl_cert_chainfile'].'" />';
|
||||
$question.= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="'.Settings::Get('system.ssl_cert_chainfile').'" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
@@ -387,7 +390,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.16-svn2'))
|
||||
{
|
||||
if((int)$settings['phpfpm']['enabled'] == 1)
|
||||
if((int)Settings::Get('phpfpm.enabled') == 1)
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
|
||||
@@ -395,9 +398,9 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question.= makeyesno('update_phpfpm_enabled_ownvhost', '1', '0', '0').'<br /><br />';
|
||||
$question.= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
|
||||
$question.= 'Local user: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpuser" value="'.$settings['system']['mod_fcgid_httpuser'].'" /><br /><br />';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpuser" value="'.Settings::Get('system.mod_fcgid_httpuser').'" /><br /><br />';
|
||||
$question.= 'Local group: ';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="'.$settings['system']['mod_fcgid_httpgroup'].'" /><br />';
|
||||
$question.= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="'.Settings::Get('system.mod_fcgid_httpgroup').'" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
@@ -437,7 +440,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$description = 'This version introduces a lot of profound changes:';
|
||||
$description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
|
||||
$description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
|
||||
$description .= 'Even though this is already tested, we <span style="color:#ff0000;font-weight:bold;">strongly recommend</span> to ';
|
||||
$description .= 'Even though this is already tested, we <span class="red">strongly recommend</span> to ';
|
||||
$description .= 'test this update in a testing environment using your existing data.<br /><br />';
|
||||
|
||||
$question = '<strong>Select your preferred Classic Theme replacement:</strong> ';
|
||||
@@ -454,7 +457,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-svn6')) {
|
||||
|
||||
if ($settings['system']['webserver'] == 'apache2') {
|
||||
if (Settings::Get('system.webserver') == 'apache2') {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.<br />';
|
||||
$description.= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
|
||||
@@ -462,7 +465,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong> ';
|
||||
$question.= makeyesno('update_system_apache24', '1', '0', '0');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
} elseif ($settings['system']['webserver'] == 'nginx') {
|
||||
} elseif (Settings::Get('system.webserver') == 'nginx') {
|
||||
$has_preconfig = true;
|
||||
$description = 'The path to nginx\'s fastcgi_params file is now customizable.<br /><br />';
|
||||
$question = '<strong>Please enter full path to you nginx/fastcgi_params file (including filename):</strong> ';
|
||||
@@ -491,8 +494,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$description = 'Froxlor changed the default parameter-set of sendmail (php.ini)<br />';
|
||||
$description .= 'sendmail_path = "/usr/sbin/sendmail -t <strong>-i</strong> -f {CUSTOMER_EMAIL}"<br /><br />';
|
||||
$description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
|
||||
if ($settings['system']['mod_fcgid'] == '1'
|
||||
|| $settings['phpfpm']['enabled'] == '1'
|
||||
if (Settings::Get('system.mod_fcgid') == '1'
|
||||
|| Settings::Get('phpfpm.enabled') == '1'
|
||||
) {
|
||||
// information about removal of php's safe_mode
|
||||
$description .= '<br /><br />The php safe_mode flag has been removed as current versions of PHP<br />';
|
||||
@@ -506,8 +509,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev1')) {
|
||||
// we only need to ask if fcgid|php-fpm is enabled
|
||||
if ($settings['system']['mod_fcgid'] == '1'
|
||||
|| $settings['phpfpm']['enabled'] == '1'
|
||||
if (Settings::Get('system.mod_fcgid') == '1'
|
||||
|| Settings::Get('phpfpm.enabled') == '1'
|
||||
) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Standard-subdomains can now be hidden from the php-configuration overview.<br />';
|
||||
@@ -538,7 +541,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$has_preconfig = true;
|
||||
$description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored<br />';
|
||||
$question = '<strong>Specify the directory for customer ssl-certificates:</strong> ';
|
||||
$question.= '<input type="text" class="text" name="system_customersslpath" value="/etc/apache2/ssl/" />';
|
||||
$question.= '<input type="text" class="text" name="system_customersslpath" value="/etc/ssl/froxlor-custom/" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
@@ -552,13 +555,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
// let the apache+fpm users know that they MUST change their config
|
||||
// for the domains / webserver to work after the update
|
||||
if (versionInUpdate($current_version, '0.9.30-dev1')) {
|
||||
if ($settings['system']['webserver'] == 'apache2'
|
||||
&& $settings['phpfpm']['enabled'] == '1'
|
||||
if (Settings::Get('system.webserver') == 'apache2'
|
||||
&& Settings::Get('phpfpm.enabled') == '1'
|
||||
) {
|
||||
$has_preconfig = true;
|
||||
$description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
|
||||
$description .= '<pre style="width:500px;border:1px solid #ccc;padding:4px;"><IfModule mod_fastcgi.c>
|
||||
FastCgiIpcDir /var/run/apache2/
|
||||
$description .= '<pre class="code-block"><IfModule mod_fastcgi.c>
|
||||
FastCgiIpcDir /var/lib/apache2/fastcgi/
|
||||
<Location "/fastcgiphp">
|
||||
Order Deny,Allow
|
||||
Deny from All
|
||||
@@ -570,4 +573,139 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev2')) {
|
||||
if (Settings::Get('system.webserver') == 'apache2'
|
||||
&& Settings::Get('phpfpm.enabled') == '1'
|
||||
) {
|
||||
$has_preconfig = true;
|
||||
$description = 'The FPM socket directory is now a setting in froxlor. Its default is <b>/var/lib/apache2/fastcgi/</b>.<br/>If you are using <b>/var/run/apache2</b> in the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) please correct this path accordingly<br />';
|
||||
$question = '';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev4')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'The template-variable {PASSWORD} has been replaced with {LINK}. Please update your password reset templates!<br />';
|
||||
$question = '';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-dev5')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable error-reporting for admins and customers!<br /><br />';
|
||||
$question = '<strong>Do you want to enable error-reporting for admins? (default: yes):</strong> ';
|
||||
$question.= makeyesno('update_error_report_admin', '1', '0', '1').'<br />';
|
||||
$question.= '<strong>Do you want to enable error-reporting for customers? (default: no):</strong> ';
|
||||
$question.= makeyesno('update_error_report_customer', '1', '0', '0');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.31-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the display/usage of the news-feed for admins<br /><br />';
|
||||
$question = '<strong>Do you want to enable the news-feed for admins? (default: yes):</strong> ';
|
||||
$question.= makeyesno('update_admin_news_feed', '1', '0', '1').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly<br /><br />';
|
||||
$question = '<strong>Do you want to enable the traffic collection for mail? (default: yes):</strong> ';
|
||||
$question.= makeyesno('mailtraffic_enabled', '1', '0', '1').'<br />';
|
||||
$question.= '<strong>Mail Transfer Agent</strong><br />';
|
||||
$question.= 'Type of your MTA: ';
|
||||
$question.= '<select name="mtaserver">';
|
||||
$question.= makeoption('Postfix', 'postfix', 'postfix');
|
||||
$question.= makeoption('Exim4', 'exim4', 'postfix');
|
||||
$question.= '</select><br />';
|
||||
$question.= 'Logfile for your MTA: ';
|
||||
$question.= '<input type="text" class="text" name="mtalog" value="/var/log/mail.log" /><br />';
|
||||
$question.= '<strong>Mail Delivery Agent</strong><br />';
|
||||
$question.= 'Type of your MDA: ';
|
||||
$question.= '<select name="mdaserver">';
|
||||
$question.= makeoption('Dovecot', 'dovecot', 'dovecot');
|
||||
$question.= makeoption('Courier', 'courier', 'dovecot');
|
||||
$question.= '</select><br /><br />';
|
||||
$question.= 'Logfile for your MDA: ';
|
||||
$question.= '<input type="text" class="text" name="mdalog" value="/var/log/mail.log" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev5')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)<br /><br />';
|
||||
$question = '<strong>Path to the cron-service configuration-file.</strong> This file will be updated regularly and automatically by froxlor.<br />Note: please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!<br />';
|
||||
$question.= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-dev6')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.<br /><br />';
|
||||
$question = '<strong>Please specify the reload-command of your cron-daemon</strong> (default: /etc/init.d/cron reload)<br />';
|
||||
$question.= '<input type="text" class="text" name="crondreload" value="/etc/init.d/cron reload" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.32-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
|
||||
$question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
|
||||
$question.= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-dev1')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the display/usage of the custom newsfeed for customers.<br /><br />';
|
||||
$question = '<strong>Do you want to enable the custom newsfeed for customer? (default: no):</strong> ';
|
||||
$question.= makeyesno('customer_show_news_feed', '1', '0', '0').'<br />';
|
||||
$question.= '<strong>You have to set the URL for your RSS-feed here, if you have chosen to enable the custom newsfeed on the customer-dashboard:</strong> ';
|
||||
$question.= '<input type="text" class="text" name="customer_news_feed_url" value="" /><br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-dev2')) {
|
||||
// only if bind is used - if not the default will be set, which is '0' (off)
|
||||
if (Settings::get('system.bind_enable') == 1) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.<br /><br />';
|
||||
$question = '<strong>Do you want to generate a bind-zone for the system-hostname? (default: no):</strong> ';
|
||||
$question.= makeyesno('dns_createhostnameentry', '1', '0', '0').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.33-rc2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.<br /><br />';
|
||||
$question = '<strong>Do you want to receive cron-errors via mail? (default: no):</strong> ';
|
||||
$question.= makeyesno('system_send_cron_errors', '1', '0', '0').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.34-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases';
|
||||
$question = '<strong>PHP mbstring</strong> is currently: ';
|
||||
if (!extension_loaded('mbstring')) {
|
||||
$question .= '<span class="red">not installed/loaded</span>';
|
||||
$question .= '<br>Please install the PHP mbstring extension in order to finish the update';
|
||||
} else {
|
||||
$question .= '<span class="green">installed/loaded</span>';
|
||||
}
|
||||
$question .= '<br>';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_db_version, '201603070')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can chose whether you want to enable or disable our Let\'s Encrypt implementation.<br />Please remember that you need to go through the webserver-configuration when enabled because this feature needs a special configuration.<br /><br />';
|
||||
$question = '<strong>Do you want to enable Let\'s Encrypt? (default: yes):</strong> ';
|
||||
$question.= makeyesno('enable_letsencrypt', '1', '0', '1').'<br />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +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 Install
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* We need those defines, because the tables.inc.php doesn't have them.
|
||||
*/
|
||||
|
||||
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
||||
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
||||
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
||||
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
||||
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
||||
|
||||
if($settings['panel']['version'] == '1.0.10')
|
||||
{
|
||||
// Drop/Rename postfix_ tables
|
||||
|
||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_POSTFIX_TRANSPORT . "`");
|
||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` RENAME `" . TABLE_MAIL_USERS . "` ");
|
||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` RENAME `" . TABLE_MAIL_VIRTUAL . "` ");
|
||||
|
||||
// Rename proftpd_ tables
|
||||
|
||||
$db->query("ALTER TABLE `" . TABLE_PROFTPD_USERS . "` RENAME `" . TABLE_FTP_USERS . "` ");
|
||||
$db->query("ALTER TABLE `" . TABLE_PROFTPD_GROUPS . "` RENAME `" . TABLE_FTP_GROUPS . "` ");
|
||||
|
||||
// Adding tables
|
||||
|
||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_HTACCESS . "`;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_HTACCESS . "` (" . " `id` int(11) unsigned NOT NULL auto_increment," . " `customerid` int(11) unsigned NOT NULL default '0'," . " `path` varchar(255) NOT NULL default ''," . " `options_indexes` tinyint(1) NOT NULL default '0'," . " PRIMARY KEY (`id`)" . ") ENGINE=MyISAM ;");
|
||||
$db->query("DROP TABLE IF EXISTS `" . TABLE_PANEL_ADMINS . "`;");
|
||||
$db->query("CREATE TABLE `" . TABLE_PANEL_ADMINS . "` (" . " `adminid` int(11) unsigned NOT NULL auto_increment," . " `loginname` varchar(50) NOT NULL default ''," . " `password` varchar(50) NOT NULL default ''," . " `name` varchar(255) NOT NULL default ''," . " `email` varchar(255) NOT NULL default ''," . " `customers` int(15) NOT NULL default '0'," . " `customers_used` int(15) NOT NULL default '0'," . " `customers_see_all` tinyint(1) NOT NULL default '0'," . " `domains` int(15) NOT NULL default '0'," . " `domains_used` int(15) NOT NULL default '0'," . " `domains_see_all` tinyint(1) NOT NULL default '0'," . " `change_serversettings` tinyint(1) NOT NULL default '0'," . " `diskspace` int(15) NOT NULL default '0'," . " `diskspace_used` int(15) NOT NULL default '0'," . " `mysqls` int(15) NOT NULL default '0'," . " `mysqls_used` int(15) NOT NULL default '0'," . " `emails` int(15) NOT NULL default '0'," . " `emails_used` int(15) NOT NULL default '0'," . " `email_forwarders` int(15) NOT NULL default '0'," . " `email_forwarders_used` int(15) NOT NULL default '0'," . " `ftps` int(15) NOT NULL default '0'," . " `ftps_used` int(15) NOT NULL default '0'," . " `subdomains` int(15) NOT NULL default '0'," . " `subdomains_used` int(15) NOT NULL default '0'," . " `traffic` int(15) NOT NULL default '0'," . " `traffic_used` int(15) NOT NULL default '0'," . " `deactivated` tinyint(1) NOT NULL default '0'," . " `lastlogin_succ` int(11) unsigned NOT NULL default '0'," . " `lastlogin_fail` int(11) unsigned NOT NULL default '0'," . " `loginfail_count` int(11) unsigned NOT NULL default '0'," . " PRIMARY KEY (`adminid`)" . ") ENGINE=MyISAM ;");
|
||||
|
||||
// Insert Admin user
|
||||
|
||||
if(!isset($adminusername)
|
||||
|| $adminusername == '')
|
||||
{
|
||||
$adminusername = 'admin';
|
||||
$adminpassword = 'admin';
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` (`loginname`, `password`, `name`, `email`, `customers`, `customers_used`, `customers_see_all`, `domains`, `domains_used`, `domains_see_all`, `change_serversettings`, `diskspace`, `diskspace_used`, `mysqls`, `mysqls_used`, `emails`, `emails_used`, `email_forwarders`, `email_forwarders_used`, `ftps`, `ftps_used`, `subdomains`, `subdomains_used`, `traffic`, `traffic_used`, `deactivated`) VALUES ('" . $db->escape($adminusername) . "', '" . md5($adminpassword) . "', 'Siteadmin', 'admin@servername', -1, 0, 1, -1, 0, 1, 1, -1024, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1048576, 0, 0);");
|
||||
|
||||
// Alter Tables
|
||||
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_succ` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `lastlogin_fail` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `loginfail_count` INT( 11 ) UNSIGNED NOT NULL ;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD INDEX ( `adminid` ) ;");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `adminid` = '1'");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `adminid` INT( 11 ) UNSIGNED NOT NULL ," . "ADD `iswildcarddomain` TINYINT( 1 ) NOT NULL ," . "ADD `speciallogfile` TINYINT( 1 ) NOT NULL ;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD INDEX ( `adminid` ) ;");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `adminid` = '1'");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` CHANGE `customerid` `userid` INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL ");
|
||||
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` CHANGE `password` `password_enc` VARCHAR( 128 ) NOT NULL ");
|
||||
$db->query("ALTER TABLE `" . TABLE_MAIL_USERS . "` ADD `password` VARCHAR( 128 ) NOT NULL AFTER `email` ;");
|
||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (24, 'login', 'maxloginattempts', '3');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (25, 'login', 'deactivatetime', '900');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (26, 'panel', 'webmail_url', '');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (27, 'panel', 'webftp_url', '');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (28, 'panel', 'standardlanguage', 'german');");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname`='ipaddress' WHERE `settinggroup`='system' AND `varname`='ipadress'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.2.0' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.2.0';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,132 +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 Install
|
||||
*
|
||||
*/
|
||||
|
||||
define('TABLE_POSTFIX_TRANSPORT', 'postfix_transport');
|
||||
define('TABLE_POSTFIX_USERS', 'postfix_users');
|
||||
define('TABLE_POSTFIX_VIRTUAL', 'postfix_virtual');
|
||||
define('TABLE_PROFTPD_GROUPS', 'proftpd_groups');
|
||||
define('TABLE_PROFTPD_USERS', 'proftpd_users');
|
||||
|
||||
if(!isset($settings['panel']['version']))
|
||||
{
|
||||
$settings['panel']['version'] = '1.0.0';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.0')
|
||||
{
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (22, 'panel', 'version', '1.0.1')");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `openbasedir` TINYINT( 1 ) NOT NULL , ADD `safemode` TINYINT( 1 ) NOT NULL");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `openbasedir`='1', `safemode`='1'");
|
||||
$settings['panel']['version'] = '1.0.1';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.1')
|
||||
{
|
||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_USERS . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `postfix`");
|
||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `domainid` INT( 11 ) NOT NULL AFTER `destination`");
|
||||
$result = $db->query("SELECT `id`, `domain` FROM `" . TABLE_PANEL_DOMAINS . "`");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_POSTFIX_USERS . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `domainid`='" . (int)$row['id'] . "' WHERE `email` LIKE '%@" . $db->escape($row['domain']) . "'");
|
||||
}
|
||||
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `createstdsubdomain` TINYINT( 1 ) NOT NULL AFTER `documentroot`");
|
||||
inserttask('1');
|
||||
inserttask('4');
|
||||
$hostname = explode('@', $settings['panel']['adminmail']);
|
||||
$hostname = $hostname[1];
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (23, 'system', 'hostname', '" . $db->escape($hostname) . "')");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.2' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.2';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.2')
|
||||
{
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_SESSIONS . "` ADD `language` VARCHAR( 64 ) NOT NULL AFTER `lastactivity` ;");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.3' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.3';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.3')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.4' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.4';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.4')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.5' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.5';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.5')
|
||||
{
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `deactivated` TINYINT( 1 ) NOT NULL ;");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.6' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.6';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.6')
|
||||
{
|
||||
$db->query("ALTER TABLE `" . TABLE_POSTFIX_VIRTUAL . "` ADD `popaccountid` INT( 11 ) NOT NULL ;");
|
||||
$result = $db->query("SELECT `id`, `email` FROM `" . TABLE_POSTFIX_USERS . "`");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `popaccountid`='" . (int)$row['id'] . "' WHERE `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' AND `destination` = '" . $db->escape($row['email']) . "'");
|
||||
}
|
||||
|
||||
$result = $db->query("SELECT `id`, `email`, `destination` FROM `" . TABLE_POSTFIX_VIRTUAL . "` WHERE `popaccountid` = '0'");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(str_replace($settings['email']['catchallkeyword'], '', $row['email']) != $row['email'])
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_POSTFIX_VIRTUAL . "` SET `email` = '" . $db->escape(str_replace($settings['email']['catchallkeyword'], '', $row['email'])) . "' WHERE `id` = '" . (int)$row['id'] . "'");
|
||||
}
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.7' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.7';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.7')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.8' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.8';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.8')
|
||||
{
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DATABASES . "` DROP `password` ;");
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_DOMAINS . "` ADD `specialsettings` TEXT NOT NULL AFTER `safemode` ;");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.9' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.9';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.0.9')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='1.0.10' WHERE `settinggroup`='panel' AND `varname`='version'");
|
||||
$settings['panel']['version'] = '1.0.10';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,120 +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 Install
|
||||
*
|
||||
*/
|
||||
|
||||
if($settings['panel']['version'] == '1.4')
|
||||
{
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4 to 1.4-svn1");
|
||||
|
||||
// Going to fix the stuff the update 1.2.19-svn42 to 1.2.19-svn43 broke
|
||||
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `documentroot` LIKE 'http%';");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(preg_match("#(https?)://?(.*)#i", $row['documentroot'], $matches))
|
||||
{
|
||||
$row['documentroot'] = $matches[1] . "://" . $matches[2];
|
||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot` = '" . $db->escape($row['documentroot']) . "' WHERE `id` = '" . $row['id'] . "';");
|
||||
}
|
||||
}
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'1.4-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = '1.4-svn1';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.4-svn1')
|
||||
{
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4-svn1 to 1.4.1");
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'1.4.1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = '1.4.1';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.4.1')
|
||||
{
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.4.1 to 1.4.1-svn1");
|
||||
|
||||
// give at least ONE admin the permission to edit phpsettings, bug #1031
|
||||
|
||||
$cntCanEditPHP = $db->query_first("SELECT COUNT(`caneditphpsettings`) as `cnt` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `caneditphpsettings` = '1'");
|
||||
|
||||
if($cntCanEditPHP['cnt'] <= 0)
|
||||
{
|
||||
// none of the admins can edit php-settings,
|
||||
//so we give those who can edit serversettings the right to edit php-settings
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `caneditphpsettings` = '1' WHERE `change_serversettings` = '1'");
|
||||
}
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'1.4.1-svn1\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = '1.4.1-svn1';
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.4.1-svn1')
|
||||
{
|
||||
$updateto = '1.4.1-svn2';
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = $updateto;
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.4.1-svn2')
|
||||
{
|
||||
$updateto = '1.4.1-svn3';
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = $updateto;
|
||||
}
|
||||
|
||||
if($settings['panel']['version'] == '1.4.1-svn3')
|
||||
{
|
||||
$updateto = '1.4.2';
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from " . $settings['panel']['version'] . " to " . $updateto);
|
||||
|
||||
// set new version
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'' . $updateto . '\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
$settings['panel']['version'] = $updateto;
|
||||
}
|
||||
|
||||
?>
|
||||