Compare commits
381 Commits
0.9.27-rc1
...
0.9.29
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23361e64bb | ||
|
|
b5a999ae6b | ||
|
|
2432b7c466 | ||
|
|
075e18def3 | ||
|
|
cce4bd36ef | ||
|
|
d61fe9e0c0 | ||
|
|
daf94c6ec9 | ||
|
|
77143c7de0 | ||
|
|
ed2949bd21 | ||
|
|
427f862dac | ||
|
|
c97b3f3e0c | ||
|
|
e50e9cbd8d | ||
|
|
d90af956de | ||
|
|
ef688bd0c0 | ||
|
|
022b83d881 | ||
|
|
14bd4c927b | ||
|
|
6bfec9dc40 | ||
|
|
60ddcc221c | ||
|
|
c11460cfcc | ||
|
|
a181954864 | ||
|
|
dc57eb1394 | ||
|
|
a33b3b3fd9 | ||
|
|
e4a4755ed0 | ||
|
|
ab8975ccc3 | ||
|
|
d4d02bfa7d | ||
|
|
fbb4c81e53 | ||
|
|
6d06187df4 | ||
|
|
1870a88f6b | ||
|
|
d02c739640 | ||
|
|
26326937b1 | ||
|
|
3267cdfda7 | ||
|
|
b7a4b69ee0 | ||
|
|
69e2c7dee1 | ||
|
|
7589e7a21b | ||
|
|
272de00af2 | ||
|
|
ff66f62831 | ||
|
|
68fb822160 | ||
|
|
c00edd399e | ||
|
|
a75dad35dd | ||
|
|
d4e79911cb | ||
|
|
44cfa99c5c | ||
|
|
9b60dc09ea | ||
|
|
04e1ade0d2 | ||
|
|
05399ce53e | ||
|
|
3ef481763c | ||
|
|
f842e69d81 | ||
|
|
de09d3dd5f | ||
|
|
1793873bbb | ||
|
|
fb04e99dcb | ||
|
|
817966f4ea | ||
|
|
d9e7cd349b | ||
|
|
95061ecf77 | ||
|
|
188f189d74 | ||
|
|
15ff558d5f | ||
|
|
6bde0820c6 | ||
|
|
21aabb154d | ||
|
|
a3ee1430ac | ||
|
|
fc4a93ff6e | ||
|
|
d595aea7a6 | ||
|
|
9ec659be5b | ||
|
|
cf515ef8be | ||
|
|
7d49a76c32 | ||
|
|
8e20d5214b | ||
|
|
537bad3926 | ||
|
|
dee238d6bd | ||
|
|
fedb513c29 | ||
|
|
435f4a189a | ||
|
|
ff218168b9 | ||
|
|
043422b101 | ||
|
|
a1ff131fd6 | ||
|
|
fb9ed8b7da | ||
|
|
42b201c54d | ||
|
|
14e9b81995 | ||
|
|
2d54fb8187 | ||
|
|
d234abc19c | ||
|
|
db8f2a767d | ||
|
|
90ea8cfc1b | ||
|
|
257444558f | ||
|
|
fe638b5f52 | ||
|
|
e8096b1cb6 | ||
|
|
54fc4758d9 | ||
|
|
2d6d3349cf | ||
|
|
ee45bd9f14 | ||
|
|
9665fe8c1f | ||
|
|
10d1b8063d | ||
|
|
1f0a2ca358 | ||
|
|
a7687659cc | ||
|
|
016ae12884 | ||
|
|
f6a729df87 | ||
|
|
413461364d | ||
|
|
c14b18ab39 | ||
|
|
febb8e37bc | ||
|
|
84d87adb9b | ||
|
|
ed151d5fd8 | ||
|
|
b93bb806f6 | ||
|
|
fb4c809ba4 | ||
|
|
fe1ad85d29 | ||
|
|
7a69cf73ba | ||
|
|
f2d10046b6 | ||
|
|
ce9c8a766f | ||
|
|
82973267f3 | ||
|
|
7adc2dd35c | ||
|
|
1ae7876e44 | ||
|
|
e97a7c611c | ||
|
|
0001c30a5d | ||
|
|
d51977af65 | ||
|
|
e29068f0d8 | ||
|
|
8f127e4769 | ||
|
|
802d59670c | ||
|
|
3d246d7926 | ||
|
|
25b4826395 | ||
|
|
65b3d536b6 | ||
|
|
5e91e98450 | ||
|
|
39d30644db | ||
|
|
df56cc45fe | ||
|
|
fb045c3fe1 | ||
|
|
271e4a660b | ||
|
|
1c0937f29b | ||
|
|
79b2adea16 | ||
|
|
6da6915cac | ||
|
|
e9f3e617c7 | ||
|
|
9af43854d9 | ||
|
|
8211a73c15 | ||
|
|
eb843c5f31 | ||
|
|
9cac851ab6 | ||
|
|
090d4a6835 | ||
|
|
3f738f6ecd | ||
|
|
fbaafafdca | ||
|
|
900df7127c | ||
|
|
350e1b2d2d | ||
|
|
b0449165f9 | ||
|
|
95efc2f3a7 | ||
|
|
faa8169964 | ||
|
|
e96461bd4c | ||
|
|
67ec8861d7 | ||
|
|
551c1616f5 | ||
|
|
3d79564fd2 | ||
|
|
8c8cbc74cf | ||
|
|
da516ed615 | ||
|
|
ab410cc91e | ||
|
|
93f320ed6d | ||
|
|
8016bd4ed0 | ||
|
|
c4879519fb | ||
|
|
66e7e8323b | ||
|
|
4e41fd84fe | ||
|
|
a8681b1e7b | ||
|
|
a903455ee0 | ||
|
|
c986c08cfb | ||
|
|
a9941fe0a4 | ||
|
|
1fa04c668d | ||
|
|
cce3c0fde3 | ||
|
|
d5997d5772 | ||
|
|
f2ecf74d41 | ||
|
|
6a16940aa0 | ||
|
|
4675bfe2b9 | ||
|
|
3587f6d119 | ||
|
|
ed3fc0208c | ||
|
|
acfe8a40b7 | ||
|
|
d5fd89beb7 | ||
|
|
faada48e38 | ||
|
|
236ba6abfb | ||
|
|
2912d0ec4c | ||
|
|
50327e2df6 | ||
|
|
d3e902ac63 | ||
|
|
71544ccc40 | ||
|
|
74c5d0718c | ||
|
|
cbc745ff72 | ||
|
|
eaba3c783a | ||
|
|
8db5e40661 | ||
|
|
3895c30ffa | ||
|
|
1a9c5f162f | ||
|
|
a071811dd0 | ||
|
|
c0322b39f1 | ||
|
|
ca7a91d4cf | ||
|
|
4d0dfb1c88 | ||
|
|
c6477f345f | ||
|
|
c7eccd6086 | ||
|
|
877add851b | ||
|
|
b5fb0da98f | ||
|
|
3ed063dd5c | ||
|
|
7733b1e625 | ||
|
|
66e6a21f77 | ||
|
|
e8c833e16d | ||
|
|
8d7c858931 | ||
|
|
deee18a7a1 | ||
|
|
69e785b5fe | ||
|
|
2897b0374c | ||
|
|
9b56b0c29d | ||
|
|
47481aab56 | ||
|
|
4b872399ac | ||
|
|
a76b064a56 | ||
|
|
db81594404 | ||
|
|
56cc714c2a | ||
|
|
e1e11061c6 | ||
|
|
2a48c2b598 | ||
|
|
b84bd2017c | ||
|
|
be11f81af4 | ||
|
|
d9ebd7a3f9 | ||
|
|
e6816c12ef | ||
|
|
a048cd96b1 | ||
|
|
f1e7c09d96 | ||
|
|
caf60c6f85 | ||
|
|
bd3661d1d4 | ||
|
|
011c27101c | ||
|
|
3b1be99814 | ||
|
|
12e57c5f10 | ||
|
|
cb6db7385a | ||
|
|
debdbf5d41 | ||
|
|
2c41ea48c1 | ||
|
|
e7a0508989 | ||
|
|
f88c93a301 | ||
|
|
92aea9d27e | ||
|
|
447f61ba78 | ||
|
|
747b01d141 | ||
|
|
de89a07970 | ||
|
|
95faab4a82 | ||
|
|
bbb44bc857 | ||
|
|
59e65b445f | ||
|
|
6b1a4ce84d | ||
|
|
09e765ba13 | ||
|
|
afd16138e4 | ||
|
|
d9ac3b535e | ||
|
|
cebd5ccf56 | ||
|
|
7289ec1459 | ||
|
|
204d539041 | ||
|
|
0aa6b8ceb8 | ||
|
|
8b9bc44279 | ||
|
|
0c471639b1 | ||
|
|
9061bfd9a3 | ||
|
|
177e8cf064 | ||
|
|
bfcd824799 | ||
|
|
d7eef7a8b2 | ||
|
|
519db12a85 | ||
|
|
bb3716c03e | ||
|
|
5612fb1c8d | ||
|
|
4155fdfd4b | ||
|
|
648f52a262 | ||
|
|
e530e53dcb | ||
|
|
123cc1336e | ||
|
|
f8e9bf9424 | ||
|
|
3657cf7cc6 | ||
|
|
6b9e6bd842 | ||
|
|
39508ca717 | ||
|
|
59c65db070 | ||
|
|
48f2c7833d | ||
|
|
3f41b6d716 | ||
|
|
ede92f3065 | ||
|
|
2e1f282a94 | ||
|
|
06db6dad72 | ||
|
|
0622eca98e | ||
|
|
0c383eac50 | ||
|
|
08bd5f7041 | ||
|
|
9ea0839426 | ||
|
|
ec537625a5 | ||
|
|
30b185825c | ||
|
|
10cda9f5a9 | ||
|
|
bd890e8ebe | ||
|
|
24fb46b3d7 | ||
|
|
8994029b3e | ||
|
|
fc91683f5f | ||
|
|
76355f5617 | ||
|
|
188e80ab2e | ||
|
|
ec032c7a15 | ||
|
|
79ae6da6b5 | ||
|
|
977b887e6b | ||
|
|
2f1bbf7055 | ||
|
|
86457e7a93 | ||
|
|
e6a30edd0b | ||
|
|
e2700ce91d | ||
|
|
251a2ebd96 | ||
|
|
11e33d855b | ||
|
|
dcfe3493a2 | ||
|
|
65cdb2def0 | ||
|
|
7d0ae7ebd2 | ||
|
|
2bb7ac9e06 | ||
|
|
7ba4e6e066 | ||
|
|
19095cb3ae | ||
|
|
d196b0b5c8 | ||
|
|
5a276dbf8d | ||
|
|
733cb43f1c | ||
|
|
78f286cbda | ||
|
|
3655055030 | ||
|
|
26d93f6308 | ||
|
|
f6d47fe96c | ||
|
|
a91e7009db | ||
|
|
c9a93e95aa | ||
|
|
084069aaf4 | ||
|
|
d006c7ecac | ||
|
|
63057fe0ac | ||
|
|
9a406e8cec | ||
|
|
36f8e50453 | ||
|
|
a7689f5a28 | ||
|
|
92e4e2d826 | ||
|
|
8ce991a249 | ||
|
|
8ab8bc0b42 | ||
|
|
861376b2a2 | ||
|
|
a45b231a7f | ||
|
|
d9a28d197e | ||
|
|
e1a0cca5cc | ||
|
|
7ac1240640 | ||
|
|
b8f1118bbc | ||
|
|
022d21054c | ||
|
|
68308c4fca | ||
|
|
f575e94ddb | ||
|
|
26849f89d1 | ||
|
|
efacd85fdd | ||
|
|
e4c1bacb6e | ||
|
|
823a09da85 | ||
|
|
a9dfdb7432 | ||
|
|
1943747594 | ||
|
|
31e24050bf | ||
|
|
b1df344390 | ||
|
|
601bf68d09 | ||
|
|
6d0d1ae015 | ||
|
|
dc558f096a | ||
|
|
38b7d46596 | ||
|
|
607cbded7d | ||
|
|
e160ff58ba | ||
|
|
5b15de8e9a | ||
|
|
b8fefe6020 | ||
|
|
cac5f7a204 | ||
|
|
da186c0505 | ||
|
|
437a92d0b5 | ||
|
|
7f7bf62d95 | ||
|
|
68d4264d84 | ||
|
|
46e788f875 | ||
|
|
f0ba09dd93 | ||
|
|
9a5b52f609 | ||
|
|
288d29de7a | ||
|
|
35a59e9f31 | ||
|
|
1c3690a882 | ||
|
|
72cefb38db | ||
|
|
432e898318 | ||
|
|
f7754e2845 | ||
|
|
0a79ef4e30 | ||
|
|
30d06584c5 | ||
|
|
bb315b783f | ||
|
|
e7c11bfe5f | ||
|
|
7a4ce63b75 | ||
|
|
07e879a9f8 | ||
|
|
80c4fdeb79 | ||
|
|
1f281a2a9a | ||
|
|
a6c5592541 | ||
|
|
938b6ebf52 | ||
|
|
f5bc81faca | ||
|
|
d89856fac0 | ||
|
|
40d68df86b | ||
|
|
a2c49c3071 | ||
|
|
42b9964e9c | ||
|
|
f4738818e6 | ||
|
|
12d137aac4 | ||
|
|
f957a0a04e | ||
|
|
4f5186f97c | ||
|
|
8f4f0b106b | ||
|
|
06e672ca2a | ||
|
|
3119cb01bc | ||
|
|
3577fa6d5d | ||
|
|
b5556d4f93 | ||
|
|
cc6b05840f | ||
|
|
0d392d64b2 | ||
|
|
173e40b0e4 | ||
|
|
1e68766b54 | ||
|
|
5181f1d801 | ||
|
|
7ca68a3490 | ||
|
|
6d79b81a89 | ||
|
|
89fdbbc436 | ||
|
|
35c2ba4a76 | ||
|
|
157cca0a2c | ||
|
|
30e889f93e | ||
|
|
dabae34261 | ||
|
|
912940f8c8 | ||
|
|
6ab5c07036 | ||
|
|
fcfb4af3a0 | ||
|
|
4abd0bbee0 | ||
|
|
4f75355983 | ||
|
|
c07322de0f | ||
|
|
604b1dc912 | ||
|
|
8ce0da0681 | ||
|
|
ba6cde89ef | ||
|
|
e6248cd5a9 | ||
|
|
aa22d5c594 |
3
.gitignore
vendored
@@ -1,5 +1,8 @@
|
||||
packages/*
|
||||
lib/classes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/*/
|
||||
temp/*
|
||||
templates/*
|
||||
install/update.log
|
||||
.buildpath
|
||||
.project
|
||||
.settings/
|
||||
|
||||
11
COPYING
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
@@ -225,7 +225,7 @@ impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
@@ -278,4 +278,3 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_default_theme' => array(
|
||||
'label' => $lng['serversettings']['default_theme'],
|
||||
'label' => array('title' => $lng['panel']['theme'], 'description' => $lng['serversettings']['default_theme']),
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'default_theme',
|
||||
'type' => 'option',
|
||||
@@ -42,6 +42,22 @@ return array(
|
||||
'option_options_method' => 'getThemes',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_theme_change_customer' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_theme_change_customer'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_theme_change_customer',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_allow_theme_change_admin' => array(
|
||||
'label' => $lng['serversettings']['panel_allow_theme_change_admin'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'allow_theme_change_admin',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
'panel_natsorting' => array(
|
||||
'label' => $lng['serversettings']['natsorting'],
|
||||
'settinggroup' => 'panel',
|
||||
@@ -77,6 +93,23 @@ 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',
|
||||
@@ -177,6 +210,14 @@ return array(
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_phpconfigs_hidestdsubdomain' => array(
|
||||
'label' => $lng['serversettings']['panel_phpconfigs_hidestdsubdomain'],
|
||||
'settinggroup' => 'panel',
|
||||
'varname' => 'phpconfigs_hidestdsubdomain',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -32,6 +32,14 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkPathConflicts'
|
||||
),
|
||||
'system_documentroot_use_default_value' => array(
|
||||
'label' => $lng['serversettings']['documentroot_use_default_value'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'documentroot_use_default_value',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ipaddress' => array(
|
||||
'label' => $lng['serversettings']['ipaddress'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -33,6 +33,15 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_apache_24' => array(
|
||||
'label' => $lng['serversettings']['apache_24'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'apache24',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
),
|
||||
'system_httpuser' => array(
|
||||
'label' => $lng['admin']['webserver_user'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -85,6 +94,15 @@ return array(
|
||||
'default' => '/var/customers/logs/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_customersslpath' => array(
|
||||
'label' => $lng['serversettings']['customerssl_directory'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'customer_ssl_path',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/etc/apache2/ssl/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpappendopenbasedir' => array(
|
||||
'label' => $lng['serversettings']['phpappendopenbasedir'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -124,7 +142,7 @@ return array(
|
||||
'label' => $lng['serversettings']['phpreload_command'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'phpreload_command',
|
||||
'type' => (getSetting('phpfpm', 'enabled') == '1') ? 'hidden' : 'string',
|
||||
'type' => 'string',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
@@ -133,19 +151,20 @@ return array(
|
||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'nginx_php_backend',
|
||||
'type' => (getSetting('phpfpm', 'enabled') == '1') ? 'hidden' : 'string',
|
||||
'type' => 'string',
|
||||
'default' => '127.0.0.1:8888',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'system_mod_log_sql' => array(
|
||||
'label' => $lng['serversettings']['mod_log_sql'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_log_sql',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'nginx_fastcgiparams' => array(
|
||||
'label' => $lng['serversettings']['nginx_fastcgiparams'],
|
||||
'settinggroup' => 'nginx',
|
||||
'varname' => 'fastcgiparams',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'default' => '/etc/nginx/fastcgi_params',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
'websrv_avail' => array('nginx')
|
||||
),
|
||||
'defaultwebsrverrhandler_enabled' => array(
|
||||
'label' => $lng['serversettings']['defaultwebsrverrhandler_enabled'],
|
||||
@@ -209,72 +228,8 @@ return array(
|
||||
'option_options_method' => 'getRedirectCodes',
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2', 'lighttpd')
|
||||
),
|
||||
),
|
||||
),
|
||||
'ssl' => array(
|
||||
'title' => $lng['admin']['sslsettings'],
|
||||
'fields' => array(
|
||||
'system_ssl_enabled' => array(
|
||||
'label' => $lng['serversettings']['ssl']['use_ssl'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'use_ssl',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_ssl_cert_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.pem',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_key_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_key_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_key_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.key',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_ca_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_ca_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_ca_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_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_openssl_cnf' => array(
|
||||
'label' => $lng['serversettings']['ssl']['openssl_cnf'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'openssl_cnf',
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
77
actions/admin/settings/131.ssl.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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(
|
||||
'ssl' => array(
|
||||
'title' => $lng['admin']['sslsettings'],
|
||||
'fields' => array(
|
||||
'system_ssl_enabled' => array(
|
||||
'label' => $lng['serversettings']['ssl']['use_ssl'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'use_ssl',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
'system_ssl_cert_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_cert_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_cert_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.pem',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_key_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_key_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_key_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '/etc/apache2/apache2.key',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_ssl_ca_file' => array(
|
||||
'label' => $lng['serversettings']['ssl']['ssl_ca_file'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'ssl_ca_file',
|
||||
'type' => 'string',
|
||||
'string_type' => 'file',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_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',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -30,7 +30,7 @@ return array(
|
||||
'save_method' => 'storeSettingField',
|
||||
'plausibility_check_method' => 'checkFcgidPhpFpm',
|
||||
'overview_option' => true
|
||||
),
|
||||
),
|
||||
'system_mod_fcgid_configdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['configdir'],
|
||||
'settinggroup' => 'system',
|
||||
@@ -66,7 +66,7 @@ return array(
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'mod_fcgid_wrapper',
|
||||
'type' => 'option',
|
||||
'option_options' => array(0 => 'ScriptAlias', 1=> 'FCGIWrapper'),
|
||||
'option_options' => array(0 => 'ScriptAlias', 1=> 'FcgidWrapper'),
|
||||
'default' => 1,
|
||||
'save_method' => 'storeSettingField',
|
||||
'websrv_avail' => array('apache2')
|
||||
|
||||
@@ -54,9 +54,16 @@ return array(
|
||||
'default' => 'froxlorlocal',
|
||||
'save_method' => 'storeSettingField'
|
||||
),
|
||||
/*
|
||||
* @TODO implement if phpfpm knows custom php.ini files
|
||||
*
|
||||
'system_phpfpm_defaultini' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'defaultini',
|
||||
'type' => 'option',
|
||||
'default' => '1',
|
||||
'option_mode' => 'one',
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_defaultini_ownvhost' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['defaultini_ownvhost'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -67,7 +74,6 @@ return array(
|
||||
'option_options_method' => 'getPhpConfigs',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
*/
|
||||
'system_phpfpm_configdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['configdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -77,6 +83,15 @@ return array(
|
||||
'default' => '/etc/php-fpm.d/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_aliasconfigdir' => array(
|
||||
'label' => $lng['serversettings']['phpfpm_settings']['aliasconfigdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
'varname' => 'aliasconfigdir',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => '/var/www/php-fpm/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_tmpdir' => array(
|
||||
'label' => $lng['serversettings']['mod_fcgid']['tmpdir'],
|
||||
'settinggroup' => 'phpfpm',
|
||||
@@ -110,7 +125,7 @@ return array(
|
||||
'type' => 'option',
|
||||
'default' => 'static',
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic'),
|
||||
'option_options' => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand'),
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_phpfpm_max_children' => array(
|
||||
|
||||
@@ -51,6 +51,16 @@ return array(
|
||||
'default' => '/var/customers/mail/',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_vmail_maildirname' => array(
|
||||
'label' => $lng['serversettings']['vmail_maildirname'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'vmail_maildirname',
|
||||
'type' => 'string',
|
||||
'string_type' => 'dir',
|
||||
'default' => 'Maildir',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'panel_sendalternativemail' => array(
|
||||
'label' => $lng['serversettings']['sendalternativemail'],
|
||||
'settinggroup' => 'panel',
|
||||
@@ -90,9 +100,17 @@ return array(
|
||||
'type' => 'hidden',
|
||||
'default' => 0,
|
||||
),
|
||||
'system_catchall_enabled' => array(
|
||||
'label' => $lng['serversettings']['catchall_enabled'],
|
||||
'settinggroup' => 'catchall',
|
||||
'varname' => 'catchall_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingResetCatchall',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -68,6 +68,16 @@ return array(
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_axfrservers' => array(
|
||||
'label' => $lng['serversettings']['axfrservers'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'axfrservers',
|
||||
'type' => 'string',
|
||||
'string_type' => 'validate_ip',
|
||||
'string_emptyallowed' => true,
|
||||
'default' => '',
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
'system_dns_createmailentry' => array(
|
||||
'label' => $lng['serversettings']['mail_also_with_mxservers'],
|
||||
'settinggroup' => 'system',
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
global $settings;
|
||||
|
||||
return array(
|
||||
'groups' => array(
|
||||
'dkim' => array(
|
||||
@@ -79,7 +81,10 @@ return array(
|
||||
'save_method' => 'storeSettingFieldInsertBindTask',
|
||||
),
|
||||
'dkim_keylength' => array(
|
||||
'label' => $lng['dkim']['dkim_keylength'],
|
||||
'label' => array(
|
||||
'title' => $lng['dkim']['dkim_keylength']['title'],
|
||||
'description' => sprintf($lng['dkim']['dkim_keylength']['description'],$settings['dkim']['dkim_prefix'])
|
||||
),
|
||||
'settinggroup' => 'dkim',
|
||||
'varname' => 'dkim_keylength',
|
||||
'type' => 'option',
|
||||
|
||||
@@ -59,7 +59,7 @@ return array(
|
||||
'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'),
|
||||
'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(
|
||||
|
||||
@@ -38,9 +38,17 @@ return array(
|
||||
'default' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
'system_passwordcryptfunc' => array(
|
||||
'label' => $lng['serversettings']['passwordcryptfunc'],
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'passwordcryptfunc',
|
||||
'type' => 'option',
|
||||
'default' => 0,
|
||||
'option_mode' => 'one',
|
||||
'option_options' => array(0 => $lng['serversettings']['systemdefault'], 1 => 'MD5', 2 => 'BLOWFISH', 3 => 'SHA-256', 4 => 'SHA-512'),
|
||||
'save_method' => 'storeSettingField',
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -28,6 +28,7 @@ return array(
|
||||
'varname' => 'backup_enabled',
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'cronmodule' => 'froxlor/backup',
|
||||
'save_method' => 'storeSettingField',
|
||||
'overview_option' => true
|
||||
),
|
||||
|
||||
293
admin_admins.php
@@ -47,26 +47,6 @@ if($page == 'admins'
|
||||
'diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'traffic' => $lng['customer']['traffic'],
|
||||
'traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')',
|
||||
/*
|
||||
'mysqls' => $lng['customer']['mysqls'],
|
||||
'mysqls_used' => $lng['customer']['mysqls'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'ftps' => $lng['customer']['ftps'],
|
||||
'ftps_used' => $lng['customer']['ftps'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'tickets' => $lng['customer']['tickets'],
|
||||
'tickets_used' => $lng['customer']['tickets'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'subdomains' => $lng['customer']['subdomains'],
|
||||
'subdomains_used' => $lng['customer']['subdomains'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'emails' => $lng['customer']['emails'],
|
||||
'emails_used' => $lng['customer']['emails'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'email_accounts' => $lng['customer']['accounts'],
|
||||
'email_accounts_used' => $lng['customer']['accounts'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'email_forwarders' => $lng['customer']['forwarders'],
|
||||
'email_forwarders_used' => $lng['customer']['forwarders'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'email_quota' => $lng['customer']['email_quota'],
|
||||
'email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'email_autoresponder' => $lng['customer']['autoresponder'],
|
||||
'email_autoresponder_used' => $lng['customer']['autoresponder'] . ' (' . $lng['panel']['used'] . ')',
|
||||
*/
|
||||
'deactivated' => $lng['admin']['deactivated']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_ADMINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
@@ -92,13 +72,23 @@ if($page == 'admins'
|
||||
/**
|
||||
* percent-values for progressbar
|
||||
*/
|
||||
if($row['diskspace'] > 0) {
|
||||
$percent = round(($row['diskspace_used']*100)/$row['diskspace'], 2);
|
||||
$doublepercent = round($percent*2, 2);
|
||||
} else {
|
||||
$percent = 0;
|
||||
$doublepercent = 0;
|
||||
}
|
||||
//For Disk usage
|
||||
if ($row['diskspace'] > 0) {
|
||||
$disk_percent = round(($row['diskspace_used']*100)/$row['diskspace'], 2);
|
||||
$disk_doublepercent = round($disk_percent*2, 2);
|
||||
} else {
|
||||
$disk_percent = 0;
|
||||
$disk_doublepercent = 0;
|
||||
}
|
||||
|
||||
//For Traffic usage
|
||||
if ($row['traffic'] > 0) {
|
||||
$traffic_percent = round(($row['traffic_used']*100)/$row['traffic'], 2);
|
||||
$traffic_doublepercent = round($traffic_percent*2, 2);
|
||||
} else {
|
||||
$traffic_percent = 0;
|
||||
$traffic_doublepercent = 0;
|
||||
}
|
||||
/* */
|
||||
|
||||
$row = str_replace_array('-1', 'UL', $row, 'customers domains diskspace traffic mysqls emails email_accounts email_forwarders email_quota email_autoresponder ftps subdomains tickets');
|
||||
@@ -281,7 +271,7 @@ if($page == 'admins'
|
||||
$number_of_aps_packages = - 1;
|
||||
}
|
||||
|
||||
$can_manage_aps_packages = intval($_POST['can_manage_aps_packages']);
|
||||
$can_manage_aps_packages = isset($_POST['can_manage_aps_packages']) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -319,6 +309,10 @@ if($page == 'admins'
|
||||
$traffic = - 1;
|
||||
}
|
||||
|
||||
$tickets_see_all = 0;
|
||||
if(isset($_POST['tickets_see_all']))
|
||||
$tickets_see_all = intval($_POST['tickets_see_all']);
|
||||
|
||||
$diskspace = $diskspace * 1024;
|
||||
$traffic = $traffic * 1024 * 1024;
|
||||
$ipaddress = intval_ressource($_POST['ipaddress']);
|
||||
@@ -386,6 +380,10 @@ if($page == 'admins'
|
||||
$change_serversettings = '0';
|
||||
}
|
||||
|
||||
if ($tickets_see_all != '1') {
|
||||
$tickets_see_all = '0';
|
||||
}
|
||||
|
||||
$_theme = $settings['panel']['default_theme'];
|
||||
|
||||
$result = $db->query("INSERT INTO
|
||||
@@ -411,6 +409,7 @@ if($page == 'admins'
|
||||
`email_quota` = '" . $db->escape($email_quota) . "',
|
||||
`ftps` = '" . $db->escape($ftps) . "',
|
||||
`tickets` = '" . $db->escape($tickets) . "',
|
||||
`tickets_see_all` = '" . $db->escape($tickets_see_all) . "',
|
||||
`mysqls` = '" . $db->escape($mysqls) . "',
|
||||
`ip` = '" . (int)$ipaddress . "',
|
||||
`can_manage_aps_packages` = '" . (int)$can_manage_aps_packages . "',
|
||||
@@ -463,11 +462,13 @@ if($page == 'admins'
|
||||
$ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
$tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
$mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
#$change_serversettings = makeyesno('change_serversettings', '1', '0', '0');
|
||||
#$customers_see_all = makeyesno('customers_see_all', '1', '0', '0');
|
||||
#$domains_see_all = makeyesno('domains_see_all', '1', '0', '0');
|
||||
#$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', '0');
|
||||
#$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', '0');
|
||||
/*
|
||||
$change_serversettings = makeyesno('change_serversettings', '1', '0', '0');
|
||||
$customers_see_all = makeyesno('customers_see_all', '1', '0', '0');
|
||||
$domains_see_all = makeyesno('domains_see_all', '1', '0', '0');
|
||||
$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', '0');
|
||||
$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', '0');
|
||||
*/
|
||||
$number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
|
||||
$admin_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/admin/formfield.admin_add.php';
|
||||
@@ -508,6 +509,7 @@ if($page == 'admins'
|
||||
$ftps = $result['ftps'];
|
||||
$tickets = $result['tickets'];
|
||||
$mysqls = $result['mysqls'];
|
||||
$tickets_see_all = $result['tickets_see_all'];
|
||||
$customers_see_all = $result['customers_see_all'];
|
||||
$domains_see_all = $result['domains_see_all'];
|
||||
$caneditphpsettings = $result['caneditphpsettings'];
|
||||
@@ -522,114 +524,85 @@ if($page == 'admins'
|
||||
{
|
||||
$password = validate($_POST['admin_password'], 'new password');
|
||||
$def_language = validate($_POST['def_language'], 'default language');
|
||||
$deactivated = intval($_POST['deactivated']);
|
||||
$customers = intval_ressource($_POST['customers']);
|
||||
$deactivated = isset($_POST['deactivated']) ? 1 : 0;
|
||||
|
||||
if(isset($_POST['customers_ul']))
|
||||
{
|
||||
$customers = - 1;
|
||||
$customers = intval_ressource($_POST['customers']);
|
||||
if (isset($_POST['customers_ul'])) {
|
||||
$customers = -1;
|
||||
}
|
||||
|
||||
$domains = intval_ressource($_POST['domains']);
|
||||
|
||||
if(isset($_POST['domains_ul']))
|
||||
{
|
||||
$domains = - 1;
|
||||
if (isset($_POST['domains_ul'])) {
|
||||
$domains = -1;
|
||||
}
|
||||
|
||||
$subdomains = intval_ressource($_POST['subdomains']);
|
||||
|
||||
if(isset($_POST['subdomains_ul']))
|
||||
{
|
||||
$subdomains = - 1;
|
||||
if (isset($_POST['subdomains_ul'])) {
|
||||
$subdomains = -1;
|
||||
}
|
||||
|
||||
$emails = intval_ressource($_POST['emails']);
|
||||
|
||||
if(isset($_POST['emails_ul']))
|
||||
{
|
||||
$emails = - 1;
|
||||
if (isset($_POST['emails_ul'])) {
|
||||
$emails = -1;
|
||||
}
|
||||
|
||||
$email_accounts = intval_ressource($_POST['email_accounts']);
|
||||
|
||||
if(isset($_POST['email_accounts_ul']))
|
||||
{
|
||||
$email_accounts = - 1;
|
||||
if (isset($_POST['email_accounts_ul'])) {
|
||||
$email_accounts = -1;
|
||||
}
|
||||
|
||||
$email_forwarders = intval_ressource($_POST['email_forwarders']);
|
||||
|
||||
if(isset($_POST['email_forwarders_ul']))
|
||||
{
|
||||
$email_forwarders = - 1;
|
||||
if (isset($_POST['email_forwarders_ul'])) {
|
||||
$email_forwarders = -1;
|
||||
}
|
||||
|
||||
if($settings['system']['mail_quota_enabled'] == '1')
|
||||
{
|
||||
if ($settings['system']['mail_quota_enabled'] == '1') {
|
||||
$email_quota = validate($_POST['email_quota'], 'email_quota', '/^\d+$/', 'vmailquotawrong', array('0', ''));
|
||||
|
||||
if(isset($_POST['email_quota_ul']))
|
||||
{
|
||||
$email_quota = - 1;
|
||||
if (isset($_POST['email_quota_ul'])) {
|
||||
$email_quota = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$email_quota = - 1;
|
||||
} else {
|
||||
$email_quota = -1;
|
||||
}
|
||||
|
||||
if($settings['autoresponder']['autoresponder_active'] == '1')
|
||||
{
|
||||
if ($settings['autoresponder']['autoresponder_active'] == '1') {
|
||||
$email_autoresponder = intval_ressource($_POST['email_autoresponder']);
|
||||
|
||||
if(isset($_POST['email_autoresponder_ul']))
|
||||
{
|
||||
$email_autoresponder = - 1;
|
||||
if (isset($_POST['email_autoresponder_ul'])) {
|
||||
$email_autoresponder = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$email_autoresponder = 0;
|
||||
}
|
||||
|
||||
$ftps = intval_ressource($_POST['ftps']);
|
||||
|
||||
if(isset($_POST['ftps_ul']))
|
||||
{
|
||||
$ftps = - 1;
|
||||
if (isset($_POST['ftps_ul'])) {
|
||||
$ftps = -1;
|
||||
}
|
||||
|
||||
if($settings['ticket']['enabled'] == 1)
|
||||
{
|
||||
if ($settings['ticket']['enabled'] == 1) {
|
||||
$tickets = intval_ressource($_POST['tickets']);
|
||||
|
||||
if(isset($_POST['tickets_ul']))
|
||||
{
|
||||
$tickets = - 1;
|
||||
if (isset($_POST['tickets_ul'])) {
|
||||
$tickets = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$tickets = 0;
|
||||
}
|
||||
|
||||
$mysqls = intval_ressource($_POST['mysqls']);
|
||||
|
||||
if(isset($_POST['mysqls_ul']))
|
||||
{
|
||||
if (isset($_POST['mysqls_ul'])) {
|
||||
$mysqls = - 1;
|
||||
}
|
||||
|
||||
$number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']);
|
||||
|
||||
if(isset($_POST['number_of_aps_packages_ul']))
|
||||
{
|
||||
$number_of_aps_packages = - 1;
|
||||
if ($settings['aps']['aps_active'] == '1') {
|
||||
$number_of_aps_packages = intval_ressource($_POST['number_of_aps_packages']);
|
||||
if (isset($_POST['number_of_aps_packages_ul'])) {
|
||||
$number_of_aps_packages = -1;
|
||||
}
|
||||
$can_manage_aps_packages = isset($_POST['can_manage_aps_packages']) ? 1 : 0;
|
||||
} else {
|
||||
$number_of_aps_packages = 0;
|
||||
}
|
||||
|
||||
$can_manage_aps_packages = intval($_POST['can_manage_aps_packages']);
|
||||
|
||||
$customers_see_all = 0;
|
||||
if(isset($_POST['customers_see_all']))
|
||||
$customers_see_all = intval($_POST['customers_see_all']);
|
||||
@@ -641,23 +614,23 @@ if($page == 'admins'
|
||||
$caneditphpsettings = 0;
|
||||
if(isset($_POST['caneditphpsettings']))
|
||||
$caneditphpsettings = intval($_POST['caneditphpsettings']);
|
||||
|
||||
|
||||
$change_serversettings = 0;
|
||||
if(isset($_POST['change_serversettings']))
|
||||
$change_serversettings = intval($_POST['change_serversettings']);
|
||||
|
||||
$diskspace = intval($_POST['diskspace']);
|
||||
$change_serversettings = isset($_POST['change_serversettings']) ? 1 : 0;
|
||||
|
||||
if(isset($_POST['diskspace_ul']))
|
||||
{
|
||||
$diskspace = - 1;
|
||||
$tickets_see_all = 0;
|
||||
if (isset($_POST['tickets_see_all']))
|
||||
$tickets_see_all = intval($_POST['tickets_see_all']);
|
||||
|
||||
$diskspace = intval($_POST['diskspace']);
|
||||
if (isset($_POST['diskspace_ul'])) {
|
||||
$diskspace = -1;
|
||||
}
|
||||
|
||||
$traffic = doubleval_ressource($_POST['traffic']);
|
||||
|
||||
if(isset($_POST['traffic_ul']))
|
||||
{
|
||||
$traffic = - 1;
|
||||
if (isset($_POST['traffic_ul'])) {
|
||||
$traffic = -1;
|
||||
}
|
||||
|
||||
$diskspace = $diskspace * 1024;
|
||||
@@ -714,7 +687,88 @@ if($page == 'admins'
|
||||
$change_serversettings = '0';
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `name`='" . $db->escape($name) . "', `email`='" . $db->escape($email) . "', `def_language`='" . $db->escape($def_language) . "', `change_serversettings` = '" . $db->escape($change_serversettings) . "', `customers` = '" . $db->escape($customers) . "', `customers_see_all` = '" . $db->escape($customers_see_all) . "', `domains` = '" . $db->escape($domains) . "', `domains_see_all` = '" . $db->escape($domains_see_all) . "', `caneditphpsettings` = '" . (int)$caneditphpsettings . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `email_quota`='" . $db->escape($email_quota) . "', `email_autoresponder`='" . $db->escape($email_autoresponder) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `ip`='" . (int)$ipaddress . "', `deactivated`='" . $db->escape($deactivated) . "', `can_manage_aps_packages`=" . (int)$can_manage_aps_packages . ", `aps_packages`=" . (int)$number_of_aps_packages . " WHERE `adminid`='" . $db->escape($id) . "'");
|
||||
if ($tickets_see_all != '1') {
|
||||
$tickets_see_all = '0';
|
||||
}
|
||||
|
||||
// check if a resource was set to something lower
|
||||
// than actually used by the admin/reseller
|
||||
$res_warning = "";
|
||||
if ($customers != $result['customers'] && $customers < $result['customers_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'customers');
|
||||
}
|
||||
if ($domains != $result['domains'] && $domains < $result['domains_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'domains');
|
||||
}
|
||||
if ($diskspace != $result['diskspace'] && ($diskspace / 1024) != -1 && $diskspace < $result['diskspace_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'diskspace');
|
||||
}
|
||||
if ($traffic != $result['traffic'] && ($traffic / 1024 / 1024) != -1 && $traffic < $result['traffic_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'traffic');
|
||||
}
|
||||
if ($emails != $result['emails'] && $emails < $result['emails_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'emails');
|
||||
}
|
||||
if ($email_accounts != $result['email_accounts'] && $email_accounts < $result['email_accounts_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'email accounts');
|
||||
}
|
||||
if ($email_forwarders != $result['email_forwarders'] && $email_forwarders < $result['email_forwarders_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'email forwarders');
|
||||
}
|
||||
if ($email_quota != $result['email_quota'] && $email_quota < $result['email_quota_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'email quota');
|
||||
}
|
||||
if ($email_autoresponder != $result['email_autoresponder'] && $email_autoresponder < $result['email_autoresponder_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'email autoresponder');
|
||||
}
|
||||
if ($ftps != $result['ftps'] && $ftps < $result['ftps_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'ftps');
|
||||
}
|
||||
if ($tickets != $result['tickets'] && $tickets < $result['tickets_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'tickets');
|
||||
}
|
||||
if ($mysqls != $result['mysqls'] && $mysqls < $result['mysqls_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'mysqls');
|
||||
}
|
||||
if ($number_of_aps_packages != $result['aps_packages'] && $number_of_aps_packages < $result['aps_packages_used']) {
|
||||
$res_warning .= sprintf($lng['error']['setlessthanalreadyused'], 'aps packages');
|
||||
}
|
||||
|
||||
if ($res_warning != "") {
|
||||
$link = '';
|
||||
$error = $res_warning;
|
||||
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
|
||||
exit;
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET
|
||||
`name`='" . $db->escape($name) . "',
|
||||
`email`='" . $db->escape($email) . "',
|
||||
`def_language`='" . $db->escape($def_language) . "',
|
||||
`change_serversettings` = '" . $db->escape($change_serversettings) . "',
|
||||
`customers` = '" . $db->escape($customers) . "',
|
||||
`customers_see_all` = '" . $db->escape($customers_see_all) . "',
|
||||
`domains` = '" . $db->escape($domains) . "',
|
||||
`domains_see_all` = '" . $db->escape($domains_see_all) . "',
|
||||
`caneditphpsettings` = '" . (int)$caneditphpsettings . "',
|
||||
`password` = '" . $password . "',
|
||||
`diskspace`='" . $db->escape($diskspace) . "',
|
||||
`traffic`='" . $db->escape($traffic) . "',
|
||||
`subdomains`='" . $db->escape($subdomains) . "',
|
||||
`emails`='" . $db->escape($emails) . "',
|
||||
`email_accounts` = '" . $db->escape($email_accounts) . "',
|
||||
`email_forwarders`='" . $db->escape($email_forwarders) . "',
|
||||
`email_quota`='" . $db->escape($email_quota) . "',
|
||||
`email_autoresponder`='" . $db->escape($email_autoresponder) . "',
|
||||
`ftps`='" . $db->escape($ftps) . "',
|
||||
`tickets`='" . $db->escape($tickets) . "',
|
||||
`tickets_see_all`='".$db->escape($tickets_see_all) . "',
|
||||
`mysqls`='" . $db->escape($mysqls) . "',
|
||||
`ip`='" . (int)$ipaddress . "',
|
||||
`deactivated`='" . $db->escape($deactivated) . "',
|
||||
`can_manage_aps_packages`=" . (int)$can_manage_aps_packages . ",
|
||||
`aps_packages`=" . (int)$number_of_aps_packages . "
|
||||
WHERE `adminid`='" . $db->escape($id) . "'");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited admin '#" . $id . "'");
|
||||
$redirect_props = Array(
|
||||
'page' => $page,
|
||||
@@ -852,13 +906,14 @@ if($page == 'admins'
|
||||
}
|
||||
}
|
||||
|
||||
#$change_serversettings = makeyesno('change_serversettings', '1', '0', $result['change_serversettings']);
|
||||
#$customers_see_all = makeyesno('customers_see_all', '1', '0', $result['customers_see_all']);
|
||||
#$domains_see_all = makeyesno('domains_see_all', '1', '0', $result['domains_see_all']);
|
||||
#$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', $result['caneditphpsettings']);
|
||||
#$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
|
||||
#$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', $result['can_manage_aps_packages']);
|
||||
|
||||
/*
|
||||
$change_serversettings = makeyesno('change_serversettings', '1', '0', $result['change_serversettings']);
|
||||
$customers_see_all = makeyesno('customers_see_all', '1', '0', $result['customers_see_all']);
|
||||
$domains_see_all = makeyesno('domains_see_all', '1', '0', $result['domains_see_all']);
|
||||
$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', $result['caneditphpsettings']);
|
||||
$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
|
||||
$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', $result['can_manage_aps_packages']);
|
||||
*/
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$admin_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/admin/formfield.admin_edit.php';
|
||||
|
||||
@@ -16,24 +16,17 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require_once('./lib/init.php');
|
||||
|
||||
require_once("./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 == 'cronjobs'
|
||||
|| $page == 'overview')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_cronjobs");
|
||||
if ($page == 'cronjobs' || $page == 'overview') {
|
||||
if ($action == '') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs');
|
||||
|
||||
$fields = array(
|
||||
'c.lastrun' => $lng['cron']['lastrun'],
|
||||
@@ -56,88 +49,65 @@ if($page == 'cronjobs'
|
||||
$i = 0;
|
||||
$count = 0;
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
$row = htmlentities_array($row);
|
||||
|
||||
|
||||
$row['lastrun'] = date('d.m.Y H:i', $row['lastrun']);
|
||||
|
||||
if((int)$row['isactive'] == 1)
|
||||
{
|
||||
$row['isactive'] = $lng['panel']['yes'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['isactive'] = $lng['panel']['no'];
|
||||
}
|
||||
|
||||
$row['isactive'] = ((int)$row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no'];
|
||||
|
||||
$description = $lng['crondesc'][$row['desc_lng_key']];
|
||||
|
||||
eval("\$crons.=\"" . getTemplate("cronjobs/cronjobs_cronjob") . "\";");
|
||||
|
||||
eval("\$crons.=\"" . getTemplate('cronjobs/cronjobs_cronjob') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("cronjobs/cronjobs") . "\";");
|
||||
eval("echo \"" . getTemplate('cronjobs/cronjobs') . "\";");
|
||||
|
||||
}
|
||||
elseif($action == 'new')
|
||||
{
|
||||
} elseif ($action == 'new') {
|
||||
/*
|
||||
* @TODO later
|
||||
*/
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CRONRUNS . "` WHERE `id`='" . (int)$id . "'");
|
||||
|
||||
if ($result['cronfile'] != '')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
$isactive = intval($_POST['isactive']);
|
||||
if ($result['cronfile'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
$isactive = isset($_POST['isactive']) ? 1 : 0;
|
||||
$interval_value = validate($_POST['interval_value'], 'interval_value', '/^([0-9]+)$/Di', 'stringisempty');
|
||||
$interval_interval = validate($_POST['interval_interval'], 'interval_interval');
|
||||
|
||||
if($isactive != 1)
|
||||
{
|
||||
|
||||
if ($isactive != 1) {
|
||||
$isactive = 0;
|
||||
}
|
||||
|
||||
$interval = $interval_value.' '.strtoupper($interval_interval);
|
||||
|
||||
|
||||
$interval = $interval_value . ' ' . strtoupper($interval_interval);
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CRONRUNS . "`
|
||||
SET `isactive` = '".(int)$isactive."',
|
||||
`interval` = '".$interval."'
|
||||
WHERE `id` = '" . (int)$id . "'");
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
#$isactive = makeyesno('isactive', '1', '0', $result['isactive']);
|
||||
} 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]);
|
||||
$interval_interval.= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]);
|
||||
$interval_interval.= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]);
|
||||
$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]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['weeks'], 'WEEK', $interval_nfo[1]);
|
||||
$interval_interval .= makeoption($lng['cronmgmt']['months'], 'MONTH', $interval_nfo[1]);
|
||||
// end of interval
|
||||
|
||||
|
||||
$change_cronfile = false;
|
||||
if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor')
|
||||
{
|
||||
if (substr($result['module'], 0, strpos($result['module'], '/')) != 'froxlor') {
|
||||
$change_cronfile = true;
|
||||
}
|
||||
|
||||
@@ -147,17 +117,13 @@ if($page == 'cronjobs'
|
||||
$title = $cronjobs_edit_data['cronjobs_edit']['title'];
|
||||
$image = $cronjobs_edit_data['cronjobs_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("cronjobs/cronjob_edit") . "\";");
|
||||
eval("echo \"" . getTemplate('cronjobs/cronjob_edit') . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
elseif ($action == 'delete' && $id != 0) {
|
||||
/*
|
||||
* @TODO later
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -48,49 +48,19 @@ if($page == 'customers'
|
||||
'c.loginname' => $lng['login']['username'],
|
||||
'a.loginname' => $lng['admin']['admin'],
|
||||
'c.name' => $lng['customer']['name'],
|
||||
'c.email' => $lng['customer']['email'],
|
||||
'c.firstname' => $lng['customer']['firstname'],
|
||||
'c.company' => $lng['customer']['company'],
|
||||
'c.diskspace' => $lng['customer']['diskspace'],
|
||||
'c.diskspace_used' => $lng['customer']['diskspace'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.traffic' => $lng['customer']['traffic'],
|
||||
'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.backup_allowed' => $lng['backup_allowed']
|
||||
/*
|
||||
'c.mysqls' => $lng['customer']['mysqls'],
|
||||
'c.mysqls_used' => $lng['customer']['mysqls'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.ftps' => $lng['customer']['ftps'],
|
||||
'c.ftps_used' => $lng['customer']['ftps'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.subdomains' => $lng['customer']['subdomains'],
|
||||
'c.subdomains_used' => $lng['customer']['subdomains'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.emails' => $lng['customer']['emails'],
|
||||
'c.emails_used' => $lng['customer']['emails'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.email_accounts' => $lng['customer']['accounts'],
|
||||
'c.email_accounts_used' => $lng['customer']['accounts'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.email_forwarders' => $lng['customer']['forwarders'],
|
||||
'c.email_forwarders_used' => $lng['customer']['forwarders'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.email_quota' => $lng['customer']['email_quota'],
|
||||
'c.email_quota_used' => $lng['customer']['email_quota'] . ' (' . $lng['panel']['used'] . ')',
|
||||
'c.deactivated' => $lng['admin']['deactivated'],
|
||||
'c.lastlogin_succ' => $lng['admin']['lastlogin_succ'],
|
||||
'c.phpenabled' => $lng['admin']['phpenabled'],
|
||||
'c.perlenabled' => $lng['admin']['perlenabled']
|
||||
*/
|
||||
'c.traffic_used' => $lng['customer']['traffic'] . ' (' . $lng['panel']['used'] . ')'
|
||||
);
|
||||
|
||||
/*
|
||||
if($settings['ticket']['enabled'] == 1)
|
||||
{
|
||||
$fields['c.tickets'] = $lng['customer']['tickets'];
|
||||
$fields['c.tickets_used'] = $lng['customer']['tickets'] . ' (' . $lng['panel']['used'] . ')';
|
||||
if ($settings['system']['backup_enabled'] == '1') {
|
||||
$field['c.backup_allowed'] = $lng['backup_allowed'];
|
||||
}
|
||||
|
||||
if($settings['autoresponder']['autoresponder_active'] == 1)
|
||||
{
|
||||
$fields['c.email_autoresponder'] = $lng['customer']['autoresponder'];
|
||||
$fields['c.email_autoresponder_used'] = $lng['customer']['autoresponder'] . ' (' . $lng['panel']['used'] . ')';
|
||||
}
|
||||
*/
|
||||
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_CUSTOMERS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$customers = '';
|
||||
$result = $db->query("SELECT `c`.*, `a`.`loginname` AS `adminname` " . "FROM `" . TABLE_PANEL_CUSTOMERS . "` `c`, `" . TABLE_PANEL_ADMINS . "` `a` " . "WHERE " . ($userinfo['customers_see_all'] ? '' : " `c`.`adminid` = '" . (int)$userinfo['adminid'] . "' AND ") . "`c`.`adminid`=`a`.`adminid` " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy($settings['panel']['natsorting']) . " " . $paging->getSqlLimit());
|
||||
@@ -163,11 +133,14 @@ if($page == 'customers'
|
||||
|
||||
if($destination_user != '')
|
||||
{
|
||||
if ($result['deactivated'] == '1') {
|
||||
standard_error("usercurrentlydeactivated", $destination_user);
|
||||
}
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid`='" . (int)$userinfo['userid'] . "' AND `hash`='" . $db->escape($s) . "'");
|
||||
$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')");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "switched user and is now '" . $destination_user . "'");
|
||||
redirectTo('customer_index.php', Array('s' => $s));
|
||||
redirectTo('customer_index.php', Array('s' => $s), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -223,12 +196,17 @@ if($page == 'customers'
|
||||
$last_dbserver = $row_database['dbserver'];
|
||||
}
|
||||
|
||||
foreach(array_unique(explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host)
|
||||
if(mysql_get_server_info() < '5.0.2') {
|
||||
// failsafe if user has been deleted manually (requires MySQL 4.1.2+)
|
||||
$db_root->query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM \'' . $db_root->escape($row_database['databasename']) .'\'',false,true);
|
||||
}
|
||||
|
||||
$host_res = $db_root->query("SELECT `Host` FROM `mysql`.`user` WHERE `User`='" . $db_root->escape($row_database['databasename']) . "'");
|
||||
while($host = $db_root->fetch_array($host_res))
|
||||
{
|
||||
$mysql_access_host = trim($mysql_access_host);
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON * . * FROM `' . $db_root->escape($row_database['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`',false,true);
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($row_database['databasename'])) . '` . * FROM `' . $db_root->escape($row_database['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`',false,true);
|
||||
$db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $db_root->escape($row_database['databasename']) . '" AND `Host` = "' . $db_root->escape($mysql_access_host) . '"');
|
||||
// as of MySQL 5.0.2 this also revokes privileges. (requires MySQL 4.1.2+)
|
||||
$db_root->query('DROP USER \'' . $db_root->escape($row_database['databasename']). '\'@\'' . $db_root->escape($host['Host']) . '\'', false, true);
|
||||
|
||||
}
|
||||
|
||||
$db_root->query('DROP DATABASE IF EXISTS `' . $db_root->escape($row_database['databasename']) . '`');
|
||||
@@ -304,7 +282,7 @@ if($page == 'customers'
|
||||
|
||||
if($result['email_autoresponder'] != '-1')
|
||||
{
|
||||
$admin_update_query.= ", `email_autoresponder` = `email_autoresponder` - 0" . (int)$result['email_autoresponder'];
|
||||
$admin_update_query.= ", `email_autoresponder_used` = `email_autoresponder_used` - 0" . (int)$result['email_autoresponder'];
|
||||
}
|
||||
|
||||
if($result['subdomains'] != '-1')
|
||||
@@ -324,7 +302,7 @@ if($page == 'customers'
|
||||
|
||||
if($result['aps_packages'] != '-1')
|
||||
{
|
||||
$admin_update_query.= ", `aps_packages` = `aps_packages` - 0" . (int)$result['aps_packages'];
|
||||
$admin_update_query.= ", `aps_packages_used` = `aps_packages_used` - 0" . (int)$result['aps_packages'];
|
||||
}
|
||||
|
||||
if(($result['diskspace'] / 1024) != '-1')
|
||||
@@ -337,23 +315,17 @@ if($page == 'customers'
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "deleted user '" . $result['loginname'] . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
if(isset($_POST['delete_userfiles'])
|
||||
&& (int)$_POST['delete_userfiles'] == 1)
|
||||
{
|
||||
if (isset($_POST['delete_userfiles'])
|
||||
&& (int)$_POST['delete_userfiles'] == 1
|
||||
) {
|
||||
inserttask('6', $result['loginname']);
|
||||
}
|
||||
|
||||
# Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
if ($settings['system']['diskquota_enabled'])
|
||||
{
|
||||
inserttask('10');
|
||||
}
|
||||
// Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
inserttask('10');
|
||||
|
||||
/*
|
||||
* move old tickets to archive
|
||||
@@ -791,13 +763,10 @@ if($page == 'customers'
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added user '" . $loginname . "'");
|
||||
inserttask('2', $loginname, $guid, $guid, $store_defaultindex);
|
||||
|
||||
# Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
if ($settings['system']['diskquota_enabled'])
|
||||
{
|
||||
inserttask('10');
|
||||
}
|
||||
// Add htpasswd for the webalizer stats
|
||||
// Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
inserttask('10');
|
||||
|
||||
// Add htpasswd for the webalizer stats
|
||||
if(CRYPT_STD_DES == 1)
|
||||
{
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
@@ -820,7 +789,8 @@ if($page == 'customers'
|
||||
}
|
||||
|
||||
inserttask('1');
|
||||
$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
$result = $db->query("INSERT INTO `" . TABLE_FTP_USERS . "` " . "(`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($cryptPassword) . "', '" . $db->escape($documentroot) . "', 'y', '" . (int)$guid . "', '" . (int)$guid . "')");
|
||||
$result = $db->query("INSERT INTO `" . TABLE_FTP_GROUPS . "` " . "(`customerid`, `groupname`, `gid`, `members`) " . "VALUES ('" . (int)$customerid . "', '" . $db->escape($loginname) . "', '" . $db->escape($guid) . "', '" . $db->escape($loginname) . "')");
|
||||
$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($loginname) . "', 'user', '0', '0', '0', '0', '0', '0')");
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added ftp-account for user '" . $loginname . "'");
|
||||
@@ -848,7 +818,6 @@ if($page == 'customers'
|
||||
"`isemaildomain` = '0', " .
|
||||
"`caneditdomain` = '0', " .
|
||||
"`openbasedir` = '1', " .
|
||||
"`safemode` = '1', " .
|
||||
"`speciallogfile` = '0', " .
|
||||
"`specialsettings` = '', " .
|
||||
"`add_date` = '".date('Y-m-d')."'");
|
||||
@@ -924,14 +893,6 @@ if($page == 'customers'
|
||||
$tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
$mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
$number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true);
|
||||
#$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', '1');
|
||||
#$email_imap = makeyesno('email_imap', '1', '0', '1');
|
||||
#$email_pop3 = makeyesno('email_pop3', '1', '0', '1');
|
||||
#$sendpassword = makeyesno('sendpassword', '1', '0', '1');
|
||||
#$phpenabled = makeyesno('phpenabled', '1', '0', '1');
|
||||
#$perlenabled = makeyesno('perlenabled', '1', '0', '0');
|
||||
#$store_defaultindex = makeyesno('store_defaultindex', '1', '0', '1');
|
||||
$backup_allowed = makeyesno('backup_allowed', '1', '0', '0');
|
||||
|
||||
$gender_options = makeoption($lng['gender']['undef'], 0, true, true, true);
|
||||
$gender_options .= makeoption($lng['gender']['male'], 1, null, true, true);
|
||||
@@ -1196,7 +1157,7 @@ if($page == 'customers'
|
||||
$_stdsubdomain = $result['loginname'] . '.' . $settings['system']['hostname'];
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `safemode`, `speciallogfile`, `specialsettings`, `add_date`) " . "VALUES ('" . $db->escape($_stdsubdomain) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '1', '0', '', '".date('Y-m-d')."')");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` " . "(`domain`, `customerid`, `adminid`, `parentdomainid`, `ipandport`, `documentroot`, `zonefile`, `isemaildomain`, `caneditdomain`, `openbasedir`, `speciallogfile`, `specialsettings`, `add_date`) " . "VALUES ('" . $db->escape($_stdsubdomain) . "', '" . (int)$result['customerid'] . "', '" . (int)$userinfo['adminid'] . "', '-1', '" . $db->escape($settings['system']['defaultip']) . "', '" . $db->escape($result['documentroot']) . "', '', '0', '0', '1', '0', '', '".date('Y-m-d')."')");
|
||||
$domainid = $db->insert_id();
|
||||
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `standardsubdomain`=\'' . (int)$domainid . '\' WHERE `customerid`=\'' . (int)$result['customerid'] . '\'');
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically added standardsubdomain for user '" . $result['loginname'] . "'");
|
||||
@@ -1235,7 +1196,7 @@ if($page == 'customers'
|
||||
|
||||
if($deactivated != $result['deactivated'])
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `postfix`='" . (($deactivated) ? 'N' : 'Y') . "', `pop3`='" . (($deactivated) ? '0' : '1') . "', `imap`='" . (($deactivated) ? '0' : '1') . "' WHERE `customerid`='" . (int)$id . "'");
|
||||
$db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `postfix`='" . (($deactivated) ? 'N' : 'Y') . "', `pop3`='" . (($deactivated) ? '0' : (int)$result['pop3']) . "', `imap`='" . (($deactivated) ? '0' : (int)$result['imap']) . "' WHERE `customerid`='" . (int)$id . "'");
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `login_enabled`='" . (($deactivated) ? 'N' : 'Y') . "' WHERE `customerid`='" . (int)$id . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `deactivated`='" . (int)$deactivated . "' WHERE `customerid`='" . (int)$id . "'");
|
||||
|
||||
@@ -1262,8 +1223,8 @@ if($page == 'customers'
|
||||
/* Prevent access, if deactivated */
|
||||
if($deactivated)
|
||||
{
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON * . * FROM `' . $db_root->escape($row_database['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($row_database['databasename'])) . '` . * FROM `' . $db_root->escape($row_database['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||
// failsafe if user has been deleted manually (requires MySQL 4.1.2+)
|
||||
$db_root->query('REVOKE ALL PRIVILEGES, GRANT OPTION FROM \'' . $db_root->escape($row_database['databasename']) .'\'',false,true);
|
||||
}
|
||||
else /* Otherwise grant access */
|
||||
{
|
||||
@@ -1299,11 +1260,8 @@ if($page == 'customers'
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `name`='" . $db->escape($name) . "', `firstname`='" . $db->escape($firstname) . "', `gender`='" . $db->escape($gender) . "', `company`='" . $db->escape($company) . "', `street`='" . $db->escape($street) . "', `zipcode`='" . $db->escape($zipcode) . "', `city`='" . $db->escape($city) . "', `phone`='" . $db->escape($phone) . "', `fax`='" . $db->escape($fax) . "', `email`='" . $db->escape($email) . "', `customernumber`='" . $db->escape($customernumber) . "', `def_language`='" . $db->escape($def_language) . "', `password` = '" . $password . "', `diskspace`='" . $db->escape($diskspace) . "', `traffic`='" . $db->escape($traffic) . "', `subdomains`='" . $db->escape($subdomains) . "', `emails`='" . $db->escape($emails) . "', `email_accounts` = '" . $db->escape($email_accounts) . "', `email_forwarders`='" . $db->escape($email_forwarders) . "', `ftps`='" . $db->escape($ftps) . "', `tickets`='" . $db->escape($tickets) . "', `mysqls`='" . $db->escape($mysqls) . "', `deactivated`='" . $db->escape($deactivated) . "', `phpenabled`='" . $db->escape($phpenabled) . "', `email_quota`='" . $db->escape($email_quota) . "', `imap`='" . $db->escape($email_imap) . "', `pop3`='" . $db->escape($email_pop3) . "', `aps_packages`='" . (int)$number_of_aps_packages . "', `perlenabled`='" . $db->escape($perlenabled) . "', `email_autoresponder`='" . $db->escape($email_autoresponder) . "', `backup_allowed`='" . $db->escape($backup_allowed) . "' WHERE `customerid`='" . (int)$id . "'");
|
||||
$admin_update_query = "UPDATE `" . TABLE_PANEL_ADMINS . "` SET `customers_used` = `customers_used` ";
|
||||
|
||||
# Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
if ($settings['system']['diskquota_enabled'])
|
||||
{
|
||||
inserttask('10');
|
||||
}
|
||||
// Using filesystem - quota, insert a task which cleans the filesystem - quota
|
||||
inserttask('10');
|
||||
|
||||
if($mysqls != '-1'
|
||||
|| $result['mysqls'] != '-1')
|
||||
@@ -1588,13 +1546,6 @@ if($page == 'customers'
|
||||
$result['aps_packages'] = '';
|
||||
}
|
||||
|
||||
#$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0'));
|
||||
#$phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']);
|
||||
#$perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']);
|
||||
#$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']);
|
||||
#$email_imap = makeyesno('email_imap', '1', '0', $result['imap']);
|
||||
#$email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']);
|
||||
$backup_allowed = makeyesno('backup_allowed', '1', '0', $result['backup_allowed']);
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$gender_options = makeoption($lng['gender']['undef'], 0, ($result['gender'] == '0' ? true : false), true, true);
|
||||
|
||||
@@ -195,11 +195,9 @@ if($page == 'domains'
|
||||
updateCounters();
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
elseif ($alias_check['count'] > 0) {
|
||||
@@ -283,9 +281,16 @@ if($page == 'domains'
|
||||
|
||||
if($userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
$isbinddomain = intval($_POST['isbinddomain']);
|
||||
$caneditdomain = intval($_POST['caneditdomain']);
|
||||
$zonefile = validate($_POST['zonefile'], 'zonefile');
|
||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||
|
||||
$isbinddomain = '0';
|
||||
$zonefile = '';
|
||||
if ($settings['system']['bind_enable'] == '1') {
|
||||
if (isset($_POST['isbinddomain'])) {
|
||||
$isbinddomain = intval($_POST['isbinddomain']);
|
||||
}
|
||||
$zonefile = validate($_POST['zonefile'], 'zonefile');
|
||||
}
|
||||
|
||||
if(isset($_POST['dkim']))
|
||||
{
|
||||
@@ -299,11 +304,13 @@ if($page == 'domains'
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
|
||||
validate($_POST['documentroot'], 'documentroot');
|
||||
|
||||
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if(isset($_POST['documentroot'])
|
||||
&& $_POST['documentroot'] != '')
|
||||
&& ($_POST['documentroot'] != ''))
|
||||
{
|
||||
if(substr($_POST['documentroot'], 0, 1) != '/'
|
||||
&& !preg_match('/^https?\:\/\//', $_POST['documentroot']))
|
||||
&& !preg_match('/^https?\:\/\//', $_POST['documentroot']))
|
||||
{
|
||||
$documentroot.= '/' . $_POST['documentroot'];
|
||||
}
|
||||
@@ -312,10 +319,19 @@ if($page == 'domains'
|
||||
$documentroot = $_POST['documentroot'];
|
||||
}
|
||||
}
|
||||
elseif (isset($_POST['documentroot'])
|
||||
&& ($_POST['documentroot'] == '')
|
||||
&& ($settings['system']['documentroot_use_default_value'] == 1))
|
||||
{
|
||||
$documentroot = makeCorrectDir($customer['documentroot'] . '/' . $domain);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$isbinddomain = '1';
|
||||
$isbinddomain = '0';
|
||||
if ($settings['system']['bind_enable'] == '1') {
|
||||
$isbinddomain = '1';
|
||||
}
|
||||
$caneditdomain = '1';
|
||||
$zonefile = '';
|
||||
$dkim = '1';
|
||||
@@ -325,10 +341,9 @@ if($page == 'domains'
|
||||
if($userinfo['caneditphpsettings'] == '1'
|
||||
|| $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
$openbasedir = intval($_POST['openbasedir']);
|
||||
$safemode = intval($_POST['safemode']);
|
||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 0;
|
||||
|
||||
if((int)$settings['system']['mod_fcgid'] == 1)
|
||||
if((int)$settings['system']['mod_fcgid'] == 1 || (int)$settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$phpsettingid = (int)$_POST['phpsettingid'];
|
||||
$phpsettingid_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$phpsettingid);
|
||||
@@ -340,12 +355,21 @@ if($page == 'domains'
|
||||
standard_error('phpsettingidwrong');
|
||||
}
|
||||
|
||||
$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', ''));
|
||||
if( (int)$settings['system']['mod_fcgid'] == 1) {
|
||||
$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', ''));
|
||||
} else {
|
||||
$mod_fcgid_starter = '-1';
|
||||
$mod_fcgid_maxrequests = '-1';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||
if ((int)$settings['phpfpm']['enabled'] == 1) {
|
||||
$phpsettingid = $settings['phpfpm']['defaultini'];
|
||||
} else {
|
||||
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||
}
|
||||
$mod_fcgid_starter = '-1';
|
||||
$mod_fcgid_maxrequests = '-1';
|
||||
}
|
||||
@@ -353,8 +377,11 @@ if($page == 'domains'
|
||||
else
|
||||
{
|
||||
$openbasedir = '1';
|
||||
$safemode = '1';
|
||||
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||
if ((int)$settings['phpfpm']['enabled'] == 1) {
|
||||
$phpsettingid = $settings['phpfpm']['defaultini'];
|
||||
} else {
|
||||
$phpsettingid = $settings['system']['mod_fcgid_defaultini'];
|
||||
}
|
||||
$mod_fcgid_starter = '-1';
|
||||
$mod_fcgid_maxrequests = '-1';
|
||||
}
|
||||
@@ -385,7 +412,7 @@ if($page == 'domains'
|
||||
&& isset($_POST['ssl_ipandport'])
|
||||
&& $_POST['ssl'] != '0')
|
||||
{
|
||||
$ssl = (int)$_POST['ssl'];
|
||||
$ssl = 1; // if ssl is set and != 0 it can only be 1
|
||||
$ssl_redirect = 0;
|
||||
if (isset($_POST['ssl_redirect'])) {
|
||||
$ssl_redirect = (int)$_POST['ssl_redirect'];
|
||||
@@ -435,11 +462,6 @@ if($page == 'domains'
|
||||
$openbasedir = '0';
|
||||
}
|
||||
|
||||
if($safemode != '1')
|
||||
{
|
||||
$safemode = '0';
|
||||
}
|
||||
|
||||
if($speciallogfile != '1')
|
||||
{
|
||||
$speciallogfile = '0';
|
||||
@@ -540,7 +562,6 @@ if($page == 'domains'
|
||||
'ssl_redirect' => $ssl_redirect,
|
||||
'ssl_ipandport' => $ssl_ipandport,
|
||||
'openbasedir' => $openbasedir,
|
||||
'safemode' => $safemode,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
@@ -570,17 +591,15 @@ if($page == 'domains'
|
||||
$question_nr++;
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `safemode`,`speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `ismainbutsubto`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($safemode) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "', '".(int)$issubof."')");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_DOMAINS . "` (`domain`, `customerid`, `adminid`, `documentroot`, `ipandport`,`aliasdomain`, `zonefile`, `dkim`, `wwwserveralias`, `isbinddomain`, `isemaildomain`, `email_only`, `subcanemaildomain`, `caneditdomain`, `openbasedir`, `speciallogfile`, `specialsettings`, `ssl`, `ssl_redirect`, `ssl_ipandport`, `add_date`, `registration_date`, `phpsettingid`, `mod_fcgid_starter`, `mod_fcgid_maxrequests`, `ismainbutsubto`) VALUES ('" . $db->escape($domain) . "', '" . (int)$customerid . "', '" . (int)$adminid . "', '" . $db->escape($documentroot) . "', '" . $db->escape($ipandport) . "', " . (($aliasdomain != 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", '" . $db->escape($zonefile) . "', '" . $db->escape($dkim) . "', '" . $db->escape($wwwserveralias) . "', '" . $db->escape($isbinddomain) . "', '" . $db->escape($isemaildomain) . "', '" . $db->escape($email_only) . "', '" . $db->escape($subcanemaildomain) . "', '" . $db->escape($caneditdomain) . "', '" . $db->escape($openbasedir) . "', '" . $db->escape($speciallogfile) . "', '" . $db->escape($specialsettings) . "', '" . $ssl . "', '" . $ssl_redirect . "' , '" . $ssl_ipandport . "', '" . $db->escape(time()) . "', '" . $db->escape($registration_date) . "', '" . (int)$phpsettingid . "', '" . (int)$mod_fcgid_starter . "', '" . (int)$mod_fcgid_maxrequests . "', '".(int)$issubof."')");
|
||||
$domainid = $db->insert_id();
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` + 1 WHERE `adminid` = '" . (int)$adminid . "'");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "added domain '" . $domain . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
@@ -680,21 +699,14 @@ if($page == 'domains'
|
||||
|
||||
while($row = $db->fetch_array($configs))
|
||||
{
|
||||
$phpconfigs.= makeoption($row['description'], $row['id'], $settings['system']['mod_fcgid_defaultini'], true, true);
|
||||
if ((int)$settings['phpfpm']['enabled'] == 1) {
|
||||
$phpconfigs.= makeoption($row['description'], $row['id'], $settings['phpfpm']['defaultini'], true, true);
|
||||
} else {
|
||||
$phpconfigs.= makeoption($row['description'], $row['id'], $settings['system']['mod_fcgid_defaultini'], true, true);
|
||||
}
|
||||
}
|
||||
|
||||
#$isbinddomain = makeyesno('isbinddomain', '1', '0', '1');
|
||||
#$isemaildomain = makeyesno('isemaildomain', '1', '0', '1');
|
||||
#$email_only = makeyesno('email_only', '1', '0', '0');
|
||||
$subcanemaildomain = makeoption($lng['admin']['subcanemaildomain']['never'], '0', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['choosableno'], '1', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['choosableyes'], '2', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['always'], '3', '0', true, true);
|
||||
#$dkim = makeyesno('dkim', '1', '0', '1');
|
||||
#$wwwserveralias = makeyesno('wwwserveralias', '1', '0', '1');
|
||||
#$caneditdomain = makeyesno('caneditdomain', '1', '0', '1');
|
||||
#$openbasedir = makeyesno('openbasedir', '1', '0', '1');
|
||||
#$safemode = makeyesno('safemode', '1', '0', '1');
|
||||
#$speciallogfile = makeyesno('speciallogfile', '1', '0', '0');
|
||||
#$ssl = makeyesno('ssl', '1', '0', '0');
|
||||
#$ssl_redirect = makeyesno('ssl_redirect', '1', '0', '0');
|
||||
$add_date = date('Y-m-d');
|
||||
|
||||
$domain_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/domains/formfield.domains_add.php';
|
||||
@@ -793,7 +805,7 @@ if($page == 'domains'
|
||||
$aliasdomain = intval($_POST['alias']);
|
||||
$issubof = intval($_POST['issubof']);
|
||||
$subcanemaildomain = intval($_POST['subcanemaildomain']);
|
||||
$caneditdomain = intval($_POST['caneditdomain']);
|
||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||
$registration_date = trim($_POST['registration_date']);
|
||||
$registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
|
||||
|
||||
@@ -816,12 +828,18 @@ if($page == 'domains'
|
||||
|
||||
if($userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
$isbinddomain = intval($_POST['isbinddomain']);
|
||||
$zonefile = validate($_POST['zonefile'], 'zonefile');
|
||||
$isbinddomain = $result['isbinddomain'];
|
||||
$zonefile = $result['zonefile'];
|
||||
if ($settings['system']['bind_enable'] == '1') {
|
||||
if (isset($_POST['isbinddomain'])) {
|
||||
$isbinddomain = (int)$_POST['isbinddomain'];
|
||||
}
|
||||
$zonefile = validate($_POST['zonefile'], 'zonefile');
|
||||
}
|
||||
|
||||
if($settings['dkim']['use_dkim'] == '1')
|
||||
{
|
||||
$dkim = intval($_POST['dkim']);
|
||||
$dkim = isset($_POST['dkim']) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -833,7 +851,16 @@ if($page == 'domains'
|
||||
|
||||
if($documentroot == '')
|
||||
{
|
||||
$documentroot = $customer['documentroot'];
|
||||
// If path is empty and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if ($settings['system']['documentroot_use_default_value'] == 1)
|
||||
{
|
||||
$documentroot = makeCorrectDir($customer['documentroot'] . '/' . $result['domain']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$documentroot = $customer['documentroot'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!preg_match('/^https?\:\/\//', $documentroot)
|
||||
@@ -854,10 +881,9 @@ if($page == 'domains'
|
||||
if($userinfo['caneditphpsettings'] == '1'
|
||||
|| $userinfo['change_serversettings'] == '1')
|
||||
{
|
||||
$openbasedir = intval($_POST['openbasedir']);
|
||||
$safemode = intval($_POST['safemode']);
|
||||
$openbasedir = isset($_POST['openbasedir']) ? intval($_POST['openbasedir']) : 0;
|
||||
|
||||
if((int)$settings['system']['mod_fcgid'] == 1)
|
||||
if((int)$settings['system']['mod_fcgid'] == 1 || (int)$settings['phpfpm']['enabled'] == 1)
|
||||
{
|
||||
$phpsettingid = (int)$_POST['phpsettingid'];
|
||||
$phpsettingid_check = $db->query_first("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "` WHERE `id` = " . (int)$phpsettingid);
|
||||
@@ -869,8 +895,13 @@ if($page == 'domains'
|
||||
standard_error('phpsettingidwrong');
|
||||
}
|
||||
|
||||
$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', ''));
|
||||
if ((int)$settings['system']['mod_fcgid'] == 1) {
|
||||
$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', ''));
|
||||
} else {
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -882,7 +913,6 @@ if($page == 'domains'
|
||||
else
|
||||
{
|
||||
$openbasedir = $result['openbasedir'];
|
||||
$safemode = $result['safemode'];
|
||||
$phpsettingid = $result['phpsettingid'];
|
||||
$mod_fcgid_starter = $result['mod_fcgid_starter'];
|
||||
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
|
||||
@@ -914,7 +944,7 @@ if($page == 'domains'
|
||||
&& isset($_POST['ssl_ipandport'])
|
||||
&& $_POST['ssl'] != '0')
|
||||
{
|
||||
$ssl = (int)$_POST['ssl'];
|
||||
$ssl = 1; // if ssl is set and != 0, it can only be 1
|
||||
$ssl_redirect = 0;
|
||||
if (isset($_POST['ssl_redirect'])) {
|
||||
$ssl_redirect = (int)$_POST['ssl_redirect'];
|
||||
@@ -946,11 +976,6 @@ if($page == 'domains'
|
||||
$openbasedir = '0';
|
||||
}
|
||||
|
||||
if($safemode != '1')
|
||||
{
|
||||
$safemode = '0';
|
||||
}
|
||||
|
||||
if($isbinddomain != '1')
|
||||
{
|
||||
$isbinddomain = '0';
|
||||
@@ -1028,7 +1053,6 @@ if($page == 'domains'
|
||||
'ssl_redirect' => $ssl_redirect,
|
||||
'ssl_ipandport' => $ssl_ipandport,
|
||||
'openbasedir' => $openbasedir,
|
||||
'safemode' => $safemode,
|
||||
'phpsettingid' => $phpsettingid,
|
||||
'mod_fcgid_starter' => $mod_fcgid_starter,
|
||||
'mod_fcgid_maxrequests' => $mod_fcgid_maxrequests,
|
||||
@@ -1064,7 +1088,6 @@ if($page == 'domains'
|
||||
|| $ssl_ipandport != $result['ssl_ipandport']
|
||||
|| $wwwserveralias != $result['wwwserveralias']
|
||||
|| $openbasedir != $result['openbasedir']
|
||||
|| $safemode != $result['safemode']
|
||||
|| $phpsettingid != $result['phpsettingid']
|
||||
|| $mod_fcgid_starter != $result['mod_fcgid_starter']
|
||||
|| $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests']
|
||||
@@ -1124,7 +1147,7 @@ if($page == 'domains'
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$result['adminid'] . "' ");
|
||||
}
|
||||
|
||||
$ssfs = isset($_POST['specialsettingsforsubdomains']) ? intval($_POST['specialsettingsforsubdomains']) : 1;
|
||||
$ssfs = isset($_POST['specialsettingsforsubdomains']) ? 1 : 0;
|
||||
if($ssfs == 1)
|
||||
{
|
||||
$upd_specialsettings = ", `specialsettings`='" . $db->escape($specialsettings) . "' ";
|
||||
@@ -1136,8 +1159,8 @@ if($page == 'domains'
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "removed specialsettings on all subdomains of domain #" . $id);
|
||||
}
|
||||
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `speciallogfile`='" . $db->escape($speciallogfile) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "', `ismainbutsubto`='" . (int)$issubof . "' WHERE `id`='" . (int)$id . "'");
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `ipandport`='" . $db->escape($ipandport) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `safemode`='" . $db->escape($safemode) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "'" . $upd_specialsettings . $updatechildren . " WHERE `parentdomainid`='" . (int)$id . "'");
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `documentroot`='" . $db->escape($documentroot) . "', `ipandport`='" . $db->escape($ipandport) . "', `ssl`='" . (int)$ssl . "', `ssl_redirect`='" . (int)$ssl_redirect . "', `ssl_ipandport`='" . (int)$ssl_ipandport . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ", `isbinddomain`='" . $db->escape($isbinddomain) . "', `isemaildomain`='" . $db->escape($isemaildomain) . "', `email_only`='" . $db->escape($email_only) . "', `subcanemaildomain`='" . $db->escape($subcanemaildomain) . "', `dkim`='" . $db->escape($dkim) . "', `caneditdomain`='" . $db->escape($caneditdomain) . "', `zonefile`='" . $db->escape($zonefile) . "', `wwwserveralias`='" . $db->escape($wwwserveralias) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `speciallogfile`='" . $db->escape($speciallogfile) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "', `specialsettings`='" . $db->escape($specialsettings) . "', `registration_date`='" . $db->escape($registration_date) . "', `ismainbutsubto`='" . (int)$issubof . "' WHERE `id`='" . (int)$id . "'");
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `customerid` = '" . (int)$customerid . "', `adminid` = '" . (int)$adminid . "', `ipandport`='" . $db->escape($ipandport) . "', `openbasedir`='" . $db->escape($openbasedir) . "', `speciallogfile`='" . $db->escape($speciallogfile) . "', `phpsettingid`='" . $db->escape($phpsettingid) . "', `mod_fcgid_starter`='" . $db->escape($mod_fcgid_starter) . "', `mod_fcgid_maxrequests`='" . $db->escape($mod_fcgid_maxrequests) . "'" . $upd_specialsettings . $updatechildren . " WHERE `parentdomainid`='" . (int)$id . "'");
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "edited domain #" . $id);
|
||||
$redirect_props = Array(
|
||||
'page' => $page,
|
||||
@@ -1237,20 +1260,11 @@ if($page == 'domains'
|
||||
}
|
||||
|
||||
$result['specialsettings'] = $result['specialsettings'];
|
||||
#$isbinddomain = makeyesno('isbinddomain', '1', '0', $result['isbinddomain']);
|
||||
#$wwwserveralias = makeyesno('wwwserveralias', '1', '0', $result['wwwserveralias']);
|
||||
#$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
|
||||
#$email_only = makeyesno('email_only', '1', '0', $result['email_only']);
|
||||
#$ssl = makeyesno('ssl', '1', '0', $result['ssl']);
|
||||
#$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||
|
||||
$subcanemaildomain = makeoption($lng['admin']['subcanemaildomain']['never'], '0', $result['subcanemaildomain'], true, true);
|
||||
$subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['choosableno'], '1', $result['subcanemaildomain'], true, true);
|
||||
$subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['choosableyes'], '2', $result['subcanemaildomain'], true, true);
|
||||
$subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['always'], '3', $result['subcanemaildomain'], true, true);
|
||||
#$dkim = makeyesno('dkim', '1', '0', $result['dkim']);
|
||||
#$caneditdomain = makeyesno('caneditdomain', '1', '0', $result['caneditdomain']);
|
||||
#$openbasedir = makeyesno('openbasedir', '1', '0', $result['openbasedir']);
|
||||
#$safemode = makeyesno('safemode', '1', '0', $result['safemode']);
|
||||
$speciallogfile = ($result['speciallogfile'] == 1 ? $lng['panel']['yes'] : $lng['panel']['no']);
|
||||
$result['add_date'] = date('Y-m-d', $result['add_date']);
|
||||
|
||||
@@ -1262,8 +1276,6 @@ if($page == 'domains'
|
||||
$phpconfigs.= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
|
||||
}
|
||||
|
||||
#$specialsettingsforsubdomains = makeyesno('specialsettingsforsubdomains', '1', '0', '1');
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$domain_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/domains/formfield.domains_edit.php';
|
||||
@@ -1272,6 +1284,8 @@ if($page == 'domains'
|
||||
$title = $domain_edit_data['domain_edit']['title'];
|
||||
$image = $domain_edit_data['domain_edit']['image'];
|
||||
|
||||
$speciallogwarning = sprintf($lng['admin']['speciallogwarning'], $lng['admin']['delete_statistics']);
|
||||
|
||||
eval("echo \"" . getTemplate("domains/domains_edit") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,11 +104,13 @@ if($page == 'overview')
|
||||
$_message = isset($latestversion[1]) ? $latestversion[1] : '';
|
||||
$_link = isset($latestversion[2]) ? $latestversion[2] : htmlspecialchars($filename . '?s=' . urlencode($s) . '&page=' . urlencode($page) . '&lookfornewversion=yes');
|
||||
|
||||
$lookfornewversion_lable = $_version;
|
||||
// add the branding so debian guys are not gettings confused
|
||||
// about their version-number
|
||||
$lookfornewversion_lable = $_version.$branding;
|
||||
$lookfornewversion_link = $_link;
|
||||
$lookfornewversion_addinfo = $_message;
|
||||
|
||||
if (version_compare($version, $_version) == -1) {
|
||||
if (version_compare2($version, $_version) == -1) {
|
||||
$isnewerversion = 1;
|
||||
} else {
|
||||
$isnewerversion = 0;
|
||||
|
||||
@@ -105,11 +105,9 @@ if($page == 'ipsandports'
|
||||
$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
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
@@ -141,11 +139,11 @@ if($page == 'ipsandports'
|
||||
{
|
||||
$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 = intval($_POST['listen_statement']);
|
||||
$namevirtualhost_statement = intval($_POST['namevirtualhost_statement']);
|
||||
$vhostcontainer = intval($_POST['vhostcontainer']);
|
||||
$listen_statement = isset($_POST['listen_statement']) ? 1 : 0;
|
||||
$namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0;
|
||||
$vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0;
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
|
||||
$vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']);
|
||||
$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)
|
||||
@@ -251,21 +249,21 @@ if($page == 'ipsandports'
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "added IP/port '" . $ip . ":" . $port . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// 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');
|
||||
/*
|
||||
$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');
|
||||
*/
|
||||
|
||||
$ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php';
|
||||
$ipsandports_add_form = htmlform::genHTMLForm($ipsandports_add_data);
|
||||
@@ -290,16 +288,23 @@ if($page == 'ipsandports'
|
||||
$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 = intval($_POST['listen_statement']);
|
||||
$namevirtualhost_statement = intval($_POST['namevirtualhost_statement']);
|
||||
$vhostcontainer = intval($_POST['vhostcontainer']);
|
||||
$listen_statement = isset($_POST['listen_statement']) ? 1 : 0;
|
||||
$namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0;
|
||||
$vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0;
|
||||
$specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/');
|
||||
$vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']);
|
||||
$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['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
|
||||
*/
|
||||
&& isset($_POST['ssl'])
|
||||
&& $_POST['ssl'] != 0
|
||||
) {
|
||||
$ssl = 1;
|
||||
$ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file');
|
||||
$ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file');
|
||||
$ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file');
|
||||
@@ -402,22 +407,22 @@ if($page == 'ipsandports'
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "changed IP/port from '" . $result['ip'] . ":" . $result['port'] . "' to '" . $ip . ":" . $port . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// 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', $result['ssl']);
|
||||
$result = htmlentities_array($result);
|
||||
#$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']);
|
||||
/*
|
||||
$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);
|
||||
|
||||
@@ -22,14 +22,12 @@ 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')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
if ($page == 'log'
|
||||
&& $userinfo['change_serversettings'] == '1'
|
||||
) {
|
||||
if ($action == '') {
|
||||
$fields = array(
|
||||
'date' => $lng['logger']['date'],
|
||||
'type' => $lng['logger']['type'],
|
||||
@@ -47,24 +45,21 @@ if($page == 'log'
|
||||
$pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
$clog = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(!isset($clog[$row['action']])
|
||||
|| !is_array($clog[$row['action']]))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
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')
|
||||
{
|
||||
if ($paging->sortfield == 'date'
|
||||
&& $paging->sortorder == 'desc'
|
||||
) {
|
||||
krsort($clog);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ksort($clog);
|
||||
}
|
||||
|
||||
@@ -72,20 +67,15 @@ if($page == 'log'
|
||||
$count = 0;
|
||||
$log_count = 0;
|
||||
$log = '';
|
||||
foreach($clog as $action => $logrows)
|
||||
{
|
||||
foreach ($clog as $action => $logrows) {
|
||||
$_action = 0;
|
||||
foreach($logrows as $row)
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
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)
|
||||
{
|
||||
if ($_action != $action) {
|
||||
switch ($action) {
|
||||
case USR_ACTION:
|
||||
$_action = $lng['admin']['customer'];
|
||||
break;
|
||||
@@ -107,15 +97,14 @@ if($page == 'log'
|
||||
}
|
||||
|
||||
$row['action'] = $_action;
|
||||
eval("\$log.=\"" . getTemplate("logger/logger_action") . "\";");
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_action') . "\";");
|
||||
}
|
||||
|
||||
$log_count++;
|
||||
$type = $row['type'];
|
||||
$_type = 'unknown';
|
||||
|
||||
switch($type)
|
||||
{
|
||||
switch ($type) {
|
||||
case LOG_INFO:
|
||||
$_type = 'Information';
|
||||
break;
|
||||
@@ -137,32 +126,27 @@ if($page == 'log'
|
||||
}
|
||||
|
||||
$row['type'] = $_type;
|
||||
eval("\$log.=\"" . getTemplate("logger/logger_log") . "\";");
|
||||
eval("\$log.=\"" . getTemplate('logger/logger_log') . "\";");
|
||||
$count++;
|
||||
$_action = $action;
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("logger/logger") . "\";");
|
||||
}
|
||||
elseif($action == 'truncate')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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 . "'");
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, "truncated the system-log (mysql)");
|
||||
$log->logAction(ADM_ACTION, LOG_WARNING, 'truncated the system-log (mysql)');
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ask_yesno('logger_reallytruncate', $filename, array('page' => $page, 'action' => $action), TABLE_PANEL_LOG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,79 +22,60 @@ define('AREA', 'admin');
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
|
||||
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 == 'message')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed panel_message");
|
||||
if ($page == 'message') {
|
||||
if ($action == '') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, 'viewed panel_message');
|
||||
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
if($_POST['receipient'] == 0
|
||||
&& $userinfo['customers_see_all'] == '1')
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to admins");
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if ($_POST['receipient'] == 0
|
||||
&& $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 . "`");
|
||||
}
|
||||
elseif($_POST['receipient'] == 1)
|
||||
{
|
||||
if($userinfo['customers_see_all'] == "1")
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to ALL customers");
|
||||
} 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 . "`");
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "sending messages to 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'] . "'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('noreceipientsgiven');
|
||||
}
|
||||
|
||||
$subject = $_POST['subject'];
|
||||
$message = wordwrap($_POST['message'], 70);
|
||||
|
||||
if(!empty($message))
|
||||
{
|
||||
if (!empty($message)) {
|
||||
$mailcounter = 0;
|
||||
$mail->Body = $message;
|
||||
$mail->Subject = $subject;
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$mail->AddAddress($row['email'], (isset($row['firstname']) ? $row['firstname'] . ' ' : '') . $row['name']);
|
||||
$mail->From = $userinfo['email'];
|
||||
$mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
|
||||
|
||||
if(!$mail->Send())
|
||||
{
|
||||
if($mail->ErrorInfo != '')
|
||||
{
|
||||
if (!$mail->Send()) {
|
||||
if ($mail->ErrorInfo != '') {
|
||||
$mailerr_msg = $mail->ErrorInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mailerr_msg = $row["email"];
|
||||
} else {
|
||||
$mailerr_msg = $row['email'];
|
||||
}
|
||||
|
||||
$log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
|
||||
standard_error('errorsendingmail', $row["email"]);
|
||||
$log->logAction(ADM_ACTION, LOG_ERR, 'Error sending mail: ' . $mailerr_msg);
|
||||
standard_error('errorsendingmail', $row['email']);
|
||||
}
|
||||
|
||||
$mailcounter++;
|
||||
@@ -102,47 +83,34 @@ if($page == 'message')
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('nomessagetosend');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($action == 'showsuccess')
|
||||
{
|
||||
if ($action == 'showsuccess') {
|
||||
$success = 1;
|
||||
$sentitems = isset($_GET['sentitems']) ? (int)$_GET['sentitems'] : 0;
|
||||
|
||||
if($sentitems == 0)
|
||||
{
|
||||
if ($sentitems == 0) {
|
||||
$successmessage = $lng['message']['noreceipients'];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$successmessage = str_replace('%s', $sentitems, $lng['message']['success']);
|
||||
}
|
||||
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$success = 0;
|
||||
$sentitems = 0;
|
||||
$successmessage = '';
|
||||
$action = '';
|
||||
}
|
||||
$action = '';
|
||||
|
||||
$receipients = '';
|
||||
|
||||
if($userinfo['customers_see_all'] == "1")
|
||||
{
|
||||
if ($userinfo['customers_see_all'] == '1') {
|
||||
$receipients.= makeoption($lng['panel']['reseller'], 0);
|
||||
}
|
||||
|
||||
$receipients.= makeoption($lng['panel']['customer'], 1);
|
||||
eval("echo \"" . getTemplate("message/message") . "\";");
|
||||
$receipients .= makeoption($lng['panel']['customer'], 1);
|
||||
eval("echo \"" . getTemplate('message/message') . "\";");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -25,47 +25,54 @@ define('AREA', 'admin');
|
||||
|
||||
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($action == '')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
$tablecontent = '';
|
||||
$count = 0;
|
||||
$result = $db->query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
|
||||
$domainresult = false;
|
||||
|
||||
if((int)$userinfo['domains_see_all'] == 0)
|
||||
{
|
||||
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `adminid` = " . (int)$userinfo['userid'] . " AND `phpsettingid` = " . (int)$row['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$domainresult = $db->query("SELECT * FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `phpsettingid` = " . (int)$row['id']);
|
||||
$query = "SELECT * FROM `".TABLE_PANEL_DOMAINS."`
|
||||
WHERE `phpsettingid` = '".(int)$row['id']."'
|
||||
AND `parentdomainid` = '0'";
|
||||
|
||||
if ((int)$userinfo['domains_see_all'] == 0) {
|
||||
$query .= " AND `adminid` = '".(int)$userinfo['userid']."'";
|
||||
}
|
||||
|
||||
$domains = '';
|
||||
|
||||
if($db->num_rows($domainresult) > 0)
|
||||
{
|
||||
while($row2 = $db->fetch_array($domainresult))
|
||||
{
|
||||
$domains.= $row2['domain'] . '<br/>';
|
||||
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);
|
||||
$ssdids = array();
|
||||
while ($ssd = $db->fetch_array($ssdids_res)) {
|
||||
$ssdids[] = $ssd['standardsubdomain'];
|
||||
}
|
||||
if (count($ssdids) > 0) {
|
||||
$query .= " AND `id` NOT IN (".implode(', ', $ssdids).")";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$domainresult = $db->query($query);
|
||||
|
||||
$domains = '';
|
||||
if ($db->num_rows($domainresult) > 0) {
|
||||
while ($row2 = $db->fetch_array($domainresult)) {
|
||||
$domains.= $row2['domain'] . '<br/>';
|
||||
}
|
||||
} else {
|
||||
$domains = $lng['admin']['phpsettings']['notused'];
|
||||
}
|
||||
|
||||
|
||||
@@ -82,14 +82,9 @@ if(($page == 'settings' || $page == 'overview')
|
||||
) {
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles due to changed setting");
|
||||
inserttask('1');
|
||||
inserttask('5');
|
||||
inserttask('9');
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
|
||||
}
|
||||
}
|
||||
@@ -128,15 +123,10 @@ elseif($page == 'rebuildconfigs'
|
||||
{
|
||||
$log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles");
|
||||
inserttask('1');
|
||||
inserttask('5');
|
||||
inserttask('9');
|
||||
inserttask('10');
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
standard_success('rebuildingconfigs', '', array('filename' => 'admin_index.php'));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -48,17 +48,28 @@ elseif(isset($_GET['id']))
|
||||
$available_templates = array(
|
||||
'createcustomer',
|
||||
'pop_success',
|
||||
'trafficmaxpercent',
|
||||
'diskmaxpercent',
|
||||
'new_ticket_by_customer',
|
||||
'new_ticket_for_customer',
|
||||
'new_ticket_by_staff',
|
||||
'new_reply_ticket_by_customer',
|
||||
'new_reply_ticket_by_staff',
|
||||
'new_database_by_customer',
|
||||
'new_ftpaccount_by_customer',
|
||||
'password_reset'
|
||||
);
|
||||
|
||||
// only show templates of features that are enabled #1191
|
||||
if ((int)$settings['system']['report_enable'] == 1) {
|
||||
array_push($available_templates,
|
||||
'trafficmaxpercent',
|
||||
'diskmaxpercent'
|
||||
);
|
||||
}
|
||||
if ((int)$settings['ticket']['enabled'] == 1) {
|
||||
array_push($available_templates,
|
||||
'new_ticket_by_customer',
|
||||
'new_ticket_for_customer',
|
||||
'new_ticket_by_staff',
|
||||
'new_reply_ticket_by_customer',
|
||||
'new_reply_ticket_by_staff'
|
||||
);
|
||||
}
|
||||
|
||||
$file_templates = array(
|
||||
'index_html'
|
||||
);
|
||||
|
||||
@@ -32,17 +32,20 @@ if(isset($_POST['id']))
|
||||
elseif(isset($_GET['id']))
|
||||
{
|
||||
$id = intval($_GET['id']);
|
||||
|
||||
if (!$userinfo['customers_see_all']) {
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$sql = "SELECT `id` FROM `panel_tickets` WHERE `id` = '".$id."' AND `adminid` = '".$userinfo['admindid']."'";
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
|
||||
// only check if this is not a category-id
|
||||
if (!isset($_GET['page']) || (isset($_GET['page']) && $_GET['page'] != 'categories')) {
|
||||
if (!$userinfo['customers_see_all']) {
|
||||
/*
|
||||
* Check if the current user is allowed to see the current ticket.
|
||||
*/
|
||||
$sql = "SELECT `id` FROM `panel_tickets` WHERE `id` = '".$id."' AND `adminid` = '".$userinfo['admindid']."'";
|
||||
|
||||
$result = $db->query_first($sql);
|
||||
if ($result == null) {
|
||||
// no rights to see the requested ticket
|
||||
standard_error(array('ticketnotaccessible'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,13 +118,17 @@ if($page == 'tickets'
|
||||
if($_cid != $row['customerid'])
|
||||
{
|
||||
$cid = $row['customerid'];
|
||||
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"');
|
||||
|
||||
if(isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
|
||||
//$customer = $usr['firstname'] . " " . $usr['name'] . " (" . $usr['loginname'] . ")";
|
||||
} else {
|
||||
if(isset($usr['loginname']))
|
||||
{
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = $usr['loginname'];
|
||||
$customerid = $usr['customerid'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
}
|
||||
eval("\$tickets.=\"" . getTemplate("tickets/tickets_customer") . "\";");
|
||||
@@ -212,12 +219,16 @@ if($page == 'tickets'
|
||||
else
|
||||
{
|
||||
$categories = '';
|
||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||
$where = '';
|
||||
if ($userinfo['tickets_see_all'] != '1') {
|
||||
$where = 'WHERE `adminid` = "' . $userinfo['adminid'] . '"';
|
||||
}
|
||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` '.$where.' ORDER BY `logicalorder`, `name` ASC');
|
||||
|
||||
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');
|
||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` '.$where.' ORDER BY `logicalorder`, `name` ASC');
|
||||
|
||||
while($row = $db->fetch_array($result2))
|
||||
{
|
||||
@@ -315,13 +326,20 @@ if($page == 'tickets'
|
||||
$isclosed = 1;
|
||||
}
|
||||
|
||||
if($mainticket->Get('by') == '1')
|
||||
if ($mainticket->Get('by') == '1')
|
||||
{
|
||||
$by = $lng['ticket']['staff'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
);
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
@@ -343,7 +361,14 @@ if($page == 'tickets'
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$cid = $subticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
);
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = $subticket->Get('subject');
|
||||
@@ -450,11 +475,16 @@ elseif($page == 'categories'
|
||||
'name' => $lng['ticket']['category'],
|
||||
'logicalorder' => $lng['ticket']['logicalorder']
|
||||
);
|
||||
|
||||
$where = '1'; // WHERE 1 is like no 'where-clause'
|
||||
if ($userinfo['tickets_see_all'] != '1') {
|
||||
$where = " `main`.`adminid` = '" . (int)$userinfo['adminid'] . "'";
|
||||
}
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_TICKET_CATS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT `main`.`id`, `main`.`name`, `main`.`logicalorder`, (
|
||||
SELECT COUNT(`sub`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub`
|
||||
WHERE `sub`.`category` = `main`.`id`
|
||||
AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "')
|
||||
AND `sub`.`answerto` = '0' AND `sub`.`adminid` = '" . $userinfo['adminid'] . "')
|
||||
as `ticketcount`, (
|
||||
SELECT COUNT(`sub2`.`id`) FROM `" . TABLE_PANEL_TICKETS . "` `sub2`
|
||||
WHERE `sub2`.`category` = `main`.`id`
|
||||
@@ -462,7 +492,7 @@ elseif($page == 'categories'
|
||||
AND (`sub2`.`status` = '0' OR `sub2`.`status` = '1' OR `sub2`.`status` = '2')
|
||||
AND `sub2`.`adminid` = '" . $userinfo['adminid'] . "'
|
||||
) as `ticketcountnotclosed`
|
||||
FROM `" . TABLE_PANEL_TICKET_CATS . "` `main` WHERE `main`.`adminid` = '" . (int)$userinfo['adminid'] . "' " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
FROM `" . TABLE_PANEL_TICKET_CATS . "` `main` WHERE " . $where . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
@@ -499,7 +529,7 @@ elseif($page == 'categories'
|
||||
if($order < 1 || $order >= 1000)
|
||||
{
|
||||
// use the latest available
|
||||
$order = ticket::getHighestOrderNumber($db) + 1;
|
||||
$order = ticket::getHighestOrderNumber($db, $userinfo['adminid']) + 1;
|
||||
}
|
||||
|
||||
if($category == '')
|
||||
@@ -515,7 +545,7 @@ elseif($page == 'categories'
|
||||
}
|
||||
else
|
||||
{
|
||||
$order = ticket::getHighestOrderNumber($db) + 1;
|
||||
$order = ticket::getHighestOrderNumber($db, $userinfo['adminid']) + 1;
|
||||
|
||||
$category_new_data = include_once dirname(__FILE__).'/lib/formfields/admin/tickets/formfield.category_new.php';
|
||||
$category_new_form = htmlform::genHTMLForm($category_new_data);
|
||||
@@ -673,12 +703,17 @@ elseif($page == 'archive'
|
||||
if($_cid != $ticket['customerid'])
|
||||
{
|
||||
$cid = $ticket['customerid'];
|
||||
$usr = $db->query_first('SELECT `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname` FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"');
|
||||
|
||||
if(isset($usr['loginname'])) {
|
||||
$customer = getCorrectFullUserDetails($usr) . ' (' . $usr['loginname'] . ')';
|
||||
} else {
|
||||
if(isset($usr['loginname']))
|
||||
{
|
||||
$customer = getCorrectFullUserDetails($usr);
|
||||
$customerloginname = $usr['loginname'];
|
||||
$customerid = $usr['customerid'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$customer = $lng['ticket']['nonexistingcustomer'];
|
||||
}
|
||||
|
||||
@@ -795,11 +830,18 @@ elseif($page == 'archive'
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
);
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = htmlentities($mainticket->Get('subject'));
|
||||
$message = htmlentities($mainticket->Get('message'));
|
||||
$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') . '"');
|
||||
@@ -817,22 +859,28 @@ elseif($page == 'archive'
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$cid = $subticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
);
|
||||
$by = '<a href="'.$linker->getLink(array('section' => 'customers', 'page' => 'customers', 'action' => 'su', 'id' => $cid)).'" rel="external">';
|
||||
$by .= getCorrectFullUserDetails($usr).'</a>';
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = htmlentities($subticket->Get('subject'));
|
||||
$message = htmlentities($subticket->Get('message'));
|
||||
$subject = $subticket->Get('subject');
|
||||
$message = $subticket->Get('message');
|
||||
eval("\$ticket_replies.=\"" . getTemplate("tickets/tickets_tickets_list") . "\";");
|
||||
}
|
||||
|
||||
$priorities = makeoption($lng['ticket']['high'], '1', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['normal'], '2', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$priorities.= makeoption($lng['ticket']['low'], '3', htmlentities($mainticket->Get('priority')), true, true);
|
||||
$subject = htmlentities($mainticket->Get('subject'));
|
||||
$subject = $mainticket->Get('subject');
|
||||
$ticket_replies_count = $db->num_rows($andere) + 1;
|
||||
|
||||
// don't forget the main-ticket!
|
||||
|
||||
eval("echo \"" . getTemplate("tickets/tickets_view") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
@@ -852,6 +900,6 @@ elseif($page == 'archive'
|
||||
ask_yesno('ticket_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $mainticket->Get('subject'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
standard_error('nocustomerforticket');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -128,7 +128,7 @@ if($page == 'overview' || $page == 'customers')
|
||||
|
||||
$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.3f %s');
|
||||
$virtual_host[$months[(int)$traffic_month['month']]] = size_readable($traffic_month['traffic'], 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s');
|
||||
$totals[$months[(int)$traffic_month['month']]] += $traffic_month['traffic'];
|
||||
}
|
||||
eval("\$domain_list .= sprintf(\"%s\", \"" . getTemplate("traffic/index_table_row") . "\");");
|
||||
@@ -138,7 +138,7 @@ if($page == 'overview' || $page == 'customers')
|
||||
'name' => $lng['traffic']['months']['total'],
|
||||
);
|
||||
foreach($totals as $month => $bytes) {
|
||||
$virtual_host[$month] = ($bytes == 0 ? '-' : size_readable($bytes, 'GiB', 'bi', '%01.3f %s'));
|
||||
$virtual_host[$month] = ($bytes == 0 ? '-' : size_readable($bytes, 'GiB', 'bi', '%01.'.(int)$settings['panel']['decimal_places'].'f %s'));
|
||||
}
|
||||
$customerview = 0;
|
||||
eval("\$total_list = sprintf(\"%s\", \"" . getTemplate("traffic/index_table_row") . "\");");
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
*/
|
||||
|
||||
define('AREA', 'admin');
|
||||
require ("./lib/init.php");
|
||||
require('./lib/init.php');
|
||||
|
||||
if($page == 'overview')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_updates");
|
||||
|
||||
/**
|
||||
@@ -29,13 +28,13 @@ if($page == 'overview')
|
||||
*/
|
||||
if (!isFroxlor()) {
|
||||
if (!isset($settings['panel']['version'])
|
||||
|| $settings['panel']['version'] == ''
|
||||
|| $settings['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']."')");
|
||||
}
|
||||
if (!isset($settings['system']['dbversion'])
|
||||
|| $settings['system']['dbversion'] == ''
|
||||
|| $settings['system']['dbversion'] == ''
|
||||
) {
|
||||
/**
|
||||
* for syscp-stable (1.4.2.1) this value has to be 0
|
||||
@@ -43,11 +42,9 @@ 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'");
|
||||
|
||||
if(isset($result['value']))
|
||||
{
|
||||
|
||||
if (isset($result['value'])) {
|
||||
$settings['system']['dbversion'] = (int)$result['value'];
|
||||
} else {
|
||||
$settings['system']['dbversion'] = 0;
|
||||
@@ -55,40 +52,36 @@ if($page == 'overview')
|
||||
}
|
||||
}
|
||||
|
||||
if(hasUpdates($version))
|
||||
{
|
||||
if (hasUpdates($version)) {
|
||||
$successful_update = false;
|
||||
$message = '';
|
||||
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
if((isset($_POST['update_preconfig'])
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
if ((isset($_POST['update_preconfig'])
|
||||
&& isset($_POST['update_changesagreed'])
|
||||
&& intval($_POST['update_changesagreed']) != 0)
|
||||
|| !isset($_POST['update_preconfig'])
|
||||
) {
|
||||
eval("echo \"" . getTemplate("update/update_start") . "\";");
|
||||
eval("echo \"" . getTemplate('update/update_start') . "\";");
|
||||
|
||||
include_once './install/updatesql.php';
|
||||
|
||||
$redirect_url = 'admin_index.php?s=' . $s;
|
||||
eval("echo \"" . getTemplate("update/update_end") . "\";");
|
||||
eval("echo \"" . getTemplate('update/update_end') . "\";");
|
||||
|
||||
updateCounters();
|
||||
inserttask('1');
|
||||
@chmod('./lib/userdata.inc.php', 0440);
|
||||
|
||||
$successful_update = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '<br /><strong style="color:#ff0000;">You have to agree that you have read the update notifications.</strong>';
|
||||
} else {
|
||||
$message = '<br /><strong style="color: red">You have to agree that you have read the update notifications.</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
if(!$successful_update)
|
||||
{
|
||||
if (!$successful_update) {
|
||||
$current_version = $settings['panel']['version'];
|
||||
$new_version = $version;
|
||||
|
||||
@@ -96,29 +89,23 @@ if($page == 'overview')
|
||||
$ui_text = str_replace('%curversion', $current_version, $ui_text);
|
||||
$ui_text = str_replace('%newversion', $new_version, $ui_text);
|
||||
$update_information = $ui_text;
|
||||
|
||||
|
||||
include_once './install/updates/preconfig.php';
|
||||
$preconfig = getPreConfig($current_version);
|
||||
if($preconfig != '')
|
||||
{
|
||||
$update_information .= '<br />'.$preconfig.$message;
|
||||
if ($preconfig != '') {
|
||||
$update_information .= '<br />' . $preconfig . $message;
|
||||
}
|
||||
|
||||
|
||||
$update_information .= $lng['update']['update_information']['part_b'];
|
||||
|
||||
eval("echo \"" . getTemplate("update/index") . "\";");
|
||||
eval("echo \"" . getTemplate('update/index') . "\";");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/*
|
||||
* @TODO version-webcheck check here
|
||||
*/
|
||||
|
||||
$success_message = $lng['update']['noupdatesavail'];
|
||||
$redirect_url = 'admin_index.php?s=' . $s;
|
||||
eval("echo \"" . getTemplate("update/noupdatesavail") . "\";");
|
||||
eval("echo \"" . getTemplate('update/noupdatesavail') . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -17,18 +17,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Required code
|
||||
|
||||
define('AREA', 'customer');
|
||||
require ("./lib/init.php");
|
||||
require ('./lib/init.php');
|
||||
|
||||
$Id = 0;
|
||||
if (isset($_GET['id'])) {
|
||||
$Id = (int)$_GET['id'];
|
||||
}
|
||||
if (isset($_POST['id'])) {
|
||||
$Id = (int)$_POST['id'];
|
||||
}
|
||||
|
||||
if(isset($_GET['id']))$Id = (int)$_GET['id'];
|
||||
|
||||
if(isset($_POST['id']))$Id = (int)$_POST['id'];
|
||||
eval("echo \"" . getTemplate("aps/header") . "\";");
|
||||
eval("echo \"" . getTemplate('aps/header') . "\";");
|
||||
$Aps = new ApsParser($userinfo, $settings, $db);
|
||||
$Aps->MainHandler($action);
|
||||
eval("echo \"" . getTemplate("aps/footer") . "\";");
|
||||
|
||||
?>
|
||||
eval("echo \"" . getTemplate('aps/footer') . "\";");
|
||||
|
||||
@@ -17,18 +17,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Required code
|
||||
|
||||
define('AREA', 'customer');
|
||||
require ("./lib/init.php");
|
||||
require('./lib/init.php');
|
||||
|
||||
// Create new autoresponder
|
||||
|
||||
if($action == "add")
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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']);
|
||||
@@ -42,39 +38,31 @@ if($action == "add")
|
||||
$ts_from = -1;
|
||||
$ts_until = -1;
|
||||
|
||||
if($date_from_off > -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)
|
||||
{
|
||||
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)
|
||||
if (empty($account)
|
||||
|| empty($subject)
|
||||
|| empty($message))
|
||||
{
|
||||
|| 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if ($db->num_rows($result) == 1) {
|
||||
standard_error('autoresponderalreadyexists');
|
||||
}
|
||||
|
||||
@@ -92,25 +80,20 @@ if($action == "add")
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('noemailaccount');
|
||||
}
|
||||
|
||||
$accounts = '';
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
$accounts.= "<option value=\"" . $row['email'] . "\">" . $row['email'] . "</option>";
|
||||
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');
|
||||
//$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);
|
||||
@@ -118,18 +101,12 @@ if($action == "add")
|
||||
$title = $autoresponder_add_data['autoresponder_add']['title'];
|
||||
$image = $autoresponder_add_data['autoresponder_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("autoresponder/autoresponder_add") . "\";");
|
||||
}
|
||||
|
||||
// Edit autoresponder
|
||||
|
||||
else
|
||||
|
||||
if($action == "edit")
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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']);
|
||||
@@ -143,49 +120,36 @@ if($action == "edit")
|
||||
$ts_from = -1;
|
||||
$ts_until = -1;
|
||||
|
||||
if($date_from_off > -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)
|
||||
{
|
||||
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)
|
||||
if (empty($account)
|
||||
|| empty($subject)
|
||||
|| empty($message))
|
||||
{
|
||||
|| 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)
|
||||
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)
|
||||
{
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
$ResponderActive = 0;
|
||||
|
||||
if(isset($_POST['active'])
|
||||
&& $_POST['active'] == '1')
|
||||
{
|
||||
$ResponderActive = 1;
|
||||
}
|
||||
$ResponderActive = (isset($_POST['active']) && $_POST['active'] == '1') ? 1 : 0;
|
||||
|
||||
$db->query("UPDATE `" . TABLE_MAIL_AUTORESPONDER . "`
|
||||
SET `message` = '" . $db->escape($message) . "',
|
||||
@@ -202,11 +166,8 @@ if($action == "edit")
|
||||
$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)
|
||||
{
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
@@ -217,31 +178,25 @@ if($action == "edit")
|
||||
$date_from = (int)$row['date_from'];
|
||||
$date_until = (int)$row['date_until'];
|
||||
|
||||
if($date_from == -1)
|
||||
{
|
||||
if ($date_from == -1) {
|
||||
$deactivated = '-1';
|
||||
$date_from = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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)
|
||||
{
|
||||
if ($date_until == -1) {
|
||||
$deactivated = '-1';
|
||||
$date_until = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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']);
|
||||
//$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);
|
||||
@@ -249,26 +204,17 @@ if($action == "edit")
|
||||
$title = $autoresponder_edit_data['autoresponder_edit']['title'];
|
||||
$image = $autoresponder_edit_data['autoresponder_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("autoresponder/autoresponder_edit") . "\";");
|
||||
}
|
||||
|
||||
// Delete autoresponder
|
||||
|
||||
else
|
||||
|
||||
if($action == "delete")
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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)
|
||||
{
|
||||
if ($db->num_rows($result) == 0) {
|
||||
standard_error('invalidautoresponder');
|
||||
}
|
||||
|
||||
@@ -282,37 +228,25 @@ if($action == "delete")
|
||||
|
||||
$email = trim(htmlspecialchars($_GET['email']));
|
||||
ask_yesno('autoresponderdelete', $filename, array('action' => $action, 'account' => $email));
|
||||
}
|
||||
|
||||
// List existing autoresponders
|
||||
|
||||
else
|
||||
{
|
||||
} 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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
} 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)
|
||||
{
|
||||
} elseif($row['date_from'] != -1 && $row['date_until'] == -1) {
|
||||
$activated_date = $lng['autoresponder']['date_from'].': '.date('d-m-Y', $row['date_from']);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$activated_date = date('d-m-Y', $row['date_from']) . ' - ' . date('d-m-Y', $row['date_until']);
|
||||
}
|
||||
eval("\$autoresponder.=\"" . getTemplate("autoresponder/autoresponder_autoresponder") . "\";");
|
||||
eval("\$autoresponder.=\"" . getTemplate('autoresponder/autoresponder_autoresponder') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("autoresponder/autoresponder") . "\";");
|
||||
eval("echo \"" . getTemplate('autoresponder/autoresponder') . "\";");
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ elseif($page == 'domains')
|
||||
'd.aliasdomain' => $lng['domains']['aliasdomain']
|
||||
);
|
||||
$paging = new paging($userinfo, $db, TABLE_PANEL_DOMAINS, $fields, $settings['panel']['paging'], $settings['panel']['natsorting']);
|
||||
$result = $db->query("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`email_only`='0' AND `d`.`id` <> " . (int)$userinfo['standardsubdomain'] . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$result = $db->query("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`caneditdomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_ipandport`, `ad`.`id` AS `aliasdomainid`, `ad`.`domain` AS `aliasdomain`, `da`.`id` AS `domainaliasid`, `da`.`domain` AS `domainalias` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `ad` ON `d`.`aliasdomain`=`ad`.`id` LEFT JOIN `" . TABLE_PANEL_DOMAINS . "` `da` ON `da`.`aliasdomain`=`d`.`id` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`email_only`='0' AND `d`.`id` <> " . (int)$userinfo['standardsubdomain'] . " " . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit());
|
||||
$paging->setEntries($db->num_rows($result));
|
||||
$sortcode = $paging->getHtmlSortCode($lng);
|
||||
$arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s);
|
||||
@@ -151,6 +151,15 @@ elseif($page == 'domains')
|
||||
$row['documentroot'] = makeCorrectDir(substr($row['documentroot'], strlen($userinfo['documentroot'])));
|
||||
}
|
||||
|
||||
// get ssl-ips if activated
|
||||
// FIXME for multi-ip later
|
||||
$show_ssledit = false;
|
||||
if ($settings['system']['use_ssl'] == '1'
|
||||
&& $row['ssl_ipandport'] != 0
|
||||
&& $row['caneditdomain'] == '1'
|
||||
) {
|
||||
$show_ssledit = true;
|
||||
}
|
||||
$row = htmlentities_array($row);
|
||||
eval("\$domains.=\"" . getTemplate("domains/domains_domain") . "\";");
|
||||
}
|
||||
@@ -197,11 +206,9 @@ elseif($page == 'domains')
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used`=`subdomains_used`-1 WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
@@ -254,8 +261,17 @@ elseif($page == 'domains')
|
||||
if(!preg_match('/^https?\:\/\//', $path)
|
||||
|| !validateUrl($idna_convert->encode($path)))
|
||||
{
|
||||
$path = $userinfo['documentroot'] . '/' . $path;
|
||||
$path = makeCorrectDir($path);
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if((($path == '') || ($path == '/'))
|
||||
&& $settings['system']['documentroot_use_default_value'] == 1)
|
||||
{
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $completedomain);
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
}
|
||||
if (strstr($path, ":") !== FALSE)
|
||||
{
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
@@ -334,8 +350,7 @@ elseif($page == 'domains')
|
||||
`parentdomainid` = '" . (int)$domain_check['id'] . "',
|
||||
`isemaildomain` = '" . ($domain_check['subcanemaildomain'] == '3' ? '1' : '0') . "',
|
||||
`openbasedir` = '" . $db->escape($domain_check['openbasedir']) . "',
|
||||
`openbasedir_path` = '" . $db->escape($openbasedir_path) . "',
|
||||
`safemode` = '" . $db->escape($domain_check['safemode']) . "',
|
||||
`openbasedir_path` = '" . $db->escape($openbasedir_path) . "',
|
||||
`speciallogfile` = '" . $db->escape($domain_check['speciallogfile']) . "',
|
||||
`specialsettings` = '" . $db->escape($domain_check['specialsettings']) . "',
|
||||
`ssl_redirect` = '" . $ssl_redirect . "',
|
||||
@@ -352,11 +367,9 @@ elseif($page == 'domains')
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
@@ -388,7 +401,13 @@ elseif($page == 'domains')
|
||||
}
|
||||
}
|
||||
|
||||
#$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$resultX = $db->query_first("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
$ssl_ipsandports = 'notempty';
|
||||
}
|
||||
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
|
||||
@@ -405,7 +424,7 @@ elseif($page == 'domains')
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_redirect`, `d`.`aliasdomain`, `d`.`openbasedir_path`, `d`.`ipandport`, `pd`.`subcanemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_DOMAINS . "` `pd` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`id`='" . (int)$id . "' AND ((`d`.`parentdomainid`!='0' AND `pd`.`id`=`d`.`parentdomainid`) OR (`d`.`parentdomainid`='0' AND `pd`.`id`=`d`.`id`)) AND `d`.`caneditdomain`='1'");
|
||||
$result = $db->query_first("SELECT `d`.`id`, `d`.`customerid`, `d`.`domain`, `d`.`documentroot`, `d`.`isemaildomain`, `d`.`iswildcarddomain`, `d`.`parentdomainid`, `d`.`ssl_redirect`, `d`.`aliasdomain`, `d`.`openbasedir`, `d`.`openbasedir_path`, `d`.`ipandport`, `pd`.`subcanemaildomain` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_DOMAINS . "` `pd` WHERE `d`.`customerid`='" . (int)$userinfo['customerid'] . "' AND `d`.`id`='" . (int)$id . "' AND ((`d`.`parentdomainid`!='0' AND `pd`.`id`=`d`.`parentdomainid`) OR (`d`.`parentdomainid`='0' AND `pd`.`id`=`d`.`id`)) AND `d`.`caneditdomain`='1'");
|
||||
$alias_check = $db->query_first('SELECT COUNT(`id`) AS count FROM `' . TABLE_PANEL_DOMAINS . '` WHERE `aliasdomain`=\'' . (int)$result['id'] . '\'');
|
||||
$alias_check = $alias_check['count'];
|
||||
$_doredirect = false;
|
||||
@@ -431,8 +450,17 @@ elseif($page == 'domains')
|
||||
if(!preg_match('/^https?\:\/\//', $path)
|
||||
|| !validateUrl($idna_convert->encode($path)))
|
||||
{
|
||||
$path = $userinfo['documentroot'] . '/' . $path;
|
||||
$path = makeCorrectDir($path);
|
||||
// If path is empty or '/' and 'Use domain name as default value for DocumentRoot path' is enabled in settings,
|
||||
// set default path to subdomain or domain name
|
||||
if((($path == '') || ($path == '/'))
|
||||
&& $settings['system']['documentroot_use_default_value'] == 1)
|
||||
{
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $result['domain']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
}
|
||||
if (strstr($path, ":") !== FALSE)
|
||||
{
|
||||
standard_error('pathmaynotcontaincolon');
|
||||
@@ -532,11 +560,9 @@ elseif($page == 'domains')
|
||||
$result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
inserttask('1');
|
||||
|
||||
# Using nameserver, insert a task which rebuilds the server config
|
||||
if ($settings['system']['bind_enable'])
|
||||
{
|
||||
inserttask('4');
|
||||
}
|
||||
// Using nameserver, insert a task which rebuilds the server config
|
||||
inserttask('4');
|
||||
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
@@ -585,9 +611,13 @@ elseif($page == 'domains')
|
||||
}
|
||||
}
|
||||
|
||||
#$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||
#$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
|
||||
#$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$resultX = $db->query_first("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
$ssl_ipsandports = 'notempty';
|
||||
}
|
||||
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
|
||||
|
||||
$result_ipandport = $db->query_first("SELECT `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id`='".(int)$result['ipandport']."'");
|
||||
@@ -613,5 +643,127 @@ elseif($page == 'domains')
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($page == 'domainssleditor') {
|
||||
|
||||
if ($action == ''
|
||||
|| $action == 'view'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
|
||||
$ssl_cert_file = isset($_POST['ssl_cert_file']) ? $_POST['ssl_cert_file'] : '';
|
||||
$ssl_key_file = isset($_POST['ssl_key_file']) ? $_POST['ssl_key_file'] : '';
|
||||
$ssl_ca_file = isset($_POST['ssl_ca_file']) ? $_POST['ssl_ca_file'] : '';
|
||||
$ssl_cert_chainfile = isset($_POST['ssl_cert_chainfile']) ? $_POST['ssl_cert_chainfile'] : '';
|
||||
$do_insert = isset($_POST['do_insert']) ? (($_POST['do_insert'] == 1) ? true : false) : false;
|
||||
|
||||
if ($ssl_cert_file != '' && $ssl_key_file == '') {
|
||||
standard_error('sslcertificateismissingprivatekey');
|
||||
}
|
||||
|
||||
$do_verify = true;
|
||||
|
||||
// no cert-file given -> forget everything
|
||||
if ($ssl_cert_file == '') {
|
||||
$ssl_key_file = '';
|
||||
$ssl_ca_file = '';
|
||||
$ssl_cert_chainfile = '';
|
||||
$do_verify = false;
|
||||
}
|
||||
|
||||
// verify certificate content
|
||||
if ($do_verify) {
|
||||
// array openssl_x509_parse ( mixed $x509cert [, bool $shortnames = true ] )
|
||||
// openssl_x509_parse() returns information about the supplied x509cert, including fields such as
|
||||
// subject name, issuer name, purposes, valid from and valid to dates etc.
|
||||
$cert_content = openssl_x509_parse($ssl_cert_file);
|
||||
|
||||
if (is_array($cert_content)
|
||||
&& isset($cert_content['subject'])
|
||||
&& isset($cert_content['subject']['CN'])
|
||||
) {
|
||||
// TODO self-signed certs might differ and don't need/want this
|
||||
/*
|
||||
$domain = $db->query_first("SELECT * FROM `".TABLE_PANEL_DOMAINS."` WHERE `id`='".(int)$id."'");
|
||||
if (strtolower($cert_content['subject']['CN']) != strtolower($idna_convert->decode($domain['domain']))) {
|
||||
standard_error('sslcertificatewrongdomain');
|
||||
}
|
||||
*/
|
||||
|
||||
// bool openssl_x509_check_private_key ( mixed $cert , mixed $key )
|
||||
// Checks whether the given key is the private key that corresponds to cert.
|
||||
if (openssl_x509_check_private_key($ssl_cert_file, $ssl_key_file) === false) {
|
||||
standard_error('sslcertificateinvalidcertkeypair');
|
||||
}
|
||||
|
||||
// check optional stuff
|
||||
if ($ssl_ca_file != '') {
|
||||
$ca_content = openssl_x509_parse($ssl_ca_file);
|
||||
if (!is_array($ca_content)) {
|
||||
// invalid
|
||||
standard_error('sslcertificateinvalidca');
|
||||
}
|
||||
}
|
||||
if ($ssl_cert_chainfile != '') {
|
||||
$chain_content = openssl_x509_parse($ssl_cert_chainfile);
|
||||
if (!is_array($chain_content)) {
|
||||
// invalid
|
||||
standard_error('sslcertificateinvalidchain');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
standard_error('sslcertificateinvalidcert');
|
||||
}
|
||||
}
|
||||
|
||||
// Add/Update database entry
|
||||
$qrystart = "UPDATE ";
|
||||
$qrywhere = "WHERE ";
|
||||
if ($do_insert) {
|
||||
$qrystart = "INSERT INTO ";
|
||||
$qrywhere = ", ";
|
||||
}
|
||||
$db->query($qrystart." `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` SET
|
||||
`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)."'
|
||||
".$qrywhere." `domainid`='".(int)$id."';"
|
||||
);
|
||||
|
||||
// insert task to re-generate webserver-configs (#1260)
|
||||
inserttask('1');
|
||||
|
||||
// back to domain overview
|
||||
redirectTo($filename, array('page' => 'domains', 's' => $s));
|
||||
}
|
||||
|
||||
$result = $db->query_first("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."`
|
||||
WHERE `domainid`='".(int)$id."';"
|
||||
);
|
||||
|
||||
$do_insert = false;
|
||||
// if no entry can be found, behave like we have empty values
|
||||
if (!is_array($result) || !isset($result['ssl_cert_file'])) {
|
||||
$result = array(
|
||||
'ssl_cert_file' => '',
|
||||
'ssl_key_file' => '',
|
||||
'ssl_ca_file' => '',
|
||||
'ssl_cert_chainfile' => ''
|
||||
);
|
||||
$do_insert = true;
|
||||
}
|
||||
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$ssleditor_data = include_once dirname(__FILE__).'/lib/formfields/customer/domains/formfield.domain_ssleditor.php';
|
||||
$ssleditor_form = htmlform::genHTMLForm($ssleditor_data);
|
||||
|
||||
$title = $ssleditor_data['domain_ssleditor']['title'];
|
||||
$image = $ssleditor_data['domain_ssleditor']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("domains/domain_ssleditor") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -237,7 +237,7 @@ elseif($page == 'emails')
|
||||
standard_error('emailiswrong', $email_full);
|
||||
}
|
||||
|
||||
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE ( `email`='" . $db->escape($email) . "' OR `email_full` = '" . $db->escape($email_full) . "' ) AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE (`email` = '" . strtolower($db->escape($email)) . "' OR `email_full` = '" . strtolower($db->escape($email_full)) . "') AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
if($email == ''
|
||||
|| $email_full == ''
|
||||
@@ -253,7 +253,7 @@ elseif($page == 'emails')
|
||||
{
|
||||
standard_error('maindomainnonexist', $domain);
|
||||
}
|
||||
elseif($email_check['email_full'] == $email_full)
|
||||
elseif(strtolower($email_check['email_full']) == strtolower($email_full))
|
||||
{
|
||||
standard_error('emailexistalready', $email_full);
|
||||
}
|
||||
@@ -281,9 +281,15 @@ elseif($page == 'emails')
|
||||
$domains.= makeoption($idna_convert->decode($row['domain']), $row['domain']);
|
||||
}
|
||||
|
||||
#$iscatchall = makeyesno('iscatchall', '1', '0', '0');
|
||||
//$iscatchall = makeyesno('iscatchall', '1', '0', '0');
|
||||
|
||||
$email_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_add.php';
|
||||
|
||||
if ( $settings['catchall']['catchall_enabled'] != '1' )
|
||||
{
|
||||
unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']);
|
||||
}
|
||||
|
||||
$email_add_form = htmlform::genHTMLForm($email_add_data);
|
||||
|
||||
$title = $email_add_data['emails_add']['title'];
|
||||
@@ -330,6 +336,12 @@ elseif($page == 'emails')
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$email_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_edit.php';
|
||||
|
||||
if ( $settings['catchall']['catchall_enabled'] != '1' )
|
||||
{
|
||||
unset($email_edit_data['emails_edit']['sections']['section_a']['fields']['mail_catchall']);
|
||||
}
|
||||
|
||||
$email_edit_form = htmlform::genHTMLForm($email_edit_data);
|
||||
|
||||
$title = $email_edit_data['emails_edit']['title'];
|
||||
@@ -341,34 +353,41 @@ elseif($page == 'emails')
|
||||
elseif($action == 'togglecatchall'
|
||||
&& $id != 0)
|
||||
{
|
||||
$result = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
|
||||
if(isset($result['email'])
|
||||
&& $result['email'] != '')
|
||||
if ( $settings['catchall']['catchall_enabled'] == '1' )
|
||||
{
|
||||
if($result['iscatchall'] == '1')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = '" . $db->escape($result['email_full']) . "', `iscatchall` = '0' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['id'] . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$email_parts = explode('@', $result['email_full']);
|
||||
$email = '@' . $email_parts[1];
|
||||
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `email`='" . $db->escape($email) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$result = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `popaccountid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
|
||||
if($email_check['email'] == $email)
|
||||
if(isset($result['email'])
|
||||
&& $result['email'] != '')
|
||||
{
|
||||
if($result['iscatchall'] == '1')
|
||||
{
|
||||
standard_error('youhavealreadyacatchallforthisdomain');
|
||||
exit;
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = '" . $db->escape($result['email_full']) . "', `iscatchall` = '0' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['id'] . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = '$email' , `iscatchall` = '1' WHERE `customerid`='" . $userinfo['customerid'] . "' AND `id`='" . $result['id'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited email address '" . $email . "'");
|
||||
}
|
||||
}
|
||||
$email_parts = explode('@', $result['email_full']);
|
||||
$email = '@' . $email_parts[1];
|
||||
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE `email`='" . $db->escape($email) . "' AND `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
if($email_check['email'] == $email)
|
||||
{
|
||||
standard_error('youhavealreadyacatchallforthisdomain');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `email` = '$email' , `iscatchall` = '1' WHERE `customerid`='" . $userinfo['customerid'] . "' AND `id`='" . $result['id'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "edited email address '" . $email . "'");
|
||||
}
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
standard_error(array('operationnotpermitted', 'featureisdisabled'), 'Catchall');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,11 +458,42 @@ elseif($page == 'accounts')
|
||||
$password = substr(md5(uniqid(microtime(), 1)), 12, 6);
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_MAIL_USERS . "` (`customerid`, `email`, `username`, " . ($settings['system']['mailpwcleartext'] == '1' ? '`password`, ' : '') . " `password_enc`, `homedir`, `maildir`, `uid`, `gid`, `domainid`, `postfix`, `quota`, `imap`, `pop3`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($email_full) . "', '" . $db->escape($username) . "', " . ($settings['system']['mailpwcleartext'] == '1' ? "'" . $db->escape($password) . "'," : '') . " ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($settings['system']['vmail_homedir']) . "', '" . $db->escape($userinfo['loginname'] . '/' . $email_full . '/') . "', '" . (int)$settings['system']['vmail_uid'] . "', '" . (int)$settings['system']['vmail_gid'] . "', '" . (int)$result['domainid'] . "', 'y', '" . (int)$quota . "', '" . (int)$userinfo['imap'] . "', '" . (int)$userinfo['pop3'] . "')");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
|
||||
$email_user=substr($email_full,0,strrpos($email_full,"@"));
|
||||
$email_domain=substr($email_full,strrpos($email_full,"@")+1);
|
||||
$maildirname=trim($settings['system']['vmail_maildirname']);
|
||||
// Add trailing slash to Maildir if needed
|
||||
$maildirpath=$maildirname;
|
||||
if (!empty($maildirname) and substr($maildirname,-1) != "/") $maildirpath.="/";
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_MAIL_USERS .
|
||||
"` (`customerid`, `email`, `username`, " . ($settings['system']['mailpwcleartext'] == '1' ? '`password`, ' : '') . " `password_enc`, `homedir`, `maildir`, `uid`, `gid`, `domainid`, `postfix`, `quota`, `imap`, `pop3`) ".
|
||||
"VALUES (".
|
||||
"'" . (int)$userinfo['customerid'] . "', ".
|
||||
"'" . $db->escape($email_full) . "', ".
|
||||
"'" . $db->escape($username) . "', " .
|
||||
($settings['system']['mailpwcleartext'] == '1' ? "'" . $db->escape($password) . "', " : '') .
|
||||
"'" . $db->escape($cryptPassword) . "', ".
|
||||
"'" . $db->escape($settings['system']['vmail_homedir']) . "', '" . $db->escape($userinfo['loginname'] . '/' . $email_domain . "/" . $email_user . "/" . $maildirpath) . "', ".
|
||||
"'" . (int)$settings['system']['vmail_uid'] . "', ".
|
||||
"'" . (int)$settings['system']['vmail_gid'] . "', ".
|
||||
"'" . (int)$result['domainid'] . "', ".
|
||||
"'y', ".
|
||||
"'" . (int)$quota . "', ".
|
||||
"'" . (int)$userinfo['imap'] . "', ".
|
||||
"'" . (int)$userinfo['pop3'] . "')");
|
||||
|
||||
$popaccountid = $db->insert_id();
|
||||
$result['destination'].= ' ' . $email_full;
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `destination` = '" . $db->escape(makeCorrectDestination($result['destination'])) . "', `popaccountid` = '" . (int)$popaccountid . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `email_accounts_used`=`email_accounts_used`+1, `email_quota_used`=`email_quota_used`+" . (int)$quota . " WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET ".
|
||||
"`destination` = '" . $db->escape(makeCorrectDestination($result['destination'])) . "', ".
|
||||
"`popaccountid` = '" . (int)$popaccountid . "' ".
|
||||
"WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET ".
|
||||
"`email_accounts_used`=`email_accounts_used`+1, ".
|
||||
"`email_quota_used`=`email_quota_used`+" . (int)$quota . " ".
|
||||
"WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added email account for '" . $email_full . "'");
|
||||
$replace_arr = array(
|
||||
'EMAIL' => $email_full,
|
||||
@@ -462,7 +512,7 @@ elseif($page == 'accounts')
|
||||
$mail->Subject = $mail_subject;
|
||||
$mail->AltBody = $mail_body;
|
||||
$mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
|
||||
$mail->AddAddress($email_full, getCorrectUserSalutation($userinfo));
|
||||
$mail->AddAddress($email_full);
|
||||
$mail->Send();
|
||||
} catch(phpmailerException $e) {
|
||||
$mailerr_msg = $e->errorMessage();
|
||||
@@ -557,7 +607,8 @@ elseif($page == 'accounts')
|
||||
$password = validatePassword($password);
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed email password for '" . $result['email_full'] . "'");
|
||||
$result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'");
|
||||
$cryptPassword = makeCryptPassword($password);
|
||||
$result = $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET " . ($settings['system']['mailpwcleartext'] == '1' ? "`password` = '" . $db->escape($password) . "', " : '') . " `password_enc`='" . $db->escape($cryptPassword) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$result['popaccountid'] . "'");
|
||||
redirectTo($filename, Array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -50,7 +50,6 @@ elseif($page == 'backup')
|
||||
|
||||
if(isset($_POST['send']) && $_POST['send'] == 'send'){
|
||||
$backup_enabled = ($_POST['backup_enabled'] == '1' ? '1' : '0');
|
||||
$backup_ftp_enabled = ($_POST['backup_ftp_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));
|
||||
@@ -353,18 +352,28 @@ elseif($page == 'htaccess')
|
||||
standard_error('invalidpath');
|
||||
}
|
||||
|
||||
if(isset($_POST['options_cgi']))
|
||||
{
|
||||
$options_cgi = intval($_POST['options_cgi']);
|
||||
if(isset($_POST['options_cgi'])
|
||||
&& (int)$_POST['options_cgi'] != 0
|
||||
) {
|
||||
$options_cgi = '1';
|
||||
}
|
||||
else
|
||||
{
|
||||
$options_cgi = '0';
|
||||
}
|
||||
|
||||
$error404path = correctErrorDocument($_POST['error404path']);
|
||||
$error403path = correctErrorDocument($_POST['error403path']);
|
||||
$error500path = correctErrorDocument($_POST['error500path']);
|
||||
$error404path = '';
|
||||
if (isset($_POST['error404path'])) {
|
||||
$error404path = correctErrorDocument($_POST['error404path']);
|
||||
}
|
||||
$error403path = '';
|
||||
if (isset($_POST['error403path'])) {
|
||||
$error403path = correctErrorDocument($_POST['error403path']);
|
||||
}
|
||||
$error500path = '';
|
||||
if (isset($_POST['error500path'])) {
|
||||
$error500path = correctErrorDocument($_POST['error500path']);
|
||||
}
|
||||
|
||||
if($path_dupe_check['path'] == $path)
|
||||
{
|
||||
@@ -393,9 +402,11 @@ elseif($page == 'htaccess')
|
||||
else
|
||||
{
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
#$options_indexes = makeyesno('options_indexes', '1', '0', '0');
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
#$options_cgi = makeyesno('options_cgi', '1', '0', '0');
|
||||
/*
|
||||
$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);
|
||||
@@ -460,9 +471,11 @@ elseif($page == 'htaccess')
|
||||
$result['error404path'] = $result['error404path'];
|
||||
$result['error403path'] = $result['error403path'];
|
||||
$result['error500path'] = $result['error500path'];
|
||||
#$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
|
||||
$cperlenabled = customerHasPerlEnabled($userinfo['customerid']);
|
||||
#$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
|
||||
/*
|
||||
$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']);
|
||||
$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']);
|
||||
*/
|
||||
$result = htmlentities_array($result);
|
||||
|
||||
$htaccess_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htaccess_edit.php';
|
||||
|
||||
242
customer_ftp.php
@@ -22,27 +22,20 @@ define('AREA', 'customer');
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require('./lib/init.php');
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if(isset($_POST['id']))
|
||||
{
|
||||
$id = 0;
|
||||
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_ftp");
|
||||
eval("echo \"" . getTemplate("ftp/ftp") . "\";");
|
||||
}
|
||||
elseif($page == 'accounts')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
eval("echo \"" . getTemplate('ftp/ftp') . "\";");
|
||||
} elseif ($page == 'accounts') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_ftp::accounts");
|
||||
$fields = array(
|
||||
'username' => $lng['login']['username'],
|
||||
@@ -59,23 +52,18 @@ elseif($page == 'accounts')
|
||||
$count = 0;
|
||||
$accounts = '';
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
if(strpos($row['homedir'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
if ($paging->checkDisplay($i)) {
|
||||
if (strpos($row['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$row['documentroot'] = substr($row['homedir'], strlen($userinfo['documentroot']));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$row['documentroot'] = $row['homedir'];
|
||||
}
|
||||
|
||||
$row['documentroot'] = makeCorrectDir($row['documentroot']);
|
||||
|
||||
$row = htmlentities_array($row);
|
||||
eval("\$accounts.=\"" . getTemplate("ftp/accounts_account") . "\";");
|
||||
eval("\$accounts.=\"" . getTemplate('ftp/accounts_account') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
@@ -83,19 +71,16 @@ elseif($page == 'accounts')
|
||||
}
|
||||
|
||||
$ftps_count = $db->num_rows($result);
|
||||
eval("echo \"" . getTemplate("ftp/accounts") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
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 . "'");
|
||||
|
||||
if(isset($result['username'])
|
||||
&& $result['username'] != $userinfo['loginname'])
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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']) . "'");
|
||||
@@ -103,95 +88,69 @@ elseif($page == 'accounts')
|
||||
$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'] . "'");
|
||||
|
||||
if($userinfo['ftps_used'] == '1')
|
||||
{
|
||||
$resetaccnumber = " , `ftp_lastaccountnumber`='0'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$resetaccnumber = '';
|
||||
}
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ask_yesno_withcheckbox('ftp_reallydelete', 'admin_customer_alsoremoveftphomedir', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $result['username']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
standard_error('ftp_cantdeletemainaccount');
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if($userinfo['ftps_used'] < $userinfo['ftps']
|
||||
|| $userinfo['ftps'] == '-1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['ftps_used'] < $userinfo['ftps']
|
||||
|| $userinfo['ftps'] == '-1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$path = validate($_POST['path'], 'path');
|
||||
$password = validate($_POST['ftp_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
|
||||
$sendinfomail = intval($_POST['sendinfomail']);
|
||||
if($sendinfomail != 1)
|
||||
{
|
||||
$sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0;
|
||||
if ($sendinfomail != 1) {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if($settings['customer']['ftpatdomain'] == '1')
|
||||
{
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
$ftpusername = validate($_POST['ftp_username'], 'username', '/^[a-zA-Z0-9][a-zA-Z0-9\-_]+\$?$/');
|
||||
if($ftpusername == '')
|
||||
{
|
||||
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'] . "'");
|
||||
if($ftpdomain_check['domain'] != $ftpdomain)
|
||||
{
|
||||
if ($ftpdomain_check['domain'] != $ftpdomain) {
|
||||
standard_error('maindomainnonexist', $domain);
|
||||
}
|
||||
$username = $ftpusername . "@" . $ftpdomain;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$username = $userinfo['loginname'] . $settings['customer']['ftpprefix'] . (intval($userinfo['ftp_lastaccountnumber']) + 1);
|
||||
}
|
||||
|
||||
$username_check = $db->query_first('SELECT * FROM `' . TABLE_FTP_USERS .'` WHERE `username` = \'' . $db->escape($username) . '\'');
|
||||
|
||||
if(!empty($username_check) && $username_check['username'] = $username)
|
||||
{
|
||||
if (!empty($username_check) && $username_check['username'] = $username) {
|
||||
standard_error('usernamealreadyexists', $username);
|
||||
}
|
||||
elseif($password == '')
|
||||
{
|
||||
} elseif ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
}
|
||||
elseif($path == '')
|
||||
{
|
||||
} elseif ($path == '') {
|
||||
standard_error('patherror');
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
$db->query("INSERT INTO `" . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int)$userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int)$userinfo['guid'] . "', '" . (int)$userinfo['guid'] . "')");
|
||||
|
||||
$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))
|
||||
{
|
||||
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')");
|
||||
}
|
||||
$db->query("UPDATE `" . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int)$userinfo['guid'] . "'");
|
||||
@@ -200,10 +159,10 @@ elseif($page == 'accounts')
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . " (" . $path . ")'");
|
||||
inserttask(5);
|
||||
|
||||
if($sendinfomail == 1)
|
||||
{
|
||||
if ($sendinfomail == 1) {
|
||||
$replace_arr = array(
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo),
|
||||
'SALUTATION' => getCorrectUserSalutation($userinfo),
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||
'USR_NAME' => $username,
|
||||
'USR_PASS' => $password,
|
||||
'USR_PATH' => makeCorrectDir(substr($path, strlen($userinfo['documentroot'])))
|
||||
@@ -240,35 +199,29 @@ elseif($page == 'accounts')
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], '/');
|
||||
|
||||
if($settings['customer']['ftpatdomain'] == '1')
|
||||
{
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
$domainlist = array();
|
||||
$domains = '';
|
||||
|
||||
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
while($row_domain = $db->fetch_array($result_domains))
|
||||
{
|
||||
while ($row_domain = $db->fetch_array($result_domains)) {
|
||||
$domainlist[] = $row_domain['domain'];
|
||||
}
|
||||
|
||||
sort($domainlist);
|
||||
|
||||
if(isset($domainlist[0]) && $domainlist[0] != '')
|
||||
{
|
||||
foreach($domainlist as $dom)
|
||||
{
|
||||
if (isset($domainlist[0]) && $domainlist[0] != '') {
|
||||
foreach ($domainlist as $dom) {
|
||||
$domains .= makeoption($idna_convert->decode($dom), $dom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
|
||||
$ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php';
|
||||
$ftp_add_form = htmlform::genHTMLForm($ftp_add_data);
|
||||
@@ -276,60 +229,50 @@ elseif($page == 'accounts')
|
||||
$title = $ftp_add_data['ftp_add']['title'];
|
||||
$image = $ftp_add_data['ftp_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("ftp/accounts_add") . "\";");
|
||||
eval("echo \"" . getTemplate('ftp/accounts_add') . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
} 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 . "'");
|
||||
|
||||
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'
|
||||
) {
|
||||
$path = validate($_POST['path'], 'path');
|
||||
|
||||
$_setnewpass = false;
|
||||
if(isset($_POST['ftp_password']) && $_POST['ftp_password'] != '')
|
||||
{
|
||||
if (isset($_POST['ftp_password']) && $_POST['ftp_password'] != '') {
|
||||
$password = validate($_POST['ftp_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
$_setnewpass = true;
|
||||
}
|
||||
|
||||
if($_setnewpass)
|
||||
{
|
||||
if($password == '')
|
||||
{
|
||||
if ($_setnewpass) {
|
||||
if ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account password for '" . $result['username'] . "'");
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'");
|
||||
$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`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $result['username'] . "_backup'");
|
||||
}
|
||||
// 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'");
|
||||
}
|
||||
}
|
||||
|
||||
if($path != '')
|
||||
{
|
||||
if ($path != '') {
|
||||
$path = makeCorrectDir($userinfo['documentroot'] . '/' . $path);
|
||||
|
||||
if($path != $result['homedir'])
|
||||
{
|
||||
if(!file_exists($path))
|
||||
{
|
||||
mkDirWithCorrectOwnership($userinfo['documentroot'], $path, $result['uid'], $result['gid']);
|
||||
inserttask(5); /* Let the cronjob do the rest */
|
||||
|
||||
if ($path != $result['homedir']) {
|
||||
if (!file_exists($path)) {
|
||||
// it's the task for "new ftp" but that will
|
||||
// create all directories and correct their permissions
|
||||
inserttask(5);
|
||||
}
|
||||
|
||||
$log->logAction(USR_ACTION, LOG_INFO, "updated ftp-account homdir for '" . $result['username'] . "'");
|
||||
@@ -338,30 +281,23 @@ elseif($page == 'accounts')
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($result['homedir'], $userinfo['documentroot']) === 0)
|
||||
{
|
||||
} else {
|
||||
if (strpos($result['homedir'], $userinfo['documentroot']) === 0) {
|
||||
$homedir = substr($result['homedir'], strlen($userinfo['documentroot']));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$homedir = $result['homedir'];
|
||||
}
|
||||
$homedir = makeCorrectDir($homedir);
|
||||
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit'], $homedir);
|
||||
|
||||
if($settings['customer']['ftpatdomain'] == '1')
|
||||
{
|
||||
if ($settings['customer']['ftpatdomain'] == '1') {
|
||||
$domains = '';
|
||||
|
||||
$result_domains = $db->query("SELECT `domain` FROM `" . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int)$userinfo['customerid'] . "'");
|
||||
|
||||
while($row_domain = $db->fetch_array($result_domains))
|
||||
{
|
||||
$domains.= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||
while ($row_domain = $db->fetch_array($result_domains)) {
|
||||
$domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,10 +307,8 @@ elseif($page == 'accounts')
|
||||
$title = $ftp_edit_data['ftp_edit']['title'];
|
||||
$image = $ftp_edit_data['ftp_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("ftp/accounts_edit") . "\";");
|
||||
eval("echo \"" . getTemplate('ftp/accounts_edit') . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -22,40 +22,32 @@ 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');
|
||||
|
||||
if($action == 'logout')
|
||||
{
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "logged out");
|
||||
|
||||
if($settings['session']['allow_multiple_login'] == '1')
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0' AND `hash` = '" . $s . "'");
|
||||
$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 . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'");
|
||||
}
|
||||
|
||||
$db->query($query);
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if($page == 'overview')
|
||||
{
|
||||
if ($page == 'overview') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_index");
|
||||
$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 = $db->fetch_array($result)) {
|
||||
$domainArray[] = $idna_convert->decode($row['domain']);
|
||||
}
|
||||
|
||||
natsort($domainArray);
|
||||
$domains = implode(', ', $domainArray);
|
||||
$domains = implode(',<br />', $domainArray);
|
||||
$userinfo['email'] = $idna_convert->decode($userinfo['email']);
|
||||
$yesterday = time() - (60 * 60 * 24);
|
||||
$month = date('M Y', $yesterday);
|
||||
@@ -77,22 +69,15 @@ if($page == 'overview')
|
||||
$awaitingtickets = $opentickets['count'];
|
||||
$awaitingtickets_text = '';
|
||||
|
||||
if($opentickets > 0)
|
||||
{
|
||||
if ($opentickets > 0) {
|
||||
$awaitingtickets_text = strtr($lng['ticket']['awaitingticketreply'], array('%s' => '<a href="customer_tickets.php?page=tickets&s=' . $s . '">' . $opentickets['count'] . '</a>'));
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/index") . "\";");
|
||||
}
|
||||
elseif($page == 'change_password')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
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 (md5($old_password) != $userinfo['password']) {
|
||||
standard_error('oldpasswordnotcorrect');
|
||||
exit;
|
||||
}
|
||||
@@ -100,44 +85,33 @@ elseif($page == 'change_password')
|
||||
$new_password = validatePassword($_POST['new_password'], 'new password');
|
||||
$new_password_confirm = validatePassword($_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
|
||||
{
|
||||
} else {
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($new_password) . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `password`='" . md5($old_password) . "'");
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed password');
|
||||
|
||||
if(isset($_POST['change_main_ftp'])
|
||||
&& $_POST['change_main_ftp'] == 'true')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($new_password) . "') WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
|
||||
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']) . "'");
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, 'changed main ftp password');
|
||||
}
|
||||
|
||||
if(isset($_POST['change_webalizer'])
|
||||
&& $_POST['change_webalizer'] == 'true')
|
||||
{
|
||||
if(CRYPT_STD_DES == 1)
|
||||
{
|
||||
if (isset($_POST['change_webalizer'])
|
||||
&& $_POST['change_webalizer'] == 'true'
|
||||
) {
|
||||
if (CRYPT_STD_DES == 1) {
|
||||
$saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
|
||||
$new_webalizer_password = crypt($new_password, $saltfordescrypt);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$new_webalizer_password = crypt($new_password);
|
||||
}
|
||||
|
||||
@@ -146,72 +120,52 @@ elseif($page == 'change_password')
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
} else {
|
||||
eval("echo \"" . getTemplate('index/change_password') . "\";");
|
||||
}
|
||||
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]))
|
||||
{
|
||||
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) . "'");
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
|
||||
}
|
||||
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
$language_options = '';
|
||||
|
||||
} else {
|
||||
$default_lang = $settings['panel']['standardlanguage'];
|
||||
if($userinfo['def_language'] != '') {
|
||||
if ($userinfo['def_language'] != '') {
|
||||
$default_lang = $userinfo['def_language'];
|
||||
}
|
||||
|
||||
while(list($language_file, $language_name) = each($languages))
|
||||
{
|
||||
$language_options.= makeoption($language_name, $language_file, $default_lang, true);
|
||||
$language_options = '';
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$language_options .= makeoption($language_name, $language_file, $default_lang, true);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/change_language") . "\";");
|
||||
eval("echo \"" . getTemplate('index/change_language') . "\";");
|
||||
}
|
||||
}
|
||||
elseif($page == 'change_theme')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
} elseif ($page == 'change_theme') {
|
||||
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) . "'");
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
|
||||
redirectTo($filename, Array('s' => $s));
|
||||
}
|
||||
else
|
||||
{
|
||||
$theme_options = '';
|
||||
|
||||
} else {
|
||||
$default_theme = $settings['panel']['default_theme'];
|
||||
if($userinfo['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) {
|
||||
$theme_options .= makeoption($t, $t, $default_theme, true);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("index/change_theme") . "\";");
|
||||
eval("echo \"" . getTemplate('index/change_theme') . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,30 +22,22 @@ define('AREA', 'customer');
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
|
||||
$need_db_sql_data = true;
|
||||
$need_root_db_sql_data = true;
|
||||
require ("./lib/init.php");
|
||||
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_mysql");
|
||||
$lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']);
|
||||
eval("echo \"" . getTemplate("mysql/mysql") . "\";");
|
||||
}
|
||||
elseif($page == 'mysqls')
|
||||
{
|
||||
if($action == '')
|
||||
{
|
||||
eval("echo \"" . getTemplate('mysql/mysql') . "\";");
|
||||
} elseif($page == 'mysqls') {
|
||||
if ($action == '') {
|
||||
$log->logAction(USR_ACTION, LOG_NOTICE, "viewed customer_mysql::mysqls");
|
||||
$fields = array(
|
||||
'databasename' => $lng['mysql']['databasename'],
|
||||
@@ -64,127 +56,115 @@ elseif($page == 'mysqls')
|
||||
|
||||
// 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))
|
||||
{
|
||||
if($paging->checkDisplay($i))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
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, '.', '');
|
||||
eval("\$mysqls.=\"" . getTemplate("mysql/mysqls_database") . "\";");
|
||||
eval("\$mysqls.=\"" . getTemplate('mysql/mysqls_database') . "\";");
|
||||
$count++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db_root->close();
|
||||
// End root-session
|
||||
|
||||
$mysqls_count = $db->num_rows($result);
|
||||
eval("echo \"" . getTemplate("mysql/mysqls") . "\";");
|
||||
}
|
||||
elseif($action == 'delete'
|
||||
&& $id != 0)
|
||||
{
|
||||
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'] != '')
|
||||
{
|
||||
if(!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']]))
|
||||
{
|
||||
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'
|
||||
) {
|
||||
// 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', array_unique(explode(',', $settings['system']['mysql_access_host']))) as $mysql_access_host)
|
||||
{
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON * . * FROM `' . $db_root->escape($result['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||
$db_root->query('REVOKE ALL PRIVILEGES ON `' . str_replace('_', '\_', $db_root->escape($result['databasename'])) . '` . * FROM `' . $db_root->escape($result['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '`');
|
||||
$db_root->query('DELETE FROM `mysql`.`user` WHERE `User` = "' . $db_root->escape($result['databasename']) . '" AND `Host` = "' . $db_root->escape($mysql_access_host) . '"');
|
||||
$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();
|
||||
|
||||
// End root-session
|
||||
|
||||
$db->query('DELETE FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int)$userinfo['customerid'] . '" AND `id`="' . (int)$id . '"');
|
||||
|
||||
if($userinfo['mysqls_used'] == '1')
|
||||
{
|
||||
$resetaccnumber = " , `mysql_lastaccountnumber`='0' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$resetaccnumber = '';
|
||||
}
|
||||
$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));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$dbnamedesc = $result['databasename'];
|
||||
if(isset($result['description']) && $result['description'] != '') {
|
||||
$dbnamedesc.= ' ('.$result['description'].')';
|
||||
if (isset($result['description']) && $result['description'] != '') {
|
||||
$dbnamedesc .= ' ('.$result['description'].')';
|
||||
}
|
||||
ask_yesno('mysql_reallydelete', $filename, array('id' => $id, 'page' => $page, 'action' => $action), $dbnamedesc);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'add')
|
||||
{
|
||||
if($userinfo['mysqls_used'] < $userinfo['mysqls']
|
||||
|| $userinfo['mysqls'] == '-1')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
} elseif ($action == 'add') {
|
||||
if ($userinfo['mysqls_used'] < $userinfo['mysqls']
|
||||
|| $userinfo['mysqls'] == '-1'
|
||||
) {
|
||||
if (isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send'
|
||||
) {
|
||||
$password = validate($_POST['mysql_password'], 'password');
|
||||
$password = validatePassword($password);
|
||||
|
||||
$sendinfomail = intval($_POST['sendinfomail']);
|
||||
if($sendinfomail != 1)
|
||||
{
|
||||
$sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0;
|
||||
if ($sendinfomail != 1) {
|
||||
$sendinfomail = 0;
|
||||
}
|
||||
|
||||
if($password == '')
|
||||
{
|
||||
if ($password == '') {
|
||||
standard_error(array('stringisempty', 'mypassword'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = $userinfo['loginname'] . $settings['customer']['mysqlprefix'] . (intval($userinfo['mysql_lastaccountnumber']) + 1);
|
||||
|
||||
if(count($sql_root) > 1)
|
||||
{
|
||||
} else {
|
||||
$dbserver = 0;
|
||||
if (count($sql_root) > 1) {
|
||||
$dbserver = validate($_POST['mysql_server'], html_entity_decode($lng['mysql']['mysql_server']), '', '', 0);
|
||||
|
||||
if(!isset($sql_root[$dbserver]) || !is_array($sql_root[$dbserver]))
|
||||
{
|
||||
if (!isset($sql_root[$dbserver]) || !is_array($sql_root[$dbserver])) {
|
||||
$dbserver = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbserver = 0;
|
||||
}
|
||||
|
||||
// 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'], '');
|
||||
|
||||
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];
|
||||
}
|
||||
$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)
|
||||
{
|
||||
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 . "'");
|
||||
@@ -192,24 +172,21 @@ elseif($page == 'mysqls')
|
||||
|
||||
$db_root->query('FLUSH PRIVILEGES');
|
||||
$db_root->close();
|
||||
|
||||
// End root-session
|
||||
// Statement modifyed for Database description -- PH 2004-11-29
|
||||
|
||||
$databasedescription = validate($_POST['description'], 'description');
|
||||
// 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'] . '"');
|
||||
|
||||
if($sendinfomail == 1)
|
||||
{
|
||||
if ($sendinfomail == 1) {
|
||||
$pma = $lng['admin']['notgiven'];
|
||||
if($settings['panel']['phpmyadmin_url'] != '')
|
||||
{
|
||||
if ($settings['panel']['phpmyadmin_url'] != '') {
|
||||
$pma = $settings['panel']['phpmyadmin_url'];
|
||||
}
|
||||
|
||||
$replace_arr = array(
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo),
|
||||
'SALUTATION' => getCorrectUserSalutation($userinfo),
|
||||
'CUST_NAME' => getCorrectUserSalutation($userinfo), // < keep this for compatibility
|
||||
'DB_NAME' => $username,
|
||||
'DB_PASS' => $password,
|
||||
'DB_DESC' => $databasedescription,
|
||||
@@ -248,17 +225,14 @@ elseif($page == 'mysqls')
|
||||
|
||||
redirectTo($filename, Array('page' => $page, 's' => $s));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$mysql_servers = '';
|
||||
|
||||
foreach($sql_root as $mysql_server => $mysql_server_details)
|
||||
{
|
||||
foreach ($sql_root as $mysql_server => $mysql_server_details) {
|
||||
$mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
|
||||
}
|
||||
|
||||
#$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
//$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
|
||||
|
||||
$mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php';
|
||||
$mysql_add_form = htmlform::genHTMLForm($mysql_add_data);
|
||||
@@ -266,66 +240,53 @@ elseif($page == 'mysqls')
|
||||
$title = $mysql_add_data['mysql_add']['title'];
|
||||
$image = $mysql_add_data['mysql_add']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
|
||||
eval("echo \"" . getTemplate('mysql/mysqls_add') . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($action == 'edit'
|
||||
&& $id != 0)
|
||||
{
|
||||
} 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 . '"');
|
||||
|
||||
if(isset($result['databasename'])
|
||||
&& $result['databasename'] != '')
|
||||
{
|
||||
if(!isset($sql_root[$result['dbserver']]) || !is_array($sql_root[$result['dbserver']]))
|
||||
{
|
||||
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 != '')
|
||||
{
|
||||
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)
|
||||
{
|
||||
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) . '\')');
|
||||
}
|
||||
|
||||
$db_root->query('FLUSH PRIVILEGES');
|
||||
$db_root->close();
|
||||
|
||||
// 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));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$mysql_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_edit.php';
|
||||
$mysql_edit_form = htmlform::genHTMLForm($mysql_edit_data);
|
||||
|
||||
$title = $mysql_edit_data['mysql_edit']['title'];
|
||||
$image = $mysql_edit_data['mysql_edit']['image'];
|
||||
|
||||
eval("echo \"" . getTemplate("mysql/mysqls_edit") . "\";");
|
||||
eval("echo \"" . getTemplate('mysql/mysqls_edit') . "\";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -221,12 +221,12 @@ elseif($page == 'tickets')
|
||||
else
|
||||
{
|
||||
$categories = '';
|
||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC');
|
||||
$result = $db->query_first('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||
|
||||
if(isset($result['name'])
|
||||
&& $result['name'] != '')
|
||||
{
|
||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `logicalorder`, `name` ASC');
|
||||
$result2 = $db->query('SELECT `id`, `name` FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `adminid` = "' . $userinfo['adminid'] . '" ORDER BY `logicalorder`, `name` ASC');
|
||||
|
||||
while($row = $db->fetch_array($result2))
|
||||
{
|
||||
@@ -340,7 +340,13 @@ elseif($page == 'tickets')
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$cid = $mainticket->Get('customer');
|
||||
$usr = $db->query_first('SELECT `customerid`, `firstname`, `name`, `company`, `loginname`
|
||||
FROM `' . TABLE_PANEL_CUSTOMERS . '`
|
||||
WHERE `customerid` = "' . (int)$cid . '"'
|
||||
);
|
||||
$by = getCorrectFullUserDetails($usr);
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = $mainticket->Get('subject');
|
||||
@@ -362,7 +368,8 @@ elseif($page == 'tickets')
|
||||
}
|
||||
else
|
||||
{
|
||||
$by = $lng['ticket']['customer'];
|
||||
$by = getCorrectFullUserDetails($usr);
|
||||
//$by = $lng['ticket']['customer'];
|
||||
}
|
||||
|
||||
$subject = $subticket->Get('subject');
|
||||
|
||||
@@ -23,20 +23,19 @@ 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']);
|
||||
}
|
||||
@@ -44,31 +43,24 @@ elseif(isset($_GET['month'])
|
||||
//BAM! $_GET???
|
||||
|
||||
elseif (isset($_GET['page'])
|
||||
&& $_GET['page'] == "current")
|
||||
{
|
||||
if(date('d') != '01')
|
||||
{
|
||||
&& $_GET['page'] == 'current'
|
||||
) {
|
||||
if (date('d') != '01') {
|
||||
$month = date('m');
|
||||
$year = date('Y');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(date('m') == '01')
|
||||
{
|
||||
} else {
|
||||
if (date('m') == '01') {
|
||||
$month = 12;
|
||||
$year = date('Y') - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$month = date('m') - 1;
|
||||
$year = date('Y');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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',
|
||||
@@ -82,19 +74,17 @@ if(!is_null($month)
|
||||
$traffic_complete['mail'] = 0;
|
||||
$show = '';
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$http = $row['http'];
|
||||
$ftp = $row['ftp_up'] + $row['ftp_down'];
|
||||
$mail = $row['mail'];
|
||||
$traf['byte'] = $http + $ftp + $mail;
|
||||
$traffic_complete['http']+= $http;
|
||||
$traffic_complete['ftp']+= $ftp;
|
||||
$traffic_complete['mail']+= $mail;
|
||||
$traf['day'] = $row['day'] . ".";
|
||||
$traffic_complete['http'] += $http;
|
||||
$traffic_complete['ftp'] += $ftp;
|
||||
$traffic_complete['mail'] += $mail;
|
||||
$traf['day'] = $row['day'] . '.';
|
||||
|
||||
if(extension_loaded('bcmath'))
|
||||
{
|
||||
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)";
|
||||
@@ -102,9 +92,7 @@ if(!is_null($month)
|
||||
$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']);
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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)";
|
||||
@@ -114,28 +102,22 @@ if(!is_null($month)
|
||||
$traf['byte'] = round($traf['byte'] / 1024, $settings['panel']['decimal_places']);
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate("traffic/traffic_month") . "\";");
|
||||
$show = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_month') . "\";");
|
||||
$show = $lng['traffic']['months'][intval($row['month'])] . ' ' . $row['year'];
|
||||
}
|
||||
|
||||
if(extension_loaded('bcmath'))
|
||||
{
|
||||
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
|
||||
{
|
||||
} 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']);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("traffic/traffic_details") . "\";");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
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");
|
||||
@@ -143,22 +125,20 @@ else
|
||||
$traffic_complete['ftp'] = 0;
|
||||
$traffic_complete['mail'] = 0;
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
while ($row = $db->fetch_array($result)) {
|
||||
$http = $row['http'];
|
||||
$ftp_up = $row['ftp_up'];
|
||||
$ftp_down = $row['ftp_down'];
|
||||
$mail = $row['mail'];
|
||||
$traffic_complete['http']+= $http;
|
||||
$traffic_complete['ftp']+= $ftp_up + $ftp_down;
|
||||
$traffic_complete['mail']+= $mail;
|
||||
$traffic_complete['http'] += $http;
|
||||
$traffic_complete['ftp'] += $ftp_up + $ftp_down;
|
||||
$traffic_complete['mail'] += $mail;
|
||||
$traf['month'] = $row['month'];
|
||||
$traf['year'] = $row['year'];
|
||||
$traf['monthname'] = $lng['traffic']['months'][intval($row['month'])] . " " . $row['year'];
|
||||
$traf['byte'] = $http + $ftp_up + $ftp_down + $mail;
|
||||
|
||||
if(extension_loaded('bcmath'))
|
||||
{
|
||||
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)";
|
||||
@@ -166,9 +146,7 @@ else
|
||||
$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']);
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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)";
|
||||
@@ -178,23 +156,18 @@ else
|
||||
$traf['byte'] = round($traf['byte'] / (1024 * 1024), $settings['panel']['decimal_places']);
|
||||
}
|
||||
|
||||
eval("\$traffic.=\"" . getTemplate("traffic/traffic_traffic") . "\";");
|
||||
eval("\$traffic.=\"" . getTemplate('traffic/traffic_traffic') . "\";");
|
||||
}
|
||||
|
||||
if(extension_loaded('bcmath'))
|
||||
{
|
||||
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
|
||||
{
|
||||
} 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']);
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("traffic/traffic") . "\";");
|
||||
eval("echo \"" . getTemplate('traffic/traffic') . "\";");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
Before Width: | Height: | Size: 51 B |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 62 B |
|
Before Width: | Height: | Size: 60 B |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 86 B |
|
Before Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 69 B |
|
Before Width: | Height: | Size: 66 B |
|
Before Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 827 B |
248
index.php
@@ -22,106 +22,74 @@ define('AREA', 'login');
|
||||
/**
|
||||
* Include our init.php, which manages Sessions, Language etc.
|
||||
*/
|
||||
require ('./lib/init.php');
|
||||
|
||||
require ("./lib/init.php");
|
||||
|
||||
if($action == '')
|
||||
{
|
||||
if ($action == '') {
|
||||
$action = 'login';
|
||||
}
|
||||
|
||||
if($action == 'login')
|
||||
{
|
||||
if(isset($_POST['send'])
|
||||
&& $_POST['send'] == 'send')
|
||||
{
|
||||
if ($action == 'login') {
|
||||
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) . "'");
|
||||
|
||||
if($row['customer'] == $loginname)
|
||||
{
|
||||
if ($row['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
$uid = 'customerid';
|
||||
$adminsession = '0';
|
||||
$is_admin = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if((int)$settings['login']['domain_login'] == 1)
|
||||
{
|
||||
} 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(isset($row2['customerid']) && $row2['customerid'] > 0)
|
||||
{
|
||||
if (isset($row2['customerid']) && $row2['customerid'] > 0) {
|
||||
$loginname = getCustomerDetail($row2['customerid'], 'loginname');
|
||||
|
||||
if($loginname !== false)
|
||||
{
|
||||
if ($loginname !== false) {
|
||||
$row3 = $db->query_first("SELECT `loginname` AS `customer` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
|
||||
if($row3['customer'] == $loginname)
|
||||
{
|
||||
if ($row3['customer'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_CUSTOMERS . "`";
|
||||
$uid = 'customerid';
|
||||
$adminsession = '0';
|
||||
$is_admin = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_admin = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_admin = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_admin = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasUpdates($version) && $is_admin == false)
|
||||
{
|
||||
if (hasUpdates($version) && $is_admin == false) {
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if($is_admin)
|
||||
{
|
||||
if(hasUpdates($version))
|
||||
{
|
||||
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(!isset($row['admin']))
|
||||
{
|
||||
if (!isset($row['admin'])) {
|
||||
redirectTo('index.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$row = $db->query_first("SELECT `loginname` AS `admin` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
}
|
||||
|
||||
if($row['admin'] == $loginname)
|
||||
{
|
||||
if ($row['admin'] == $loginname) {
|
||||
$table = "`" . TABLE_PANEL_ADMINS . "`";
|
||||
$uid = 'adminid';
|
||||
$adminsession = '1';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
exit;
|
||||
}
|
||||
@@ -129,64 +97,48 @@ if($action == 'login')
|
||||
|
||||
$userinfo = $db->query_first("SELECT * FROM $table WHERE `loginname`='" . $db->escape($loginname) . "'");
|
||||
|
||||
if($userinfo['loginfail_count'] >= $settings['login']['maxloginattempts']
|
||||
&& $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime']))
|
||||
{
|
||||
if ($userinfo['loginfail_count'] >= $settings['login']['maxloginattempts']
|
||||
&& $userinfo['lastlogin_fail'] > (time() - $settings['login']['deactivatetime'])
|
||||
) {
|
||||
redirectTo('index.php', Array('showmessage' => '3'), true);
|
||||
exit;
|
||||
}
|
||||
elseif($userinfo['password'] == md5($password))
|
||||
{
|
||||
} elseif($userinfo['password'] == md5($password)) {
|
||||
// login correct
|
||||
// reset loginfail_counter, set lastlogin_succ
|
||||
|
||||
$db->query("UPDATE $table SET `lastlogin_succ`='" . time() . "', `loginfail_count`='0' WHERE `$uid`='" . (int)$userinfo[$uid] . "'");
|
||||
$userinfo['userid'] = $userinfo[$uid];
|
||||
$userinfo['adminsession'] = $adminsession;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// login incorrect
|
||||
|
||||
$db->query("UPDATE $table SET `lastlogin_fail`='" . time() . "', `loginfail_count`=`loginfail_count`+1 WHERE `$uid`='" . (int)$userinfo[$uid] . "'");
|
||||
unset($userinfo);
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($userinfo['userid'])
|
||||
&& $userinfo['userid'] != '')
|
||||
{
|
||||
if (isset($userinfo['userid'])
|
||||
&& $userinfo['userid'] != ''
|
||||
) {
|
||||
$s = md5(uniqid(microtime(), 1));
|
||||
|
||||
if(isset($_POST['language']))
|
||||
{
|
||||
if (isset($_POST['language'])) {
|
||||
$language = validate($_POST['language'], 'language');
|
||||
|
||||
if($language == 'profile')
|
||||
{
|
||||
if ($language == 'profile') {
|
||||
$language = $userinfo['def_language'];
|
||||
}
|
||||
elseif(!isset($languages[$language]))
|
||||
{
|
||||
} elseif(!isset($languages[$language])) {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
}
|
||||
|
||||
if(isset($userinfo['theme']) && $userinfo['theme'] != '') {
|
||||
if (isset($userinfo['theme']) && $userinfo['theme'] != '') {
|
||||
$theme = $userinfo['theme'];
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$theme = $settings['panel']['default_theme'];
|
||||
}
|
||||
|
||||
if($settings['session']['allow_multiple_login'] != '1')
|
||||
{
|
||||
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']) . "'");
|
||||
}
|
||||
|
||||
@@ -195,56 +147,41 @@ if($action == 'login')
|
||||
$columns = mysql_num_fields($fields);
|
||||
$field_array = array();
|
||||
for ($i = 0; $i < $columns; $i++) {
|
||||
$field_array[] = mysql_field_name($fields, $i);
|
||||
$field_array[] = mysql_field_name($fields, $i);
|
||||
}
|
||||
|
||||
if (!in_array('theme', $field_array)) {
|
||||
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']) . "')");
|
||||
} 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) . "')");
|
||||
}
|
||||
} 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) . "')");
|
||||
}
|
||||
|
||||
if($userinfo['adminsession'] == '1')
|
||||
{
|
||||
if(hasUpdates($version))
|
||||
{
|
||||
if ($userinfo['adminsession'] == '1') {
|
||||
if (hasUpdates($version)) {
|
||||
redirectTo('admin_updates.php', Array('s' => $s), true);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
redirectTo('admin_index.php', Array('s' => $s), true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
redirectTo('customer_index.php', Array('s' => $s), true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
redirectTo('index.php', Array('showmessage' => '2'), true);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
exit;
|
||||
} else {
|
||||
$language_options = '';
|
||||
$language_options.= makeoption($lng['login']['profile_lng'], 'profile', 'profile', true, true);
|
||||
$language_options .= makeoption($lng['login']['profile_lng'], 'profile', 'profile', true, true);
|
||||
|
||||
while(list($language_file, $language_name) = each($languages))
|
||||
{
|
||||
$language_options.= makeoption($language_name, $language_file, 'profile', true);
|
||||
while (list($language_file, $language_name) = each($languages)) {
|
||||
$language_options .= makeoption($language_name, $language_file, 'profile', true);
|
||||
}
|
||||
|
||||
$smessage = isset($_GET['showmessage']) ? (int)$_GET['showmessage'] : 0;
|
||||
$message = '';
|
||||
$successmessage = '';
|
||||
|
||||
switch($smessage)
|
||||
{
|
||||
switch ($smessage) {
|
||||
case 1:
|
||||
$successmessage = $lng['pwdreminder']['success'];
|
||||
break;
|
||||
@@ -252,7 +189,7 @@ if($action == 'login')
|
||||
$message = $lng['error']['login'];
|
||||
break;
|
||||
case 3:
|
||||
$message = $lng['error']['login_blocked'];
|
||||
$message = sprintf($lng['error']['login_blocked'],$settings['login']['deactivatetime']);
|
||||
break;
|
||||
case 4:
|
||||
$cmail = isset($_GET['customermail']) ? $_GET['customermail'] : 'unknown';
|
||||
@@ -264,23 +201,21 @@ if($action == 'login')
|
||||
}
|
||||
|
||||
$update_in_progress = '';
|
||||
if(hasUpdates($version))
|
||||
{
|
||||
if (hasUpdates($version)) {
|
||||
$update_in_progress = $lng['update']['updateinprogress_onlyadmincanlogin'];
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("login") . "\";");
|
||||
eval("echo \"" . getTemplate('login') . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if($action == 'forgotpwd')
|
||||
{
|
||||
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 . "`
|
||||
@@ -288,64 +223,48 @@ if($action == 'forgotpwd')
|
||||
AND `email`='" . $db->escape($email) . "'";
|
||||
$result = $db->query($sql);
|
||||
|
||||
if($db->num_rows() == 0)
|
||||
{
|
||||
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($db->num_rows() > 0)
|
||||
{
|
||||
if ($db->num_rows() > 0) {
|
||||
$adminchecked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$result = null;
|
||||
}
|
||||
}
|
||||
|
||||
if($result !== null)
|
||||
{
|
||||
if ($result !== null) {
|
||||
$user = $db->fetch_array($result);
|
||||
|
||||
/* Check whether user is banned */
|
||||
if($user['deactivated'])
|
||||
{
|
||||
if ($user['deactivated']) {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
redirectTo('index.php', Array('showmessage' => '5'), true);
|
||||
}
|
||||
|
||||
if(($adminchecked && $settings['panel']['allow_preset_admin'] == '1')
|
||||
|| $adminchecked == false)
|
||||
{
|
||||
if($user !== false)
|
||||
{
|
||||
if (($adminchecked && $settings['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))
|
||||
{
|
||||
while (strlen($rnd) < ($minlength * 2)) {
|
||||
$rnd .= md5(uniqid(microtime(), 1));
|
||||
}
|
||||
$password = substr($rnd, (int)($minlength / 2), $minlength);
|
||||
}
|
||||
|
||||
if($adminchecked)
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($password) . "'
|
||||
WHERE `loginname`='" . $user['loginname'] . "'
|
||||
AND `email`='" . $user['email'] . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($password) . "'
|
||||
WHERE `loginname`='" . $user['loginname'] . "'
|
||||
AND `email`='" . $user['email'] . "'");
|
||||
}
|
||||
$passwordTable = $adminchecked ? TABLE_PANEL_ADMINS : TABLE_PANEL_CUSTOMERS;
|
||||
$db->query("UPDATE `" . $passwordTable . "` SET `password`='" . md5($password) . "'
|
||||
WHERE `loginname`='" . $user['loginname'] . "'
|
||||
AND `email`='" . $user['email'] . "'");
|
||||
|
||||
$rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
|
||||
$rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
|
||||
@@ -389,9 +308,7 @@ if($action == 'forgotpwd')
|
||||
$mail->ClearAddresses();
|
||||
redirectTo('index.php', Array('showmessage' => '1'), true);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
} 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!");
|
||||
$message = $lng['login']['combination_not_found'];
|
||||
@@ -399,28 +316,21 @@ if($action == 'forgotpwd')
|
||||
|
||||
unset($user);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$message = $lng['login']['usernotfound'];
|
||||
}
|
||||
}
|
||||
|
||||
if($adminchecked)
|
||||
{
|
||||
if($settings['panel']['allow_preset_admin'] != '1')
|
||||
{
|
||||
if ($adminchecked) {
|
||||
if ($settings['panel']['allow_preset_admin'] != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
unset ($adminchecked);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($settings['panel']['allow_preset'] != '1')
|
||||
{
|
||||
} else {
|
||||
if ($settings['panel']['allow_preset'] != '1') {
|
||||
$message = $lng['pwdreminder']['notallowed'];
|
||||
}
|
||||
}
|
||||
|
||||
eval("echo \"" . getTemplate("fpwd") . "\";");
|
||||
eval("echo \"" . getTemplate('fpwd') . "\";");
|
||||
}
|
||||
|
||||
@@ -100,23 +100,27 @@ function page_header() {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="iso-8859-1" />
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Default-Style" content="text/css" />
|
||||
<link rel="stylesheet" href="../templates/Froxlor/froxlor.css" />
|
||||
<!--[if IE]><link rel="stylesheet" href="../templates/Froxlor/froxlor_ie.css" /><![endif]-->
|
||||
<link rel="stylesheet" href="../templates/Froxlor/assets/css/main.css" />
|
||||
<!--[if IE]><link rel="stylesheet" href="../templates/Froxlor/assets/css/main_ie.css" /><![endif]-->
|
||||
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../templates/Froxlor/js/froxlor.js"></script>
|
||||
<script type="text/javascript" src="../templates/Froxlor/assets/js/main.js"></script>
|
||||
<link href="../templates/Froxlor/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||
<title>Froxlor Server Management Panel - Installation</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
input {
|
||||
background: #dae7ee url('../images/Froxlor/icons/text_align_left.png') no-repeat 5px 4px;
|
||||
background: #dae7ee url('../templates/Froxlor/assets/img/icons/text_align_left.png') no-repeat 5px 4px;
|
||||
}
|
||||
input[type="password"] {
|
||||
background: #dae7ee url('../images/Froxlor/icons/password.png') no-repeat 4px 4px;
|
||||
background: #dae7ee url('../templates/Froxlor/assets/img/icons/password.png') no-repeat 4px 4px;
|
||||
}
|
||||
input[type="submit"] {
|
||||
background: #ccc url('../images/Froxlor/icons/button_ok.png') no-repeat 4px 8px;
|
||||
background: #ccc url('../templates/Froxlor/assets/img/icons/button_ok.png') no-repeat 4px 8px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -154,13 +158,13 @@ function status_message($case, $text)
|
||||
|
||||
function requirement_checks() {
|
||||
|
||||
global $lng;
|
||||
global $lng, $theme;
|
||||
page_header();
|
||||
|
||||
?>
|
||||
<article class="install bradius">
|
||||
<header class="dark">
|
||||
<img src="../images/Froxlor/logo.png" alt="Froxlor Server Management Panel" />
|
||||
<img src="../templates/Froxlor/assets/img/logo.png" alt="Froxlor Server Management Panel" />
|
||||
</header>
|
||||
|
||||
<section class="installsec">
|
||||
@@ -520,7 +524,7 @@ if(isset($_POST['installstep'])
|
||||
?>
|
||||
<article class="install bradius">
|
||||
<header class="dark">
|
||||
<img src="../images/Froxlor/logo.png" alt="Froxlor Server Management Panel" />
|
||||
<img src="../templates/Froxlor/assets/img/logo.png" alt="Froxlor Server Management Panel" />
|
||||
</header>
|
||||
|
||||
<section class="installsec">
|
||||
@@ -673,8 +677,6 @@ if(isset($_POST['installstep'])
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($languages[$language]) . "' WHERE `settinggroup` = 'panel' AND `varname` = 'standardlanguage'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($mysql_access_host) . "' WHERE `settinggroup` = 'system' AND `varname` = 'mysql_access_host'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($webserver) . "' WHERE `settinggroup` = 'system' AND `varname` = 'webserver'");
|
||||
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpuser) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '" . $db->escape($httpgroup) . "' WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
|
||||
@@ -692,23 +694,20 @@ if(isset($_POST['installstep'])
|
||||
$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'");
|
||||
$ssettings = '';
|
||||
}
|
||||
elseif($webserver == "nginx")
|
||||
elseif($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'");
|
||||
$ssettings = '';
|
||||
}
|
||||
|
||||
// insert the lastcronrun to be the installation date
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = UNIX_TIMESTAMP() WHERE `settinggroup` = \'system\' AND `varname` = \'lastcronrun\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS);
|
||||
$db->query($query);
|
||||
|
||||
|
||||
// set specific times for some crons (traffic only at night, etc.)
|
||||
$ts = mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()));
|
||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_traffic.php';");
|
||||
@@ -717,7 +716,6 @@ if(isset($_POST['installstep'])
|
||||
$db->query("UPDATE `".TABLE_PANEL_CRONRUNS."` SET `lastrun` = '".$ts."' WHERE `cronfile` ='cron_ticketarchive.php';");
|
||||
|
||||
// and lets insert the default ip and port
|
||||
|
||||
$query = "INSERT INTO `".TABLE_PANEL_IPSANDPORTS."`
|
||||
SET `ip`= '".$db->escape($serverip)."',
|
||||
`port` = '80',
|
||||
@@ -728,14 +726,12 @@ if(isset($_POST['installstep'])
|
||||
$defaultip = $db->insert_id();
|
||||
|
||||
// insert the defaultip
|
||||
|
||||
$query = 'UPDATE `%s` SET `value` = \'%s\' WHERE `settinggroup` = \'system\' AND `varname` = \'defaultip\'';
|
||||
$query = sprintf($query, TABLE_PANEL_SETTINGS, $db->escape($defaultip));
|
||||
$db->query($query);
|
||||
status_message('green', 'OK');
|
||||
|
||||
//last but not least create the main admin
|
||||
|
||||
status_message('begin', $lng['install']['adding_admin_user']);
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_ADMINS . "` SET
|
||||
`loginname` = '" . $db->escape($admin_user) . "',
|
||||
@@ -767,6 +763,7 @@ if(isset($_POST['installstep'])
|
||||
`ftps_used` = 0,
|
||||
`tickets` = -1,
|
||||
`tickets_used` = 0,
|
||||
`tickets_see_all` = 1,
|
||||
`subdomains` = -1,
|
||||
`subdomains_used` = 0,
|
||||
`traffic` = -1048576,
|
||||
@@ -779,7 +776,6 @@ if(isset($_POST['installstep'])
|
||||
status_message('green', 'OK');
|
||||
|
||||
//now we create the userdata.inc.php with the mysql-accounts
|
||||
|
||||
status_message('begin', $lng['install']['creating_configfile']);
|
||||
$userdata = "<?php\n";
|
||||
$userdata.= "//automatically generated userdata.inc.php for Froxlor\n";
|
||||
@@ -794,7 +790,6 @@ if(isset($_POST['installstep'])
|
||||
$userdata.= "?>";
|
||||
|
||||
//we test now if we can store the userdata.inc.php in ../lib
|
||||
|
||||
if($fp = @fopen('../lib/userdata.inc.php', 'w'))
|
||||
{
|
||||
$result = @fputs($fp, $userdata, strlen($userdata));
|
||||
@@ -841,7 +836,7 @@ else
|
||||
?>
|
||||
<article class="install bradius">
|
||||
<header class="dark">
|
||||
<img src="../images/Froxlor/logo.png" alt="Froxlor Server Management Panel" />
|
||||
<img src="../templates/Froxlor/assets/img/logo.png" alt="Froxlor Server Management Panel" />
|
||||
</header>
|
||||
<section class="installsec">
|
||||
<h2><?php echo $lng['install']['language']; ?></h2>
|
||||
|
||||
@@ -73,6 +73,12 @@ $lng['install']['bcmathdescription'] = 'Traffic-calculation related functions wi
|
||||
$lng['install']['openbasedir'] = 'Testing if open_basedir is enabled...';
|
||||
$lng['install']['openbasedirenabled'] = 'enabled. Froxlor will not work properly with open_basedir enabled. Please disable open_basedir for Froxlor';
|
||||
|
||||
/**
|
||||
* ADDED IN 1.2.19-svn7
|
||||
*/
|
||||
|
||||
$lng['install']['servername_should_be_fqdn'] = 'The servername should be a FQDN and not an IP address';
|
||||
|
||||
/**
|
||||
* Renamed in 1.2.19-svn40
|
||||
*/
|
||||
|
||||
@@ -63,6 +63,12 @@ $lng['install']['click_here_to_login'] = 'Cliquez ici pour vous rendre <20> l\'in
|
||||
$lng['install']['httpuser'] = 'Nom du utilisateur du HTTP';
|
||||
$lng['install']['httpgroup'] = 'Nom du la group du HTTP';
|
||||
|
||||
/**
|
||||
* ADDED IN 1.2.19-svn7
|
||||
*/
|
||||
|
||||
$lng['install']['servername_should_be_fqdn'] = 'Le nom du serveur doit être un nom FQDN, pas une adresse IP';
|
||||
|
||||
/**
|
||||
* Renamed in 1.2.19-svn40
|
||||
*/
|
||||
|
||||
@@ -73,6 +73,12 @@ $lng['install']['openbasedirenabled'] = 'aktiviert. Froxlor wird mit aktiviertem
|
||||
$lng['install']['httpuser'] = 'HTTP Username';
|
||||
$lng['install']['httpgroup'] = 'HTTP Gruppenname';
|
||||
|
||||
/**
|
||||
* ADDED IN 1.2.19-svn7
|
||||
*/
|
||||
|
||||
$lng['install']['servername_should_be_fqdn'] = 'Der Servername sollte eine FQDN sein und keine IP Adresse sein';
|
||||
|
||||
/**
|
||||
* Renamed in 1.2.19-svn40
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ if(isFroxlorVersion('0.9-r0'))
|
||||
showUpdateStep("Performing database updates");
|
||||
/*
|
||||
* add missing database-updates if necessary (old: update/update_database.php)
|
||||
*/
|
||||
*/
|
||||
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 1)
|
||||
{
|
||||
$db->query("ALTER TABLE `panel_databases` ADD `dbserver` INT( 11 ) UNSIGNED NOT NULL default '0';");
|
||||
@@ -29,9 +29,9 @@ if(isFroxlorVersion('0.9-r0'))
|
||||
if(isset($settings['system']['dbversion']) && (int)$settings['system']['dbversion'] < 2)
|
||||
{
|
||||
$db->query("ALTER TABLE `panel_ipsandports` CHANGE `ssl_cert` `ssl_cert_file` VARCHAR( 255 ) NOT NULL,
|
||||
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
||||
ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL,
|
||||
ADD `default_vhostconf_domain` TEXT NOT NULL;");
|
||||
ADD `ssl_key_file` VARCHAR( 255 ) NOT NULL,
|
||||
ADD `ssl_ca_file` VARCHAR( 255 ) NOT NULL,
|
||||
ADD `default_vhostconf_domain` TEXT NOT NULL;");
|
||||
|
||||
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ssl_key_file', `value` = '';");
|
||||
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'system', `varname` = 'ssl_ca_file', `value` = '';");
|
||||
@@ -40,7 +40,7 @@ if(isFroxlorVersion('0.9-r0'))
|
||||
|
||||
/*
|
||||
* remove billing tables in database
|
||||
*/
|
||||
*/
|
||||
define('TABLE_BILLING_INVOICES', 'billing_invoices');
|
||||
define('TABLE_BILLING_INVOICES_ADMINS', 'billing_invoices_admins');
|
||||
define('TABLE_BILLING_INVOICE_CHANGES', 'billing_invoice_changes');
|
||||
@@ -67,116 +67,116 @@ if(isFroxlorVersion('0.9-r0'))
|
||||
|
||||
/*
|
||||
* update panel_domains, panel_customers, panel_admins
|
||||
*/
|
||||
*/
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "`
|
||||
DROP `firstname`,
|
||||
DROP `title`,
|
||||
DROP `company`,
|
||||
DROP `street`,
|
||||
DROP `zipcode`,
|
||||
DROP `city`,
|
||||
DROP `country`,
|
||||
DROP `phone`,
|
||||
DROP `fax`,
|
||||
DROP `taxid`,
|
||||
DROP `contract_date`,
|
||||
DROP `contract_number`,
|
||||
DROP `contract_details`,
|
||||
DROP `included_domains_qty`,
|
||||
DROP `included_domains_tld`,
|
||||
DROP `additional_traffic_fee`,
|
||||
DROP `additional_traffic_unit`,
|
||||
DROP `additional_diskspace_fee`,
|
||||
DROP `additional_diskspace_unit`,
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `calc_tax`,
|
||||
DROP `term_of_payment`,
|
||||
DROP `payment_every`,
|
||||
DROP `payment_method`,
|
||||
DROP `bankaccount_holder`,
|
||||
DROP `bankaccount_number`,
|
||||
DROP `bankaccount_blz`,
|
||||
DROP `bankaccount_bank`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`,
|
||||
DROP `lastinvoiced_date_traffic`,
|
||||
DROP `lastinvoiced_date_diskspace`,
|
||||
DROP `customer_categories_once`,
|
||||
DROP `customer_categories_period`,
|
||||
DROP `invoice_fee`,
|
||||
DROP `invoice_fee_hosting`,
|
||||
DROP `invoice_fee_hosting_customers`,
|
||||
DROP `invoice_fee_domains`,
|
||||
DROP `invoice_fee_traffic`,
|
||||
DROP `invoice_fee_diskspace`,
|
||||
DROP `invoice_fee_other`,
|
||||
DROP `edit_billingdata`;");
|
||||
DROP `firstname`,
|
||||
DROP `title`,
|
||||
DROP `company`,
|
||||
DROP `street`,
|
||||
DROP `zipcode`,
|
||||
DROP `city`,
|
||||
DROP `country`,
|
||||
DROP `phone`,
|
||||
DROP `fax`,
|
||||
DROP `taxid`,
|
||||
DROP `contract_date`,
|
||||
DROP `contract_number`,
|
||||
DROP `contract_details`,
|
||||
DROP `included_domains_qty`,
|
||||
DROP `included_domains_tld`,
|
||||
DROP `additional_traffic_fee`,
|
||||
DROP `additional_traffic_unit`,
|
||||
DROP `additional_diskspace_fee`,
|
||||
DROP `additional_diskspace_unit`,
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `calc_tax`,
|
||||
DROP `term_of_payment`,
|
||||
DROP `payment_every`,
|
||||
DROP `payment_method`,
|
||||
DROP `bankaccount_holder`,
|
||||
DROP `bankaccount_number`,
|
||||
DROP `bankaccount_blz`,
|
||||
DROP `bankaccount_bank`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`,
|
||||
DROP `lastinvoiced_date_traffic`,
|
||||
DROP `lastinvoiced_date_diskspace`,
|
||||
DROP `customer_categories_once`,
|
||||
DROP `customer_categories_period`,
|
||||
DROP `invoice_fee`,
|
||||
DROP `invoice_fee_hosting`,
|
||||
DROP `invoice_fee_hosting_customers`,
|
||||
DROP `invoice_fee_domains`,
|
||||
DROP `invoice_fee_traffic`,
|
||||
DROP `invoice_fee_diskspace`,
|
||||
DROP `invoice_fee_other`,
|
||||
DROP `edit_billingdata`;");
|
||||
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_CUSTOMERS . "`
|
||||
DROP `taxid`,
|
||||
DROP `title`,
|
||||
DROP `country`,
|
||||
DROP `additional_service_description`,
|
||||
DROP `contract_date`,
|
||||
DROP `contract_number`,
|
||||
DROP `contract_details`,
|
||||
DROP `included_domains_qty`,
|
||||
DROP `included_domains_tld`,
|
||||
DROP `additional_traffic_fee`,
|
||||
DROP `additional_traffic_unit`,
|
||||
DROP `additional_diskspace_fee`,
|
||||
DROP `additional_diskspace_unit`,
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `calc_tax`,
|
||||
DROP `term_of_payment`,
|
||||
DROP `payment_every`,
|
||||
DROP `payment_method`,
|
||||
DROP `bankaccount_holder`,
|
||||
DROP `bankaccount_number`,
|
||||
DROP `bankaccount_blz`,
|
||||
DROP `bankaccount_bank`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`,
|
||||
DROP `lastinvoiced_date_traffic`,
|
||||
DROP `lastinvoiced_date_diskspace`,
|
||||
DROP `invoice_fee`,
|
||||
DROP `invoice_fee_hosting`,
|
||||
DROP `invoice_fee_domains`,
|
||||
DROP `invoice_fee_traffic`,
|
||||
DROP `invoice_fee_diskspace`,
|
||||
DROP `invoice_fee_other`;");
|
||||
DROP `taxid`,
|
||||
DROP `title`,
|
||||
DROP `country`,
|
||||
DROP `additional_service_description`,
|
||||
DROP `contract_date`,
|
||||
DROP `contract_number`,
|
||||
DROP `contract_details`,
|
||||
DROP `included_domains_qty`,
|
||||
DROP `included_domains_tld`,
|
||||
DROP `additional_traffic_fee`,
|
||||
DROP `additional_traffic_unit`,
|
||||
DROP `additional_diskspace_fee`,
|
||||
DROP `additional_diskspace_unit`,
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `calc_tax`,
|
||||
DROP `term_of_payment`,
|
||||
DROP `payment_every`,
|
||||
DROP `payment_method`,
|
||||
DROP `bankaccount_holder`,
|
||||
DROP `bankaccount_number`,
|
||||
DROP `bankaccount_blz`,
|
||||
DROP `bankaccount_bank`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`,
|
||||
DROP `lastinvoiced_date_traffic`,
|
||||
DROP `lastinvoiced_date_diskspace`,
|
||||
DROP `invoice_fee`,
|
||||
DROP `invoice_fee_hosting`,
|
||||
DROP `invoice_fee_domains`,
|
||||
DROP `invoice_fee_traffic`,
|
||||
DROP `invoice_fee_diskspace`,
|
||||
DROP `invoice_fee_other`;");
|
||||
$db->query("ALTER TABLE `panel_domains`
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`;");
|
||||
DROP `taxclass`,
|
||||
DROP `setup_fee`,
|
||||
DROP `interval_fee`,
|
||||
DROP `interval_length`,
|
||||
DROP `interval_type`,
|
||||
DROP `interval_payment`,
|
||||
DROP `service_active`,
|
||||
DROP `servicestart_date`,
|
||||
DROP `serviceend_date`,
|
||||
DROP `lastinvoiced_date`;");
|
||||
|
||||
$db->query("DELETE FROM `" . TABLE_PANEL_SETTINGS . "`
|
||||
WHERE `settinggroup` = 'billing';");
|
||||
WHERE `settinggroup` = 'billing';");
|
||||
|
||||
$db->query("ALTER TABLE `" . TABLE_PANEL_ADMINS . "`
|
||||
MODIFY `traffic` BIGINT(30),
|
||||
MODIFY `traffic_used` BIGINT(30)");
|
||||
MODIFY `traffic` BIGINT(30),
|
||||
MODIFY `traffic_used` BIGINT(30)");
|
||||
|
||||
lastStepStatus(0);
|
||||
|
||||
@@ -192,7 +192,7 @@ if(isFroxlorVersion('0.9-r1'))
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('spf', 'spf_entry', '@ IN TXT \"v=spf1 a mx -all\"');");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'froxlor_graphic' WHERE `varname` = 'syscp_graphic'");
|
||||
if(isset($settings['admin']['syscp_graphic'])
|
||||
&& $settings['admin']['syscp_graphic'] != ''
|
||||
&& $settings['admin']['syscp_graphic'] != ''
|
||||
){
|
||||
$settings['admin']['froxlor_graphic'] = $settings['admin']['syscp_graphic'];
|
||||
}
|
||||
@@ -226,15 +226,15 @@ if(isFroxlorVersion('0.9-r3'))
|
||||
showUpdateStep("Creating new table 'cronjobs_run'");
|
||||
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `cronjobs_run` (
|
||||
`id` bigint(20) NOT NULL auto_increment,
|
||||
`module` varchar(250) NOT NULL,
|
||||
`cronfile` varchar(250) NOT NULL,
|
||||
`lastrun` int(15) NOT NULL DEFAULT '0',
|
||||
`interval` varchar(100) NOT NULL DEFAULT '5 MINUTE',
|
||||
`isactive` tinyint(1) DEFAULT '1',
|
||||
`desc_lng_key` varchar(100) NOT NULL DEFAULT 'cron_unknown_desc',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
`id` bigint(20) NOT NULL auto_increment,
|
||||
`module` varchar(250) NOT NULL,
|
||||
`cronfile` varchar(250) NOT NULL,
|
||||
`lastrun` int(15) NOT NULL DEFAULT '0',
|
||||
`interval` varchar(100) NOT NULL DEFAULT '5 MINUTE',
|
||||
`isactive` tinyint(1) DEFAULT '1',
|
||||
`desc_lng_key` varchar(100) NOT NULL DEFAULT 'cron_unknown_desc',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
|
||||
lastStepStatus(0);
|
||||
showUpdateStep("Inserting new values into table");
|
||||
@@ -305,8 +305,8 @@ if(isFroxlorVersion('0.9.1'))
|
||||
$result = $db->query_first("SELECT MAX(`guid`) as `latestguid` FROM `".TABLE_PANEL_CUSTOMERS."`");
|
||||
|
||||
if (isset($result['latestguid'])
|
||||
&& (int)$result['latestguid'] > 0
|
||||
&& $result['latestguid'] != $settings['system']['lastguid']
|
||||
&& (int)$result['latestguid'] > 0
|
||||
&& $result['latestguid'] != $settings['system']['lastguid']
|
||||
) {
|
||||
checkLastGuid();
|
||||
lastStepStatus(1, 'fixed');
|
||||
@@ -409,9 +409,9 @@ if(isFroxlorVersion('0.9.4'))
|
||||
* some users might still have the setting in their database
|
||||
* because we already had this back in older versions.
|
||||
* To not confuse Froxlor, we just update old settings.
|
||||
*/
|
||||
*/
|
||||
if(isset($settings['system']['awstats_path'])
|
||||
&& $settings['system']['awstats_path'] != ''
|
||||
&& $settings['system']['awstats_path'] != ''
|
||||
) {
|
||||
showUpdateStep("Updating awstats path setting");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
|
||||
@@ -425,7 +425,7 @@ if(isFroxlorVersion('0.9.4'))
|
||||
}
|
||||
|
||||
if(isset($settings['system']['awstats_domain_file'])
|
||||
&& $settings['system']['awstats_domain_file'] != ''
|
||||
&& $settings['system']['awstats_domain_file'] != ''
|
||||
) {
|
||||
showUpdateStep("Updating awstats configuration path setting");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `varname` = 'awstats_conf' WHERE `varname` = 'awstats_domain_file';");
|
||||
@@ -543,28 +543,28 @@ if(isFroxlorVersion('0.9.6-svn2'))
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'enabled', '1');");
|
||||
|
||||
if(isset($_POST['update_deferr_500'])
|
||||
&& trim($_POST['update_deferr_500']) != ''
|
||||
&& trim($_POST['update_deferr_500']) != ''
|
||||
) {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err500', '".$db->escape($_POST['update_deferr_500'])."');");
|
||||
$err500 = true;
|
||||
}
|
||||
|
||||
if(isset($_POST['update_deferr_401'])
|
||||
&& trim($_POST['update_deferr_401']) != ''
|
||||
&& trim($_POST['update_deferr_401']) != ''
|
||||
) {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err401', '".$db->escape($_POST['update_deferr_401'])."');");
|
||||
$err401 = true;
|
||||
}
|
||||
|
||||
if(isset($_POST['update_deferr_403'])
|
||||
&& trim($_POST['update_deferr_403']) != ''
|
||||
&& trim($_POST['update_deferr_403']) != ''
|
||||
) {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err403', '".$db->escape($_POST['update_deferr_403'])."');");
|
||||
$err403 = true;
|
||||
}
|
||||
|
||||
if(isset($_POST['update_deferr_404'])
|
||||
&& trim($_POST['update_deferr_404']) != ''
|
||||
&& trim($_POST['update_deferr_404']) != ''
|
||||
) {
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('defaultwebsrverrhandler', 'err404', '".$db->escape($_POST['update_deferr_404'])."');");
|
||||
$err404 = true;
|
||||
@@ -672,17 +672,17 @@ if(isFroxlorVersion('0.9.6'))
|
||||
|
||||
showUpdateStep("Adding new tables to database");
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `redirect_codes` (
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`code` varchar(3) NOT NULL,
|
||||
`enabled` tinyint(1) DEFAULT '1',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`code` varchar(3) NOT NULL,
|
||||
`enabled` tinyint(1) DEFAULT '1',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `domain_redirect_codes` (
|
||||
`rid` int(5) NOT NULL,
|
||||
`did` int(11) unsigned NOT NULL,
|
||||
UNIQUE KEY `rc` (`rid`, `did`)
|
||||
) ENGINE=MyISAM;");
|
||||
`rid` int(5) NOT NULL,
|
||||
`did` int(11) unsigned NOT NULL,
|
||||
UNIQUE KEY `rc` (`rid`, `did`)
|
||||
) ENGINE=MyISAM;");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Filling new tables with default data");
|
||||
@@ -1202,8 +1202,8 @@ if(isFroxlorVersion('0.9.14-svn6'))
|
||||
|
||||
/*
|
||||
* revert database changes we did for multiserver-support
|
||||
* before branching - sorry guys :/
|
||||
*/
|
||||
* before branching - sorry guys :/
|
||||
*/
|
||||
if(isFroxlorVersion('0.9.14-svn9'))
|
||||
{
|
||||
showUpdateStep("Reverting multiserver-patches (svn)", false);
|
||||
@@ -1396,17 +1396,17 @@ if(isFroxlorVersion('0.9.17-svn1'))
|
||||
|
||||
showUpdateStep("Adding new tables to database");
|
||||
$db->query("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;");
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`fid` int(11) NOT NULL,
|
||||
`docrootsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
$db->query("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;");
|
||||
`id` int(5) NOT NULL auto_increment,
|
||||
`fid` int(11) NOT NULL,
|
||||
`docrootsettings` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.17-svn2');
|
||||
@@ -1553,7 +1553,7 @@ if(isFroxlorVersion('0.9.20.1'))
|
||||
// The customer-table may miss the columns, if installed a fresh 0.9.20 or 0.9.20.1 - add them
|
||||
$result = $db->query("DESCRIBE `" . TABLE_PANEL_CUSTOMERS . "`");
|
||||
$columnfound = 0;
|
||||
while($row = $db->fetch_array($result))
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if($row['Field'] == 'backup_allowed')
|
||||
{
|
||||
@@ -1642,7 +1642,7 @@ if(isFroxlorVersion('0.9.22-svn1'))
|
||||
|
||||
/* fix backup_dir for #186 */
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/var/customers/backups/' WHERE `varname` = 'backup_dir';");
|
||||
|
||||
|
||||
updateToVersion('0.9.22-svn2');
|
||||
}
|
||||
|
||||
@@ -1650,7 +1650,7 @@ if(isFroxlorVersion('0.9.22-svn2'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.22-svn2 to 0.9.22-rc1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
updateToVersion('0.9.22-rc1');
|
||||
}
|
||||
|
||||
@@ -1658,7 +1658,7 @@ if(isFroxlorVersion('0.9.22-rc1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.22-rc1 to 0.9.22");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
updateToVersion('0.9.22');
|
||||
}
|
||||
|
||||
@@ -1729,10 +1729,10 @@ if(isFroxlorVersion('0.9.25'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.25 to 0.9.26-svn1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// enable bind by default
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'bind_enable', '1')");
|
||||
|
||||
|
||||
updateToVersion('0.9.26-svn1');
|
||||
}
|
||||
|
||||
@@ -1756,24 +1756,24 @@ if(isFroxlorVersion('0.9.26'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.26 to 0.9.27-svn1");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// check for multiple backup_ftp_enabled entries
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `varname` = 'backup_ftp_enabled';");
|
||||
|
||||
|
||||
// if there are more than one entry try to fix it
|
||||
if ($db->num_rows($handle) > 1) {
|
||||
$rows = $db->fetch_array($handle);
|
||||
$state = false;
|
||||
|
||||
|
||||
// iterate through all found entries
|
||||
// and try to guess what value it should be
|
||||
foreach ($rows as $row) {
|
||||
$state = $state | $row['value'];
|
||||
}
|
||||
|
||||
|
||||
// now delete all entries
|
||||
$db->query("DELETE FROM `panel_settings` WHERE `varname` = 'backup_ftp_enabled';");
|
||||
|
||||
|
||||
// and re-add it
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'backup_ftp_enabled', '". $state ."');");
|
||||
}
|
||||
@@ -1785,18 +1785,18 @@ if(isFroxlorVersion('0.9.27-svn1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.27-svn1 to 0.9.27-svn2");
|
||||
lastStepStatus(0);
|
||||
|
||||
|
||||
// Get FastCGI timeout setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' AND `varname` = 'mod_fcgid_idle_timeout';");
|
||||
|
||||
|
||||
// If timeout is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'mod_fcgid_idle_timeout', '30');");
|
||||
}
|
||||
|
||||
|
||||
// Get FastCGI timeout setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'idle_timeout';");
|
||||
|
||||
|
||||
// If timeout is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'idle_timeout', '30');");
|
||||
@@ -1812,3 +1812,346 @@ if(isFroxlorVersion('0.9.27-svn2'))
|
||||
|
||||
updateToVersion('0.9.27-rc1');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.27-rc1'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.27-rc1 to 0.9.27");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.27');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.27')) {
|
||||
showUpdateStep("Updating from 0.9.27 to 0.9.28-svn1");
|
||||
lastStepStatus(0);
|
||||
|
||||
// Get AliasconfigDir setting if available
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'phpfpm' AND `varname` = 'aliasconfigdir';");
|
||||
|
||||
// If AliasconfigDir is set then skip
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('phpfpm', 'aliasconfigdir', '/var/www/php-fpm/');");
|
||||
}
|
||||
|
||||
updateToVersion('0.9.28-svn1');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.28-svn1')) {
|
||||
showUpdateStep("Updating from 0.9.28-svn1 to 0.9.28-svn2");
|
||||
lastStepStatus(0);
|
||||
|
||||
// Insert ISO-Codes into database. Default value is foo, which is not a valid language code.
|
||||
$db->query("ALTER TABLE `panel_languages` ADD `iso` CHAR( 3 ) NOT NULL DEFAULT 'foo' AFTER `language`");
|
||||
|
||||
$handle = $db->query("SELECT `language` FROM `panel_languages` WHERE `iso`='foo'");
|
||||
|
||||
$langauges = $db->fetch_array($handle);
|
||||
foreach($languages as $language){
|
||||
switch ($language) {
|
||||
case "Deutsch":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='de' WHERE `language` = 'Deutsch'");
|
||||
break;
|
||||
case "English":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='en' WHERE `language` = 'English'");
|
||||
break;
|
||||
case "Français":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='fr' WHERE `language` = 'Français'");
|
||||
break;
|
||||
case "Chinese":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='zh' WHERE `language` = 'Chinese'");
|
||||
break;
|
||||
case "Catalan":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='ca' WHERE `language` = 'Catalan'");
|
||||
break;
|
||||
case "Español":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='es' WHERE `language` = 'Español'");
|
||||
break;
|
||||
case "Português":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='pt' WHERE `language` = 'Português'");
|
||||
break;
|
||||
case "Danish":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='da' WHERE `language` = 'Danish'");
|
||||
break;
|
||||
case "Italian":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='it' WHERE `language` = 'Italian'");
|
||||
break;
|
||||
case "Bulgarian":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='bg' WHERE `language` = 'Bulgarian'");
|
||||
break;
|
||||
case "Slovak":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='sk' WHERE `language` = 'Slovak'");
|
||||
break;
|
||||
case "Dutch":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='nl' WHERE `language` = 'Dutch'");
|
||||
break;
|
||||
case "Russian":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='ru' WHERE `language` = 'Russian'");
|
||||
break;
|
||||
case "Hungarian":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='hu' WHERE `language` = 'Hungarian'");
|
||||
break;
|
||||
case "Swedish":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='sv' WHERE `language` = 'Swedish'");
|
||||
break;
|
||||
case "Czech":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='cz' WHERE `language` = 'Czech'");
|
||||
break;
|
||||
case "Polski":
|
||||
$db->query("UPDATE `panel_languages` SET `iso`='pl' WHERE `language` = 'Polski'");
|
||||
break;
|
||||
default:
|
||||
showUpdateStep("Sorry, but I don't know the ISO-639 language code for ".$language.". Please update the entry in `panel_languages` manually.\n");
|
||||
}
|
||||
}
|
||||
|
||||
updateToVersion('0.9.28-svn2');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.28-svn2')) {
|
||||
showUpdateStep("Updating from 0.9.28-svn2 to 0.9.28-svn3");
|
||||
lastStepStatus(0);
|
||||
|
||||
// change lenght of passwd column
|
||||
$db->query("ALTER TABLE `" . TABLE_FTP_USERS . "` MODIFY `password` varchar(128) NOT NULL default ''");
|
||||
|
||||
// Add default setting for vmail_maildirname if not already in place
|
||||
$handle = $db->query("SELECT `value` FROM `panel_settings` WHERE `settinggroup` = 'system' AND `varname` = 'vmail_maildirname';");
|
||||
if ($db->num_rows($handle) < 1) {
|
||||
showUpdateStep("Adding default Maildir value into Mailserver settings.");
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'vmail_maildirname', 'Maildir');");
|
||||
}
|
||||
|
||||
updateToVersion('0.9.28-svn3');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.28-svn3'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9.28-svn3 to 0.9.28-svn4", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
if (isset($_POST['classic_theme_replacement']) && $_POST['classic_theme_replacement'] != '')
|
||||
{
|
||||
$classic_theme_replacement = $_POST['classic_theme_replacement'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$classic_theme_replacement = 'Froxlor';
|
||||
}
|
||||
showUpdateStep('Setting replacement for the discontinued and removed Classic theme (if active)', true);
|
||||
|
||||
// Updating default theme setting
|
||||
if ($settings['panel']['default_theme'] == 'Classic')
|
||||
{
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '".$db->escape($classic_theme_replacement)."' WHERE varname = 'default_theme';");
|
||||
}
|
||||
|
||||
// Updating admin's theme setting
|
||||
$db->query('UPDATE `' . TABLE_PANEL_ADMINS . '` SET `theme` = \'' . $db->escape($classic_theme_replacement) . '\' WHERE `theme` = \'Classic\'');
|
||||
|
||||
// Updating customer's theme setting
|
||||
$db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `theme` = \'' . $db->escape($classic_theme_replacement) . '\' WHERE `theme` = \'Classic\'');
|
||||
|
||||
// Updating theme setting of active sessions
|
||||
$db->query('UPDATE `' . TABLE_PANEL_SESSIONS . '` SET `theme` = \'' . $db->escape($classic_theme_replacement) . '\' WHERE `theme` = \'Classic\'');
|
||||
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep('Altering Froxlor database and tables to use UTF-8. This may take a while..', true);
|
||||
|
||||
$db->query('ALTER DATABASE `' . $db->getDbName() . '` CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||
|
||||
$handle = $db->query('SHOW TABLES');
|
||||
while ($row = $db->fetch_array($handle))
|
||||
{
|
||||
foreach ($row as $table)
|
||||
{
|
||||
$db->query('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
||||
}
|
||||
}
|
||||
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.28-svn4');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.28-svn4')) {
|
||||
showUpdateStep("Updating from 0.9.28-svn4 to 0.9.28-svn5");
|
||||
|
||||
// Catchall functionality (enabled by default) see #1114
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('catchall', 'catchall_enabled', '1');");
|
||||
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.28-svn5');
|
||||
}
|
||||
|
||||
if(isFroxlorVersion('0.9.28-svn5')) {
|
||||
showUpdateStep("Updating from 0.9.28-svn5 to 0.9.28-svn6", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
$update_system_apache24 = isset($_POST['update_system_apache24']) ? (int)$_POST['update_system_apache24'] : '0';
|
||||
showUpdateStep('Setting value for apache-2.4 modification', true);
|
||||
// support for Apache-2.4
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'apache24', '".$update_system_apache24."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Inserting new tickets-see-all field to panel_admins", true);
|
||||
$db->query("ALTER TABLE `panel_admins` ADD `tickets_see_all` tinyint(1) NOT NULL default '0' AFTER `tickets_used`");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Updating main admin entry", true);
|
||||
$db->query("UPDATE `panel_admins` SET `tickets_see_all` = '1' WHERE `adminid` = '".$userinfo['adminid']."';");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Inserting new panel webfont-settings (default: off)", true);
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'use_webfonts', '0');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'webfont', 'Numans');");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Inserting settings for nginx fastcgi-params file", true);
|
||||
$fastcgiparams = '/etc/nginx/fastcgi_params';
|
||||
if (isset($_POST['nginx_fastcgi_params']) && $_POST['nginx_fastcgi_params'] != '') {
|
||||
$fastcgiparams = makeCorrectFile($_POST['nginx_fastcgi_params']);
|
||||
}
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('nginx', 'fastcgiparams', '".$db->escape($fastcgiparams)."')");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.28-svn6');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.28-svn6')) {
|
||||
showUpdateStep("Updating from 0.9.28-svn6 to 0.9.28 release candidate 1");
|
||||
lastStepStatus(0);
|
||||
updateToVersion('0.9.28-rc1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.28-rc1')) {
|
||||
showUpdateStep("Updating from 0.9.28-rc1 to 0.9.28-rc2", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
$update_system_documentroot_use_default_value = isset($_POST['update_system_documentroot_use_default_value']) ? (int)$_POST['update_system_documentroot_use_default_value'] : '0';
|
||||
showUpdateStep("Adding new settings for using domain name as default value for DocumentRoot path", true);
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'documentroot_use_default_value', '".$update_system_documentroot_use_default_value."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.28-rc2');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.28-rc2')) {
|
||||
showUpdateStep("Updating from 0.9.28-rc2 to 0.9.28 final", true);
|
||||
$db->query("DELETE FROM `panel_settings` WHERE `settinggroup`='system' AND `varname`='mod_log_sql'");
|
||||
$db->query("DELETE FROM `panel_settings` WHERE `settinggroup`='system' AND `varname`='openssl_cnf'");
|
||||
$db->query("ALTER TABLE `panel_domains` DROP `safemode`");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.28');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.28')) {
|
||||
showUpdateStep("Updating from 0.9.28 final to 0.9.28.1");
|
||||
lastStepStatus(0);
|
||||
updateToVersion('0.9.28.1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.28.1')) {
|
||||
showUpdateStep("Updating from 0.9.28.1 to 0.9.29-dev1", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
$hide_stdsubdomains = isset($_POST['hide_stdsubdomains']) ? (int)$_POST['hide_stdsubdomains'] : '0';
|
||||
showUpdateStep('Setting value for "hide standard subdomains"', true);
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'phpconfigs_hidestdsubdomain', '".$hide_stdsubdomains."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
// don't advertise security questions - just set a default silently
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'passwordcryptfunc', '1');");
|
||||
|
||||
$fastcgiparams = $settings['nginx']['fastcgiparams'];
|
||||
// check the faulty value explicitly
|
||||
if ($fastcgiparams == '/etc/nginx/fastcgi_params/') {
|
||||
$fastcgiparams = makeCorrectFile(substr(fastcgiparams,0,-1));
|
||||
$db->query("UPDATE TABLE `panel_settings` SET `value`='".$db->escape($fastcgiparams)."' WHERE `varname`='fastcgiparams';");
|
||||
}
|
||||
updateToVersion('0.9.29-dev1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.29-dev1')) {
|
||||
showUpdateStep("Updating from 0.9.29-dev1 to 0.9.29-dev2", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
$allow_themechange_c = isset($_POST['allow_themechange_c']) ? (int)$_POST['allow_themechange_c'] : '1';
|
||||
$allow_themechange_a = isset($_POST['allow_themechange_a']) ? (int)$_POST['allow_themechange_a'] : '1';
|
||||
showUpdateStep("Inserting new setting to allow/disallow theme changes (default: on)", true);
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_theme_change_admin', '".$allow_themechange_a."');");
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_theme_change_customer', '".$allow_themechange_c."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.29-dev2');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.29-dev2')) {
|
||||
showUpdateStep("Updating from 0.9.29-dev2 to 0.9.29-dev3", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
$system_afxrservers = isset($_POST['system_afxrservers']) ? trim($_POST['system_afxrservers']) : '';
|
||||
if ($system_afxrservers != '') {
|
||||
$axfrservers = explode(',', $system_afxrservers);
|
||||
$newaxfrserver = array();
|
||||
foreach ($axfrservers as $index => $axfrserver) {
|
||||
if (validate_ip($axfrserver, true) !== false) {
|
||||
$newaxfrserver[] = $axfrserver;
|
||||
}
|
||||
}
|
||||
$system_afxrservers = implode(", ", $newaxfrserver);
|
||||
}
|
||||
showUpdateStep("Inserting new setting for AFXR server", true);
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'axfrservers', '".$db->escape($system_afxrservers)."');");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.29-dev3');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.29-dev3')) {
|
||||
showUpdateStep("Updating from 0.9.29-dev3 to 0.9.29-dev4", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("Adding new tables to database", true);
|
||||
$db->query("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,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;");
|
||||
lastStepStatus(0);
|
||||
|
||||
$system_customersslpath = isset($_POST['system_customersslpath']) ? makeCorrectDir($_POST['system_customersslpath']) : '/etc/apache2/ssl/';
|
||||
$db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'customer_ssl_path', '".$db->escape($system_customersslpath)."');");
|
||||
updateToVersion('0.9.29-dev4');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.29-dev4')) {
|
||||
showUpdateStep("Updating from 0.9.29-dev4 to 0.9.29-rc1", true);
|
||||
lastStepStatus(0);
|
||||
|
||||
// check for wrong vmail_maildirname database-field-name (bug #1242)
|
||||
showUpdateStep("correcting Maildir setting database-field-name (if needed).", true);
|
||||
$db->query("UPDATE `panel_settings` SET `varname` = 'vmail_maildirname' WHERE `settinggroup` = 'system' AND `varname` = 'vmail_maildir'");
|
||||
lastStepStatus(0);
|
||||
|
||||
showUpdateStep("setting default php-configuration for php-fpm", true);
|
||||
$dval = (isset($settings['system']['mod_fcgid_defaultini']) ? $settings['system']['mod_fcgid_defaultini'] : '1');
|
||||
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'phpfpm', `varname` = 'defaultini', `value` = '".(int)$dval."'");
|
||||
$dval = (isset($settings['system']['mod_fcgid_ownvhost']) ? $settings['system']['mod_fcgid_ownvhost'] : '1');
|
||||
$db->query("INSERT INTO `panel_settings` SET `settinggroup` = 'phpfpm', `varname` = 'vhost_defaultini', `value` = '".(int)$dval."'");
|
||||
lastStepStatus(0);
|
||||
|
||||
updateToVersion('0.9.29-rc1');
|
||||
}
|
||||
|
||||
if (isFroxlorVersion('0.9.29-rc1')) {
|
||||
showUpdateStep("Updating from 0.9.29-rc1 to 0.9.29 final", true);
|
||||
lastStepStatus(0);
|
||||
updateToVersion('0.9.29');
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
if(isFroxlorVersion('0.9'))
|
||||
{
|
||||
showUpdateStep("Updating from 0.9 to 1.0", false);
|
||||
showUpdateStep("Converting database tables to UTF-8");
|
||||
|
||||
// Convert all data to UTF-8 to have a sane standard across all data
|
||||
$result = $db->query("SHOW TABLES");
|
||||
while($table = $db->fetch_array($result, 'num'))
|
||||
{
|
||||
$db->query("ALTER TABLE " . $table[0] . " CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;");
|
||||
$db->query("ALTER TABLE " . $table[0] . " DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
|
||||
|
||||
$affected_columns = array();
|
||||
|
||||
$primarykey = "";
|
||||
$columns = $db->query("SHOW COLUMNS FROM ".$table[0]);
|
||||
while ($column = $db->fetch_array($columns))
|
||||
{
|
||||
if (!(strpos($column['Type'], "char") === false) || !(strpos($column['Type'], "text") === false))
|
||||
{
|
||||
$affected_columns[] = $column['Field'];
|
||||
}
|
||||
|
||||
if ($column['Key'] == 'PRI') {
|
||||
$primarykey = $column['Field'];
|
||||
}
|
||||
}
|
||||
|
||||
$count_cols = count($affected_columns);
|
||||
if ($count_cols > 0)
|
||||
{
|
||||
$load = "";
|
||||
foreach($affected_columns as $col)
|
||||
{
|
||||
$load .= ", `" . $col . "`";
|
||||
}
|
||||
|
||||
$rows = $db->query("SELECT $primarykey" . $load . " FROM `" . $table[0] . "`");
|
||||
while ($row = $db->fetch_array($rows))
|
||||
{
|
||||
$changes = "";
|
||||
for ($i = 0; $i < $count_cols; $i++)
|
||||
{
|
||||
$base = "`" . $affected_columns[$i] . "` = '" . convertUtf8($row[$affected_columns[$i]]) . "'";
|
||||
$changes .= ($i == ($count_cols-1)) ? $base : $base . ", ";
|
||||
}
|
||||
|
||||
$db->query("UPDATE `" . $table[0] . "` SET " . $changes . " WHERE `$primarykey` = '" . $db->escape($row[$primarykey]) . "';");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastStepStatus(0);
|
||||
}
|
||||
*/
|
||||
|
||||
?>
|
||||
@@ -49,14 +49,6 @@ function versionInUpdate($current_version, $version_to_check)
|
||||
if (!isFroxlor()) {
|
||||
return true;
|
||||
}
|
||||
$pos_a = strpos($current_version, '-svn');
|
||||
$pos_b = strpos($version_to_check, '-svn');
|
||||
// if we compare svn-versions, we have to add -svn0 to the version
|
||||
// to compare it correctly
|
||||
if($pos_a === false && $pos_b !== false)
|
||||
{
|
||||
$current_version.= '-svn9999';
|
||||
}
|
||||
|
||||
return version_compare($current_version, $version_to_check, '<');
|
||||
|
||||
return (version_compare2($current_version, $version_to_check) == -1 ? true : false);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
{
|
||||
global $settings, $lng, $db;
|
||||
global $settings, $lng, $db, $theme;
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.4-svn2'))
|
||||
{
|
||||
@@ -158,7 +158,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question.= makeyesno('update_defdns_mailentry', '1', '0', '0');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.10-svn1'))
|
||||
{
|
||||
$has_nouser = false;
|
||||
@@ -171,13 +171,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$has_nouser = true;
|
||||
$guessed_user = 'www-data';
|
||||
if(function_exists('posix_getuid')
|
||||
&& function_exists('posix_getpwuid')
|
||||
&& function_exists('posix_getpwuid')
|
||||
) {
|
||||
$_httpuser = posix_getpwuid(posix_getuid());
|
||||
$guessed_user = $_httpuser['name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
|
||||
if(!isset($result) || !isset($result['value']))
|
||||
{
|
||||
@@ -185,7 +185,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$has_nogroup = true;
|
||||
$guessed_group = 'www-data';
|
||||
if(function_exists('posix_getgid')
|
||||
&& function_exists('posix_getgrgid')
|
||||
&& function_exists('posix_getgrgid')
|
||||
) {
|
||||
$_httpgroup = posix_getgrgid(posix_getgid());
|
||||
$guessed_group = $_httpgroup['name'];
|
||||
@@ -198,8 +198,8 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
if($has_nouser)
|
||||
{
|
||||
$question = '<strong>Please enter the webservers username:</strong> <input type="text" class="text" name="update_httpuser" value="'.$guessed_user.'" />';
|
||||
}
|
||||
elseif($has_nogroup)
|
||||
}
|
||||
elseif($has_nogroup)
|
||||
{
|
||||
$question2 = '<strong>Please enter the webservers groupname:</strong> <input type="text" class="text" name="update_httpgroup" value="'.$guessed_group.'" />';
|
||||
if($has_nouser) {
|
||||
@@ -238,7 +238,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
$question.= '<input type="text" class="text" name="update_perlpath" value="/usr/bin/perl" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.12-svn1'))
|
||||
{
|
||||
if($settings['system']['mod_fcgid'] == 1)
|
||||
@@ -345,13 +345,13 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.14-svn10'))
|
||||
{
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = '<strong>This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!</strong>';
|
||||
$description = '<strong>This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!</strong>';
|
||||
$question = '';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.16-svn1'))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
@@ -417,16 +417,128 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.18-svn2'))
|
||||
{
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
|
||||
$description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
|
||||
$question = '<strong>Select default panel theme:</strong> ';
|
||||
$question.= '<select name="update_default_theme">';
|
||||
$themes = getThemes();
|
||||
foreach($themes as $theme) {
|
||||
$question.= makeoption($theme, $theme, 'Froxlor');
|
||||
foreach($themes as $cur_theme) // $theme is already in use
|
||||
{
|
||||
$question.= makeoption($cur_theme, $cur_theme, 'Froxlor');
|
||||
}
|
||||
$question.= '</select>';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if(versionInUpdate($current_version, '0.9.28-svn4'))
|
||||
{
|
||||
$has_preconfig = true;
|
||||
$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 .= 'test this update in a testing environment using your existing data.<br /><br />';
|
||||
|
||||
$question = '<strong>Select your preferred Classic Theme replacement:</strong> ';
|
||||
$question.= '<select name="classic_theme_replacement">';
|
||||
$themes = getThemes();
|
||||
foreach($themes as $cur_theme)
|
||||
{
|
||||
$question.= makeoption($cur_theme, $cur_theme, 'Froxlor');
|
||||
}
|
||||
$question.= '</select>';
|
||||
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-svn6')) {
|
||||
|
||||
if ($settings['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
|
||||
LoadModule authz_host_module modules/mod_authz_host.so</pre><br />';
|
||||
$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') {
|
||||
$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> ';
|
||||
$question.= '<input type="text" class="text" name="nginx_fastcgi_params" value="/etc/nginx/fastcgi_params" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28-rc2')) {
|
||||
|
||||
$has_preconfig = true;
|
||||
|
||||
$description = 'This version adds an option to append the domain-name to the document-root for domains and subdomains.<br />';
|
||||
$description .= 'You can enable or disable this feature anytime from settings -> system settings.<br />';
|
||||
|
||||
$question = '<strong>Do you want to automatically append the domain-name to the documentroot of newly created domains?:</strong> ';
|
||||
$question.= makeyesno('update_system_documentroot_use_default_value', '1', '0', '0');
|
||||
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.28')) {
|
||||
|
||||
$has_preconfig = true;
|
||||
// just an information about the new sendmail parameter (#1134)
|
||||
$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'
|
||||
) {
|
||||
// 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 />';
|
||||
$description .= 'do not support it anymore.<br /><br />';
|
||||
$description .= 'Please check your php-configurations and remove safe_mode-directives to avoid php notices/warnings.';
|
||||
}
|
||||
$question = '';
|
||||
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
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'
|
||||
) {
|
||||
$has_preconfig = true;
|
||||
$description = 'Standard-subdomains can now be hidden from the php-configuration overview.<br />';
|
||||
$question = '<strong>Do you want to hide the standard-subdomains (this can be changed in the settings any time)?:</strong> ';
|
||||
$question.= makeyesno('hide_stdsubdomains', '1', '0', '0');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev2')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'You can now decide whether admins/customers are able to change the theme<br />';
|
||||
$question = '<strong>If you want to disallow theme-changing, select "no" from the dropdowns:</strong> ';
|
||||
$question.= "Admins: ". makeyesno('allow_themechange_a', '1', '0', '1').' ';
|
||||
$question.= "Customers: ".makeyesno('allow_themechange_c', '1', '0', '1');
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev3')) {
|
||||
$has_preconfig = true;
|
||||
$description = 'There is now a possibility to specify AFXR servers for your bind zone-configuration<br />';
|
||||
$question = '<strong>Enter a comma-separated list of AFXR servers or leave empty (default):</strong> ';
|
||||
$question.= '<input type="text" class="text" name="system_afxrservers" value="" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
|
||||
if (versionInUpdate($current_version, '0.9.29-dev4')) {
|
||||
$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/" />';
|
||||
eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,36 +393,28 @@ class ApsInstaller extends ApsParser
|
||||
//check for special PHP permissions
|
||||
//must be done with xpath otherwise check not possible (XML parser problem with attributes)
|
||||
|
||||
if($ParentMapping && $ParentMapping !== null)
|
||||
{
|
||||
if ($ParentMapping && $ParentMapping !== null) {
|
||||
|
||||
$ParentMapping->registerXPathNamespace('p', 'http://apstandard.com/ns/1/php');
|
||||
$Result = $ParentMapping->xpath('p:permissions');
|
||||
|
||||
if($Result[0]['writable'] == 'true')
|
||||
{
|
||||
//fixing file permissions to writeable
|
||||
|
||||
if(is_dir($Path))
|
||||
{
|
||||
chmod($Path, 0775);
|
||||
|
||||
if (is_array($Result) && isset($Result[0]) && is_array($Result[0])) {
|
||||
if (isset($Result[0]['writable']) && $Result[0]['writable'] == 'true') {
|
||||
// fixing file permissions to writeable
|
||||
if (is_dir($Path)) {
|
||||
chmod($Path, 0775);
|
||||
} else {
|
||||
chmod($Path, 0664);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
chmod($Path, 0664);
|
||||
}
|
||||
}
|
||||
|
||||
if($Result[0]['readable'] == 'false')
|
||||
{
|
||||
//fixing file permissions to non readable
|
||||
|
||||
if(is_dir($Path))
|
||||
{
|
||||
chmod($Path, 0333);
|
||||
}
|
||||
else
|
||||
{
|
||||
chmod($Path, 0222);
|
||||
|
||||
if (isset($Result[0]['readable']) && $Result[0]['readable'] == 'false') {
|
||||
//fixing file permissions to non readable
|
||||
if (is_dir($Path)) {
|
||||
chmod($Path, 0333);
|
||||
} else {
|
||||
chmod($Path, 0222);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class ApsParser
|
||||
|
||||
private function ManageInstances()
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
$Question = false;
|
||||
|
||||
//dont do anything if there is no instance
|
||||
@@ -170,7 +170,7 @@ class ApsParser
|
||||
//create table with contents based on instance status
|
||||
if($Question != true)
|
||||
{
|
||||
global $settings;
|
||||
global $settings, $theme;
|
||||
$Instances = '';
|
||||
|
||||
if((int)$this->userinfo['customers_see_all'] == 1)
|
||||
@@ -317,7 +317,7 @@ class ApsParser
|
||||
|
||||
private function ManagePackages()
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
$Question = false;
|
||||
|
||||
if(isset($_POST['save']))
|
||||
@@ -611,7 +611,7 @@ class ApsParser
|
||||
|
||||
private function UploadNewPackages()
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
|
||||
//define how many files can be uploaded at once
|
||||
|
||||
@@ -724,7 +724,7 @@ class ApsParser
|
||||
|
||||
private function SearchPackages()
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
$Error = 0;
|
||||
$Ids = array();
|
||||
$ShowAll = 0;
|
||||
@@ -852,7 +852,7 @@ class ApsParser
|
||||
|
||||
private function CustomerStatus($CustomerId)
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
$Data = '';
|
||||
$Fieldname = '';
|
||||
$Fieldvalue = '';
|
||||
@@ -877,7 +877,7 @@ class ApsParser
|
||||
//skip if parse of xml has failed
|
||||
|
||||
if($Xml == false)continue;
|
||||
$Icon = './images/Classic/default.png';
|
||||
$Icon = 'templates/'.$theme.'/assets/img/default.png';
|
||||
|
||||
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
|
||||
|
||||
@@ -1033,7 +1033,7 @@ class ApsParser
|
||||
|
||||
private function CreatePackageInstance($PackageId, $CustomerId)
|
||||
{
|
||||
global $lng;
|
||||
global $lng, $theme;
|
||||
|
||||
if(!self::IsValidPackageId($PackageId, true))return false;
|
||||
|
||||
@@ -1141,7 +1141,7 @@ class ApsParser
|
||||
|
||||
private function CheckException($Category, $Item, $Value)
|
||||
{
|
||||
global $settings;
|
||||
global $settings, $theme;
|
||||
|
||||
//search for element within system settings
|
||||
|
||||
@@ -1164,7 +1164,7 @@ class ApsParser
|
||||
|
||||
private function CheckSubmappings($ParentMapping, $Url)
|
||||
{
|
||||
global $lng;
|
||||
global $lng, $theme;
|
||||
$Error = array();
|
||||
|
||||
//check for special PHP handler extensions
|
||||
@@ -1243,7 +1243,7 @@ class ApsParser
|
||||
|
||||
private function InstallNewPackage($Filename)
|
||||
{
|
||||
global $lng, $userinfo;
|
||||
global $lng, $userinfo, $theme;
|
||||
|
||||
if(file_exists($Filename)
|
||||
&& $Xml = self::GetXmlFromZip($Filename))
|
||||
@@ -1726,7 +1726,7 @@ class ApsParser
|
||||
|
||||
public function MainHandler($Action)
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action, $Id, $userinfo;
|
||||
global $lng, $filename, $s, $page, $action, $Id, $userinfo, $theme;
|
||||
|
||||
//check for basic functions, classes and permissions
|
||||
|
||||
@@ -2810,7 +2810,7 @@ class ApsParser
|
||||
|
||||
private function ShowPackageInstaller($PackageId, $WrongData, $CustomerId)
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
$Data = '';
|
||||
$Fieldname = '';
|
||||
$Fieldvalue = '';
|
||||
@@ -2838,7 +2838,7 @@ class ApsParser
|
||||
|
||||
//icon for package
|
||||
|
||||
$Icon = './images/Classic/default.png';
|
||||
$Icon = 'templates/'.$theme.'/img/default.png';
|
||||
|
||||
if($this->aps_version != '1.0')
|
||||
{
|
||||
@@ -3187,7 +3187,7 @@ class ApsParser
|
||||
{
|
||||
$Temp.= '<textarea name="text" rows="10" cols="55">';
|
||||
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
|
||||
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'ISO-8859-1');
|
||||
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'UTF-8');
|
||||
$Temp.= '</textarea>';
|
||||
$Groupname = $lng['aps']['license'];
|
||||
$Fieldname = $lng['aps']['license'];
|
||||
@@ -3231,7 +3231,7 @@ class ApsParser
|
||||
|
||||
private function ShowPackageInfo($PackageId, $All = false)
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action, $userinfo;
|
||||
global $lng, $filename, $s, $page, $action, $userinfo, $theme;
|
||||
$Data = '';
|
||||
$Fieldname = '';
|
||||
$Fieldvalue = '';
|
||||
@@ -3245,7 +3245,7 @@ class ApsParser
|
||||
//return if parse of xml file has failed
|
||||
|
||||
if($Xml == false)return false;
|
||||
$Icon = './images/Classic/default.png';
|
||||
$Icon = 'templates/'.$theme.'/img/default.png';
|
||||
|
||||
$this->aps_version = isset($Xml->attributes()->version) ? (string)$Xml->attributes()->version : '1.0';
|
||||
|
||||
@@ -3378,7 +3378,7 @@ class ApsParser
|
||||
if($license->text->name)$Temp = $license->text->name . '<br/>';
|
||||
$Temp.= '<form name="license" action="#"><textarea name="text" rows="10" cols="70">';
|
||||
$FileContent = file_get_contents('./packages/' . $Row['Path'] . '/license.txt');
|
||||
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'ISO-8859-1');
|
||||
$Temp.= htmlentities($FileContent, ENT_QUOTES, 'UTF-8');
|
||||
$Temp.= '</textarea></form>';
|
||||
$Fieldname = $lng['aps']['license'];
|
||||
$Fieldvalue = $Temp;
|
||||
@@ -3460,7 +3460,7 @@ class ApsParser
|
||||
*/
|
||||
private function InfoBox($Message, $Type = 0)
|
||||
{
|
||||
global $lng, $filename, $s, $page, $action;
|
||||
global $lng, $filename, $s, $page, $action, $theme;
|
||||
//shows a box with informations
|
||||
eval("echo \"" . getTemplate("aps/infobox") . "\";");
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class db
|
||||
|
||||
if(!$this->link_id)
|
||||
{
|
||||
//try to connect with no password an change it afterwards. only for root user
|
||||
//try to connect with no password and change it afterwards. only for root user
|
||||
|
||||
if($this->user == 'root')
|
||||
{
|
||||
@@ -134,11 +134,8 @@ class db
|
||||
$this->showerror('Trying to use database ' . $this->database . ' failed, exiting');
|
||||
}
|
||||
}
|
||||
/*
|
||||
* this is not for 0.9.x
|
||||
*/
|
||||
//mysql_query("SET NAMES utf8", $this->link_id);
|
||||
//mysql_query("SET CHARACTER SET utf8", $this->link_id);
|
||||
|
||||
mysql_set_charset('utf8', $this->link_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +186,7 @@ class db
|
||||
function query($query_str, $unbuffered = false, $suppress_error = false)
|
||||
{
|
||||
|
||||
global $numbqueries;
|
||||
global $numbqueries, $theme;
|
||||
|
||||
if (!mysql_ping($this->link_id))
|
||||
{
|
||||
@@ -349,7 +346,7 @@ class db
|
||||
|
||||
function showerror($errormsg, $mysqlActive = true)
|
||||
{
|
||||
global $filename;
|
||||
global $filename, $theme;
|
||||
|
||||
$text = 'MySQL - Error: ' . str_replace("\n", "\t", $errormsg);
|
||||
if($mysqlActive)
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
// }}}
|
||||
|
||||
// Source for updates: http://phlymail.com/en/downloads/idna-convert.html
|
||||
|
||||
/**
|
||||
* Encode/decode Internationalized Domain Names.
|
||||
*
|
||||
@@ -47,8 +49,8 @@
|
||||
* ACE input and output is always expected to be ASCII.
|
||||
*
|
||||
* @author Matthias Sommerfeld <mso@phlylabs.de>
|
||||
* @copyright 2004-2010 phlyLabs Berlin, http://phlylabs.de
|
||||
* @version 0.7.0 2010-11-20
|
||||
* @copyright 2004-2011 phlyLabs Berlin, http://phlylabs.de
|
||||
* @version 0.8.0 2011-03-11
|
||||
*/
|
||||
class idna_convert
|
||||
{
|
||||
@@ -76,11 +78,14 @@ class idna_convert
|
||||
protected $_scount = 11172; // _lcount * _tcount * _vcount
|
||||
protected $_error = false;
|
||||
|
||||
protected static $_mb_string_overload = null;
|
||||
|
||||
// See {@link set_paramter()} for details of how to change the following
|
||||
// settings from within your script / application
|
||||
protected $_api_encoding = 'utf8'; // Default input charset is UTF-8
|
||||
protected $_allow_overlong = false; // Overlong UTF-8 encodings are forbidden
|
||||
protected $_strict_mode = false; // Behave strict or not
|
||||
protected $_idn_version = 2003; // Can be either 2003 (old, default) or 2008
|
||||
|
||||
/**
|
||||
* the constructor
|
||||
@@ -93,7 +98,15 @@ class idna_convert
|
||||
{
|
||||
$this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount;
|
||||
// If parameters are given, pass these to the respective method
|
||||
if (is_array($options)) return $this->set_parameter($options);
|
||||
if (is_array($options)) {
|
||||
$this->set_parameter($options);
|
||||
}
|
||||
|
||||
// populate mbstring overloading cache if not set
|
||||
if (self::$_mb_string_overload === null) {
|
||||
self::$_mb_string_overload = (extension_loaded('mbstring')
|
||||
&& (ini_get('mbstring.func_overload') & 0x02) === 0x02);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,11 +149,18 @@ class idna_convert
|
||||
case 'strict':
|
||||
$this->_strict_mode = ($v) ? true : false;
|
||||
break;
|
||||
case 'encode_german_sz':
|
||||
if (!$v) {
|
||||
$this->NP['replacemaps'][0xDF] = array(0x73, 0x73);
|
||||
case 'idn_version':
|
||||
if (in_array($v, array('2003', '2008'))) {
|
||||
$this->_idn_version = $v;
|
||||
} else {
|
||||
unset($this->NP['replacemaps'][0xDF]);
|
||||
$this->_error('Set Parameter: Unknown parameter '.$v.' for option '.$k);
|
||||
}
|
||||
break;
|
||||
case 'encode_german_sz': // Deprecated
|
||||
if (!$v) {
|
||||
self::$NP['replacemaps'][0xDF] = array(0x73, 0x73);
|
||||
} else {
|
||||
unset(self::$NP['replacemaps'][0xDF]);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -398,13 +418,13 @@ class idna_convert
|
||||
}
|
||||
// Find last occurence of the delimiter
|
||||
$delim_pos = strrpos($encoded, '-');
|
||||
if ($delim_pos > strlen($this->_punycode_prefix)) {
|
||||
for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) {
|
||||
if ($delim_pos > self::byteLength($this->_punycode_prefix)) {
|
||||
for ($k = self::byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) {
|
||||
$decoded[] = ord($encoded{$k});
|
||||
}
|
||||
}
|
||||
$deco_len = count($decoded);
|
||||
$enco_len = strlen($encoded);
|
||||
$enco_len = self::byteLength($encoded);
|
||||
|
||||
// Wandering through the strings; init
|
||||
$is_first = true;
|
||||
@@ -442,7 +462,7 @@ class idna_convert
|
||||
protected function _encode($decoded)
|
||||
{
|
||||
// We cannot encode a domain name containing the Punycode prefix
|
||||
$extract = strlen($this->_punycode_prefix);
|
||||
$extract = self::byteLength($this->_punycode_prefix);
|
||||
$check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix);
|
||||
$check_deco = array_slice($decoded, 0, $extract);
|
||||
|
||||
@@ -589,24 +609,28 @@ class idna_convert
|
||||
// While mapping required chars we apply the cannonical ordering
|
||||
foreach ($input as $v) {
|
||||
// Map to nothing == skip that code point
|
||||
if (in_array($v, $this->NP['map_nothing'])) continue;
|
||||
if (in_array($v, self::$NP['map_nothing'])) continue;
|
||||
// Try to find prohibited input
|
||||
if (in_array($v, $this->NP['prohibit']) || in_array($v, $this->NP['general_prohibited'])) {
|
||||
if (in_array($v, self::$NP['prohibit']) || in_array($v, self::$NP['general_prohibited'])) {
|
||||
$this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
|
||||
return false;
|
||||
}
|
||||
foreach ($this->NP['prohibit_ranges'] as $range) {
|
||||
foreach (self::$NP['prohibit_ranges'] as $range) {
|
||||
if ($range[0] <= $v && $v <= $range[1]) {
|
||||
$this->_error('NAMEPREP: Prohibited input U+'.sprintf('%08X', $v));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Hangul syllable decomposition
|
||||
|
||||
if (0xAC00 <= $v && $v <= 0xD7AF) {
|
||||
foreach ($this->_hangul_decompose($v) as $out) $output[] = (int) $out;
|
||||
// There's a decomposition mapping for that code point
|
||||
} elseif (isset($this->NP['replacemaps'][$v])) {
|
||||
foreach ($this->_apply_cannonical_ordering($this->NP['replacemaps'][$v]) as $out) {
|
||||
// Hangul syllable decomposition
|
||||
foreach ($this->_hangul_decompose($v) as $out) {
|
||||
$output[] = (int) $out;
|
||||
}
|
||||
} elseif (($this->_idn_version == '2003') && isset(self::$NP['replacemaps'][$v])) {
|
||||
// There's a decomposition mapping for that code point
|
||||
// Decompositions only in version 2003 (original) of IDNA
|
||||
foreach ($this->_apply_cannonical_ordering(self::$NP['replacemaps'][$v]) as $out) {
|
||||
$output[] = (int) $out;
|
||||
}
|
||||
} else {
|
||||
@@ -715,11 +739,11 @@ class idna_convert
|
||||
*/
|
||||
protected function _get_combining_class($char)
|
||||
{
|
||||
return isset($this->NP['norm_combcls'][$char]) ? $this->NP['norm_combcls'][$char] : 0;
|
||||
return isset(self::$NP['norm_combcls'][$char]) ? self::$NP['norm_combcls'][$char] : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apllies the cannonical ordering of a decomposed UCS4 sequence
|
||||
* Applies the cannonical ordering of a decomposed UCS4 sequence
|
||||
* @param array Decomposed UCS4 sequence
|
||||
* @return array Ordered USC4 sequence
|
||||
*/
|
||||
@@ -758,7 +782,7 @@ class idna_convert
|
||||
protected function _combine($input)
|
||||
{
|
||||
$inp_len = count($input);
|
||||
foreach ($this->NP['replacemaps'] as $np_src => $np_target) {
|
||||
foreach (self::$NP['replacemaps'] as $np_src => $np_target) {
|
||||
if ($np_target[0] != $input[0]) continue;
|
||||
if (count($np_target) != $inp_len) continue;
|
||||
$hit = false;
|
||||
@@ -797,12 +821,7 @@ class idna_convert
|
||||
{
|
||||
$output = array();
|
||||
$out_len = 0;
|
||||
// Patch by Daniel Hahler; work around prolbem with mbstring.func_overload
|
||||
if (function_exists('mb_strlen')) {
|
||||
$inp_len = mb_strlen($input, '8bit');
|
||||
} else {
|
||||
$inp_len = strlen($input);
|
||||
}
|
||||
$inp_len = self::byteLength($input);
|
||||
$mode = 'next';
|
||||
$test = 'none';
|
||||
for ($k = 0; $k < $inp_len; ++$k) {
|
||||
@@ -923,7 +942,7 @@ class idna_convert
|
||||
protected function _ucs4_string_to_ucs4($input)
|
||||
{
|
||||
$output = array();
|
||||
$inp_len = strlen($input);
|
||||
$inp_len = self::byteLength($input);
|
||||
// Input length must be dividable by 4
|
||||
if ($inp_len % 4) {
|
||||
$this->_error('Input UCS4 string is broken');
|
||||
@@ -942,6 +961,56 @@ class idna_convert
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the length of a string in bytes even if mbstring function
|
||||
* overloading is turned on
|
||||
*
|
||||
* @param string $string the string for which to get the length.
|
||||
* @return integer the length of the string in bytes.
|
||||
*/
|
||||
protected static function byteLength($string)
|
||||
{
|
||||
if (self::$_mb_string_overload) {
|
||||
return mb_strlen($string, '8bit');
|
||||
}
|
||||
return strlen((binary) $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to return a concrete IDNA instance.
|
||||
*
|
||||
* @param array $params Set of paramaters
|
||||
* @return idna_convert
|
||||
* @access public
|
||||
*/
|
||||
public function getInstance($params = array())
|
||||
{
|
||||
return new idna_convert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to return a concrete IDNA instance for either php4 or php5,
|
||||
* only creating a new instance if no IDNA instance with the same
|
||||
* parameters currently exists.
|
||||
*
|
||||
* @param array $params Set of paramaters
|
||||
*
|
||||
* @return object idna_convert
|
||||
* @access public
|
||||
*/
|
||||
public function singleton($params = array())
|
||||
{
|
||||
static $instances;
|
||||
if (!isset($instances)) {
|
||||
$instances = array();
|
||||
}
|
||||
$signature = serialize($params);
|
||||
if (!isset($instances[$signature])) {
|
||||
$instances[$signature] = idna_convert::getInstance($params);
|
||||
}
|
||||
return $instances[$signature];
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds all relevant mapping tables
|
||||
* See RFC3454 for details
|
||||
@@ -949,7 +1018,7 @@ class idna_convert
|
||||
* @private array
|
||||
* @since 0.5.2
|
||||
*/
|
||||
protected $NP = array
|
||||
protected static $NP = array
|
||||
('map_nothing' => array(0xAD, 0x34F, 0x1806, 0x180B, 0x180C, 0x180D, 0x200B, 0x200C
|
||||
,0x200D, 0x2060, 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07
|
||||
,0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, 0xFEFF
|
||||
@@ -984,7 +1053,7 @@ class idna_convert
|
||||
,0xD0 => array(0xF0), 0xD1 => array(0xF1), 0xD2 => array(0xF2), 0xD3 => array(0xF3)
|
||||
,0xD4 => array(0xF4), 0xD5 => array(0xF5), 0xD6 => array(0xF6), 0xD8 => array(0xF8)
|
||||
,0xD9 => array(0xF9), 0xDA => array(0xFA), 0xDB => array(0xFB), 0xDC => array(0xFC)
|
||||
,0xDD => array(0xFD), 0xDE => array(0xFE) /* Here was German "ß" -> "ss", is now configurable */
|
||||
,0xDD => array(0xFD), 0xDE => array(0xFE), 0xDF => array(0x73, 0x73)
|
||||
,0x100 => array(0x101), 0x102 => array(0x103), 0x104 => array(0x105)
|
||||
,0x106 => array(0x107), 0x108 => array(0x109), 0x10A => array(0x10B)
|
||||
,0x10C => array(0x10D), 0x10E => array(0x10F), 0x110 => array(0x111)
|
||||
|
||||
@@ -124,7 +124,7 @@ class idna_convert_wrapper
|
||||
|
||||
if(strlen($domain) !== 0)
|
||||
{
|
||||
$domain = utf8_decode($this->idna_converter->$action(utf8_encode($domain . '.none')));
|
||||
$domain = $this->idna_converter->$action($domain . '.none');
|
||||
$domain = substr($domain, 0, strlen($domain) - 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class htmlform
|
||||
|
||||
public static function genHTMLForm($data = array())
|
||||
{
|
||||
global $lng;
|
||||
global $lng, $theme;
|
||||
$nob = false;
|
||||
|
||||
self::$_form = '';
|
||||
|
||||
@@ -421,6 +421,8 @@ class paging
|
||||
|
||||
function getHtmlArrowCode($baseurl, $field = '')
|
||||
{
|
||||
global $theme;
|
||||
|
||||
if($field != ''
|
||||
&& isset($this->fields[$field]))
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ class phpinterface_fcgid
|
||||
|
||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => ($this->_domain['safemode'] == '0' ? 'Off' : 'On'),
|
||||
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
||||
'PEAR_DIR' => $this->_settings['system']['mod_fcgid_peardir'],
|
||||
'OPEN_BASEDIR' => $openbasedir,
|
||||
'OPEN_BASEDIR_C' => $openbasedirc,
|
||||
|
||||
@@ -39,6 +39,62 @@ class phpinterface_fpm
|
||||
*/
|
||||
private $_domain = array();
|
||||
|
||||
/**
|
||||
* Admin-Date cache array
|
||||
* @var array
|
||||
*/
|
||||
private $_admin_cache = array();
|
||||
|
||||
/**
|
||||
* defines what can be used for pool-config from php.ini
|
||||
* @var array
|
||||
*/
|
||||
private $_ini = array(
|
||||
'php_value' => array(
|
||||
'error_reporting',
|
||||
'max_execution_time',
|
||||
'include_path',
|
||||
'upload_max_filesize',
|
||||
'log_errors_max_len'
|
||||
),
|
||||
'php_flag' => array(
|
||||
'short_open_tag',
|
||||
'asp_tags',
|
||||
'display_errors',
|
||||
'display_startup_errors',
|
||||
'log_errors',
|
||||
'track_errors',
|
||||
'html_errors',
|
||||
'magic_quotes_gpc',
|
||||
'magic_quotes_runtime',
|
||||
'magic_quotes_sybase'
|
||||
),
|
||||
'php_admin_value' => array(
|
||||
'precision',
|
||||
'output_buffering',
|
||||
'disable_functions',
|
||||
'max_input_time',
|
||||
'memory_limit',
|
||||
'post_max_size',
|
||||
'variables_order',
|
||||
'gpc_order',
|
||||
'date.timezone'
|
||||
),
|
||||
'php_admin_flag' => array(
|
||||
'allow_call_time_pass_reference',
|
||||
'allow_url_fopen',
|
||||
'cgi.force_redirect',
|
||||
'enable_dl',
|
||||
'expose_php',
|
||||
'ignore_repeated_errors',
|
||||
'ignore_repeated_source',
|
||||
'report_memleaks',
|
||||
'register_argc_argv',
|
||||
'file_uploads',
|
||||
'allow_url_fopen'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* main constructor
|
||||
*/
|
||||
@@ -93,7 +149,14 @@ class phpinterface_fpm
|
||||
|
||||
$fpm_config.= 'pm = '.$fpm_pm."\n";
|
||||
$fpm_config.= 'pm.max_children = '.$fpm_children."\n";
|
||||
if($fpm_pm == 'dynamic') {
|
||||
if($fpm_pm == 'dynamic' || $fpm_pm == 'ondemand') {
|
||||
// failsafe, refs #955
|
||||
if ($fpm_start_servers < $fpm_min_spare_servers) {
|
||||
$fpm_start_servers = $fpm_min_spare_servers;
|
||||
}
|
||||
if ($fpm_start_servers > $fpm_max_spare_servers) {
|
||||
$fpm_start_servers = $fpm_start_servers - (($fpm_start_servers - $fpm_max_spare_servers) + 1);
|
||||
}
|
||||
$fpm_config.= 'pm.start_servers = '.$fpm_start_servers."\n";
|
||||
$fpm_config.= 'pm.min_spare_servers = '.$fpm_min_spare_servers."\n";
|
||||
$fpm_config.= 'pm.max_spare_servers = '.$fpm_max_spare_servers."\n";
|
||||
@@ -125,13 +188,13 @@ class phpinterface_fpm
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
|
||||
$_custom_openbasedir = explode(':', $this->_settings['system']['phpappendopenbasedir']);
|
||||
foreach($_custom_openbasedir as $cobd)
|
||||
{
|
||||
$_phpappendopenbasedir .= appendOpenBasedirPath($cobd);
|
||||
}
|
||||
|
||||
|
||||
if($this->_domain['openbasedir_path'] == '0' && strstr($this->_domain['documentroot'], ":") === false)
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['documentroot'], true);
|
||||
@@ -140,10 +203,10 @@ class phpinterface_fpm
|
||||
{
|
||||
$openbasedir = appendOpenBasedirPath($this->_domain['customerroot'], true);
|
||||
}
|
||||
|
||||
|
||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||
$openbasedir .= $_phpappendopenbasedir;
|
||||
|
||||
|
||||
$openbasedir = explode(':', $openbasedir);
|
||||
$clean_openbasedir = array();
|
||||
foreach($openbasedir as $number => $path)
|
||||
@@ -161,11 +224,42 @@ class phpinterface_fpm
|
||||
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
$fpm_config.= 'php_admin_value[upload_tmp_dir] = ' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||
|
||||
$admin = $this->_getAdminData($this->_domain['adminid']);
|
||||
$php_ini_variables = array(
|
||||
'SAFE_MODE' => 'Off', // keep this for compatibility, just in case
|
||||
'PEAR_DIR' => $this->_settings['system']['mod_fcgid_peardir'],
|
||||
'TMP_DIR' => $this->getTempDir(),
|
||||
'CUSTOMER_EMAIL' => $this->_domain['email'],
|
||||
'ADMIN_EMAIL' => $admin['email'],
|
||||
'DOMAIN' => $this->_domain['domain'],
|
||||
'CUSTOMER' => $this->_domain['loginname'],
|
||||
'ADMIN' => $admin['loginname']
|
||||
);
|
||||
|
||||
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
|
||||
$phpini_array = explode("\n", $phpini);
|
||||
|
||||
$fpm_config.= "\n\n";
|
||||
foreach ($phpini_array as $inisection) {
|
||||
$is = explode("=", $inisection);
|
||||
foreach ($this->_ini as $sec => $possibles) {
|
||||
if (in_array(trim($is[0]), $possibles)) {
|
||||
$fpm_config.= $sec.'['.trim($is[0]).'] = ' . trim($is[1]) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||
fclose($fh);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this is done via createConfig as php-fpm defines
|
||||
* the ini-values/flags in its pool-config
|
||||
*
|
||||
* @param string $phpconfig
|
||||
*/
|
||||
public function createIniFile($phpconfig)
|
||||
{
|
||||
return;
|
||||
@@ -229,7 +323,51 @@ class phpinterface_fpm
|
||||
safe_exec('chown -R ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($tmpdir));
|
||||
safe_exec('chmod 0750 ' . escapeshellarg($tmpdir));
|
||||
}
|
||||
|
||||
|
||||
return $tmpdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* fastcgi-fakedirectory directory
|
||||
*
|
||||
* @param boolean $createifnotexists create the directory if it does not exist
|
||||
*
|
||||
* @return string the directory
|
||||
*/
|
||||
public function getAliasConfigDir($createifnotexists = true)
|
||||
{
|
||||
// ensure default...
|
||||
if (!isset($this->_settings['phpfpm']['aliasconfigdir'])) {
|
||||
$this->_settings['phpfpm']['aliasconfigdir'] = '/var/www/php-fpm';
|
||||
}
|
||||
|
||||
$configdir = makeCorrectDir($this->_settings['phpfpm']['aliasconfigdir'] . '/' . $this->_domain['loginname'] . '/' . $this->_domain['domain'] . '/');
|
||||
if(!is_dir($configdir) && $createifnotexists)
|
||||
{
|
||||
safe_exec('mkdir -p ' . escapeshellarg($configdir));
|
||||
safe_exec('chown ' . $this->_domain['guid'] . ':' . $this->_domain['guid'] . ' ' . escapeshellarg($configdir));
|
||||
}
|
||||
|
||||
return $configdir;
|
||||
}
|
||||
|
||||
/**
|
||||
* return the admin-data of a specific admin
|
||||
*
|
||||
* @param int $adminid id of the admin-user
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _getAdminData($adminid) {
|
||||
$adminid = intval($adminid);
|
||||
|
||||
if (!isset($this->_admin_cache[$adminid])) {
|
||||
$this->_admin_cache[$adminid] = $this->_db->query_first(
|
||||
"SELECT `email`, `loginname` FROM `" . TABLE_PANEL_ADMINS . "`
|
||||
WHERE `adminid` = " . (int)$adminid
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_admin_cache[$adminid];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2317,4 +2317,4 @@ class phpmailerException extends Exception {
|
||||
return $errorMsg;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -89,7 +89,7 @@ class ticket
|
||||
// initialize purifier
|
||||
require_once dirname(dirname(__FILE__)).'/htmlpurifier/library/HTMLPurifier.auto.php';
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
$config->set('Core.Encoding', 'ISO-8859-1'); // for now
|
||||
$config->set('Core.Encoding', 'UTF-8'); //htmlpurifier uses utf-8 anyway as default
|
||||
$config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
|
||||
$this->_purifier = new HTMLPurifier($config);
|
||||
|
||||
@@ -260,7 +260,7 @@ class ticket
|
||||
|
||||
public function sendMail($customerid = - 1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null)
|
||||
{
|
||||
global $mail;
|
||||
global $mail, $theme;
|
||||
|
||||
// Some checks are to be made here in the future
|
||||
|
||||
@@ -449,9 +449,13 @@ class ticket
|
||||
*
|
||||
* @return int highest order number
|
||||
*/
|
||||
static public function getHighestOrderNumber($_db = null)
|
||||
static public function getHighestOrderNumber($_db = null, $_uid = 0)
|
||||
{
|
||||
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`;";
|
||||
$where = '';
|
||||
if ($_uid > 0) {
|
||||
$where = ' WHERE `adminid` = "'.(int)$_uid.'"';
|
||||
}
|
||||
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`".$where.";";
|
||||
$result = $_db->query_first($sql);
|
||||
return (isset($result['highestorder']) ? (int)$result['highestorder'] : 0);
|
||||
}
|
||||
@@ -680,13 +684,13 @@ class ticket
|
||||
private function convertLatin1ToHtml($str)
|
||||
{
|
||||
$html_entities = array (
|
||||
"<EFBFBD>" => "Ä",
|
||||
"<EFBFBD>" => "ä",
|
||||
"<EFBFBD>" => "Ö",
|
||||
"<EFBFBD>" => "ö",
|
||||
"<EFBFBD>" => "Ü",
|
||||
"<EFBFBD>" => "ü",
|
||||
"<EFBFBD>" => "ß"
|
||||
"Ä" => "Ä",
|
||||
"ä" => "ä",
|
||||
"Ö" => "Ö",
|
||||
"ö" => "ö",
|
||||
"Ü" => "Ü",
|
||||
"ü" => "ü",
|
||||
"ß" => "ß"
|
||||
/*
|
||||
* @TODO continue this table for all the special-characters
|
||||
*/
|
||||
|
||||
283
lib/classes/webserver/class.ConfigIO.php
Normal file
@@ -0,0 +1,283 @@
|
||||
<?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 Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
* @since 0.9.29
|
||||
*
|
||||
*/
|
||||
|
||||
class ConfigIO {
|
||||
|
||||
/**
|
||||
* internal settings array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_settings = null;
|
||||
|
||||
/**
|
||||
* constructor gets the froxlor settings
|
||||
* as array
|
||||
*/
|
||||
public function __construct(array $settings = null) {
|
||||
$this->_settings = $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* clean up former created configs, including (if enabled)
|
||||
* awstats, fcgid, php-fpm and of course automatically created
|
||||
* webserver vhost and diroption files
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function cleanUp() {
|
||||
// awstats files
|
||||
$this->_cleanAwstatsFiles();
|
||||
|
||||
// fcgid files
|
||||
$this->_cleanFcgidFiles();
|
||||
|
||||
// php-fpm files
|
||||
$this->_cleanFpmFiles();
|
||||
|
||||
// clean webserver-configs
|
||||
$this->_cleanWebserverConfigs();
|
||||
|
||||
// old htpasswd files
|
||||
$this->_cleanHtpasswdFiles();
|
||||
|
||||
// customer-specified ssl-certificates
|
||||
$this->_cleanCustomerSslCerts();
|
||||
}
|
||||
|
||||
/**
|
||||
* remove customer-specified auto-generated ssl-certificates
|
||||
* (they are being regenerated)
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanCustomerSslCerts() {
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'customer_ssl_path');
|
||||
if ($configdir !== false) {
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove webserver related configuration files before regeneration
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanWebserverConfigs() {
|
||||
|
||||
// get directories
|
||||
$configdirs = array();
|
||||
$configdirs[] = makeCorrectDir($this->_getFile('system', 'apacheconf_vhost'));
|
||||
$configdirs[] = makeCorrectDir($this->_getFile('system', 'apacheconf_diroptions'));
|
||||
|
||||
// file pattern
|
||||
$pattern = "/^([0-9]){2}_(froxlor|syscp)_(.+)\.conf$/";
|
||||
|
||||
// check ALL the folders
|
||||
foreach ($configdirs as $config_dir) {
|
||||
|
||||
// check directory
|
||||
if (@is_dir($config_dir)) {
|
||||
|
||||
// create directory iterator
|
||||
$its = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($config_dir)
|
||||
);
|
||||
|
||||
// iterate through all subdirs,
|
||||
// look for vhost/diroption files
|
||||
// and delete them
|
||||
foreach ($its as $fullFileName => $it ) {
|
||||
if ($it->isFile() && preg_match($pattern, $it->getFilename())) {
|
||||
// remove file
|
||||
safe_exec('rm -f '. escapeshellarg(makeCorrectFile($its->getPathname())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove htpasswd files before regeneration
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanHtpasswdFiles() {
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'apacheconf_htpasswddir');
|
||||
|
||||
if ($configdir !== false) {
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove awstats related configuration files before regeneration
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanAwstatsFiles() {
|
||||
|
||||
if ($this->_settings['system']['awstats_enabled'] == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
//dhr: cleanout froxlor-generated awstats configs prior to re-creation
|
||||
$awstatsclean['header'] = "## GENERATED BY FROXLOR\n";
|
||||
$awstatsclean['headerold'] = "## GENERATED BY SYSCP\n";
|
||||
$awstatsclean['path'] = $this->_getFile('system', 'awstats_conf');
|
||||
|
||||
/**
|
||||
* dont do anyting if the directory not exists
|
||||
* (e.g. awstats not installed yet or whatever)
|
||||
* fixes #45
|
||||
*/
|
||||
if ($awstatsclean['path'] !== false && is_dir($awstatsclean['path'])) {
|
||||
$awstatsclean['dir'] = dir($awstatsclean['path']);
|
||||
while ($awstatsclean['entry'] = $awstatsclean['dir']->read()) {
|
||||
$awstatsclean['fullentry'] = makeCorrectFile($awstatsclean['path'].'/'.$awstatsclean['entry']);
|
||||
/**
|
||||
* dont do anything if the file does not exist
|
||||
*/
|
||||
if (@file_exists($awstatsclean['fullentry'])) {
|
||||
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
|
||||
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1);
|
||||
fclose($awstatsclean['fh']);
|
||||
|
||||
if ($awstatsclean['headerRead'] == $awstatsclean['header']
|
||||
|| $awstatsclean['headerRead'] == $awstatsclean['headerold']
|
||||
) {
|
||||
$awstats_conf_file = makeCorrectFile($awstatsclean['fullentry']);
|
||||
@unlink($awstats_conf_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($awstatsclean);
|
||||
//end dhr
|
||||
}
|
||||
|
||||
/**
|
||||
* remove fcgid related configuration files before regeneration
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanFcgidFiles() {
|
||||
|
||||
if ($this->_settings['system']['mod_fcgid'] == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('system', 'mod_fcgid_configdir');
|
||||
if ($configdir !== false) {
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// create directory iterator
|
||||
$its = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($configdir)
|
||||
);
|
||||
|
||||
// iterate through all subdirs,
|
||||
// look for php-fcgi-starter files
|
||||
// and take immutable-flag away from them
|
||||
// so we can delete them :)
|
||||
foreach ($its as $fullFileName => $it ) {
|
||||
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter') {
|
||||
// set chattr -i
|
||||
removeImmutable($its->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove php-fpm related configuration files before regeneration
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
private function _cleanFpmFiles() {
|
||||
|
||||
if ($this->_settings['phpfpm']['enabled'] == '0') {
|
||||
return;
|
||||
}
|
||||
|
||||
// get correct directory
|
||||
$configdir = $this->_getFile('phpfpm', 'configdir');
|
||||
if ($configdir !== false) {
|
||||
|
||||
$configdir = makeCorrectDir($configdir);
|
||||
|
||||
if (@is_dir($configdir)) {
|
||||
// now get rid of old stuff
|
||||
//(but append /* so we don't delete the directory)
|
||||
$configdir.='/*';
|
||||
safe_exec('rm -rf '. makeCorrectFile($configdir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a file/direcotry from the settings array and checks whether it exists
|
||||
*
|
||||
* @param string $group settings-group
|
||||
* @param string $varname var-name
|
||||
* @param boolean $check_exists check if the file exists
|
||||
*
|
||||
* @return string|boolean complete path including filename if any or false on error
|
||||
*/
|
||||
private function _getFile($group, $varname, $check_exists = true) {
|
||||
|
||||
// read from settings
|
||||
$file = $this->_settings[$group][$varname];
|
||||
|
||||
// check whether it exists
|
||||
if ($check_exists && @file_exists($file) == false) {
|
||||
return false;
|
||||
}
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
113
lib/classes/webserver/class.DomainSSL.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?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 Michael Kaufmann <mkaufmann@nutime.de>
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Cron
|
||||
*
|
||||
* @since 0.9.29
|
||||
*
|
||||
*/
|
||||
|
||||
class DomainSSL {
|
||||
|
||||
/**
|
||||
* internal settings array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_settings = null;
|
||||
|
||||
/**
|
||||
* internal database object
|
||||
*
|
||||
* @var db
|
||||
*/
|
||||
private $_db = null;
|
||||
|
||||
/**
|
||||
* constructor gets the froxlor settings as array
|
||||
* and the initialized database object
|
||||
*/
|
||||
public function __construct(array $settings = null, $db = null) {
|
||||
$this->_settings = $settings;
|
||||
$this->_db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* read domain-related (or if empty, parentdomain-related) ssl-certificates from the database
|
||||
* and (if not empty) set the corresponding array-indices (ssl_cert_file, ssl_key_file,
|
||||
* ssl_ca_file and ssl_cert_chainfile). Hence the parameter as reference.
|
||||
*
|
||||
* @param array $domain domain-array as reference so we can set the corresponding array-indices
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function setDomainSSLFilesArray(array &$domain = null) {
|
||||
// check if the domain itself has a certificate defined
|
||||
$dom_certs = $this->_db->query_first("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` WHERE `domainid` ='".$domain['id']."'");
|
||||
if (!is_array($dom_certs)
|
||||
|| !isset($dom_certs['ssl_cert_file'])
|
||||
|| $dom_certs['ssl_cert_file'] == ''
|
||||
) {
|
||||
// maybe its parent?
|
||||
if ($domain['parentdomainid'] != 0) {
|
||||
$dom_certs = $this->_db->query_first("SELECT * FROM `".TABLE_PANEL_DOMAIN_SSL_SETTINGS."` WHERE `domainid` ='".$domain['parentdomainid']."'");
|
||||
}
|
||||
}
|
||||
|
||||
// check if it's an array and if the most important field is set
|
||||
if (is_array($dom_certs)
|
||||
&& isset($dom_certs['ssl_cert_file'])
|
||||
&& $dom_certs['ssl_cert_file'] != ''
|
||||
) {
|
||||
// get destination path
|
||||
$sslcertpath = makeCorrectDir($this->_settings['system']['customer_ssl_path']);
|
||||
// create path if it does not exist
|
||||
if (!file_exists($sslcertpath)) {
|
||||
safe_exec('mkdir -p '.escapeshellarg($sslcertpath));
|
||||
}
|
||||
// make correct files for the certificates
|
||||
$ssl_files = array(
|
||||
'ssl_cert_file' => makeCorrectFile($sslcertpath.'/'.$domain['domain'].'.crt'),
|
||||
'ssl_key_file' => makeCorrectFile($sslcertpath.'/'.$domain['domain'].'.key')
|
||||
);
|
||||
// initialize optional files
|
||||
$ssl_files['ssl_ca_file'] = '';
|
||||
$ssl_files['ssl_cert_chainfile'] = '';
|
||||
// set them if they are != empty
|
||||
if ($dom_certs['ssl_ca_file'] != '') {
|
||||
$ssl_files['ssl_ca_file'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_CA.pem');
|
||||
}
|
||||
if ($dom_certs['ssl_cert_chainfile'] != '') {
|
||||
$ssl_files['ssl_cert_chainfile'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_chain.pem');
|
||||
}
|
||||
// create them on the filesystem
|
||||
foreach ($ssl_files as $type => $filename) {
|
||||
if ($filename != '') {
|
||||
touch($filename);
|
||||
$_fh = fopen($filename, 'w');
|
||||
fwrite($_fh, $dom_certs[$type]);
|
||||
fclose($_fh);
|
||||
chmod($filename, 0600);
|
||||
}
|
||||
}
|
||||
// override corresponding array values
|
||||
$domain['ssl_cert_file'] = $ssl_files['ssl_cert_file'];
|
||||
$domain['ssl_key_file'] = $ssl_files['ssl_key_file'];
|
||||
$domain['ssl_ca_file'] = $ssl_files['ssl_ca_file'];
|
||||
$domain['ssl_cert_chainfile'] = $ssl_files['ssl_cert_chainfile'];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'freebsd' => Array(
|
||||
'label' => 'FreeBSD',
|
||||
@@ -22,6 +39,40 @@ return Array(
|
||||
'http' => Array(
|
||||
'label' => $lng['admin']['configfiles']['http'],
|
||||
'daemons' => Array(
|
||||
|
||||
// Begin: Nginx Config
|
||||
'nginx' => array(
|
||||
'label' => 'Nginx Webserver',
|
||||
'commands_1' => array(
|
||||
'cd /usr/ports/www/nginx',
|
||||
'make config',
|
||||
'set [x] IPv6 protocol (default)',
|
||||
'set [x] Enable HTTP module (default)',
|
||||
'set [x] Enable http_cache module (default)',
|
||||
'set [x] Enable http_gzip_static module',
|
||||
'set [x] Enable http_rewrite module (default)',
|
||||
'set [x] Enable http_ssl module (default)',
|
||||
'set [x] Enable http_stub_status module (default)',
|
||||
'make install clean; rehash',
|
||||
),
|
||||
'commands_2' => array(
|
||||
$configcommand['vhost'],
|
||||
$configcommand['diroptions'],
|
||||
($settings['system']['deactivateddocroot'] != '') ? 'mkdir -p '. $settings['system']['deactivateddocroot'] : null,
|
||||
'mkdir -p '. $settings['system']['documentroot_prefix'],
|
||||
'mkdir -p '. $settings['system']['mod_fcgid_tmpdir'],
|
||||
'mkdir -p '. $settings['system']['logfiles_directory'],
|
||||
'echo "nginx_enable=\"YES\"" >> /etc/rc.conf'
|
||||
),
|
||||
'files' => array(
|
||||
'usr_local_etc_nginx_nginx.conf' => '/usr/local/etc/nginx/nginx.conf',
|
||||
),
|
||||
'restart' => array(
|
||||
'/usr/local/etc/rc.d/nginx restart'
|
||||
)
|
||||
),
|
||||
// End: Nginx Config
|
||||
|
||||
'apache2' => Array(
|
||||
'label' => 'Apache2 Webserver',
|
||||
'commands' => Array(
|
||||
@@ -52,6 +103,42 @@ return Array(
|
||||
'dns' => Array(
|
||||
'label' => $lng['admin']['configfiles']['dns'],
|
||||
'daemons' => Array(
|
||||
|
||||
// Begin: Bind 9.x Config
|
||||
'bind9' => array(
|
||||
'label' => 'Bind9 Nameserver',
|
||||
'commands_1' => array(
|
||||
'cd /usr/ports/dns/bind99',
|
||||
'make config',
|
||||
'set [x] International Domain Names',
|
||||
'set [x] IPv6 protocol (default)',
|
||||
'set [x] 64-bit file support',
|
||||
'set [x] Replace base BIND with this version',
|
||||
'set [x] Enable RPZ NSDNAME policy records',
|
||||
'set [x] Enable RPZ NSIP trigger rules',
|
||||
'set [x] dig/host/nslookup will do DNSSEC validation',
|
||||
'set [x] Build with OpenSSL (Required for DNSSEC) (default)',
|
||||
'set [x] Threading support (default)',
|
||||
'make install clean; rehash',
|
||||
),
|
||||
'commands_2' => array(
|
||||
'echo "named_enable=\"YES\"" >> /etc/rc.conf',
|
||||
PHP_EOL,
|
||||
(strpos($settings['system']['bindconf_directory'], '/etc/namedb') === false) ? '(TIP: Be sure the path below is "/etc/namedb", if not you have configured the bind-directory in a false way in PANEL->SETTINGS->NAMESERVER SETTINGS!)' : null,
|
||||
'echo "include \"'. $settings['system']['bindconf_directory'] .'froxlor_bind.conf\";" >> '. $settings['system']['bindconf_directory'] .'named.conf',
|
||||
'echo "include \"'. $settings['system']['bindconf_directory'] .'default-zone\";" >> '. $settings['system']['bindconf_directory'] .'named.conf',
|
||||
),
|
||||
'files' => array(
|
||||
'etc_namedb_named.conf' => $settings['system']['bindconf_directory'] .'named.conf',
|
||||
'etc_namedb_master_default.zone' => $settings['system']['bindconf_directory'] .'master/default.zone',
|
||||
'etc_namedb_default-zone' => $settings['system']['bindconf_directory'] .'default-zone',
|
||||
),
|
||||
'restart' => array(
|
||||
'/etc/rc.d/named restart'
|
||||
)
|
||||
),
|
||||
// End: Bind 9.x Config
|
||||
|
||||
'powerdns' => Array(
|
||||
'label' => 'PowerDNS',
|
||||
'commands_1' => Array(
|
||||
@@ -89,10 +176,10 @@ return Array(
|
||||
'make install'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'pw groupadd vmail -g '.$settings['system']['vmail_gid'],
|
||||
'pw useradd vmail -u '.$settings['system']['vmail_uid'].' -g '.$settings['system']['vmail_gid'].' -s/sbin/nologin -d/dev/null',
|
||||
($vmail_group === false) ? 'pw groupadd ' . $vmail_groupname . ' -g '.$settings['system']['vmail_gid'] : '',
|
||||
($vmail_user === false) ? 'pw useradd ' . $vmail_username . ' -u '.$settings['system']['vmail_uid'].' -g '.$settings['system']['vmail_gid'].' -s/sbin/nologin -d/dev/null' : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'chmod 0750 ' . $settings['system']['vmail_homedir']
|
||||
),
|
||||
'commands_3' => Array(
|
||||
@@ -111,6 +198,9 @@ return Array(
|
||||
'usr_local_etc_postfix_mysql-virtual_sender_permissions.cf' => '/usr/local/etc/postfix/mysql-virtual_sender_permissions.cf'
|
||||
),
|
||||
'restart' => Array(
|
||||
'newaliases',
|
||||
'mkdir /var/spool/postfix/etc',
|
||||
'cp /etc/resolv.conf /var/spool/postfix/etc',
|
||||
'sh /usr/local/etc/rc.d/postfix restart'
|
||||
)
|
||||
),
|
||||
@@ -180,13 +270,45 @@ return Array(
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'echo "dovecot unix - n n - - pipe
|
||||
flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf',
|
||||
flags=DRhu user='.$vmail_username.':'.$vmail_groupname.' argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf',
|
||||
'chmod 0640 /usr/local/etc/dovecot-sql.conf'
|
||||
),
|
||||
'restart' => Array(
|
||||
'sh /usr/local/etc/rc.d/dovecot restart'
|
||||
)
|
||||
),
|
||||
|
||||
// Begin: Dovecot 2.x Config
|
||||
'dovecot2' => array(
|
||||
'label' => 'Dovecot 2.x',
|
||||
'commands_1' => array(
|
||||
'cd /usr/ports/mail/dovecot2',
|
||||
'make config',
|
||||
'set [x] kqueue(2) support (default)',
|
||||
'set [x] MySQL database',
|
||||
'set [x] SSL protocol (default)',
|
||||
'make install clean; rehash',
|
||||
),
|
||||
'commands_2' => array(
|
||||
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf',
|
||||
PHP_EOL,
|
||||
'pw adduser '. $vmail_username .' -g '. $vmail_groupname .' -u '. $settings['system']['vmail_gid'] .' -d /nonexistent -s /usr/sbin/nologin -c "User for virtual mailtransport used by Postfix and Dovecot"',
|
||||
PHP_EOL,
|
||||
'chmod 0640 /usr/local/etc/dovecot-sql.conf'
|
||||
),
|
||||
'files' => array(
|
||||
'usr_local_etc_dovecot_dovecot.conf' => '/usr/local/etc/dovecot/dovecot.conf',
|
||||
'usr_local_etc_dovecot_dovecot-sql.conf' => '/usr/local/etc/dovecot/dovecot-sql.conf'
|
||||
),
|
||||
'commands_3' => array(
|
||||
'echo "dovecot unix - n n - - pipe'. PHP_EOL .'flags=DRhu user='. $vmail_username .':'. $vmail_groupname .' argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient} -a ${recipient}" >> /usr/local/etc/postfix/master.cf',
|
||||
),
|
||||
'restart' => array(
|
||||
'/usr/local/etc/rc.d/dovecot restart'
|
||||
)
|
||||
)
|
||||
// End: Dovecot 2.x Config
|
||||
|
||||
)
|
||||
),
|
||||
'ftp' => Array(
|
||||
@@ -222,7 +344,7 @@ return Array(
|
||||
'cron' => Array(
|
||||
'label' => 'Crond (cronscript)',
|
||||
'commands' => Array(
|
||||
'echo "*/5 * * * * root /usr/local/bin/php -q '.makeCorrectDir(dirname(dirname(dirname(__FILE__)))).'scripts/froxlor_master_cronjob.php" >> /etc/crontab'
|
||||
'echo "*/5 * * * * root nice -n 5 /usr/local/bin/php -q '.makeCorrectDir(dirname(dirname(dirname(__FILE__)))).'scripts/froxlor_master_cronjob.php" >> /etc/crontab'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/rc.d/cron restart'
|
||||
@@ -240,7 +362,8 @@ return Array(
|
||||
'sed -i.bak \'s/^LogSeparator/# LogSeparator/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^SiteDomain/# SiteDomain/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirIcons=\"\/awstatsicons\"/DirIcons=\"\/awstats-icon\"/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirIcons=\"\/awstatsicons\"/DirIcons=\"\/awstats-icon\"/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself'
|
||||
)
|
||||
),
|
||||
'libnss' => Array(
|
||||
|
||||
@@ -17,6 +17,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'gentoo' => Array(
|
||||
'label' => 'Gentoo',
|
||||
@@ -123,30 +140,25 @@ return Array(
|
||||
'postfix_courier' => Array(
|
||||
'label' => 'Postfix/Courier',
|
||||
'commands_1' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'echo "mail-mta/postfix -dovecot-sasl sasl" >> /etc/portage/package.use',
|
||||
'emerge -av postfix',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
||||
'touch /etc/postfix/main.cf',
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'touch /etc/sasl2/smtpd.conf',
|
||||
'chown root:root /etc/postfix/main.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'chown root:root /etc/sasl2/smtpd.conf',
|
||||
'chmod 0644 /etc/postfix/main.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'chmod 0600 /etc/sasl2/smtpd.conf',
|
||||
'for suffix in {alias,mailbox,uid,gid}_maps mailbox_domains sender_permissions; do',
|
||||
' touch /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
' chown root:postfix /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
' chmod 0640 /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
'done'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||
@@ -154,6 +166,8 @@ return Array(
|
||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'etc_postfix_mysql-virtual_uid_maps.cf' => '/etc/postfix/mysql-virtual_uid_maps.cf',
|
||||
'etc_postfix_mysql-virtual_gid_maps.cf' => '/etc/postfix/mysql-virtual_gid_maps.cf',
|
||||
'etc_sasl2_smtpd.conf' => '/etc/sasl2/smtpd.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
@@ -166,30 +180,22 @@ return Array(
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands_1' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'echo "mail-mta/postfix dovecot-sasl -sasl" >> /etc/portage/package.use',
|
||||
'emerge -av postfix',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'chmod 0750 ' . $settings['system']['vmail_homedir'],
|
||||
'mv /etc/postfix/main.cf /etc/postfix/main.cf.gentoo',
|
||||
'touch /etc/postfix/main.cf',
|
||||
'touch /etc/postfix/master.cf',
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'chown root:root /etc/postfix/main.cf',
|
||||
'chown root:root /etc/postfix/master.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'chown root:postfix /etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'chmod 0644 /etc/postfix/main.cf',
|
||||
'chmod 0644 /etc/postfix/master.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'chmod 0640 /etc/postfix/mysql-virtual_sender_permissions.cf'
|
||||
'touch /etc/postfix/{main,master}.cf',
|
||||
'chown root:root /etc/postfix/{main,master}.cf',
|
||||
'chmod 0644 /etc/postfix/{main,master}.cf',
|
||||
'for suffix in {alias,mailbox,uid,gid}_maps mailbox_domains sender_permissions; do',
|
||||
' touch /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
' chown root:postfix /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
' chmod 0640 /etc/postfix/mysql-virtual_${suffix}.cf',
|
||||
'done'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
||||
@@ -197,7 +203,9 @@ return Array(
|
||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf'
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'etc_postfix_mysql-virtual_uid_maps.cf' => '/etc/postfix/mysql-virtual_uid_maps.cf',
|
||||
'etc_postfix_mysql-virtual_gid_maps.cf' => '/etc/postfix/mysql-virtual_gid_maps.cf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'rc-update add postfix default'
|
||||
@@ -293,34 +301,14 @@ milter_default_action = accept" >> /etc/postfix/main.cf',
|
||||
)
|
||||
),
|
||||
'dovecot' => Array(
|
||||
'label' => 'Dovecot 1',
|
||||
'label' => 'Dovecot',
|
||||
'commands_1' => Array(
|
||||
'echo "net-mail/dovecot mysql" >> /etc/portage/package.use',
|
||||
'emerge -av dovecot',
|
||||
'mv dovecot.conf dovecot.conf.gentoo',
|
||||
'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
|
||||
'touch dovecot.conf',
|
||||
'touch dovecot-sql.conf',
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'chmod 0640 /etc/dovecot/dovecot-sql.conf',
|
||||
'rc-update add dovecot default'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/dovecot restart'
|
||||
)
|
||||
),
|
||||
'dovecot2' => Array(
|
||||
'label' => 'Dovecot 2',
|
||||
'commands_1' => Array(
|
||||
'emerge -av dovecot',
|
||||
'mv dovecot.conf dovecot.conf.gentoo',
|
||||
'mv dovecot-sql.conf dovecot-sql.conf.gentoo',
|
||||
'touch dovecot.conf',
|
||||
'touch dovecot-sql.conf',
|
||||
'mv /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.gentoo',
|
||||
'mv /etc/dovecot/dovecot-sql.conf /etc/dovecot/dovecot-sql.conf.gentoo',
|
||||
'touch /etc/dovecot/dovecot.conf',
|
||||
'touch /etc/dovecot/dovecot-sql.conf',
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||
@@ -342,13 +330,14 @@ milter_default_action = accept" >> /etc/postfix/main.cf',
|
||||
'proftpd' => Array(
|
||||
'label' => 'ProFTPd',
|
||||
'commands_1' => Array(
|
||||
'emerge -av proftpd'
|
||||
'echo "net-ftp/proftpd mysql" >> /etc/portage/package.use',
|
||||
'emerge -av proftpd',
|
||||
'touch /etc/proftpd/proftpd.conf'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'touch /etc/proftpd/proftpd.conf',
|
||||
'chown root:0 /etc/proftpd/proftpd.conf',
|
||||
'chmod 0600 /etc/proftpd/proftpd.conf',
|
||||
'rc-update add proftpd default'
|
||||
@@ -404,8 +393,10 @@ milter_default_action = accept" >> /etc/postfix/main.cf',
|
||||
'label' => 'Awstats',
|
||||
'commands' => Array(
|
||||
'emerge awstats',
|
||||
'awstats_configure.pl',
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself',
|
||||
'rm /etc/cron.d/awstats'
|
||||
),
|
||||
),
|
||||
'libnss' => Array(
|
||||
|
||||
@@ -17,6 +17,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'ubuntu_lucid' => Array(
|
||||
'label' => 'Ubuntu 10.04 (Lucid)',
|
||||
@@ -128,13 +145,13 @@ return Array(
|
||||
'postfix_courier' => Array(
|
||||
'label' => 'Postfix/Courier',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -189,13 +206,13 @@ return Array(
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -359,7 +376,9 @@ return Array(
|
||||
'apt-get install awstats',
|
||||
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
|
||||
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself',
|
||||
'rm /etc/cron.d/awstats'
|
||||
),
|
||||
),
|
||||
'libnss' => Array(
|
||||
|
||||
@@ -14,12 +14,29 @@
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Configfiles
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'debian_lenny' => Array(
|
||||
'label' => 'Debian 5.0 (Lenny)',
|
||||
'ubuntu_precise' => Array(
|
||||
'label' => 'Ubuntu 12.04 (Precise)',
|
||||
'services' => Array(
|
||||
'http' => Array(
|
||||
'label' => $lng['admin']['configfiles']['http'],
|
||||
@@ -67,7 +84,7 @@ return Array(
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/lighttpd restart'
|
||||
)
|
||||
),
|
||||
),
|
||||
'nginx' => Array(
|
||||
'label' => 'Nginx Webserver',
|
||||
@@ -82,7 +99,7 @@ return Array(
|
||||
'rm /etc/nginx/sites-enabled/default',
|
||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
||||
//'mkdir -p ' . $settings['system']['deactivateddocroot'],
|
||||
'mkdir -p ' . $settings['system']['deactivateddocroot'],
|
||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
||||
'chmod u+x /etc/init.d/php-fcgi'
|
||||
@@ -91,8 +108,8 @@ return Array(
|
||||
'/etc/init.d/php-fcgi start',
|
||||
'/etc/init.d/nginx restart'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'dns' => Array(
|
||||
'label' => $lng['admin']['configfiles']['dns'],
|
||||
@@ -128,13 +145,13 @@ return Array(
|
||||
'postfix_courier' => Array(
|
||||
'label' => 'Postfix/Courier',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -189,13 +206,13 @@ return Array(
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -282,14 +299,17 @@ return Array(
|
||||
'dovecot' => Array(
|
||||
'label' => 'Dovecot',
|
||||
'commands_1' => Array(
|
||||
'apt-get install dovecot-imapd dovecot-pop3d'
|
||||
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix dovecot-mysql mail-stack-delivery'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||
|
||||
'etc_dovecot_conf.d_01_mail_stack_delivery.conf' => '/etc/dovecot/conf.d/01-mail-stack-delivery.conf',
|
||||
'etc_dovecot_conf.d_10_auth.conf' => '/etc/dovecot/conf.d/10-auth.conf',
|
||||
'etc_dovecot_conf.d_auth-sql.conf.ext' => '/etc/dovecot/conf.d/auth-sql.conf.ext',
|
||||
'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
|
||||
'chmod 0640 /etc/dovecot/dovecot-sql.conf.ext'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/dovecot restart'
|
||||
@@ -358,18 +378,20 @@ return Array(
|
||||
'apt-get install awstats',
|
||||
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
|
||||
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself',
|
||||
'rm /etc/cron.d/awstats'
|
||||
),
|
||||
),
|
||||
'libnss' => Array(
|
||||
'label' => 'libnss (system login with mysql)',
|
||||
'label' => 'libnss-bg (system login with mysql)',
|
||||
'commands' => Array(
|
||||
'apt-get install libnss-mysql nscd',
|
||||
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
||||
'apt-get install libnss-mysql-bg nscd',
|
||||
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
||||
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
||||
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
|
||||
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
|
||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||
),
|
||||
'restart' => Array(
|
||||
@@ -17,6 +17,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'sle_10' => Array(
|
||||
'label' => 'SUSE Linux Enterprise 10',
|
||||
@@ -71,11 +88,11 @@ return Array(
|
||||
'usr_lib_sasl2_smtpd.conf' => '/usr/lib/sasl2/smtpd.conf'
|
||||
),
|
||||
'commands' => Array(
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -158,9 +175,9 @@ return Array(
|
||||
'awstats' => Array(
|
||||
'label' => 'Awstats',
|
||||
'commands' => Array(
|
||||
'awstats_configure.pl',
|
||||
makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -17,6 +17,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'debian_squeeze' => Array(
|
||||
'label' => 'Debian 6.0 (Squeeze)',
|
||||
@@ -128,13 +145,13 @@ return Array(
|
||||
'postfix_courier' => Array(
|
||||
'label' => 'Postfix/Courier',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' '.$vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -189,13 +206,13 @@ return Array(
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R ' . $vmail_username . ':' . $vmail_groupname . ' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -358,7 +375,9 @@ return Array(
|
||||
'apt-get install awstats',
|
||||
'cp /usr/share/awstats/tools/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
|
||||
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself',
|
||||
'rm /etc/cron.d/awstats'
|
||||
),
|
||||
),
|
||||
'libnss' => Array(
|
||||
|
||||
@@ -17,6 +17,23 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'opensuse_11_x' => Array(
|
||||
'label' => 'openSUSE 11.x',
|
||||
@@ -68,11 +85,11 @@ return Array(
|
||||
'etc_sasl2_smtpd.conf' => '/etc/sasl2/smtpd.conf'
|
||||
),
|
||||
'commands' => Array(
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R ' . $vmail_username . ':' . $vmail_groupname . ' ' . $settings['system']['vmail_homedir'],
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -106,13 +123,13 @@ return Array(
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'zypper install postfix postfix-mysql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -238,14 +255,8 @@ return Array(
|
||||
'label' => 'Awstats',
|
||||
'commands' => Array(
|
||||
'cp /usr/share/doc/packages/awstats/awstats.model.conf /etc/awstats/',
|
||||
/**makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),*/
|
||||
'sed -i.bak \'s/^DirData/# DirData/\''.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'cp awstats.model.conf awstats.yourdomain.xx.conf #e.g one.example.com or example.com',
|
||||
'edit awstats.yourdomain.xx.conf',
|
||||
'change SiteDomain="yourdomain.xx #e.g SiteDomain="example.com" ',
|
||||
'change HostAliases="yourdomain.xx www.yourdomain.de 127.0.0.1 localhost" ',
|
||||
'Set DirIcons="/awstatsicons" ',
|
||||
'run awstats in your favorite browser by http://yourdomain.xx/cgi-bin/awstats.pl'
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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,16 +9,32 @@
|
||||
* 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 Configfiles
|
||||
*
|
||||
*/
|
||||
|
||||
// Try to guess user/group from settings' email UID/GID
|
||||
$vmail_user=posix_getpwuid($settings['system']['vmail_uid']);
|
||||
$vmail_group=posix_getgrgid($settings['system']['vmail_gid']);
|
||||
|
||||
/* If one of them are not set, call it 'vmail' and suggest creating user/group
|
||||
* in scripts. */
|
||||
if ($vmail_user === false) {
|
||||
$vmail_username="vmail";
|
||||
} else {
|
||||
$vmail_username=$vmail_user['name'];
|
||||
}
|
||||
if ($vmail_group === false) {
|
||||
$vmail_groupname="vmail";
|
||||
} else {
|
||||
$vmail_groupname=$vmail_group['name'];
|
||||
}
|
||||
|
||||
return Array(
|
||||
'ubuntu_hardy' => Array(
|
||||
'label' => 'Ubuntu 8.04 (Hardy)',
|
||||
'debian_wheezy' => Array(
|
||||
'label' => 'Debian 7.0 (Wheezy)',
|
||||
'services' => Array(
|
||||
'http' => Array(
|
||||
'label' => $lng['admin']['configfiles']['http'],
|
||||
@@ -42,7 +57,7 @@ return Array(
|
||||
null,
|
||||
'restart' => Array(
|
||||
'/etc/init.d/apache2 restart'
|
||||
)
|
||||
),
|
||||
),
|
||||
'lighttpd' => Array(
|
||||
'label' => 'Lighttpd Webserver',
|
||||
@@ -100,7 +115,8 @@ return Array(
|
||||
'bind' => Array(
|
||||
'label' => 'Bind9',
|
||||
'commands' => Array(
|
||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf',
|
||||
'apt-get install bind9',
|
||||
'echo "include \"' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf\";" >> /etc/bind/named.conf.local',
|
||||
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||
'chown root:bind ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
||||
'chmod 0644 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
|
||||
@@ -113,7 +129,7 @@ return Array(
|
||||
'label' => 'PowerDNS',
|
||||
'files' => Array(
|
||||
'etc_powerdns_pdns.conf' => '/etc/powerdns/pdns.conf',
|
||||
'etc_powerdns_pdns-froxlor.conf' => '/etc/powerdns/pdns_froxlor.conf',
|
||||
'etc_powerdns_bindbackend.conf' => '/etc/powerdns/bindbackend.conf',
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/pdns restart'
|
||||
@@ -127,13 +143,13 @@ return Array(
|
||||
'postfix_courier' => Array(
|
||||
'label' => 'Postfix/Courier',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' '.$vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R '.$vmail_username.':'.$vmail_groupname.' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql libsasl2-2 libsasl2-modules libsasl2-modules-sql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -158,7 +174,8 @@ return Array(
|
||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf'
|
||||
'etc_postfix_sasl_smtpd.conf' => '/etc/postfix/sasl/smtpd.conf',
|
||||
'etc_aliases' => '/etc/aliases'
|
||||
),
|
||||
'restart' => Array(
|
||||
'newaliases',
|
||||
@@ -168,33 +185,33 @@ return Array(
|
||||
'dkim' => Array(
|
||||
'label' => 'DomainKey filter',
|
||||
'commands_1' => Array(
|
||||
'apt-get install dkim-filter',
|
||||
'apt-get install opendkim',
|
||||
'mkdir -p /etc/postfix/dkim'
|
||||
),
|
||||
'files' => Array(
|
||||
'dkim-filter.conf' => '/etc/dkim-filter.conf'
|
||||
'opendkim.conf' => '/etc/opendkim.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'echo "milter_default_action = accept" >> /etc/postfix/main.cf',
|
||||
'echo "milter_protocol = 2" >> /etc/postfix/main.cf',
|
||||
'echo "milter_protocol = 6" >> /etc/postfix/main.cf',
|
||||
'echo "smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf',
|
||||
'echo "non_smtpd_milters = inet:localhost:8891" >> /etc/postfix/main.cf'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/dkim-filter restart',
|
||||
'/etc/init.d/opendkim restart',
|
||||
'/etc/init.d/postfix restart'
|
||||
)
|
||||
),
|
||||
'postfix_dovecot' => Array(
|
||||
'label' => 'Postfix/Dovecot',
|
||||
'commands' => Array(
|
||||
($vmail_group === false) ? 'groupadd -g ' . $settings['system']['vmail_gid'] . ' ' . $vmail_groupname : '',
|
||||
($vmail_user === false) ? 'useradd -u ' . $settings['system']['vmail_uid'] . ' -g ' . $vmail_groupname . ' ' . $vmail_username : '',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R ' . $vmail_username . ':' . $vmail_groupname . ' ' . $settings['system']['vmail_homedir'],
|
||||
'apt-get install postfix postfix-mysql',
|
||||
'mkdir -p /var/spool/postfix/etc/pam.d',
|
||||
'mkdir -p /var/spool/postfix/var/run/mysqld',
|
||||
'groupadd -g ' . $settings['system']['vmail_gid'] . ' vmail',
|
||||
'useradd -u ' . $settings['system']['vmail_uid'] . ' -g vmail vmail',
|
||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
||||
'touch /etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'touch /etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
@@ -218,11 +235,12 @@ return Array(
|
||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf',
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf'
|
||||
'etc_postfix_mysql-virtual_sender_permissions.cf' => '/etc/postfix/mysql-virtual_sender_permissions.cf',
|
||||
'etc_aliases' => '/etc/aliases'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/postfix restart',
|
||||
'newaliases'
|
||||
'newaliases',
|
||||
'/etc/init.d/postfix restart'
|
||||
)
|
||||
),
|
||||
'postfix_mxaccess' => Array(
|
||||
@@ -245,7 +263,7 @@ return Array(
|
||||
'# choose "no configuration at this time" and "splitted configuration files" in the dialog'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt.rul' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt.rul',
|
||||
'etc_exim4_conf.d_acl_30_exim4-config_check_rcpt' => '/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt',
|
||||
'etc_exim4_conf.d_auth_30_froxlor-config' => '/etc/exim4/conf.d/auth/30_froxlor-config',
|
||||
'etc_exim4_conf.d_main_10_froxlor-config_options' => '/etc/exim4/conf.d/main/10_froxlor-config_options',
|
||||
'etc_exim4_conf.d_router_180_froxlor-config' => '/etc/exim4/conf.d/router/180_froxlor-config',
|
||||
@@ -266,6 +284,9 @@ return Array(
|
||||
'daemons' => Array(
|
||||
'courier' => Array(
|
||||
'label' => 'Courier',
|
||||
'commands' => Array(
|
||||
'apt-get install courier-pop courier-imap courier-authlib-mysql'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_courier_authdaemonrc' => '/etc/courier/authdaemonrc',
|
||||
'etc_courier_authmysqlrc' => '/etc/courier/authmysqlrc'
|
||||
@@ -278,14 +299,17 @@ return Array(
|
||||
'dovecot' => Array(
|
||||
'label' => 'Dovecot',
|
||||
'commands_1' => Array(
|
||||
'apt-get install dovecot-imapd dovecot-pop3d dovecot-postfix',
|
||||
'apt-get install dovecot-imapd dovecot-pop3d dovecot-mysql'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_dovecot_conf.d_10-auth.conf' => '/etc/dovecot/conf.d/10-auth.conf',
|
||||
'etc_dovecot_conf.d_10-mail.conf' => '/etc/dovecot/conf.d/10-mail.conf',
|
||||
'etc_dovecot_conf.d_10-master.conf' => '/etc/dovecot/conf.d/10-master.conf',
|
||||
'etc_dovecot_conf.d_15-lda.conf' => '/etc/dovecot/conf.d/15-lda.conf',
|
||||
'etc_dovecot_conf.d_20-imap.conf' => '/etc/dovecot/conf.d/20-imap.conf',
|
||||
'etc_dovecot_conf.d_20-pop3.conf' => '/etc/dovecot/conf.d/20-pop3.conf',
|
||||
'etc_dovecot_dovecot.conf' => '/etc/dovecot/dovecot.conf',
|
||||
'etc_dovecot_dovecot-sql.conf' => '/etc/dovecot/dovecot-sql.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'chmod 0640 /etc/dovecot/dovecot-sql.conf'
|
||||
'etc_dovecot_dovecot-sql.conf.ext' => '/etc/dovecot/dovecot-sql.conf.ext'
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/dovecot restart'
|
||||
@@ -302,6 +326,7 @@ return Array(
|
||||
'apt-get install proftpd-basic proftpd-mod-mysql'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_proftpd_sql.conf' => '/etc/proftpd/sql.conf',
|
||||
'etc_proftpd_modules.conf' => '/etc/proftpd/modules.conf',
|
||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
||||
),
|
||||
@@ -351,30 +376,62 @@ return Array(
|
||||
'label' => 'Awstats',
|
||||
'commands' => Array(
|
||||
'apt-get install awstats',
|
||||
'cp /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
|
||||
'cp /usr/share/awstats/tools/awstats_buildstaticpages.pl '.makeCorrectDir($settings['system']['awstats_path']),
|
||||
'mv '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.conf').' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
'sed -i.bak \'s/^DirData/# DirData/\' '.makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf'),
|
||||
'# Please make sure you deactivate awstats own cronjob as Froxlor handles that itself',
|
||||
'rm /etc/cron.d/awstats'
|
||||
),
|
||||
),
|
||||
'libnss' => Array(
|
||||
'label' => 'libnss (system login with mysql)',
|
||||
'commands' => Array(
|
||||
'apt-get install libnss-mysql nscd',
|
||||
'chmod 600 /etc/nss-mysql.conf /etc/nss-mysql-root.conf'
|
||||
'apt-get install libnss-mysql-bg nscd',
|
||||
'chmod 600 /etc/libnss-mysql.cfg /etc/libnss-mysql-root.cfg'
|
||||
),
|
||||
'files' => Array(
|
||||
'etc_nss-mysql.conf' => '/etc/nss-mysql.conf',
|
||||
'etc_nss-mysql-root.conf' => '/etc/nss-mysql-root.conf',
|
||||
'etc_libnss-mysql.cfg' => '/etc/libnss-mysql.cfg',
|
||||
'etc_libnss-mysql-root.cfg' => '/etc/libnss-mysql-root.cfg',
|
||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf',
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/nscd restart'
|
||||
)
|
||||
),
|
||||
'fcgid' => array(
|
||||
'label' => 'FCGID',
|
||||
'commands' => array(
|
||||
'apt-get install apache2-suexec libapache2-mod-fcgid php5-cgi',
|
||||
'a2enmod suexec fcgid',
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'groupadd -f '.$settings['system']['mod_fcgid_httpgroup'] : null,
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'useradd -s /bin/false -g '.$settings['system']['mod_fcgid_httpgroup'].' '.$settings['system']['mod_fcgid_httpuser'] : null,
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'chown -R '.$settings['system']['mod_fcgid_httpuser'].':'.$settings['system']['mod_fcgid_httpgroup'].' '.$pathtophpfiles : null,
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'mkdir -p '.makeCorrectDir($settings['system']['mod_fcgid_configdir']) : null,
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'mkdir -p '.makeCorrectDir($settings['system']['mod_fcgid_tmpdir']) : null,
|
||||
($settings['system']['mod_fcgid_ownvhost'] == '1') ? 'a2dismod php5' : null
|
||||
),
|
||||
'restart' => Array(
|
||||
'/etc/init.d/apache2 restart'
|
||||
)
|
||||
),
|
||||
'php-fpm' => array(
|
||||
'label' => 'PHP-FPM',
|
||||
'commands' => array(
|
||||
'# add "non-free" after all occurances of "main" in /etc/apt/sources.list',
|
||||
'# this is needed for libapache2-mod-fastcgi to install',
|
||||
'apt-get install apache2-suexec libapache2-mod-fastcgi php5-fpm',
|
||||
'# change fpm-configuration directory to "/etc/php5/fpm/pool.d/" in froxlor',
|
||||
'sed -i.bak \'s/^;include=\/etc\/php5\/fpm/*.conf/include=include=\/etc\/php5\/fpm\/pool.d\/*.conf/\' /etc/php5/fpm/php-fpm.conf',
|
||||
'rm /etc/php5/fpm/pool.d/www.conf',
|
||||
'a2enmod suexec fastcgi actions',
|
||||
($settings['phpfpm']['enabled_ownvhost'] == '1') ? 'groupadd -f '.$settings['phpfpm']['vhost_httpgroup'] : null,
|
||||
($settings['phpfpm']['enabled_ownvhost'] == '1') ? 'useradd -s /bin/false -g '.$settings['phpfpm']['vhost_httpgroup'].' '.$settings['phpfpm']['vhost_httpuser'] : null,
|
||||
($settings['phpfpm']['enabled_ownvhost'] == '1') ? 'chown -R '.$settings['phpfpm']['vhost_httpuser'].':'.$settings['phpfpm']['vhost_httpgroup'].' '.$pathtophpfiles : null,
|
||||
($settings['phpfpm']['enabled_ownvhost'] == '1') ? 'a2dismod php5' : null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
@@ -45,5 +45,5 @@ else
|
||||
|
||||
$cfgPath = 'lib/configfiles/';
|
||||
$configfiles = Array();
|
||||
$configfiles = array_merge(include $cfgPath . 'squeeze.inc.php', include $cfgPath . 'lenny.inc.php', include $cfgPath . 'lucid.inc.php', include $cfgPath . 'hardy.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse11.inc.php', include $cfgPath . 'sle10.inc.php', include $cfgPath . 'freebsd.inc.php');
|
||||
$configfiles = array_merge(include $cfgPath . 'wheezy.inc.php', include $cfgPath . 'squeeze.inc.php', include $cfgPath . 'precise.inc.php', include $cfgPath . 'lucid.inc.php', include $cfgPath . 'gentoo.inc.php', include $cfgPath . 'suse11.inc.php', include $cfgPath . 'sle10.inc.php', include $cfgPath . 'freebsd.inc.php');
|
||||
|
||||
|
||||
@@ -200,6 +200,14 @@ return array(
|
||||
'visible' => ($settings['ticket']['enabled'] == '1' ? true : false),
|
||||
'ul_field' => $tickets_ul
|
||||
),
|
||||
'tickets_see_all' => array(
|
||||
'label' => $lng['admin']['tickets_see_all'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array()
|
||||
),
|
||||
'mysqls' => array(
|
||||
'label' => $lng['customer']['mysqls'],
|
||||
'type' => 'textul',
|
||||
|
||||
@@ -214,6 +214,14 @@ return array(
|
||||
'visible' => ($settings['ticket']['enabled'] == '1' ? true : false),
|
||||
'ul_field' => $tickets_ul
|
||||
),
|
||||
'tickets_see_all' => array(
|
||||
'label' => $lng['admin']['tickets_see_all'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['tickets_see_all'])
|
||||
),
|
||||
'mysqls' => array(
|
||||
'label' => $lng['customer']['mysqls'],
|
||||
'type' => 'textul',
|
||||
|
||||
@@ -251,8 +251,11 @@ return array(
|
||||
),
|
||||
'backup_allowed' => array(
|
||||
'label' => $lng['backup_allowed'].'?',
|
||||
'type' => 'yesno',
|
||||
'yesno_var' => $backup_allowed
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'visible' => ($settings['system']['backup_enabled'] == '1' ? true : false)
|
||||
),
|
||||
'number_of_aps_packages' => array(
|
||||
'label' => $lng['aps']['numberofapspackages'],
|
||||
|
||||
@@ -260,8 +260,12 @@ return array(
|
||||
),
|
||||
'backup_allowed' => array(
|
||||
'label' => $lng['backup_allowed'].'?',
|
||||
'type' => 'yesno',
|
||||
'yesno_var' => $backup_allowed
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['backup_allowed']),
|
||||
'visible' => ($settings['system']['backup_enabled'] == '1' ? true : false)
|
||||
),
|
||||
'number_of_aps_packages' => array(
|
||||
'label' => $lng['aps']['numberofapspackages'],
|
||||
|
||||
@@ -54,7 +54,8 @@ return array(
|
||||
'select_var' => $subtodomains
|
||||
),
|
||||
'caneditdomain' => array(
|
||||
'label' => $lng['admin']['domain_edit'],
|
||||
'label' => $lng['admin']['domain_editable']['title'],
|
||||
'desc' => $lng['admin']['domain_editable']['desc'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
@@ -130,7 +131,8 @@ return array(
|
||||
'value' => array('1')
|
||||
),
|
||||
'speciallogfile' => array(
|
||||
'label' => 'Speciallogfile',
|
||||
'label' => $lng['admin']['speciallogfile']['title'],
|
||||
'desc' => $lng['admin']['speciallogfile']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
@@ -161,16 +163,8 @@ return array(
|
||||
),
|
||||
'value' => array('1')
|
||||
),
|
||||
'safemode' => array(
|
||||
'label' => 'Safemode',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array('1')
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => ((int)$settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'visible' => (((int)$settings['system']['mod_fcgid'] == 1 || (int)$settings['phpfpm']['enabled'] == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
@@ -190,7 +184,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['nameserversettings'],
|
||||
'image' => 'icons/domain_add.png',
|
||||
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'visible' => ($settings['system']['bind_enable'] == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'fields' => array(
|
||||
'isbinddomain' => array(
|
||||
'label' => 'Nameserver',
|
||||
|
||||
@@ -63,7 +63,8 @@ return array(
|
||||
'value' => $subdomains.' '.$lng['customer']['subdomains'].', '.$alias_check.' '.$lng['domains']['aliasdomains'].', '.$emails.' '.$lng['customer']['emails'].', '.$email_accounts.' '.$lng['customer']['accounts'].', '.$email_forwarders.' '.$lng['customer']['forwarders']
|
||||
),
|
||||
'caneditdomain' => array(
|
||||
'label' => $lng['admin']['domain_edit'],
|
||||
'label' => $lng['admin']['domain_editable']['title'],
|
||||
'desc' => $lng['admin']['domain_editable']['desc'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
@@ -141,7 +142,8 @@ return array(
|
||||
'value' => array($result['wwwserveralias'])
|
||||
),
|
||||
'speciallogfile' => array(
|
||||
'label' => 'Speciallogfile',
|
||||
'label' => $lng['admin']['speciallogfile']['title'],
|
||||
'desc' => $lng['admin']['speciallogfile']['description'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
@@ -183,16 +185,8 @@ return array(
|
||||
),
|
||||
'value' => array($result['openbasedir'])
|
||||
),
|
||||
'safemode' => array(
|
||||
'label' => 'Safemode',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['safemode'])
|
||||
),
|
||||
'phpsettingid' => array(
|
||||
'visible' => ((int)$settings['system']['mod_fcgid'] == 1 ? true : false),
|
||||
'visible' => (((int)$settings['system']['mod_fcgid'] == 1 || (int)$settings['phpfpm']['enabled'] == 1) ? true : false),
|
||||
'label' => $lng['admin']['phpsettings']['title'],
|
||||
'type' => 'select',
|
||||
'select_var' => $phpconfigs
|
||||
@@ -214,7 +208,7 @@ return array(
|
||||
'section_d' => array(
|
||||
'title' => $lng['admin']['nameserversettings'],
|
||||
'image' => 'icons/domain_edit.png',
|
||||
'visible' => ($userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'visible' => ($settings['system']['bind_enable'] == '1' && $userinfo['change_serversettings'] == '1' ? true : false),
|
||||
'fields' => array(
|
||||
'isbinddomain' => array(
|
||||
'label' => 'Nameserver',
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Formfields
|
||||
*
|
||||
*/
|
||||
|
||||
return array(
|
||||
'domain_ssleditor' => array(
|
||||
'title' => $lng['panel']['ssleditor'],
|
||||
'image' => 'icons/ssl.png',
|
||||
'sections' => array(
|
||||
'section_a' => array(
|
||||
'title' => 'SSL certificates',
|
||||
'image' => 'icons/ssl.png',
|
||||
'fields' => array(
|
||||
'ssl_cert_file' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_file_content'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['ssl_cert_file']
|
||||
),
|
||||
'ssl_key_file' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['ipsandports']['ssl_key_file_content'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['ssl_key_file']
|
||||
),
|
||||
'ssl_ca_file' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['ipsandports']['ssl_ca_file_content'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['ssl_ca_file']
|
||||
),
|
||||
'ssl_cert_chainfile' => array(
|
||||
'style' => 'vertical-align:top;',
|
||||
'label' => $lng['admin']['ipsandports']['ssl_cert_chainfile_content'],
|
||||
'desc' => $lng['admin']['ipsandports']['ssl_paste_description'],
|
||||
'type' => 'textarea',
|
||||
'cols' => 60,
|
||||
'rows' => 12,
|
||||
'value' => $result['ssl_cert_chainfile']
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -43,7 +43,7 @@ return array(
|
||||
),
|
||||
'path' => array(
|
||||
'label' => $lng['panel']['path'],
|
||||
'desc' => ($settings['panel']['pathedit'] != 'Dropdown' ? $lng['panel']['pathDescription'] : null).(isset($pathSelect['note']) ? '<br />'.$pathSelect['value'] : ''),
|
||||
'desc' => ($settings['panel']['pathedit'] != 'Dropdown' ? $lng['panel']['pathDescriptionSubdomain'] : null).(isset($pathSelect['note']) ? $pathSelect['note'].'<br />'.$pathSelect['value'] : ''),
|
||||
'type' => $pathSelect['type'],
|
||||
'select_var' => $pathSelect['value'],
|
||||
'value' => $pathSelect['value']
|
||||
@@ -61,13 +61,13 @@ return array(
|
||||
'select_var' => isset($redirectcode) ? $redirectcode : null
|
||||
),
|
||||
'ssl_redirect' => array(
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? true : false),
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'label' => 'SSL Redirect',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['ssl_redirect'])
|
||||
'value' => array()
|
||||
),
|
||||
'openbasedir_path' => array(
|
||||
'label' => $lng['domain']['openbasedirpath'],
|
||||
|
||||