Compare commits
1813 Commits
Author | SHA1 | Date | |
---|---|---|---|
320d814df4 | |||
8953017b9d | |||
874e896178 | |||
973632b4ae | |||
5fa9663d99 | |||
1ed31ad638 | |||
da94f781b3 | |||
d4640219a6 | |||
1fc048fec9 | |||
d6d5477022 | |||
691bcfa061 | |||
3148db54b5 | |||
|
58ee240c80 | ||
ca090638da | |||
4f05231b04 | |||
730577b4a4 | |||
51f2c41b31 | |||
|
2de3ac9044 | ||
|
09f632cc6d | ||
339da62a23 | |||
5a4d3d420f | |||
cd1e8adce3 | |||
|
e676ca47dc | ||
637758c13e | |||
6a0c067cef | |||
a956f85fc7 | |||
1a137bb683 | |||
57eacfb953 | |||
88247f0de3 | |||
eb0bc9ae5c | |||
7f133f17f7 | |||
944b0fe6c5 | |||
eae2b3df81 | |||
3b3abe615d | |||
756014d568 | |||
6d4c438d62 | |||
5c2743c01a | |||
eeb660293c | |||
01261f8c92 | |||
06078cc8e7 | |||
a37ea34670 | |||
56418b1551 | |||
dc9f128b79 | |||
2533b362ab | |||
0c416c7d7c | |||
fd94b0108c | |||
99fb30b0ec | |||
81e2e345a7 | |||
ce5071c3e3 | |||
1210561448 | |||
9294697d58 | |||
3a92a54cd5 | |||
b6a70659b1 | |||
cd22f3e9d8 | |||
8aba48a1d2 | |||
|
423ef8d36f | ||
098abccde7 | |||
|
75aaaf21b7 | ||
622027302f | |||
5b999eff2d | |||
562eeceac2 | |||
f9e0755b23 | |||
74b9faf7af | |||
|
9978074fbc | ||
2df50d9096 | |||
14aba49194 | |||
17df9c8dbc | |||
6dae66540d | |||
0317979c92 | |||
a4b3824a42 | |||
f1200c4999 | |||
d7365d719f | |||
42f5c1a20a | |||
74e69aa520 | |||
20da5d2f36 | |||
fe951ad050 | |||
|
8edcc7e57f | ||
|
62ad932aa7 | ||
33fb35bd34 | |||
|
003f98b18c | ||
6e3720f8e4 | |||
|
4f3d0a57f9 | ||
|
f28659a025 | ||
|
026b463fb7 | ||
bfe0065f1c | |||
91a1b1872c | |||
cf67b11295 | |||
dd4169f815 | |||
dbe04bb342 | |||
98f2b68560 | |||
805bb610a5 | |||
3148d0eb2a | |||
67439317c4 | |||
5e90541918 | |||
704862faad | |||
c8df65baee | |||
49d86a55be | |||
de3db5527b | |||
d115befab9 | |||
6b20d0c8b6 | |||
b296525e39 | |||
7a16536341 | |||
aa94e21602 | |||
bb932e5b9c | |||
a9ca845c80 | |||
b8bad36510 | |||
1c3d9c98b4 | |||
dc9577ff6a | |||
2336e406f4 | |||
84f5bca0a9 | |||
fb35d4fff9 | |||
ace1423a13 | |||
3b9a8e5456 | |||
c60b247ef7 | |||
89f0f5c688 | |||
7bdf01d344 | |||
c0d9a461af | |||
1844d91893 | |||
1a3594311b | |||
8b6dcf4db0 | |||
9d8e057410 | |||
8a2586d01b | |||
be5d5d182b | |||
38b653d075 | |||
88a1b978ce | |||
a2946bd67d | |||
410b925b8d | |||
4f9b48135c | |||
5bc4698520 | |||
0f64ad3674 | |||
93f949d914 | |||
b971d2d85c | |||
edd279ca8e | |||
525b7de7e2 | |||
b6bfc39cbf | |||
3f4420181c | |||
94eaed0b2c | |||
|
d747568575 | ||
2cda0cbb66 | |||
d41db57211 | |||
bc99761b7a | |||
fc2c9d791a | |||
f9b6eeb92c | |||
2d60df2417 | |||
6dc0bc8d34 | |||
110322ab47 | |||
e40be770c3 | |||
d32f9c02ce | |||
83185a6b32 | |||
a9644ddec1 | |||
e9b29737c9 | |||
4f03a73f9a | |||
647bd84995 | |||
eb60d6b39f | |||
4d038b0777 | |||
67b0a6005e | |||
d605c80332 | |||
98954281d5 | |||
58e0ddc952 | |||
f1030c0298 | |||
9cb71e62c1 | |||
60ff2c853c | |||
6c4e883a8a | |||
25a4a3db40 | |||
5f2aab1501 | |||
8a2fbc6f38 | |||
2b6779af8f | |||
efa1372cdc | |||
|
64e902c5a1 | ||
ee97a2f932 | |||
4960397655 | |||
da03edb665 | |||
712117dfc4 | |||
048e2dd3f0 | |||
3beed6b2ec | |||
c62a98b22a | |||
20d97e5bce | |||
2581119295 | |||
95c55aa931 | |||
059bc5ac39 | |||
324a85fb7f | |||
28e968b15f | |||
9d2c4404c0 | |||
d61b142e40 | |||
d1a1f51bf0 | |||
0cf963ac5e | |||
5921115af0 | |||
87d7478864 | |||
3179d5b669 | |||
8ced21fe86 | |||
84e4de1e7a | |||
39309d1914 | |||
194b396788 | |||
7dd32257d1 | |||
6de62a6929 | |||
1c6433eb73 | |||
762998cd4b | |||
73abafebac | |||
81cd6f75fe | |||
42f28a72da | |||
69916d8f6d | |||
ec2e29083b | |||
98a5570ef6 | |||
3ec1610fff | |||
bc39c22c29 | |||
2e3b718fe2 | |||
be8182ffcc | |||
dfaaffcff4 | |||
de782c7fea | |||
3ea37e0e11 | |||
0f1407682e | |||
e40e821b5f | |||
31ad9138ef | |||
9cd07fe829 | |||
4dec01bdaa | |||
e64670e5aa | |||
7c07d7f3e2 | |||
f9c5d4dbaf | |||
52f203b43d | |||
35d80bdcee | |||
a6b7367002 | |||
75c04cae38 | |||
915b6786d9 | |||
b561f7eec8 | |||
89556ae68f | |||
33149aafb9 | |||
edf8850952 | |||
393bf21f30 | |||
03a2051ad7 | |||
51ad3e70d3 | |||
9417960281 | |||
a312bc5e8f | |||
a617eebeec | |||
38e53aaa6a | |||
8b6d411d58 | |||
1b436f9535 | |||
64fccc272c | |||
ead790853e | |||
|
47e7a81f6f | ||
|
73b11b48af | ||
|
5bb282b3bd | ||
|
9608c5a83d | ||
568e539e49 | |||
|
8c99b13e12 | ||
35bbb22c56 | |||
|
169b8d3b76 | ||
d8a63bc2cd | |||
f105a0b5d2 | |||
843a6e11ae | |||
a5320b07d7 | |||
3eafe870bc | |||
82704cfbd6 | |||
88ba0f148e | |||
|
19376e7f6c | ||
|
3ae6e5cdb4 | ||
29c9d8dc7d | |||
7c822661e6 | |||
3a85c9060b | |||
834e75cdd6 | |||
6ea5f5af11 | |||
e2099735e1 | |||
|
8b1e218862 | ||
e718518698 | |||
cc55a13151 | |||
0fc11b3885 | |||
16b7297d19 | |||
1683b7c72a | |||
f4ad0a2351 | |||
7f6b193656 | |||
15dbe153f5 | |||
547efb38e4 | |||
f44ccdc4e1 | |||
1549125665 | |||
cf76dd744d | |||
57afba72e8 | |||
3f97ad09df | |||
00213f806c | |||
d0f1c50f51 | |||
bc16b7c25f | |||
5424424eaf | |||
7aed881f08 | |||
ca169c5bc7 | |||
7041adcdfb | |||
ffcdb223cc | |||
c70bdfcd90 | |||
d512573af8 | |||
0527a9def1 | |||
09ef31e750 | |||
9213453bc3 | |||
|
8c3cbf0489 | ||
|
45ac4ec1ee | ||
e3123d7c45 | |||
680059dece | |||
e9526daf1c | |||
a2774b8fb9 | |||
5618a334d9 | |||
|
8b32bebdc2 | ||
788a18f7f1 | |||
ad186da482 | |||
345cb1748a | |||
e8f07d27ef | |||
e64fe1eb17 | |||
|
e6dfd1dfec | ||
|
a56e775ab9 | ||
|
ce3a59b13c | ||
|
85d1acad5e | ||
|
13dd999158 | ||
|
cb3bd91b76 | ||
|
d5130ed655 | ||
|
199438285c | ||
|
a149731c46 | ||
|
2e629df611 | ||
|
fcdc1021af | ||
|
ce5cbaa850 | ||
dcd243505d | |||
|
4d32e942a3 | ||
|
95909d7ed4 | ||
|
fad8ca5854 | ||
|
cd3778ca0d | ||
|
8fe1498847 | ||
|
0edc9657b4 | ||
9fe423db62 | |||
|
a9e7114375 | ||
|
e150bd1d26 | ||
|
4c9f963aa7 | ||
|
9d81661cfe | ||
fcd3cacfbc | |||
|
3edc959096 | ||
|
d656d8fe38 | ||
|
eccbb59bcc | ||
|
8457e51717 | ||
|
227c7a9410 | ||
|
9c92fda11b | ||
|
896f090aba | ||
|
5363698020 | ||
|
aa0c213cc3 | ||
|
5009f51342 | ||
|
b340206d3a | ||
|
2cbb0c4134 | ||
|
8c574ec88c | ||
|
5af9f92102 | ||
|
6bf331b355 | ||
|
4b74ceb854 | ||
|
25054c4e0f | ||
|
fbe53e3b29 | ||
|
5397f7014a | ||
|
ebb3cf8ab1 | ||
|
55e7dbe704 | ||
|
f13d938bde | ||
|
0ff5c7c28a | ||
|
fc789e6ef9 | ||
|
9f3ce28877 | ||
|
4e7f9eac50 | ||
|
2fc85b1068 | ||
|
930ea9a6ac | ||
|
d4ebd68052 | ||
|
e9d41c4869 | ||
|
577c2be622 | ||
|
8e7fe6bcd7 | ||
|
973cc5746e | ||
|
8326eb3ebf | ||
|
e9baceb039 | ||
|
720b72f8e4 | ||
a3ebe57f1f | |||
|
d9dc5e0ed7 | ||
|
bc024c3253 | ||
|
137d92624e | ||
|
5d13afd8f6 | ||
|
5628f42782 | ||
|
eae5b8bb06 | ||
|
40fef4e360 | ||
|
ab35143e18 | ||
|
f176ac628b | ||
|
7a09546198 | ||
|
47672a5eb6 | ||
|
3307ba01dc | ||
7d3558460b | |||
|
2fdb7e4525 | ||
|
48d8805605 | ||
|
e4a104f52e | ||
|
ff09ea09cc | ||
|
a4ce7ffea7 | ||
0f8b5da18a | |||
|
1a358c2f09 | ||
|
b56881bf01 | ||
|
59de37a12b | ||
|
2a819b1b98 | ||
|
a9eb9f8cf2 | ||
|
70f630d125 | ||
|
0075e2169c | ||
|
f47a67fd57 | ||
|
b2bb9cfb92 | ||
|
a3f68852ce | ||
|
2031d82600 | ||
|
31b09570f9 | ||
|
b18aef404a | ||
|
6fb71835bf | ||
|
22aaedd3be | ||
|
758203b6d3 | ||
|
57182b0589 | ||
|
0f44076e48 | ||
|
094139dead | ||
|
30fd4bad7c | ||
|
9fef4b2871 | ||
|
db702e43c9 | ||
|
93c5cb995a | ||
|
5fada43676 | ||
|
adac8fb3fd | ||
|
0eef94a164 | ||
|
3c0c880661 | ||
|
e122d020eb | ||
|
a8629df5ec | ||
|
415005e2f6 | ||
|
6e78c45c67 | ||
|
6ac77e629a | ||
|
313e854723 | ||
|
4332d9c205 | ||
|
833d2a9096 | ||
|
6e71f0542b | ||
f6fe379a54 | |||
|
cc5adc17b2 | ||
284318a287 | |||
|
edcd348bca | ||
|
21ae86958d | ||
|
0dca0bb57d | ||
|
933ced4575 | ||
|
232d69cf72 | ||
|
c1850f0bb3 | ||
|
ebd6684d4a | ||
|
62f958622c | ||
|
626145340e | ||
|
84b0d891e0 | ||
|
ef98d5056a | ||
|
ea0b6a0cd5 | ||
|
f015b5b820 | ||
|
6d3810b7ba | ||
|
e273b04dab | ||
|
9799fb5e3f | ||
|
c27a0e1aea | ||
47ee6edaad | |||
b8d2af4c67 | |||
|
8faa0d9f4e | ||
|
9ef0739b80 | ||
|
ad7f3d6167 | ||
|
78dfb230ed | ||
|
854a4ca010 | ||
|
7fde2eb9cd | ||
8c6d98ddbd | |||
c2229a6c79 | |||
|
120abce028 | ||
|
a6d6f2bea2 | ||
|
3f6a95f7a6 | ||
|
090f650ac1 | ||
|
06109eb0c4 | ||
|
f6938b2f13 | ||
|
9467525dac | ||
|
1914b23c74 | ||
|
e333ff3d27 | ||
|
a5b7002239 | ||
|
9faf346634 | ||
|
67a0db5349 | ||
|
e5b8c84736 | ||
|
090383bc95 | ||
|
52107afc1a | ||
|
3b9ded0b29 | ||
c51a3ee5a1 | |||
ba9c01b82c | |||
|
132ca02cdf | ||
|
9cd082b878 | ||
|
efbf92b012 | ||
|
ff1940cdc5 | ||
|
6a17db4e04 | ||
|
5a2e48eeef | ||
|
b9fd28f20f | ||
|
1a8f50adb0 | ||
|
31d602986e | ||
|
fb83027a1e | ||
|
19edc91dfd | ||
|
27a23f68c0 | ||
|
1306efd380 | ||
|
b19473f658 | ||
|
53c60eed76 | ||
|
1fae58c350 | ||
|
0c00a697ec | ||
|
7e8ea1cdbf | ||
|
a39d0fa6cf | ||
|
b40e1deb89 | ||
|
ee751b471d | ||
|
782e9895e5 | ||
|
8552881f7d | ||
|
9bfd6a29fb | ||
|
f5c80e7b5c | ||
|
d7a5c1d9c1 | ||
|
e66e0c1452 | ||
|
21daf749f0 | ||
|
1e46d6fabd | ||
|
8b34ca34c7 | ||
|
964e917f4a | ||
|
210e82e798 | ||
|
243fa1a1d9 | ||
|
506425a9e1 | ||
|
a72a602120 | ||
|
bcd2bb9242 | ||
|
a6e6993a65 | ||
054133e013 | |||
2d875ba623 | |||
|
e6f6fd7d38 | ||
792acd7b17 | |||
|
30d884b699 | ||
|
bc14d1f0ef | ||
|
062a4c1090 | ||
134bbb9984 | |||
|
a441bed2a2 | ||
|
f5ee6448e4 | ||
|
3e77eddb33 | ||
|
ad8c815b3c | ||
|
96724464e2 | ||
|
8f346ae0b7 | ||
|
8a47afef58 | ||
|
6768fe96c2 | ||
|
c4a47928a8 | ||
|
ec06357535 | ||
|
bb1b6c377c | ||
|
9c87fadb7d | ||
|
db7aa3d12a | ||
304de4ab71 | |||
|
3e5f589972 | ||
|
6fbee71173 | ||
07c015856e | |||
|
17b7bf6757 | ||
|
e0716bbeb2 | ||
|
4e4f0adfd6 | ||
|
a66e23fe9b | ||
80565efefb | |||
3a325ecc6c | |||
|
aa28272dbd | ||
|
097ec6ef1a | ||
|
2bdfebc428 | ||
|
5282e789ba | ||
|
b0aa66c7cf | ||
|
772aa904d9 | ||
|
459f75727a | ||
|
e2d4ab3715 | ||
|
80f5873d9a | ||
|
abdfa54f36 | ||
|
361e424acd | ||
|
7ac85ac412 | ||
|
80077be185 | ||
014a7fabcb | |||
a2fee28bba | |||
|
f7434502b7 | ||
|
a4361fe8ce | ||
|
48978fb060 | ||
|
03a8eab3d1 | ||
|
428c592139 | ||
|
dca7c2c520 | ||
|
c9c1ffca4e | ||
|
ad5554bb52 | ||
|
bf7642dab3 | ||
|
a63f4ced3d | ||
|
b896d43db7 | ||
|
f4b08ff0a3 | ||
|
c70764dab2 | ||
|
542b830577 | ||
|
bfe902e062 | ||
|
c205c9ff94 | ||
|
2d702f5542 | ||
|
d68b0bdb0c | ||
|
07b25a2fc3 | ||
|
a43d46f5f5 | ||
|
47851c9ed2 | ||
|
f82d42e729 | ||
|
c43fccf297 | ||
|
d446b9a78f | ||
|
1deebaff20 | ||
|
df66227729 | ||
|
bcbb02f52f | ||
|
f5470239e4 | ||
|
f8909d5e8c | ||
d27633fc28 | |||
|
6066b9312e | ||
|
fe0d2f2760 | ||
|
2c0d88c4d5 | ||
|
2c9a6830c8 | ||
|
6b3b5d6fec | ||
|
b4ab5d8cd1 | ||
|
bffc2fd799 | ||
|
3f36afc285 | ||
|
18e9cf7039 | ||
|
43f7df6c76 | ||
|
03328b9293 | ||
|
3dd80070c7 | ||
|
3984c260b0 | ||
|
82a4d7a2a2 | ||
|
3b43090bda | ||
|
f0c4299ba3 | ||
|
f10079497c | ||
|
07fc4a3666 | ||
|
38bc096444 | ||
|
146c4b7ac1 | ||
|
9d854e9642 | ||
|
6e200bf956 | ||
|
b3c9a02660 | ||
|
22699f1ed5 | ||
|
c0232e6fce | ||
|
96c9bf2a93 | ||
|
b5020645be | ||
|
bf483e4abc | ||
|
a37018aab6 | ||
|
be7d49c0f5 | ||
|
336d8c1faa | ||
|
ab942731e6 | ||
|
168336a20b | ||
|
297377b0fd | ||
|
65d7cb3823 | ||
|
1d9a837e37 | ||
|
05f5a606d1 | ||
|
614f02a108 | ||
|
32a134f31a | ||
|
4ae850d529 | ||
|
3f27aea2ea | ||
|
30da4ae75e | ||
|
b7bf41a191 | ||
|
38769615ac | ||
|
6cc94bcb33 | ||
|
7f6a9c6513 | ||
|
7e371a20d9 | ||
|
28270d7d18 | ||
|
d6084f035f | ||
|
816323a154 | ||
|
0a3207e879 | ||
|
7af300b8f5 | ||
|
9753081407 | ||
|
c83fd59763 | ||
|
445a5866ad | ||
|
f070a121fe | ||
|
c2f0fb24c3 | ||
|
7eea7c09d4 | ||
|
6263f3a2f4 | ||
|
ada83c629a | ||
|
1dea407037 | ||
|
b83cb193f1 | ||
|
5ad1044dc0 | ||
|
09b3d77b19 | ||
|
7ce1add5dc | ||
|
34341ef01c | ||
|
1aec37b6f6 | ||
|
9b05509ec4 | ||
|
53450ea9d6 | ||
|
60bd21bf42 | ||
|
d05fe335b8 | ||
|
55b1476139 | ||
|
de1d5d6d51 | ||
|
e61b91dd5e | ||
|
1814298f4f | ||
|
5c52ec61da | ||
|
86f6d6429e | ||
|
31c4afe751 | ||
|
a34cb53e91 | ||
|
2dca8f236e | ||
|
55b7b28eb1 | ||
|
919c71a1c1 | ||
|
2d5d4b0e46 | ||
|
2703f72de8 | ||
|
7f071cbe80 | ||
|
55587f67fe | ||
|
ae7ee06031 | ||
|
3fbc5fa262 | ||
|
397786991d | ||
|
1a82e11b5e | ||
|
71d2b234c6 | ||
|
f8d4d074d5 | ||
|
6ac121bc01 | ||
|
452446a375 | ||
|
dcd17ed01c | ||
|
8eaf93a916 | ||
|
0d1efa5a87 | ||
|
d92b88b65a | ||
|
aee1aa6904 | ||
|
5dafbd2997 | ||
|
54b4814389 | ||
|
d01bd8a080 | ||
|
3081dcc8db | ||
|
c86d7569f3 | ||
|
e8b35a6971 | ||
|
3339153ad3 | ||
|
ed6252bb38 | ||
|
01e2d8f2a7 | ||
|
dd71e6bc70 | ||
|
46ee9df63a | ||
|
922edc96d7 | ||
|
a671caeb79 | ||
|
3088481d6d | ||
|
00bba6c05a | ||
|
5b09b3e52c | ||
|
3772274ca3 | ||
|
7ce4d812bd | ||
|
2ed44e874c | ||
|
9898fb0cbe | ||
|
bc45a6d3be | ||
|
e320dcd1bb | ||
|
54840e96ad | ||
|
406e11a38e | ||
|
a61b48252c | ||
|
952ebf8b9d | ||
|
b6d472d62f | ||
|
0cd01e2c03 | ||
|
c3956be558 | ||
|
6e6920851d | ||
|
022fe7d6f4 | ||
|
ba103d5636 | ||
|
a2e2f1b194 | ||
|
e514b1590b | ||
|
2bb6899c33 | ||
|
cb4bd3acaa | ||
|
fa615bc2e0 | ||
|
957e67686a | ||
|
911487871d | ||
|
c397a953a1 | ||
|
e7b0201e0a | ||
|
340c0f9213 | ||
|
db4e8ee0db | ||
|
95caad6b59 | ||
|
ae9de7aa92 | ||
|
ce6761755e | ||
|
6154992f4f | ||
|
0b9fdeceb8 | ||
|
34017d54db | ||
|
aa12eceeea | ||
|
9805b4bb18 | ||
|
333f769a16 | ||
|
75276ab2da | ||
|
814869ec77 | ||
|
3f3abb4255 | ||
|
55a33cf012 | ||
|
accfbe0acd | ||
94c1859a01 | |||
|
bbf1cec98c | ||
|
ff72960382 | ||
|
61ee2d0af6 | ||
|
933d03e45a | ||
|
86085a0c31 | ||
|
7c969e495e | ||
|
97ab17ce7a | ||
|
58959cf866 | ||
|
7201dfd113 | ||
|
a314bca69b | ||
|
cb98a6fc94 | ||
|
f107ae4556 | ||
|
3a3b7f362b | ||
|
ff917b25ad | ||
|
dfbbc11cfb | ||
|
7c1e123ad6 | ||
|
84094ad38b | ||
|
5a3a4d959f | ||
|
83f6c31dd6 | ||
|
e5031f9987 | ||
|
0253f8e67e | ||
|
c207f0507d | ||
|
6ceecb42aa | ||
|
f8bd639f39 | ||
|
cf6e7f625a | ||
|
cbc119382b | ||
|
c08ab3a456 | ||
|
09c7b15656 | ||
|
5ee217accb | ||
|
eba2eadaca | ||
|
7021cb983e | ||
|
37cc5cb178 | ||
|
a5d7c6ccd4 | ||
|
766be1f051 | ||
|
f61ef23e3f | ||
|
896e0d924b | ||
|
1c1d479474 | ||
|
ee492a0c23 | ||
|
da54de32b9 | ||
|
4ba7804b88 | ||
|
928328f2b0 | ||
|
730dd2f2df | ||
|
8b1b38dddc | ||
|
57770e76cf | ||
|
aad2f6a34f | ||
|
3802e1bf0f | ||
|
c9e7971c41 | ||
|
e97f3d1fbf | ||
|
21c0ee9134 | ||
|
96df4dc857 | ||
|
c32628e2b2 | ||
|
df4b6f214e | ||
|
f0f41cbfb6 | ||
|
e9f480e3ef | ||
|
82a3cb7dd5 | ||
|
34a8a2eee4 | ||
|
e6b9635e22 | ||
|
154e891cb4 | ||
4fc223a6a6 | |||
|
22a34c3315 | ||
|
51e076aafc | ||
|
46a8345de2 | ||
|
17d7014da9 | ||
|
7128870ef6 | ||
|
48408c6547 | ||
|
3ca9395d69 | ||
|
95d2593b28 | ||
|
02874adbd0 | ||
|
f583aa6439 | ||
|
547cd5abb6 | ||
|
51fcdcd1a5 | ||
|
58aec22fc3 | ||
|
ac55ecc545 | ||
|
f8b5cdafa2 | ||
|
5feb4535d6 | ||
|
6d90246bbe | ||
|
c086ba176f | ||
|
c2aeeb07f9 | ||
|
a9cd400834 | ||
|
4594619a4a | ||
|
668e724a01 | ||
|
cabdaed21d | ||
|
38bdf1318f | ||
|
4ccd67e28a | ||
|
6cdfb4a7bc | ||
|
a99a839998 | ||
|
ef5c919803 | ||
|
fdfb945ed0 | ||
|
bee65e50f7 | ||
|
324f5bf94e | ||
|
a8e98c1e08 | ||
9e08c6f2a5 | |||
|
074f4652d1 | ||
|
650faf25f6 | ||
|
4670851505 | ||
|
48bcea8f65 | ||
|
2ddae8e300 | ||
|
d04f703f35 | ||
|
86f8cb5100 | ||
|
c4592d242a | ||
|
6a1ac9ada4 | ||
|
62b8b3ceff | ||
|
4f49920526 | ||
|
1a60aeac2e | ||
|
1a3062f2f9 | ||
|
14e709be37 | ||
|
5636b1ab3d | ||
|
67383cf052 | ||
|
2ba5c0e9b3 | ||
|
2af3df4bc6 | ||
|
e4829b9c04 | ||
|
a63215f299 | ||
|
cca081b5c7 | ||
|
803863571b | ||
|
e3e25f78d7 | ||
|
7ce675da86 | ||
|
f33c686aab | ||
|
bdd7d31bd5 | ||
|
6ae53d90af | ||
|
217ccb9e09 | ||
|
8a79393989 | ||
524302fb2e | |||
|
dadbe36bd2 | ||
|
0f9e49a1ce | ||
|
991422fef4 | ||
|
b5e502c647 | ||
|
5688f81904 | ||
|
0a82b6933e | ||
|
0820dc9997 | ||
|
93cfdc3ed1 | ||
|
3bb795a793 | ||
|
99a4ca6192 | ||
|
b84a6b1855 | ||
|
8384a58118 | ||
|
037b823db9 | ||
|
edef518da3 | ||
|
1bfbb5c243 | ||
|
232fde0a73 | ||
|
93eeeafd3c | ||
|
af112aa72b | ||
|
8dbc46145c | ||
|
184e6ccdc3 | ||
|
42c1d4e340 | ||
|
2ab669ba3a | ||
|
eb078a0b73 | ||
|
4649a0d3dc | ||
|
1a599a6af3 | ||
|
5337d899d4 | ||
|
c3685f3aad | ||
|
feff032c31 | ||
|
ef958483bb | ||
|
dfeadec80b | ||
|
f66bab2dd2 | ||
|
27ed59eb08 | ||
|
c9a81dd174 | ||
|
fe40fd57ae | ||
|
53fbb8e6e7 | ||
|
904f7d1109 | ||
|
7edc74b253 | ||
|
2f82594a60 | ||
|
791abc1c2b | ||
|
1f899a3d80 | ||
|
1a3982d1b7 | ||
|
64c626ffdb | ||
|
c454ec6d98 | ||
|
70c77762a2 | ||
|
7309244ccf | ||
|
fa5bf90195 | ||
|
f34ddb1060 | ||
|
561c512a9b | ||
|
bde9f2eb00 | ||
|
47880fa951 | ||
|
56357c4d40 | ||
|
ec2574d707 | ||
|
7c183fbe73 | ||
|
3f60187158 | ||
|
5193574f68 | ||
|
d9e41240a4 | ||
e9924db3a2 | |||
|
96efd0f194 | ||
|
99cccc9d2f | ||
|
af3aa7afec | ||
|
44119fba90 | ||
|
12cb4f014a | ||
|
91b46e23aa | ||
|
2bb02b6e13 | ||
|
ef0f43d7e4 | ||
|
49469f6aaf | ||
|
12634894ac | ||
|
a2383a2702 | ||
|
ddd7498016 | ||
|
4ecec3a3ab | ||
|
3bb7507fe5 | ||
|
7410a0019b | ||
|
8105bfaa1e | ||
|
9ddaba0b4c | ||
|
090166b780 | ||
|
98fe748bef | ||
|
24c50487d2 | ||
|
2da623dfb3 | ||
|
390391d117 | ||
|
80f1fbbce7 | ||
|
1a628d39f7 | ||
|
66a68d0f23 | ||
|
457045d81a | ||
|
3346a0c90f | ||
|
b75f693454 | ||
|
7b6604fba2 | ||
|
5244480d4c | ||
|
6c9734648a | ||
|
44ca9e2a2e | ||
|
e886e7dc33 | ||
|
e31b03ccdf | ||
|
7ceb242814 | ||
|
4ff92e7f5c | ||
|
b6ee459833 | ||
|
f7dd6a8d72 | ||
|
0cdf90e24a | ||
|
94ab0b8b07 | ||
|
1163023062 | ||
|
65a9e7c9e8 | ||
|
c3fd4941fe | ||
|
36e06aec16 | ||
|
f5cb3ec179 | ||
|
090ebdb332 | ||
|
a05f966cfd | ||
|
335cdc6055 | ||
|
6a5b962f01 | ||
88ff761876 | |||
eefd9ece11 | |||
|
078bf1c1fc | ||
|
037d69bccb | ||
eb062a2424 | |||
0619cdc9c1 | |||
15739dd410 | |||
|
e458257c65 | ||
|
3d8fa75d59 | ||
|
f4268b53cf | ||
|
dfca800514 | ||
|
862d94d35d | ||
af08dd1b43 | |||
6c3c70024d | |||
edc7838128 | |||
|
46e329471c | ||
|
3373095a66 | ||
|
3ea2da1ad2 | ||
|
8969b71613 | ||
|
ae92fe1514 | ||
|
36b817ac58 | ||
|
9527ef632f | ||
|
af45d34721 | ||
|
c39131199d | ||
|
e4cce9618e | ||
|
4d45e57a9b | ||
|
16749fec8c | ||
|
8a4da51366 | ||
|
2568072c0e | ||
|
8c9e361918 | ||
|
55c1565f66 | ||
|
9f70aa80d2 | ||
|
9fb205bc2b | ||
|
1af5e68bd0 | ||
|
b674060ddf | ||
55dff20bc1 | |||
|
a3f76b3369 | ||
a8e84342b9 | |||
|
42e32bb7a7 | ||
|
f4129ff8ee | ||
|
938c4cbd69 | ||
619a5c4ecf | |||
|
ff0e1060e9 | ||
|
ad20c781a5 | ||
|
278f9e65ac | ||
|
d6d4e36640 | ||
|
4f5207858f | ||
|
d06e4a1d48 | ||
|
bd1096760b | ||
|
6bd729e859 | ||
|
5ef2495ee3 | ||
525243bd8d | |||
a17583c599 | |||
|
2630786cc1 | ||
|
86f2c59faa | ||
|
00e7f3eb40 | ||
|
ae1b1dfbb1 | ||
|
8e01325cad | ||
|
3e01b98388 | ||
|
797fc7a3c0 | ||
|
e3fe5b8022 | ||
|
d342a4ca9a | ||
|
64e96c1c30 | ||
cd51a360df | |||
|
d7153a4bf1 | ||
|
b399cf74e9 | ||
|
9718ab4ec1 | ||
4f3c9af3c4 | |||
df448fbaf5 | |||
88694193b4 | |||
|
e76ded074c | ||
|
f483c90ee2 | ||
|
7042f3dd9e | ||
|
a93517dcf1 | ||
|
1106a510da | ||
|
4dac50301d | ||
|
3762bd4906 | ||
|
d41f8547db | ||
|
75349a34b5 | ||
|
b10408b631 | ||
bac1404cf1 | |||
|
1c9430286c | ||
|
c7d87ac5c8 | ||
|
e6c055e782 | ||
|
35605b5af3 | ||
|
8db2b94203 | ||
|
09411a4b32 | ||
|
049dff0952 | ||
|
7374d5f752 | ||
|
f809557679 | ||
|
18a2718888 | ||
|
3e7578411b | ||
|
456e329232 | ||
|
a15b37d9ea | ||
|
813f27c4d2 | ||
|
11462e76ef | ||
|
8057b40bb3 | ||
|
b40f1e2e51 | ||
|
06991af115 | ||
|
4e3593375f | ||
|
b0c7cd350f | ||
|
0e2fbf3cf1 | ||
|
787f446c31 | ||
|
943afd00d1 | ||
|
bc33e32ea4 | ||
22e055d5e8 | |||
|
cf25dbfdf8 | ||
|
35aa8c4023 | ||
|
4ef272a337 | ||
|
bbb5072130 | ||
|
388179bf0b | ||
|
6faef577e1 | ||
|
1a8035af4f | ||
|
0299f597ff | ||
|
782aee16b2 | ||
|
2e492ebd7d | ||
|
1092d60f79 | ||
|
1f4414ba4f | ||
|
f23f07b05c | ||
|
5178462d64 | ||
|
bd61854a10 | ||
|
1af0045997 | ||
|
cb3e2ea468 | ||
|
c92e0096dd | ||
|
16eac2f8c4 | ||
|
ad20a18317 | ||
|
9069570f0b | ||
|
f467c35bd3 | ||
|
8fe93ec779 | ||
|
db710b9e06 | ||
|
3a01ec4d26 | ||
|
2c28a620b9 | ||
|
75703ecadd | ||
|
2b2139687a | ||
|
869ce50f31 | ||
|
16d48592cc | ||
|
414b5c6b60 | ||
|
5a7c5aefb9 | ||
|
597dc2a91a | ||
|
6658e9e5c3 | ||
|
e3cd96c758 | ||
|
3315068a30 | ||
|
b8fa2dc338 | ||
|
96447cedc1 | ||
|
e7261672cc | ||
|
f41546b1fd | ||
|
173eff33c1 | ||
|
06ee0e9c3c | ||
|
66c4355ee0 | ||
|
409c455bd1 | ||
|
bb4e935303 | ||
|
9598f0db42 | ||
|
522aed6a5e | ||
|
dea6f80d24 | ||
|
ee003d6336 | ||
|
25c267f3df | ||
|
2e8479383e | ||
|
652917cbdf | ||
|
667fb0e290 | ||
|
10aa1a8da0 | ||
|
3d09666c68 | ||
|
540b9aab74 | ||
c46be46bb8 | |||
c495135e56 | |||
|
87c5569dab | ||
|
92f14d52f3 | ||
|
7e188d1b05 | ||
|
21a38d8b00 | ||
|
15b494a2ac | ||
|
8c0dca3df7 | ||
|
aa3435bfd7 | ||
|
f0f612b11a | ||
|
0f17cac626 | ||
|
a89a076db9 | ||
|
4b28412648 | ||
|
db2f3367dd | ||
|
c70ad9e6a2 | ||
|
921f382c6a | ||
|
9e82414728 | ||
|
f4702e5381 | ||
|
94d5689077 | ||
|
3ad8bfb380 | ||
|
3337aa8bb8 | ||
|
bb5fa8db5b | ||
|
f70b40f112 | ||
|
1e396a5328 | ||
|
c3f902bfe6 | ||
|
450f3e5d35 | ||
|
c20f285ca7 | ||
|
30100a5a31 | ||
|
47b61f05c0 | ||
|
5670b19fab | ||
|
27f3346435 | ||
|
8d3dcacded | ||
|
825da2027f | ||
|
ca0a4274dc | ||
|
cab8caac90 | ||
|
7bb7a388b8 | ||
|
b5778a8be2 | ||
|
26b2d74cc4 | ||
|
128d387ebe | ||
|
98502d9e93 | ||
|
93f5b82dec | ||
|
a5ec847ed1 | ||
|
57d72e95d0 | ||
|
42ff39f4d9 | ||
|
41f1e0a3bc | ||
|
c6b03cfe55 | ||
|
d47903a912 | ||
|
489cae7122 | ||
|
0720df1a2e | ||
|
ff5c620a29 | ||
|
69304a0c71 | ||
|
f49b53f9d6 | ||
|
c2336a753e | ||
74c448d0d0 | |||
|
08bb694753 | ||
|
4ef067118b | ||
|
e291836523 | ||
|
5b964974cd | ||
|
02cda0c1f4 | ||
|
2a1825303a | ||
|
03797744e2 | ||
|
7b83f8ca6f | ||
|
6da2a33ce3 | ||
|
c1ae7b8eb9 | ||
|
e42c3feaa7 | ||
|
83b029e3b9 | ||
|
3feb32d6c9 | ||
|
155c858fd6 | ||
|
f2f4f7bb12 | ||
|
ee834e6621 | ||
|
a2451c0575 | ||
|
e53314f403 | ||
|
1396cbc25f | ||
|
94815071c0 | ||
|
29dd1e8c72 | ||
|
b03e1de0a9 | ||
|
5661cb318d | ||
|
3d907f260e | ||
|
d9530d1590 | ||
|
9c0348cce3 | ||
|
175686aded | ||
|
ab56e6f35b | ||
|
ab52444bfd | ||
|
4aff809fcb | ||
|
3f667e8fa6 | ||
|
70699aeecd | ||
|
56c163f6a9 | ||
|
f48f50e09e | ||
|
24f7bb5a66 | ||
|
12f5b7dbd3 | ||
|
10b8d4b2e4 | ||
|
43077feb01 | ||
|
e6c21582f8 | ||
|
cccfb7eac8 | ||
|
532a08763f | ||
|
bd5d6a277d | ||
|
a033d72f20 | ||
|
98c96a7c81 | ||
|
c76dbeab05 | ||
|
22c222d3cc | ||
|
8256aea4cd | ||
|
4ea034e92e | ||
|
9f82089d61 | ||
|
5714193eeb | ||
|
086c163db1 | ||
|
c9ab51dbb2 | ||
|
45a70affce | ||
|
881c3a0f81 | ||
|
3fc3544f23 | ||
|
3627e79fe0 | ||
|
b9cf71c6b0 | ||
|
4c51930c25 | ||
|
d406f720d8 | ||
|
b4ba38d770 | ||
|
58b89f7ae4 | ||
|
5d117fa66c | ||
|
94f9d71a66 | ||
|
2905446030 | ||
|
87d993da35 | ||
80d500413d | |||
638757879c | |||
64254875f8 | |||
a749b8c000 | |||
62bb63242b | |||
5e28bc91ea | |||
3215cad462 | |||
5e3eacbb69 | |||
ecb95933aa | |||
f739935096 | |||
35cd7c6e67 | |||
5fd1b69135 | |||
88c13f7d7c | |||
0792bf98bd | |||
58e8dcd5f6 | |||
a6d1008242 | |||
7e4a380320 | |||
a4449482e3 | |||
7b5caf0e8d | |||
5a47fa8074 | |||
b2f43076aa | |||
a2bfeb72a7 | |||
12c3e2d60d | |||
4345070720 | |||
7f4b1fa9cc | |||
bad9918b98 | |||
255ac6220c | |||
0fc7477672 | |||
24f1a64fca | |||
5de084e63e | |||
8be55e86d7 | |||
d73922358f | |||
5cb3a50642 | |||
4873d03d42 | |||
c34ce4c17e | |||
f1e3006b45 | |||
b5d74330fe | |||
5a1c3bf5c8 | |||
401185b953 | |||
|
f133155798 | ||
d310943b0e | |||
eaba2fb708 | |||
a2f78ea9f3 | |||
2f42366d0a | |||
|
f7f54f8754 | ||
|
90e644e9eb | ||
|
a2b662e2ce | ||
7016a45312 | |||
|
2562abdf4b | ||
a0a17e6076 | |||
853fecc4a0 | |||
d62109d72b | |||
bf860a32ac | |||
|
2565789af7 | ||
|
77023f6400 | ||
|
a899cc2dff | ||
|
ab8a889464 | ||
|
3c740457f3 | ||
|
6609bf4b16 | ||
|
f4f4e25798 | ||
|
cbe589f5b7 | ||
|
caa90f9f9c | ||
|
862e23e79c | ||
|
bc5c274c8f | ||
|
37159eae3b | ||
|
f96df5ec61 | ||
|
827d9a0b8d | ||
|
142d9edb20 | ||
|
b41405ea09 | ||
|
1a0b315365 | ||
|
dae493b1a8 | ||
|
13c577d2ae | ||
|
48ecf35f1a | ||
|
fb6517dc9f | ||
|
aa38622b8d | ||
|
248847436b | ||
|
be536272ca | ||
|
77a3af4d11 | ||
|
7644b9b07c | ||
|
e01a75faea | ||
|
b89e838625 | ||
|
62a2176aaa | ||
|
734c68a022 | ||
|
cef80ad20b | ||
|
475d0e22ae | ||
|
08617d41c6 | ||
|
b33ccc4a84 | ||
|
18e6862949 | ||
|
97a76cbd69 | ||
|
d70ed401cb | ||
|
644cec05cb | ||
|
3fc6218332 | ||
|
bc287f0e11 | ||
|
545ff7db87 | ||
|
1480519bb2 | ||
|
f7d6971849 | ||
|
43d731cf72 | ||
|
3994b924de | ||
|
a2db90289a | ||
|
b3c77aa972 | ||
|
11d726867c | ||
|
8b025cf8bd | ||
|
29baaa700c | ||
|
9424e48c74 | ||
|
d86191d4af | ||
|
c64c1a441d | ||
|
52f00cbe59 | ||
|
5a3b2916d1 | ||
|
6a477d39f0 | ||
|
aa3741a9fa | ||
|
5c8464520c | ||
|
18dd2c01e4 | ||
|
49894f7d9e | ||
|
1cde50242d | ||
|
1a4d8e809d | ||
|
7c648ce829 | ||
|
d77047f62c | ||
|
e6a5f9712d | ||
|
ba2ede20aa | ||
|
663c9119e6 | ||
|
d3b254fc82 | ||
|
7bf20e29e7 | ||
|
289fb76906 | ||
|
a7ce1ff704 | ||
|
c8039ec248 | ||
|
b337c689b9 | ||
|
6ad1828079 | ||
|
67de68b28b | ||
|
8914f01b3b | ||
|
ff3bfa545f | ||
|
dfd3b9e615 | ||
|
78037e60a3 | ||
|
57eb898bfd | ||
|
fa33342dbc | ||
|
3594485267 | ||
|
00d668a74a | ||
|
67216c0a83 | ||
|
081c4a88a2 | ||
|
2d08fda940 | ||
|
a23d9fa216 | ||
|
a31cdfce24 | ||
|
935ad85fd5 | ||
|
6954c598a3 | ||
|
3c20e8cf5c | ||
|
5483483031 | ||
|
688591b616 | ||
|
df38a1860f | ||
|
48d0159a92 | ||
|
c7182e840d | ||
|
8ceb695d43 | ||
|
d14a778831 | ||
|
545bb19896 | ||
|
5798c2399d | ||
|
438824fa36 | ||
|
441316b9f5 | ||
|
58fd82ca36 | ||
|
803f2ba075 | ||
|
db1b51ae8a | ||
|
2f89219756 | ||
|
e320d0e84f | ||
|
9e9dbf8e2a | ||
|
cf412e049f | ||
|
d7c3e297ed | ||
|
8869a560ed | ||
|
71c327f14c | ||
|
0f0743bd52 | ||
|
0b5c5d5aba | ||
|
a3c6141ab7 | ||
|
3804d26cab | ||
|
88fffc078b | ||
|
f1803662a8 | ||
|
3c080e4725 | ||
|
23ac4ef88a | ||
|
4d9c33ed1c | ||
|
ff92bca633 | ||
|
1cf83dcd34 | ||
|
7091d7b326 | ||
|
a32cf9128b | ||
|
97ca21d295 | ||
|
4b7614caec | ||
|
6c1852e094 | ||
|
4f47218a13 | ||
|
a4d12d7b65 | ||
|
33f30bd1c6 | ||
|
e7f8779ba8 | ||
|
2a3a9dec9d | ||
|
a570ed75d0 | ||
|
9436b486f9 | ||
|
f72a0187be | ||
|
ba7eb96e8a | ||
|
709623dfc5 | ||
|
8fc9b85bfa | ||
|
d2805afc9f | ||
|
faac427cc7 | ||
|
372bae4203 | ||
|
9cde3262d6 | ||
|
fead1b65a1 | ||
|
f77021b82b | ||
|
2c9e65b518 | ||
|
0cfd1df846 | ||
|
54d5cbdce8 | ||
|
71a0330a0b | ||
|
691ce8986c | ||
|
d2b3fe7746 | ||
|
1a79be3970 | ||
|
f28e65f0cf | ||
|
037135cf71 | ||
|
f904f05dc9 | ||
|
b8b73e82fe | ||
|
23812038d9 | ||
|
5d0ac36fa4 | ||
|
e4844832f1 | ||
|
8f1db81e83 | ||
|
dc25058a05 | ||
|
f3ea7d790b | ||
|
2f5998843e | ||
|
eec1d1a352 | ||
|
dee2f2ada7 | ||
|
48cc52cf72 | ||
|
aaf3bafb02 | ||
|
d24daf52eb | ||
|
d357e505c9 | ||
|
d065656ff5 | ||
|
7d0a71da64 | ||
|
3fc81ec53e | ||
|
758c727c45 | ||
|
a6006211f2 | ||
|
d2018e1863 | ||
|
52e5075989 | ||
|
67e901d3d0 | ||
|
0054423407 | ||
|
bf564e55ef | ||
|
9a86a61c99 | ||
|
fdd7ff70b1 | ||
|
be0e643c57 | ||
|
d19f6814da | ||
|
f2bd65cae3 | ||
|
3baf24269f | ||
|
185be59862 | ||
|
c2f3993fc1 | ||
|
b96c9d0a2c | ||
|
d4e51d3dfd | ||
|
e731d9869e | ||
|
606de23f8d | ||
|
219aa4c9b1 | ||
|
62728e608d | ||
|
503c17352c | ||
|
b4f99c1c18 | ||
|
526d5ad4ae | ||
|
37de991028 | ||
|
0cdd55cdf8 | ||
|
74ebf724cc | ||
|
30b056108f | ||
|
630bf80f07 | ||
|
6b9f2bd789 | ||
|
d2531a526d | ||
|
a0161a2c72 | ||
|
7e70d5b14b | ||
|
dd79c9aa21 | ||
|
2a656a58d5 | ||
|
1ecda26d3d | ||
|
88244a7b09 | ||
|
0e260d1aaf | ||
|
d9d01ed7e0 | ||
|
edef539707 | ||
|
ad4f4e8d8e | ||
|
abac28fa46 | ||
|
1f3e727c17 | ||
|
e1368a3f87 | ||
|
16162499cf | ||
|
9b54eea039 | ||
|
d3be5cc087 | ||
|
71b1b70528 | ||
|
62aa4c4639 | ||
|
0f78be2194 | ||
|
e4f172e715 | ||
|
fca7c3c7cd | ||
|
0808bb5ba6 | ||
|
a40ec07b59 | ||
|
1524f0899a | ||
|
4a23ae7dc4 | ||
|
6172334090 | ||
|
7f35a7488b | ||
|
9e01c73cae | ||
|
46ce6f2a91 | ||
|
de68b862da | ||
|
a300b99171 | ||
|
0933263cc9 | ||
|
a650a35dd6 | ||
|
95bc033817 | ||
|
4f199b2f26 | ||
|
2695ef98b6 | ||
|
72e58f0959 | ||
|
47ccc46359 | ||
|
053837d069 | ||
|
1565458c26 | ||
|
f085fbc767 | ||
|
35162b8906 | ||
|
da50f6f6d9 | ||
|
9587ff9b5b | ||
|
64d7650e54 | ||
|
e45a3e489f | ||
|
9037f69c09 | ||
|
092e9c2dcf | ||
|
2d7676fdf6 | ||
|
7c661b11c6 | ||
|
498a34ae19 | ||
|
a310180709 | ||
|
14eed1072d | ||
|
3f39164db1 | ||
|
4102ce00f3 | ||
|
c1b633843f | ||
|
38668789b9 | ||
|
f5a970e50f | ||
|
4cfac7bbef | ||
|
edb40a06d3 | ||
|
727625dfc8 | ||
|
72d0c3b0a4 | ||
|
d53e1d8020 | ||
|
83636a02ef | ||
|
36c8e6c042 | ||
|
56a50c9df4 | ||
|
ec5ba068bb | ||
|
5ff3a7656d | ||
|
c61789c2d7 | ||
|
53e9400dde | ||
|
30cb668a73 | ||
|
f1224a98ee | ||
|
1528c610d7 | ||
|
c26fc8bb26 | ||
|
bebe603a9b | ||
|
0b2a379dd8 | ||
|
898ecc3055 | ||
|
f553f42460 | ||
|
69477cea8d | ||
|
8f87a017a1 | ||
|
f81dad7eae | ||
|
50283a0b21 | ||
|
2ba492d94f | ||
|
9d19afcdf2 | ||
|
37b8fa7243 | ||
|
7b6a433ae6 | ||
|
24ecf02e7b | ||
|
1d4cac01d1 | ||
|
7e49da1999 | ||
|
1613a1052e | ||
|
5c7d525871 | ||
|
a9380cf307 | ||
|
159a8aa0df | ||
|
69e08359c2 | ||
|
4aa44861b4 | ||
|
6247d20f95 | ||
|
de2f60bfdc | ||
|
551be06d9e | ||
|
f720da79d0 | ||
|
03ffd84e76 | ||
|
1a963cff00 | ||
|
ce82496013 | ||
|
89c61a5571 | ||
|
29d7f891da | ||
|
17b4327dfb | ||
|
b3d7a7a124 | ||
|
92019f99a4 | ||
|
0861fd73d2 | ||
|
4db2ce5175 | ||
|
031dbdc2b2 | ||
|
31d689aa0d | ||
|
57f1b175b1 | ||
|
e5ed85ed3f | ||
|
fd108b1334 | ||
|
077eac1c53 | ||
|
3ec23b5ae5 | ||
|
8a88f48d89 | ||
|
2752ce5c25 | ||
|
6c6a26225f | ||
|
b0225eadeb | ||
|
344299805c | ||
|
41d40e3c04 | ||
|
2f18eb65b1 | ||
|
79c4da8b2c | ||
|
b2a0a6cebd | ||
|
e708282a8f | ||
|
58d015c247 | ||
|
fcba6ec6f4 | ||
|
460d2d96c2 | ||
|
31b6d96fc9 | ||
|
555898e446 | ||
|
5bd6f22cab | ||
|
69c54ba37c | ||
|
ba5259b36c | ||
|
91c5ca45ae | ||
|
c9ffa8291d | ||
|
f4e87f5303 | ||
|
17369b2f14 | ||
|
36547eeeca | ||
|
f54acb3ae5 | ||
|
63ab503077 | ||
|
69695e5c3f | ||
|
3f95a395c8 | ||
|
66a0d6ddca | ||
|
3e121c675f | ||
|
be696ee3da | ||
|
3929f26791 | ||
|
ac64783a29 | ||
|
3e4163cbfe | ||
|
12883cfbe2 | ||
|
466cc31f45 | ||
|
ae149896e7 | ||
|
13622c46b3 | ||
|
7bdd14c790 | ||
|
98aad6e490 | ||
|
3741e57eab | ||
|
c50d60730c | ||
|
214e52e5c2 | ||
|
3a337c3137 | ||
|
da790fc8d2 | ||
|
69463ded6b | ||
|
c948956779 | ||
|
7035c3feba | ||
|
cb77595747 | ||
|
423c1335f4 | ||
|
5e75270cd0 | ||
|
2d793bcb94 | ||
|
dd6632ffdf | ||
|
2d04bbe4ee | ||
|
22916ce8a0 | ||
|
7f8b2fca89 | ||
|
e3b8848f78 | ||
|
e4be5385ca | ||
|
092ebd16ba | ||
|
8abf075e2f | ||
|
b84b439358 | ||
|
9e871ee587 | ||
|
1681690d27 | ||
|
00fd2b796c | ||
|
1ab3efb86f | ||
|
7b35045f06 | ||
4bb79cb7cb | |||
|
323a7f2fcd | ||
|
a53ff04192 | ||
|
5016eceae8 | ||
|
0fc5beb17a | ||
|
36a2d977a0 | ||
|
d0bd084d1c | ||
|
8c69f5ad09 | ||
|
54db1deb2b | ||
|
e198b825ce | ||
|
09f4af88bf | ||
|
f9d39a8257 | ||
|
e07756c59f | ||
|
b006c39c40 | ||
|
6a594f7f72 | ||
|
354ffafa0b | ||
|
61c52eb127 | ||
|
a5243fa1f3 | ||
|
0802ce8993 | ||
|
4f16162665 | ||
|
fca74ed824 | ||
|
cf374158a8 | ||
|
ee756d06b9 | ||
|
35e6787a1e | ||
|
c490ea8523 | ||
|
82e40ddd84 | ||
|
678f54ca0c | ||
|
4e69fc957d | ||
|
87676a5cee | ||
|
eaaaff85c2 | ||
|
5f71deeb36 | ||
|
1f4582ab20 | ||
|
96c4727be2 | ||
|
7df57f5506 | ||
|
e17909854c | ||
|
6b18c2868a | ||
|
24deb150d2 | ||
|
6d87e5e1a6 | ||
|
4ae2ea9a65 | ||
|
743ebfb9de | ||
|
be3efcfad3 | ||
|
c119159be6 | ||
|
177c3f22a7 | ||
|
1ca18622c6 | ||
3864f97270 | |||
0b32b6a0d6 | |||
0aaed55634 | |||
e7d9e59f4d | |||
c6e5e23057 | |||
|
2876d9deed | ||
|
219b593b94 | ||
|
87064f2da4 | ||
|
169680eda7 | ||
|
450e970ed8 | ||
|
13554a8e43 | ||
8ebe7ce06f | |||
|
f2ab19036a | ||
|
2dc674e5d6 | ||
|
fbeba2a54f | ||
|
7bd3e21ca8 | ||
|
57f742a539 | ||
|
b2167895e6 | ||
|
04a096fea1 | ||
|
777b640f8e | ||
|
7569720a52 | ||
|
567f61d7ca | ||
|
108c2f7d5c | ||
|
1020716f6a | ||
|
81a8bb1d2b | ||
|
ef9e3c841e | ||
|
f6844739cf | ||
|
bcb3409cc5 | ||
|
a7950b3a4e | ||
|
49be184c50 | ||
|
6cf1baeace | ||
|
1da924416c | ||
|
12b0883686 | ||
|
856123de48 | ||
|
863de0057c | ||
|
82d4e79dc9 | ||
|
a923a3cfdc | ||
|
ef94a7eaf8 | ||
|
12e7d34929 | ||
|
7f31dfa2af | ||
|
65404ac1d2 | ||
|
b22f5456fc | ||
|
20701ad5da | ||
|
720c4472d3 | ||
|
863f6867c6 | ||
|
3e5834983f | ||
|
51f6af7ced | ||
|
5a3af46203 | ||
|
a47e66a6a6 | ||
|
1cd6926f4f | ||
|
6698601d19 | ||
|
b54cd674e6 | ||
|
7b790bbfdb | ||
|
af5414a9eb | ||
|
6adf0da114 | ||
|
5b485a0410 | ||
|
a3a12bab3e | ||
|
83f61978fe | ||
|
40e5242b8b | ||
|
29f27300a2 | ||
|
14d42d71b2 | ||
|
b7661d5957 | ||
|
9780210973 | ||
11fa45cb19 | |||
b102988073 | |||
f0b8fd06c3 | |||
d091447409 | |||
b498de216e | |||
2a5b6015de | |||
d6ac8f443a | |||
0bb8eeab44 | |||
dc203af8a0 | |||
f3367271f5 | |||
|
e34b0d1c0d | ||
|
152c15dde4 | ||
|
b1d924c60a | ||
|
6e239bbf0f | ||
|
65b00240d3 | ||
|
68f0e13e09 | ||
|
84f37eb14c | ||
|
5bba5ed824 | ||
|
f4c3c56789 | ||
|
79b37c720f | ||
|
66130ec312 | ||
|
2354cf1ef0 | ||
|
4516fabf62 |
60
.gitignore
vendored
@ -1,5 +1,55 @@
|
||||
src/messenger/.idea/workspace.xml
|
||||
src/messenger/webim/install/package
|
||||
src/messenger/absent_*
|
||||
src/messenger/release*
|
||||
.DS_Store
|
||||
# IDE folders
|
||||
.idea
|
||||
|
||||
src/mibew/install/package
|
||||
src/absent_*
|
||||
src/release*
|
||||
src/upload*
|
||||
src/*.po
|
||||
|
||||
# Do not index actual configuration files
|
||||
src/mibew/configs/config.yml
|
||||
src/tests/server_side/mibew/libs/config.php
|
||||
|
||||
# Do not index avatars
|
||||
src/mibew/files/avatar/*
|
||||
!src/mibew/files/avatar/.keep
|
||||
|
||||
# Do not index cache files
|
||||
src/mibew/cache/*
|
||||
!src/mibew/cache/.keep
|
||||
!src/mibew/cache/.htaccess
|
||||
|
||||
# Do not index plugins
|
||||
src/mibew/plugins/*
|
||||
!src/mibew/plugins/.keep
|
||||
|
||||
# Do not index custom locales
|
||||
src/mibew/locales/*
|
||||
!src/mibew/locales/en/
|
||||
|
||||
# Do not index composer files
|
||||
src/composer.phar
|
||||
src/composer.lock
|
||||
|
||||
# Do not index third-party libraries
|
||||
src/mibew/vendor
|
||||
src/mibew/js/vendor
|
||||
|
||||
# Do not index node.js modules that are used for building
|
||||
src/node_modules
|
||||
src/package-lock.json
|
||||
|
||||
# Do not index compiled js files of the core
|
||||
src/mibew/js/compiled/*
|
||||
!src/mibew/js/compiled/.keep
|
||||
|
||||
# Do not index compiled files of chat styles
|
||||
src/mibew/styles/chats/*/templates_compiled/client_side/*
|
||||
!src/mibew/styles/chats/*/templates_compiled/client_side/.keep
|
||||
src/mibew/styles/chats/*/js/compiled/*
|
||||
!src/mibew/styles/chats/*/js/compiled/.keep
|
||||
|
||||
# Do not index compiled files of page styles
|
||||
src/mibew/styles/pages/*/templates_compiled/client_side/*
|
||||
!src/mibew/styles/pages/*/templates_compiled/client_side/.keep
|
||||
|
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "src/i18n"]
|
||||
path = src/i18n
|
||||
url = git@github.com:Mibew/i18n.git
|
12
ISSUE_TEMPLATE.md
Normal file
@ -0,0 +1,12 @@
|
||||
### Environment
|
||||
* Mibew Messenger version:
|
||||
* OS:
|
||||
* Web server:
|
||||
* PHP:
|
||||
* PHP extensions:
|
||||
* MySQL:
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### Steps to reproduce the behavior
|
8
PULL_REQUEST_TEMPLATE.md
Normal file
@ -0,0 +1,8 @@
|
||||
Fixes # .
|
||||
|
||||
Changes proposed in this pull request:
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
@Mibew/core-developers
|
71
README.md
Normal file
@ -0,0 +1,71 @@
|
||||
# Mibew Messenger
|
||||
|
||||
Mibew Messenger is an open-source live support application written
|
||||
in PHP and MySQL. It enables one-on-one chat assistance in real-time
|
||||
directly from your website.
|
||||
|
||||
## About this repository
|
||||
|
||||
This repository contains the core of Mibew Messenger application.
|
||||
|
||||
## Server requirements
|
||||
|
||||
1. A webserver or web hosting account running on any major Operating System
|
||||
2. PHP (7.2.5 and above) with PDO, pdo_mysql, cURL, mbstring and gd extensions
|
||||
3. MySQL 5.0 and above
|
||||
|
||||
## Build from sources
|
||||
|
||||
There are several actions one should do before use the latest version of Mibew from the repository:
|
||||
|
||||
1. Obtain a copy of the repository using `git clone`, download button, or another way.
|
||||
2. Install [node.js](http://nodejs.org/) and [npm](https://www.npmjs.org/).
|
||||
3. Install [Gulp](http://gulpjs.com/).
|
||||
4. Navigate to `src/` directory of the local copy of the repository.
|
||||
5. Install npm dependencies using `npm install`.
|
||||
6. Run Gulp to build Mibew using `gulp default`.
|
||||
|
||||
Finally `.tar.gz` and `.zip` archives of the ready-to-use Mibew will be available in `src/release` directory.
|
||||
|
||||
## Terms of Use
|
||||
|
||||
Mibew Messenger is licensed under the terms of [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
## Other repositories of the Mibew project
|
||||
|
||||
### Actual
|
||||
1. [Mibew Messenger i18n repository](https://github.com/Mibew/i18n)
|
||||
2. [Mibew Messenger design repository](https://github.com/Mibew/design)
|
||||
3. [Mibew documentation repository](https://github.com/Mibew/docs.mibew.org)
|
||||
|
||||
### Obsolete
|
||||
1. [Mibew Java applications repository](https://github.com/Mibew/java)
|
||||
2. [Mibew Tray repository](https://github.com/Mibew/tray)
|
||||
|
||||
### Plugins
|
||||
|
||||
1. [Mibew Boilerplate plugin](https://github.com/Mibew/boilerplate-plugin) - a template for a real plugin
|
||||
|
||||
#### Ready for production use
|
||||
|
||||
1. [Mibew Advanced Button plugin](https://github.com/Mibew/advanced-button-plugin)
|
||||
2. [Mibew Auto Invite plugin](https://github.com/Mibew/auto-invite-plugin)
|
||||
3. [Mibew Auto Reply plugin](https://github.com/Mibew/auto-reply-plugin)
|
||||
4. [Mibew Broadcast plugin](https://github.com/Mibew/broadcast-plugin)
|
||||
5. [Mibew Bulk Logs Operations plugin](https://github.com/Mibew/bulk-logs-operations-plugin)
|
||||
6. [Mibew Button Refresh plugin](https://github.com/Mibew/button-refresh-plugin)
|
||||
7. [Mibew Emoji plugin](https://github.com/Mibew/emoji-plugin)
|
||||
8. [Mibew Filter Visitors By Operator Code plugin](https://github.com/Mibew/filter-visitors-by-operator-code-plugin)
|
||||
9. [Mibew First Message plugin](https://github.com/Mibew/first-message-plugin)
|
||||
10. [Mibew Geo IP plugin](https://github.com/Mibew/geo-ip-plugin)
|
||||
11. [Mibew Google Maps plugin](https://github.com/Mibew/google-maps-plugin)
|
||||
12. [Mibew Open Street Map plugin](https://github.com/Mibew/open-street-map-plugin)
|
||||
13. [Mibew Operator Status plugin](https://github.com/Mibew/mibew-operator-status-plugin)
|
||||
14. [Mibew Purge History plugin](https://github.com/Mibew/purge-history-plugin)
|
||||
15. [Mibew Real Ban plugin](https://github.com/Mibew/real-ban-plugin)
|
||||
16. [Mibew Slack plugin](https://github.com/Mibew/mibew_slack)
|
||||
17. [Mibew Title Notification plugin](https://github.com/Mibew/title-notification-plugin)
|
||||
|
||||
#### Not ready for production use (not stable, broken, obsolete, etc.)
|
||||
|
||||
1. [Mibew External API plugin](https://github.com/Mibew/external-api-plugin)
|
Before Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 1.9 KiB |
4
src/.bowerrc
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"directory": "./mibew/js/vendor",
|
||||
"analytics": false
|
||||
}
|
27
src/.eslintrc
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"indent": ["error", 4, {"SwitchCase": 1}],
|
||||
"no-trailing-spaces": "error",
|
||||
"semi": ["error", "always"],
|
||||
"guard-for-in": "error",
|
||||
"no-unused-vars": ["error", {"caughtErrors": "none", "args": "none"}]
|
||||
},
|
||||
"globals": {
|
||||
"Mibew": true,
|
||||
"MibewAPI": true,
|
||||
"MibewAPIInteraction": true,
|
||||
"MibewAPIChatInteraction": true,
|
||||
"MibewAPIUsersInteraction": true,
|
||||
"MibewAPIExecutionContext": true,
|
||||
"Handlebars": true,
|
||||
"_": true,
|
||||
"Backbone": true,
|
||||
"jQuery": true,
|
||||
"vex": true,
|
||||
"validator": true
|
||||
},
|
||||
"env":{
|
||||
"browser": true
|
||||
}
|
||||
}
|
17
src/bower.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "mibew",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"underscore": "1.8.2",
|
||||
"json": "https://github.com/douglascrockford/JSON-js.git#c98948ae1944a28e2e8ebc3717894e580aeaaa05",
|
||||
"jquery": "1.11.3",
|
||||
"backbone": "1.1.2",
|
||||
"marionette": "2.4.1",
|
||||
"handlebars": "4.3.0",
|
||||
"vex": "2.3.2",
|
||||
"validator-js": "3.40.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"underscore": "1.8.2"
|
||||
}
|
||||
}
|
51
src/composer.json
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "mibew/mibew",
|
||||
"version": "3.6.0",
|
||||
"description": "Mibew Messenger - open-source live support application",
|
||||
"type": "project",
|
||||
"homepage": "https://mibew.org",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mibew Messenger Project",
|
||||
"homepage": "https://mibew.org/credits"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "support@mibew.org",
|
||||
"issues": "https://github.com/mibew/mibew/issues",
|
||||
"forum": "https://mibew.org/forums",
|
||||
"source": "https://github.com/mibew/mibew"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/mibew/handlebars.php"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/mibew/handlebars.php-helpers"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"mibew/handlebars.php": "~0.10.5",
|
||||
"mibew/handlebars.php-helpers": "1.*",
|
||||
"symfony/http-foundation": "4.4.*",
|
||||
"symfony/routing": "4.4.*",
|
||||
"symfony/config": "4.4.*",
|
||||
"symfony/yaml": "^5.2",
|
||||
"symfony/translation": "2.6.*",
|
||||
"tedivm/stash": "0.12.*",
|
||||
"mibew/html5": "1.1.*",
|
||||
"vierbergenlars/php-semver": "3.0.*",
|
||||
"swiftmailer/swiftmailer": "~5.4.0",
|
||||
"ua-parser/uap-php": "^3.9",
|
||||
"true/punycode": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "3.*"
|
||||
},
|
||||
"config": {
|
||||
"vendor-dir": "mibew/vendor"
|
||||
}
|
||||
}
|
743
src/gulpfile.js
Normal file
@ -0,0 +1,743 @@
|
||||
// Initialize requirements
|
||||
var fs = require('fs'),
|
||||
https = require('https'),
|
||||
exec = require('child_process').exec,
|
||||
eventStream = require('event-stream'),
|
||||
runSequence = require('gulp4-run-sequence'),
|
||||
through = require('through2'),
|
||||
lodash = require('lodash'),
|
||||
PoFile = require('pofile'),
|
||||
strftime = require('strftime'),
|
||||
del = require('del'),
|
||||
bower = require('bower'),
|
||||
gulp = require('gulp'),
|
||||
uglify = require('gulp-uglify'),
|
||||
concat = require('gulp-concat'),
|
||||
phpcs = require('gulp-phpcs'),
|
||||
order = require('gulp-order'),
|
||||
handlebars = require('gulp-handlebars'),
|
||||
handlebarsEngine = require('handlebars'),
|
||||
defineModule = require('gulp-define-module'),
|
||||
header = require('gulp-header'),
|
||||
zip = require('gulp-zip'),
|
||||
tar = require('gulp-tar'),
|
||||
gzip = require('gulp-gzip'),
|
||||
chmod = require('gulp-chmod'),
|
||||
xgettext = require('gulp-xgettext'),
|
||||
concatPo = require('gulp-concat-po'),
|
||||
rename = require('gulp-rename'),
|
||||
eslint = require('gulp-eslint'),
|
||||
removeDuplicateHeaders = require('mibew-gulp-greh'),
|
||||
mkdirp = require('mkdirp');
|
||||
|
||||
// Set global configuration
|
||||
var config = {
|
||||
mibewPath: 'mibew',
|
||||
configsPath: 'mibew/configs',
|
||||
phpVendorPath: 'mibew/vendor',
|
||||
jsVendorPath: 'mibew/js/vendor',
|
||||
pluginsPath: 'mibew/plugins',
|
||||
avatarsPath: 'mibew/files/avatar',
|
||||
cachePath: 'mibew/cache',
|
||||
jsPath: 'mibew/js',
|
||||
chatStylesPath: 'mibew/styles/chats',
|
||||
pageStylesPath: 'mibew/styles/pages',
|
||||
i18nPath: 'i18n',
|
||||
i18nPrefix: 'mibew-i18n-',
|
||||
releasePath: 'release',
|
||||
uploadPath: 'upload',
|
||||
compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt'),
|
||||
getComposerUrl: 'https://getcomposer.org/installer',
|
||||
phpBin: 'php -d "suhosin.executor.include.whitelist = phar" -d "memory_limit=512M"',
|
||||
package: require('./composer.json'),
|
||||
msginit: 'msginit',
|
||||
msgcat: 'msgcat'
|
||||
}
|
||||
config.i18nSuffix = '-' + config.package.version + '-' + strftime('%Y%m%d');
|
||||
|
||||
// Tasks for cleaning //////////////////
|
||||
|
||||
// Cleans all built files
|
||||
gulp.task('clean', function(callback) {
|
||||
return del([
|
||||
config.releasePath,
|
||||
'composer.lock',
|
||||
config.phpVendorPath,
|
||||
config.jsVendorPath,
|
||||
config.jsPath + '/compiled/**/*',
|
||||
'!' + config.jsPath + '/compiled/.keep',
|
||||
config.chatStylesPath + '/*/templates_compiled/client_side/*.js',
|
||||
config.chatStylesPath + '/*/js/compiled/*.js',
|
||||
config.pageStylesPath + '/*/templates_compiled/client_side/*.js'
|
||||
], callback);
|
||||
});
|
||||
|
||||
// Cleans temporary English translation in the release dir
|
||||
gulp.task('clean-tmp-po', function(callback) {
|
||||
return del([config.releasePath + '/translation.po'], callback);
|
||||
});
|
||||
|
||||
// Cleans temporary files of translations in the release dir
|
||||
gulp.task('clean-tmp-i18n-files', function(callback) {
|
||||
return del([
|
||||
config.releasePath + '/**/*',
|
||||
'!' + config.releasePath + '/*.zip',
|
||||
'!' + config.releasePath + '/*.tar.gz',
|
||||
'!' + config.releasePath + '/*.pot'
|
||||
], callback);
|
||||
});
|
||||
|
||||
// Cleans all files prepared for uploading to CDN
|
||||
gulp.task('clean-upload', function(callback) {
|
||||
return del([config.uploadPath], callback);
|
||||
});
|
||||
|
||||
// Cleans everything
|
||||
gulp.task('clean-all', function(callback) {
|
||||
runSequence( ['clean', 'clean-upload'],
|
||||
callback );
|
||||
});
|
||||
|
||||
|
||||
// Watcher tasks ///////////////////////
|
||||
|
||||
// Watch styles
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch(config.pageStylesPath + '/**/*.handlebars', gulp.series('page-styles'));
|
||||
gulp.watch(config.chatStylesPath + '/**/js/source/**/*.js', gulp.series('chat-styles-js'));
|
||||
gulp.watch(config.chatStylesPath + '/**/*.handlebars', gulp.series('chat-styles-handlebars'));
|
||||
});
|
||||
|
||||
// Service tasks //////////////////
|
||||
|
||||
// Get and install PHP Composer
|
||||
gulp.task('get-composer', function(callback) {
|
||||
// Check whether Composer is already in place
|
||||
if (fs.existsSync('./composer.phar')) {
|
||||
callback(null);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get installer from the Internet
|
||||
https.get(config.getComposerUrl, function(response) {
|
||||
// Run PHP to install Composer
|
||||
var php = exec(config.phpBin, function(error, stdout, stderr) {
|
||||
callback(error ? stderr : null);
|
||||
});
|
||||
// Pass installer code to PHP via STDIN
|
||||
response.pipe(php.stdin);
|
||||
});
|
||||
});
|
||||
|
||||
// Install Composer dependencies excluding development ones
|
||||
gulp.task('composer-install', gulp.series('get-composer', function(callback) {
|
||||
exec(config.phpBin + ' composer.phar install --no-dev',
|
||||
function(error, stdout, stderr) {
|
||||
callback(error ? stderr : null);
|
||||
});
|
||||
}));
|
||||
|
||||
// Install all Composer dependencies
|
||||
gulp.task('composer-install-dev', gulp.series('get-composer', function(callback) {
|
||||
exec(config.phpBin + ' composer.phar install',
|
||||
function(error, stdout, stderr) {
|
||||
callback(error ? stderr : null);
|
||||
});
|
||||
}));
|
||||
|
||||
// Installs bower dependencies
|
||||
gulp.task('bower-install', function(callback) {
|
||||
bower.commands.install([], {}, {})
|
||||
.on('error', function(error) {
|
||||
callback(error);
|
||||
})
|
||||
.on('end', function() {
|
||||
// We should manually minify JavaScript files that was not minified
|
||||
// by bower packages' authors
|
||||
// TODO: This is a temproary workaround and should be removed once
|
||||
// the packages will be fixed
|
||||
var stream = eventStream.merge(
|
||||
gulp.src(config.jsVendorPath + '/backbone/backbone.js',
|
||||
{base: config.jsVendorPath})
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
// There are neither "@license" tag nor "!preserve" in the
|
||||
// header. Add the header manually
|
||||
.pipe(header(
|
||||
"// Backbone.js 1.1.2\n"
|
||||
+ "// (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n"
|
||||
+ "// Backbone may be freely distributed under the MIT license.\n"
|
||||
+ "// For all details and documentation:\n"
|
||||
+ "// http://backbonejs.org\n"
|
||||
))
|
||||
.pipe(rename('backbone/backbone-min.js')),
|
||||
gulp.src(config.jsVendorPath + '/json/json2.js',
|
||||
{base: config.jsVendorPath})
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
// There are neither "@license" tag nor "!preserve" in the
|
||||
// header, add the header manually
|
||||
.pipe(header("// json2.js. Public Domain. See http://www.JSON.org/js.html\n"))
|
||||
.pipe(rename('json/json2.min.js'))
|
||||
)
|
||||
.pipe(gulp.dest(config.jsVendorPath));
|
||||
|
||||
stream
|
||||
.on('error', callback)
|
||||
.on('end', callback);
|
||||
});
|
||||
});
|
||||
|
||||
// Tasks for checking //////////////////
|
||||
|
||||
// Checks all PHP files with PHP Code Sniffer
|
||||
gulp.task('phpcs', gulp.series('composer-install-dev', function() {
|
||||
return gulp.src([
|
||||
config.mibewPath + '/**/*.php',
|
||||
'!' + config.phpVendorPath + '/**/*.*',
|
||||
'!' + config.pluginsPath + '/**/*.*',
|
||||
'!' + config.cachePath + '/**/*.*'
|
||||
], {
|
||||
// Content of the cache directory is readable only for webserver.
|
||||
// Thus we must to set "strict" option to false to prevent "EACCES"
|
||||
// errors. At the same we need to see all errors that take place.
|
||||
strict: false,
|
||||
silent: false
|
||||
})
|
||||
.pipe(phpcs({
|
||||
bin: config.phpVendorPath + '/bin/phpcs',
|
||||
standard: 'PSR2',
|
||||
warningSeverity: 0
|
||||
}))
|
||||
.pipe(phpcs.reporter('log'))
|
||||
.pipe(phpcs.reporter('fail'));
|
||||
}));
|
||||
|
||||
// Checks all JavaScript Source files with ESLint
|
||||
gulp.task('eslint', function() {
|
||||
return gulp.src(config.jsPath + '/source/**/*.js')
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
|
||||
|
||||
// Restore empty English translation in the source code
|
||||
gulp.task('post-pack-cleanup', function(callback) {
|
||||
gulp.src('translation.po')
|
||||
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||
|
||||
del(['translation.po', config.releasePath + '/translation.po'], callback);
|
||||
});
|
||||
|
||||
// Tasks of compiling //////////////////
|
||||
|
||||
// Compile all JavaScript files of the Mibew Messenger Core
|
||||
gulp.task('js', function() {
|
||||
return eventStream.merge(
|
||||
getClientSideApp('default'),
|
||||
getClientSideApp('chat'),
|
||||
getClientSideApp('thread_log'),
|
||||
getClientSideApp('users'),
|
||||
gulp.src(config.jsPath + '/source/**/*.js')
|
||||
)
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
.pipe(removeDuplicateHeaders())
|
||||
.pipe(gulp.dest(config.jsPath + '/compiled'));
|
||||
});
|
||||
|
||||
// Compile and concatenate Handlebars templates for all chat styles
|
||||
gulp.task('chat-styles-handlebars', function() {
|
||||
return getChildDirs(config.chatStylesPath)
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
gulp.src(config.chatStylesPath + '/' + dir
|
||||
+ '/templates_src/client_side/**/*.handlebars')
|
||||
.pipe(handlebars({
|
||||
// Use specific version of Handlebars.js
|
||||
handlebars: handlebarsEngine
|
||||
}))
|
||||
.pipe(wrapHandlebarsTemplate())
|
||||
.pipe(concat('templates.js'))
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
.pipe(header(config.compiledTemplatesHeader))
|
||||
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||
+ '/templates_compiled/client_side'))
|
||||
.on('end', resolve)
|
||||
.on('error', reject);
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Compile and concatenate js files for all chat styles
|
||||
gulp.task('chat-styles-js', function() {
|
||||
return getChildDirs(config.chatStylesPath)
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
gulp.src(config.chatStylesPath + '/' + dir
|
||||
+ '/js/source/**/*.js')
|
||||
.pipe(concat('scripts.js'))
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
.pipe(gulp.dest(config.chatStylesPath + '/' + dir
|
||||
+ '/js/compiled'))
|
||||
.on('end', resolve)
|
||||
.on('error', reject);
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Performs all job related to pages styles
|
||||
gulp.task('page-styles', function() {
|
||||
return getChildDirs(config.pageStylesPath)
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject){
|
||||
gulp.src(config.pageStylesPath + '/' + dir
|
||||
+ '/templates_src/client_side/**/*.handlebars')
|
||||
.pipe(handlebars({
|
||||
// Use specific version of Handlebars.js
|
||||
handlebars: handlebarsEngine
|
||||
}))
|
||||
.pipe(wrapHandlebarsTemplate())
|
||||
.pipe(concat('templates.js'))
|
||||
.pipe(uglify({preserveComments: 'some'}))
|
||||
.pipe(header(config.compiledTemplatesHeader))
|
||||
.pipe(gulp.dest(config.pageStylesPath + '/' + dir
|
||||
+ '/templates_compiled/client_side'))
|
||||
.on('end', resolve)
|
||||
.on('error', reject);
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Performs all job related to chat styles
|
||||
gulp.task('chat-styles', gulp.series('chat-styles-handlebars', 'chat-styles-js'));
|
||||
|
||||
// Prepares ready to use development version of Mibew Messenger without
|
||||
// packing or validating it
|
||||
gulp.task('rebuild', function(callback) {
|
||||
runSequence(
|
||||
'clean',
|
||||
['js', 'chat-styles', 'page-styles', 'composer-install',
|
||||
'bower-install'],
|
||||
callback
|
||||
);
|
||||
});
|
||||
|
||||
// Tasks for localization issues ///////
|
||||
|
||||
// Generate POT-file based upon the source code
|
||||
gulp.task('generate-pot', function() {
|
||||
return eventStream.merge(
|
||||
gulp.src([
|
||||
config.mibewPath + '/**/*.php',
|
||||
'!' + config.phpVendorPath + '/**/*.*',
|
||||
'!' + config.pluginsPath + '/**/*.*',
|
||||
'!' + config.cachePath + '/**/*.*'
|
||||
], {
|
||||
// Content of the cache directory is readable only for
|
||||
// webserver. Thus we must to set "strict" option to false
|
||||
// to prevent "EACCES" errors. At the same we need to see all
|
||||
// errors that take place.
|
||||
strict: false,
|
||||
silent: false
|
||||
})
|
||||
.pipe(xgettext({
|
||||
language: 'PHP',
|
||||
keywords: [
|
||||
{name: 'getlocal'},
|
||||
{name: 'no_field'},
|
||||
{name: 'wrong_field'},
|
||||
{name: 'failed_uploading_file', singular: 2}
|
||||
]
|
||||
})),
|
||||
gulp.src(config.jsPath + '/source/**/*.js', {base: config.mibewPath})
|
||||
.pipe(xgettext({
|
||||
language: 'JavaScript',
|
||||
keywords: [
|
||||
{name: 'trans'}
|
||||
]
|
||||
})),
|
||||
gulp.src([
|
||||
config.chatStylesPath + '/default/templates_src/**/*.handlebars',
|
||||
config.pageStylesPath + '/default/templates_src/**/*.handlebars'
|
||||
], {base: config.mibewPath})
|
||||
.pipe(xgettextHandlebars())
|
||||
)
|
||||
.pipe(concatPo(config.i18nPrefix + 'translation'
|
||||
+ config.i18nSuffix + '.pot',
|
||||
{
|
||||
headers: {
|
||||
'Project-Id-Version': 'Mibew Messenger '
|
||||
+ config.package.version,
|
||||
'Report-Msgid-Bugs-To': config.package.support.email,
|
||||
'POT-Creation-Date': strftime('%Y-%m-%d %H:%M%z'),
|
||||
'PO-Revision-Date': '',
|
||||
'Last-Translator': '',
|
||||
'Language-Team': '',
|
||||
'Content-Type': 'text/plain; charset=UTF-8'
|
||||
}
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(config.releasePath));
|
||||
});
|
||||
|
||||
// Generate temporary English translation to be used in the release
|
||||
gulp.task('generate-tmp-po', gulp.series('generate-pot', function(callback) {
|
||||
return exec(config.msginit + ' --no-translator --no-wrap -i '
|
||||
+ config.releasePath + '/' + config.i18nPrefix + 'translation'
|
||||
+ config.i18nSuffix + '.pot' + ' -l en -o '
|
||||
+ config.releasePath + '/translation.po',
|
||||
function(error, stdout, stderr) {
|
||||
callback(error ? stderr : null);
|
||||
});
|
||||
}));
|
||||
|
||||
// Generate complete translations (that includes missed strings) to be used
|
||||
// in the release
|
||||
gulp.task('generate-pos', gulp.series('generate-tmp-po', function(callback) {
|
||||
|
||||
return getChildDirs(config.i18nPath + '/translations')
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
mkdirp(config.releasePath + '/' + dir, function (error) {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
exec(config.msgcat + ' ' + config.i18nPath + '/translations/'
|
||||
+ dir + '/translation.po ' + config.releasePath
|
||||
+ '/translation.po --no-location --no-wrap --use-first'
|
||||
+ ' -o ' + config.releasePath + '/' + dir
|
||||
+ '/translation.po',
|
||||
function(error, stdout, stderr) {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
||||
var sources = [
|
||||
config.i18nPath + '/translations/' + dir + '/**/*',
|
||||
'!' + config.i18nPath + '/translations/' + dir
|
||||
+ '/translation.po'
|
||||
];
|
||||
|
||||
gulp.src(sources)
|
||||
.pipe(gulp.dest(config.releasePath + '/' + dir))
|
||||
.on('error', reject)
|
||||
.on('end', resolve);
|
||||
});
|
||||
}));
|
||||
});
|
||||
}));
|
||||
|
||||
// Packaging tasks /////////////////////
|
||||
|
||||
// Pack sources for release as .zip and .tar.gz archives
|
||||
gulp.task('pack-sources', gulp.series('composer-install', 'bower-install', function() {
|
||||
gulp.src(config.mibewPath + '/locales/en/translation.po')
|
||||
.pipe(gulp.dest('.'));
|
||||
gulp.src(config.releasePath + '/translation.po')
|
||||
.pipe(gulp.dest(config.mibewPath + '/locales/en/'));
|
||||
|
||||
var sources = [
|
||||
config.mibewPath + '/**/*',
|
||||
// Exclude user's config
|
||||
'!' + config.configsPath + '/config.yml',
|
||||
// Exclude cache files but not the ".keep" file.
|
||||
'!' + config.cachePath + '/**/!(.keep)',
|
||||
// Exclude avatars but not the ".keep" file.
|
||||
'!' + config.avatarsPath + '/!(.keep)',
|
||||
// Exclude plugins but not the ".keep" file.
|
||||
'!' + config.pluginsPath + '/!(.keep)',
|
||||
'!' + config.pluginsPath + '/*/**/*',
|
||||
// Exclude Git repositories that can be shipped with third-party libs
|
||||
'!' + config.phpVendorPath + '/**/.git',
|
||||
'!' + config.phpVendorPath + '/**/.git/**/*',
|
||||
// Exclude vendors binaries
|
||||
'!' + config.phpVendorPath + '/bin/**/*',
|
||||
// Exclude JavaScript sources
|
||||
'!' + config.jsPath + '/source/**/*',
|
||||
// Actually we does not need backbone.babysitter and backbone.wreqr
|
||||
// dependencies because they embed into marionette.js. So we exclude
|
||||
// "backbone.babysitter" and "backbone.wreqr" directories and all their
|
||||
// contents.
|
||||
'!' + config.jsVendorPath + '/backbone.babysitter{,/**}',
|
||||
'!' + config.jsVendorPath + '/backbone.wreqr{,/**}',
|
||||
// Exclude dot files within third-party JS libraries.
|
||||
'!' + config.jsVendorPath + '/**/.*',
|
||||
// Exclude config files of various package systems
|
||||
'!' + config.jsVendorPath + '/**/{bower,component,package,composer}.json',
|
||||
// Exclude config files of various build systems
|
||||
'!' + config.jsVendorPath + '/**/Gruntfile.*',
|
||||
'!' + config.jsVendorPath + '/**/gulpfile.*',
|
||||
'!' + config.jsVendorPath + '/**/Makefile',
|
||||
// Exclude HTML files from third-party JS libraries. Such files can be
|
||||
// used for docs or for tests, we need none of them.
|
||||
'!' + config.jsVendorPath + '/**/*.html',
|
||||
// There are too many useless files in Vex.js library. Exclude them.
|
||||
'!' + config.jsVendorPath + '/vex/sass{,/**}',
|
||||
'!' + config.jsVendorPath + '/vex/docs{,/**}',
|
||||
'!' + config.jsVendorPath + '/vex/docs{,/**}',
|
||||
'!' + config.jsVendorPath + '/vex/coffee{,/**}'
|
||||
];
|
||||
var srcOptions = {
|
||||
// Dot files (.htaccess, .keep, etc.) must be included in the package
|
||||
dot: true,
|
||||
// Content of the cache directory is readable only for webserver. Thus
|
||||
// we must to set "strict" option to false to prevent "EACCES" errors.
|
||||
// At the same we need to see all errors that take place.
|
||||
strict: false,
|
||||
silent: false,
|
||||
// Preserve root directory name (i.e. 'mibew/')
|
||||
base: '.'
|
||||
}
|
||||
var version = config.package.version;
|
||||
|
||||
return eventStream.merge(
|
||||
gulp.src(sources, srcOptions)
|
||||
.pipe(zip('mibew-' + version + '.zip')),
|
||||
gulp.src(sources, srcOptions)
|
||||
.pipe(tar('mibew-' + version + '.tar'))
|
||||
.pipe(gzip())
|
||||
)
|
||||
.pipe(chmod(644))
|
||||
.pipe(gulp.dest(config.releasePath));
|
||||
}));
|
||||
|
||||
// Pack translations for release as .zip and .tar.gz archives
|
||||
gulp.task('pack-i18n', function(callback) {
|
||||
return getChildDirs(config.i18nPath + '/translations')
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
|
||||
var srcOptions = {
|
||||
base: config.releasePath
|
||||
};
|
||||
|
||||
eventStream.merge(
|
||||
gulp.src(config.releasePath + '/' + dir
|
||||
+ '/**/*', srcOptions)
|
||||
.pipe(zip(config.i18nPrefix + dir
|
||||
+ config.i18nSuffix + '.zip')),
|
||||
gulp.src(config.releasePath + '/' + dir
|
||||
+ '/**/*', srcOptions)
|
||||
.pipe(tar(config.i18nPrefix + dir
|
||||
+ config.i18nSuffix + '.tar'))
|
||||
.pipe(gzip())
|
||||
)
|
||||
.pipe(chmod(644))
|
||||
.pipe(gulp.dest(config.releasePath))
|
||||
.on('error', reject)
|
||||
.on('end', resolve);
|
||||
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Tasks of releasing //////////////////
|
||||
|
||||
// Prepare release of Mibew Messenger
|
||||
gulp.task('prepare-release', function(callback) {
|
||||
runSequence(
|
||||
'clean',
|
||||
['phpcs', 'js', 'chat-styles', 'page-styles', 'generate-pot',
|
||||
'generate-tmp-po'],
|
||||
'pack-sources',
|
||||
'post-pack-cleanup',
|
||||
callback
|
||||
);
|
||||
});
|
||||
|
||||
// Prepare releases of translations for Mibew Messenger
|
||||
gulp.task('prepare-i18n-release', function(callback) {
|
||||
runSequence( 'clean-tmp-po',
|
||||
'generate-pos',
|
||||
'pack-i18n',
|
||||
'clean-tmp-i18n-files',
|
||||
callback
|
||||
);
|
||||
});
|
||||
|
||||
// Mirror prepared releases of Mibew Messenger and its translations in a form
|
||||
// intended for uploading into the CDN
|
||||
gulp.task('prepare-for-upload', function(callback) {
|
||||
gulp.src(config.releasePath + '/mibew-' + config.package.version + '.*')
|
||||
.pipe(gulp.dest(config.uploadPath + '/core/' + config.package.version + '/'));
|
||||
|
||||
gulp.src(config.releasePath + '/mibew-i18n-translation-' + config.package.version + '-*.pot')
|
||||
.pipe(gulp.dest(config.uploadPath + '/i18n/_pot/' + config.package.version + '/'));
|
||||
|
||||
return getChildDirs(config.i18nPath + '/translations')
|
||||
.then(function (dirs) {
|
||||
return Promise.all(dirs.map(function (dir) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
gulp.src(config.releasePath + '/mibew-i18n-' + dir + '-' + config.package.version + '-*.*')
|
||||
.pipe(gulp.dest(config.uploadPath + '/i18n/' + dir + '/' + config.package.version + '/'))
|
||||
.on('error', reject)
|
||||
.on('end', resolve);
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
// Perform all preparations before uploading the release of Mibew Messenger and
|
||||
// its translations into the CDN
|
||||
gulp.task('prepare-all', function(callback) {
|
||||
runSequence('clean-all', 'prepare-release', 'prepare-i18n-release',
|
||||
'prepare-for-upload', callback);
|
||||
});
|
||||
|
||||
// Prepare release archives of the development version of Mibew Messenger
|
||||
gulp.task('default', function(callback) {
|
||||
runSequence(
|
||||
'clean',
|
||||
['js', 'chat-styles', 'page-styles', 'generate-tmp-po'],
|
||||
'pack-sources',
|
||||
['post-pack-cleanup', 'clean-tmp-po'],
|
||||
callback
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Loads and prepare js file for a client side application with the specified
|
||||
* name.
|
||||
*
|
||||
* @param {String} name Application name.
|
||||
* @returns A files stream that can be piped to any gulp plugin.
|
||||
*/
|
||||
var getClientSideApp = function(name) {
|
||||
var appSource = config.jsPath + '/source/' + name;
|
||||
|
||||
return gulp.src(appSource + '/**/*.js')
|
||||
.pipe(order(
|
||||
[
|
||||
appSource + '/init.js',
|
||||
// The following line is equivalent to
|
||||
// gulp.src([appSource + '/*.js', '!' + appSource + '/app.js']);
|
||||
appSource + '/!(app).js',
|
||||
appSource + '/models/**/base*.js',
|
||||
appSource + '/models/**/*.js',
|
||||
appSource + '/collections/**/base*.js',
|
||||
appSource + '/collections/**/*.js',
|
||||
appSource + '/model_views/**/base*.js',
|
||||
appSource + '/model_views/**/*.js',
|
||||
appSource + '/collection_views/**/base*.js',
|
||||
appSource + '/collection_views/**/*.js',
|
||||
appSource + '/regions/**/base*.js',
|
||||
appSource + '/regions/**/*.js',
|
||||
appSource + '/layouts/**/base*.js',
|
||||
appSource + '/layouts/**/*.js',
|
||||
appSource + '/**/base*.js',
|
||||
// The following line is equivalent to
|
||||
// gulp.src([appSource + '/**/*.js', '!' + appSource + '/app.js']);
|
||||
'!' + appSource + '/app.js',
|
||||
appSource + '/app.js'
|
||||
],
|
||||
{base: process.cwd()}
|
||||
))
|
||||
.pipe(concat(name + '_app.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps a handlebars template with a function and attach it to the
|
||||
* Handlebars.templates object.
|
||||
*
|
||||
* @returns {Function} A function that can be used in pipe() method of a file
|
||||
* stream right after gulp-handlebars plugin.
|
||||
*/
|
||||
var wrapHandlebarsTemplate = function() {
|
||||
return defineModule('plain', {
|
||||
wrapper: '(function() {\n'
|
||||
+ 'var templates = Handlebars.templates = Handlebars.templates || {};\n'
|
||||
+ 'Handlebars.templates["<%= relative %>"] = <%= handlebars %>;\n'
|
||||
+ '})()',
|
||||
context: function(context) {
|
||||
return {relative: context.file.relative.replace(/\.js$/, '').replace(/\\/g, '/')};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts gettext messages from handlebars templates.
|
||||
*
|
||||
* @returns {Function} A function that can be used in pipe() method of a file
|
||||
* stream.
|
||||
*/
|
||||
var xgettextHandlebars = function() {
|
||||
var helperRegExp = /\{{2}l10n\s*('|")(.*?[^\\])\1.*?\}{2}/g;
|
||||
|
||||
return through.obj(function (file, enc, callback) {
|
||||
var po = new PoFile();
|
||||
match = false,
|
||||
contents = file.contents.toString();
|
||||
|
||||
while (match = helperRegExp.exec(contents)) {
|
||||
// Try to find item in the .po file by its name
|
||||
var item = lodash.find(po.items, function(item) {
|
||||
return match[2] === item.msgid;
|
||||
});
|
||||
|
||||
var line = contents.substr(0, match.index).split(/\r?\n|\r/g).length;
|
||||
|
||||
if (!item) {
|
||||
// There is no such item, create new one
|
||||
item = new PoFile.Item();
|
||||
item.msgid = match[2].replace(/\\'/g, "'").replace(/\\"/g, '"');
|
||||
po.items.push(item);
|
||||
}
|
||||
|
||||
// Add new reference
|
||||
item.references.push(file.relative + ':' + line);
|
||||
}
|
||||
|
||||
// Update file contents
|
||||
file.contents = Buffer.from(po.toString());
|
||||
this.push(file);
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves list of all dirs which are placed in the specified one.
|
||||
*
|
||||
* @param {String} srcDir A dir to search.
|
||||
* @returns Promise A promise which will be resolved with list of child dirs or
|
||||
* rejected with the occured error.
|
||||
*/
|
||||
var getChildDirs = function(srcDir) {
|
||||
return (new Promise(function(resolve, reject) {
|
||||
fs.readdir(srcDir, function (err, files) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(files);
|
||||
}
|
||||
});
|
||||
})).then(function (files) {
|
||||
// Replace all files that are not a directory with nulls.
|
||||
return Promise.all(files.map(function (file) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
fs.lstat(srcDir + '/' + file, function (err, stat) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(stat.isDirectory() ? file : null);
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
}).then(function(dirs) {
|
||||
// Remove all nulls from the array.
|
||||
return dirs.filter(function (dir) {
|
||||
return null !== dir;
|
||||
});
|
||||
});
|
||||
}
|
1
src/i18n
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 55868d9973f531c3550575481bde4233cc625b91
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<buildpath>
|
||||
<buildpathentry kind="src" path=""/>
|
||||
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
|
||||
</buildpath>
|
@ -1 +0,0 @@
|
||||
messenger
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
|
||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/webim/locales/bg/properties" charset="windows-1251" />
|
||||
<file url="file://$PROJECT_DIR$/webim/locales/ca/properties" charset="ISO-8859-1" />
|
||||
<file url="file://$PROJECT_DIR$/webim/locales/ru/properties" charset="windows-1251" />
|
||||
<file url="file://$PROJECT_DIR$/webim/locales/sp/properties" charset="ISO-8859-1" />
|
||||
<file url="file://$PROJECT_DIR$/webim/locales/ua/properties" charset="windows-1251" />
|
||||
</component>
|
||||
</project>
|
||||
|
@ -1,11 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0" is_locked="false">
|
||||
<option name="myName" value="Project Default" />
|
||||
<option name="myLocal" value="false" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
@ -1,7 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Project Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="true" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="PHP">
|
||||
<CLASSES />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
||||
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DependencyValidationManager">
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</component>
|
||||
<component name="ProjectResources">
|
||||
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" />
|
||||
</project>
|
||||
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/messenger.iml" filepath="$PROJECT_DIR$/.idea/messenger.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
@ -1,80 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="js">
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="jsp">
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="php">
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="sass">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="sql">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="xml">
|
||||
<option name="INDENT_SIZE" value="4" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
<ADDITIONAL_INDENT_OPTIONS fileType="yml">
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="8" />
|
||||
<option name="TAB_SIZE" value="4" />
|
||||
<option name="USE_TAB_CHARACTER" value="false" />
|
||||
<option name="SMART_TABS" value="false" />
|
||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
||||
</ADDITIONAL_INDENT_OPTIONS>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>messenger</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.dltk.core.scriptbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.php.core.PHPNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,9 +0,0 @@
|
||||
#Sat May 08 00:52:18 CEST 2010
|
||||
eclipse.preferences.version=1
|
||||
encoding//webim/locales=UTF-8
|
||||
encoding//webim/locales/bg/properties=cp1251
|
||||
encoding//webim/locales/ca/properties=ISO-8859-1
|
||||
encoding//webim/locales/names/properties=utf-8
|
||||
encoding//webim/locales/ru=cp1251
|
||||
encoding//webim/locales/sp/properties=ISO-8859-1
|
||||
encoding//webim/locales/ua/properties=cp1251
|
@ -1,56 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub read_transl($) {
|
||||
my($from) = @_;
|
||||
my %translation = ();
|
||||
open(IN, "webim/locales/$from/properties");
|
||||
while(<IN>) {
|
||||
chomp;
|
||||
if(/^([\w\.]+)=(.*)$/) {
|
||||
if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") {
|
||||
$translation{$1} = $2;
|
||||
}
|
||||
} else {
|
||||
die "wrong line in $from: $_\n";
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
return %translation;
|
||||
}
|
||||
|
||||
%tr_en = read_transl("en");
|
||||
|
||||
@all_keys = keys %tr_en;
|
||||
|
||||
sub check_transl($%) {
|
||||
my($name,%tr) = @_;
|
||||
print "checking $name...\n";
|
||||
my @totransl = ();
|
||||
for $key (@all_keys) {
|
||||
unless(exists $tr{$key}) {
|
||||
push @totransl, "$key=".$tr_en{$key};
|
||||
}
|
||||
}
|
||||
for $key(keys %tr) {
|
||||
unless(exists $tr_en{$key}) {
|
||||
print "unknown key in $name: $key\n";
|
||||
}
|
||||
}
|
||||
if($#totransl >= 0) {
|
||||
print "@{[$#totransl+1]} lines absent in locales/$name/properties\n";
|
||||
open(OUT, "> absent_$name");
|
||||
for(sort @totransl) {
|
||||
print OUT "$_\n";
|
||||
}
|
||||
close(OUT);
|
||||
}
|
||||
}
|
||||
|
||||
check_transl("ru", read_transl("ru"));
|
||||
check_transl("fr", read_transl("fr"));
|
||||
check_transl("de", read_transl("de"));
|
||||
check_transl("sp", read_transl("sp"));
|
||||
check_transl("it", read_transl("it"));
|
||||
check_transl("pl", read_transl("pl"));
|
||||
check_transl("zh-tw", read_transl("zh-tw"));
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd webim/js/source
|
||||
ant
|
||||
rm -rf bin
|
@ -1,245 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Digest::MD5 qw(md5 md5_hex md5_base64);
|
||||
|
||||
@rules = (
|
||||
["redirect(ed)?\\.tpl", 1],
|
||||
["\\.tpl", 0],
|
||||
|
||||
["view/license.php", 0],
|
||||
["view/themes.php", 2],
|
||||
["view/translate.php", 2],
|
||||
["view/translatelist.php", 2],
|
||||
["view/settings.php", 2],
|
||||
["view/updates.php", 2],
|
||||
["view/features.php", 2],
|
||||
["view/performance.php", 2],
|
||||
["view/avatar.php", 2],
|
||||
["view/permissions.php", 2],
|
||||
["view/agent.php", 2],
|
||||
["view/agents.php", 2],
|
||||
["view/group.php", 2],
|
||||
["view/groupmembers.php", 2],
|
||||
["view/groups.php", 2],
|
||||
["view/operator_groups.php", 2],
|
||||
["view/gen_button.php", 2],
|
||||
["view/install_err.php", 2],
|
||||
["view/install_index.php", 2],
|
||||
["view/.*\\.php", 1],
|
||||
|
||||
["install/.*\\.php", 2],
|
||||
|
||||
["operator/themes.php", 2],
|
||||
["operator/translate.php", 2],
|
||||
["operator/settings.php", 2],
|
||||
["operator/updates.php", 2],
|
||||
["operator/features.php", 2],
|
||||
["operator/performance.php", 2],
|
||||
["operator/avatar.php", 2],
|
||||
["operator/permissions.php", 2],
|
||||
["operator/operator.php", 2],
|
||||
["operator/operators.php", 2],
|
||||
["operator/group.php", 2],
|
||||
["operator/groupmembers.php", 2],
|
||||
["operator/groups.php", 2],
|
||||
["operator/opgroups.php", 2],
|
||||
["operator/getcode.php", 2],
|
||||
["operator/.*\\.php", 1],
|
||||
|
||||
["webim/client.php", 0],
|
||||
["webim/leavemessage.php", 0],
|
||||
["webim/captcha.php", 0],
|
||||
["webim/license.php", 0],
|
||||
["webim/mail.php", 0],
|
||||
|
||||
["libs/operator_settings.php", 2],
|
||||
["webim/libs/chat.php", 0],
|
||||
["libs/pagination.php", 1],
|
||||
["libs/settings.php", 2],
|
||||
["libs/groups.php", 2],
|
||||
["libs/demothread.php", 2],
|
||||
|
||||
["webim/thread.php", 0],
|
||||
["webim/b.php", 0],
|
||||
["webim/button.php", 0],
|
||||
["webim/index.php", 0],
|
||||
|
||||
["webim/libs/.*\\.php", 1],
|
||||
);
|
||||
|
||||
%messagekeys = (
|
||||
"localeid" => 0,
|
||||
"output_charset" => 0,
|
||||
"output_encoding" => 0,
|
||||
"harderrors.header" => 0,
|
||||
|
||||
"errors.required" => 0,
|
||||
"errors.wrong_field" => 0,
|
||||
"errors.file.move.error" => 2,
|
||||
"errors.invalid.file.type" => 2,
|
||||
"errors.file.size.exceeded" => 2,
|
||||
|
||||
"permission.admin" => 1,
|
||||
"permission.takeover" => 1,
|
||||
"permission.viewthreads" => 1,
|
||||
|
||||
"chat.thread.state_chatting_with_agent" => 1,
|
||||
"chat.thread.state_closed" => 1,
|
||||
"chat.thread.state_loading" => 1,
|
||||
"chat.thread.state_wait" => 1,
|
||||
"chat.thread.state_wait_for_another_agent" => 1,
|
||||
|
||||
"clients.queue.chat" => 1,
|
||||
"clients.queue.prio" => 1,
|
||||
"clients.queue.wait" => 1,
|
||||
);
|
||||
|
||||
|
||||
$webimPath = "webim";
|
||||
|
||||
%urls = ();
|
||||
|
||||
%usermessages = ();
|
||||
%operatormessages = ();
|
||||
$current_level = 0;
|
||||
|
||||
sub usemsg($) {
|
||||
my ($m) = @_;
|
||||
$messagekeys{$m} = exists $messagekeys{$m} && $messagekeys{$m} < $current_level ? $messagekeys{$m} : $current_level;
|
||||
if($current_level == -1) {
|
||||
print " .. $m\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub file_content($) {
|
||||
my $input = $_[0];
|
||||
open( IN1, "< $input" ) or die "cannot find file $input";
|
||||
my $oldslash = $/;
|
||||
$/ = EOI;
|
||||
$content = <IN1>;
|
||||
close( IN1 );
|
||||
if($content =~ s/\r//g) {
|
||||
open( OUT1, "> $input") or die "cannot fix $input";
|
||||
print OUT1 $content;
|
||||
close(OUT1);
|
||||
}
|
||||
$/ = $oldslash;
|
||||
return $content;
|
||||
}
|
||||
|
||||
sub process_tpl($) {
|
||||
my ($filename) = @_;
|
||||
my $m = file_content($filename);
|
||||
while( $m =~ /\${msg:([\w\.]+)(,[\w\.]+)?}/g ) {
|
||||
usemsg($1);
|
||||
}
|
||||
while( $m =~ /\${url:([\w\.]+)(,[\w\.]+)?}/g ) {
|
||||
usemsg($1);
|
||||
$urls{"%$1"} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub process_php($) {
|
||||
my ($source) = @_;
|
||||
my $content = file_content($source);
|
||||
$content =~ s/<\?xml version=\\"1\.0\\" encoding=\\"UTF-8\\"\?>//;
|
||||
|
||||
while( $content =~ s/<\?(?!xml)(.*?)\?>//s ) {
|
||||
my $inner = $1;
|
||||
while($inner =~ s/(getlocal|getstring|no_field)2?_?\((.*?)[,\)]//s) {
|
||||
my $firstarg = $2;
|
||||
if( $firstarg =~ /^["']([\w\.]+)['"]$/) {
|
||||
usemsg($1);
|
||||
} elsif($firstarg =~ /^\$\w+$/ || $firstarg eq '"$var.header"' || $firstarg eq '"permission.$permid"' || $firstarg eq '$threadstate_key[$thread[\'istate\']]') {
|
||||
# skip
|
||||
} else {
|
||||
print "> unknown: $firstarg\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub file_checksum($) {
|
||||
my ($source) = @_;
|
||||
if($source =~ /\.(png|gif|jpg|ico|wav)$/ || $source =~ /config\.php$/) {
|
||||
return "-";
|
||||
}
|
||||
|
||||
my $content = file_content($source);
|
||||
return md5_hex($content);
|
||||
}
|
||||
|
||||
@allsources = ();
|
||||
|
||||
sub process_one($) {
|
||||
my($source) = @_;
|
||||
push @allsources, $source unless $source =~ /$webimPath\/locales/ && $source !~ /$webimPath\/locales\/(en|names)/ || $source =~ /\/package$/;
|
||||
|
||||
if($source !~ /\.(php|tpl)$/) {
|
||||
return;
|
||||
}
|
||||
|
||||
$current_level = -1;
|
||||
|
||||
A: foreach $rule (@rules) {
|
||||
my $key = $$rule[0];
|
||||
if($source =~ /$key/) {
|
||||
$current_level = $$rule[1];
|
||||
last A;
|
||||
}
|
||||
}
|
||||
if($current_level < 0 || $current_level > 2) {
|
||||
print "not detected for: $source\n";
|
||||
$current_level = 0;
|
||||
}
|
||||
|
||||
if($source =~ /\.php$/) {
|
||||
# print "$source ($current_level)\n";
|
||||
process_php($source);
|
||||
} elsif($source =~ /\.tpl$/) {
|
||||
process_tpl($source);
|
||||
} else {
|
||||
#print ". $source\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub process_files($) {
|
||||
my($from) = @_;
|
||||
opendir(DIR, $from) || die "can't opendir $from: $!";
|
||||
my @content = readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) {
|
||||
process_one("$from/$_");
|
||||
}
|
||||
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
|
||||
process_files("$from/$_");
|
||||
}
|
||||
}
|
||||
|
||||
process_files($webimPath);
|
||||
|
||||
# fix
|
||||
$messagekeys{'page.analysis.userhistory.title'} = 1;
|
||||
$messagekeys{'errors.failed.uploading.file'} = 2;
|
||||
|
||||
|
||||
open( OUT, "> $webimPath/locales/names/level1") or die "cannot write file, $!";
|
||||
for $key(sort grep { $messagekeys{$_} == 0 } keys %messagekeys) {
|
||||
print OUT "$key\n";
|
||||
}
|
||||
close( OUT );
|
||||
|
||||
open( OUT, "> $webimPath/locales/names/level2") or die "cannot write file, $!";
|
||||
for $key(sort grep { $messagekeys{$_} == 1 } keys %messagekeys) {
|
||||
print OUT "$key\n";
|
||||
}
|
||||
close( OUT );
|
||||
|
||||
open( OUT, "> $webimPath/install/package") or die "cannot write file, $!";
|
||||
for $key(sort @allsources) {
|
||||
$digest = file_checksum($key);
|
||||
$key =~ s/$webimPath\///;
|
||||
print OUT "$key $digest\n";
|
||||
}
|
||||
close( OUT );
|
@ -1,143 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
##################################################################
|
||||
# Arguments
|
||||
##################################################################
|
||||
|
||||
$targetFolder = "deploy";
|
||||
$suffix = "164";
|
||||
|
||||
##################################################################
|
||||
# Copies tree into target folder, preprocess .phps
|
||||
##################################################################
|
||||
|
||||
sub process_dir($$) {
|
||||
my ($from,$to) = @_;
|
||||
opendir(DIR, $from) || die "can't opendir $from: $!";
|
||||
my @content = readdir(DIR);
|
||||
closedir DIR;
|
||||
mkdir $to;
|
||||
|
||||
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess" || $_ eq ".keep") } @content) {
|
||||
my ($source,$target) = ("$from/$_","$to/$_");
|
||||
|
||||
open (IN,"$source");
|
||||
binmode(IN);
|
||||
open (OUT,">$target");
|
||||
binmode(OUT);
|
||||
print OUT $buffer while (read (IN,$buffer,65536));
|
||||
}
|
||||
|
||||
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
|
||||
process_dir("$from/$_","$to/$_");
|
||||
}
|
||||
}
|
||||
|
||||
##################################################################
|
||||
# Main
|
||||
##################################################################
|
||||
|
||||
`rm -rf $targetFolder`;
|
||||
die "Target folder exists: $targetFolder" if -e $targetFolder;
|
||||
|
||||
process_dir("./webim", $targetFolder);
|
||||
|
||||
`rm -rf release$suffix`;
|
||||
die "release folder exists: release$suffix" if -e "release$suffix";
|
||||
mkdir "release$suffix";
|
||||
|
||||
chdir "$targetFolder";
|
||||
|
||||
`zip -r ../release$suffix/mibew${suffix}_all.zip * .htaccess`;
|
||||
|
||||
chdir "locales";
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_cs.zip cs`;
|
||||
`rm -rf cs`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_fi.zip fi`;
|
||||
`rm -rf fi`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_da.zip da`;
|
||||
`rm -rf da`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_el.zip el`;
|
||||
`rm -rf el`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_lv.zip lv`;
|
||||
`rm -rf lv`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_fa.zip fa`;
|
||||
`rm -rf fa`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_nl.zip nl`;
|
||||
`rm -rf nl`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_th.zip th`;
|
||||
`rm -rf th`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ar.zip ar`;
|
||||
`rm -rf ar`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_bg.zip bg`;
|
||||
`rm -rf bg`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ca.zip ca`;
|
||||
`rm -rf ca`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_de.zip de`;
|
||||
`rm -rf de`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ru.zip ru`;
|
||||
`rm -rf ru`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ro.zip ro`;
|
||||
`rm -rf ro`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_hu.zip hu`;
|
||||
`rm -rf hu`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_fr.zip fr`;
|
||||
`rm -rf fr`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_it.zip it`;
|
||||
`rm -rf it`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ka.zip ka`;
|
||||
`rm -rf ka`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_pl.zip pl`;
|
||||
`rm -rf pl`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_pt-br.zip pt-br`;
|
||||
`rm -rf pt-br`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_sp.zip sp`;
|
||||
`rm -rf sp`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_sv.zip sv`;
|
||||
`rm -rf sv`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_ua.zip ua`;
|
||||
`rm -rf ua`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_he.zip he`;
|
||||
`rm -rf he`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_hr.zip hr`;
|
||||
`rm -rf hr`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_tr.zip tr`;
|
||||
`rm -rf tr`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_zh-cn.zip zh-cn`;
|
||||
`rm -rf zh-cn`;
|
||||
|
||||
`zip -r ../../release$suffix/mibew${suffix}_zh-tw.zip zh-tw`;
|
||||
`rm -rf zh-tw`;
|
||||
|
||||
chdir "..";
|
||||
`zip -r ../release$suffix/mibew$suffix.zip * .htaccess`;
|
||||
|
||||
chdir "..";
|
||||
`rm -rf $targetFolder`;
|
@ -1,14 +0,0 @@
|
||||
This file is part of Mibew Messenger project.
|
||||
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
All rights reserved. The contents of this file are subject to the terms of
|
||||
the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
the provisions of the GPL are applicable instead of those above. If you wish
|
||||
to allow use of your version of this file only under the terms of the GPL, and
|
||||
not to allow others to use your version of this file under the terms of the
|
||||
EPL, indicate your decision by deleting the provisions above and replace them
|
||||
with the notice and other provisions required by the GPL.
|
@ -1,63 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$sourceFolder = "../webim";
|
||||
|
||||
sub file_content($) {
|
||||
my $input = $_[0];
|
||||
open( IN1, "< $input" ) or die "cannot find file $input";
|
||||
$/ = EOI;
|
||||
$content = <IN1>;
|
||||
$content =~ s/\r//g;
|
||||
close( IN1 );
|
||||
return $content;
|
||||
}
|
||||
|
||||
$php_header = file_content("header.txt");
|
||||
$php_header =~ s/\s+$//;
|
||||
|
||||
@allfiles = ();
|
||||
|
||||
sub process_folder($) {
|
||||
my($from) = @_;
|
||||
|
||||
opendir(DIR, $from) || die "can't opendir $from: $!";
|
||||
my @content = readdir(DIR);
|
||||
closedir DIR;
|
||||
|
||||
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess") } @content) {
|
||||
push @allfiles, "$from/$_";
|
||||
}
|
||||
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
|
||||
process_folder("$from/$_");
|
||||
}
|
||||
}
|
||||
|
||||
process_folder($sourceFolder);
|
||||
|
||||
P: for $phpfile (grep { /\.php$/ } @allfiles) {
|
||||
$content = file_content($phpfile);
|
||||
$content =~ s/\s+$//g;
|
||||
die "not a php: $phpfile" unless $content =~ /^<\?php\n(\/\*.*?\*\/)?/s;
|
||||
die "no comment in $phpfile" unless defined($1);
|
||||
$comment = $1;
|
||||
if($comment =~ /\[external\]/) {
|
||||
next P;
|
||||
};
|
||||
die "no contributors in $phpfile" unless $comment =~ /Contributors:/;
|
||||
$newcomment = $comment;
|
||||
$newcomment =~ s/\s\*\s//g;
|
||||
$newcomment =~ s/^\/\*//;
|
||||
$newcomment =~ s/\*\/$//;
|
||||
$newcomment =~ s/.*(Contributors:)/$1/s;
|
||||
$newcomment =~ s/^\s+//;
|
||||
$newcomment =~ s/\s+$//;
|
||||
$newcomment = "$php_header\n\n$newcomment";
|
||||
$newcomment =~ s/^/ * /gm;
|
||||
$newcomment = "/*\n$newcomment\n */";
|
||||
|
||||
$content =~ s/^(<\?php\n)\/\*.*?\*\//$1$newcomment/s;
|
||||
|
||||
open( OUT, "> $phpfile" ) or die "cannot write file: $phpfile\n";
|
||||
print OUT $content;
|
||||
close( OUT );
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub sort_transl($) {
|
||||
my($from) = @_;
|
||||
my @translation = ();
|
||||
my $header = "";
|
||||
open(IN, "$from");
|
||||
while(<IN>) {
|
||||
chomp;
|
||||
my $curr = $_;
|
||||
if(/^([\w\.]+)=(.*)$/) {
|
||||
if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") {
|
||||
push @translation, $curr;
|
||||
} else {
|
||||
$header .= "$curr\n";
|
||||
}
|
||||
} else {
|
||||
die "wrong line in $from: $curr\n";
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
open(OUT, "> $from");
|
||||
print OUT $header;
|
||||
for$line(sort @translation) {
|
||||
print OUT "$line\n";
|
||||
}
|
||||
close(OUT);
|
||||
}
|
||||
|
||||
die "no parameter\n" if $#ARGV < 0;
|
||||
die "doesn't exists\n" unless -e $ARGV[0];
|
||||
|
||||
sort_transl($ARGV[0]);
|
@ -1,4 +0,0 @@
|
||||
<IfModule mod_security.c>
|
||||
SecFilterEngine Off
|
||||
SecFilterScanPOST Off
|
||||
</IfModule>
|
@ -1,19 +0,0 @@
|
||||
Mibew Messenger
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
|
||||
LICENSE
|
||||
|
||||
Mibew Messenger is distributed under the terms of the Eclipse Public License (or
|
||||
the General Public License, this means that you can choose one of two, and use it
|
||||
accordingly) with the following special exception.
|
||||
|
||||
License exception:
|
||||
No one may remove, alter or hide any copyright notices or links to the community
|
||||
site ("http://mibew.org") contained within the Program. Any derivative work
|
||||
must include this license exception.
|
||||
|
||||
Eclipse Public License:
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
General Public License:
|
||||
http://www.gnu.org/copyleft/gpl.html
|
@ -1,41 +0,0 @@
|
||||
Mibew Messenger
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
|
||||
REQUIREMENTS
|
||||
|
||||
* Apache web server 1.3.34 or above
|
||||
* MySQL database 5.0 or above
|
||||
* PHP 4.x or above with MySQL support
|
||||
|
||||
INSTALLATION
|
||||
|
||||
1. Create folder with name 'webim' in the root of your website.
|
||||
2. Upload all the files contained in this archive (retaining the directory structure) into created folder.
|
||||
Be sure to chromo the webim folder to 755 and the install folder to 644.
|
||||
3. Add a MySQL database with the name 'webim'
|
||||
4. Edit /webim/libs/config.php to the information needed to connect to the database
|
||||
5. Using your web browser visit http://<yourdomain>/webim/install/ and
|
||||
hit 'Create tables'
|
||||
6. Remove /webim/install/ directory from your server
|
||||
7. Logon as
|
||||
user: admin
|
||||
password: <empty>
|
||||
7. Get button code and setup it on your site.
|
||||
8. Change your password and name.
|
||||
9. Wait for your visitors on 'Pending users' page.
|
||||
|
||||
On unix/linux platforms change the owner of /webim/images/avatar folder
|
||||
to the user, under which the web server is running (for instance, www).
|
||||
The owner should have all rights on the folder /webim/images/avatar
|
||||
(chmod 700 /webim/images/avatar).
|
||||
|
||||
UPDATE
|
||||
|
||||
1. Backup your /webim/libs/config.php
|
||||
2. Backup your /webim/images/avatar folder.
|
||||
3. Delete the items in the webim folder on the server.
|
||||
4. Upload all the files contained in the downloaded archive (retaining the directory structure) into webim folder.
|
||||
5. Re-edit the MySQL database settings you config.php
|
||||
6. Visit http://<yourdomain>/webim/install/ and follow the instructions to update database (if needed).
|
||||
7. Remove /webim/install/ directory from your server
|
||||
8. Restore contents of /webim/images/avatar folder.
|
@ -1 +0,0 @@
|
||||
Mibew/1.6.4
|
@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('libs/common.php');
|
||||
require_once('libs/chat.php');
|
||||
require_once('libs/operator.php');
|
||||
require_once('libs/groups.php');
|
||||
|
||||
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
|
||||
if($referer && isset($_SESSION['threadid'])) {
|
||||
$link = connect();
|
||||
$thread = thread_by_id_($_SESSION['threadid'], $link);
|
||||
if ($thread && $thread['istate'] != $state_closed) {
|
||||
$msg = getstring2_("chat.client.visited.page", array($referer), $thread['locale']);
|
||||
post_message_($thread['threadid'], $kind_for_agent,$msg,$link);
|
||||
}
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
$image = verifyparam(isset($_GET['image']) ? "image" : "i", "/^\w+$/", "webim");
|
||||
$lang = verifyparam(isset($_GET['language']) ? "language" : "lang", "/^[\w-]{2,5}$/", "");
|
||||
if(!$lang || !locale_exists($lang)) {
|
||||
$lang = $current_locale;
|
||||
}
|
||||
|
||||
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||
if($groupid) {
|
||||
loadsettings();
|
||||
if($settings['enablegroups'] == '1') {
|
||||
$group = group_by_id($groupid);
|
||||
if(!$group) {
|
||||
$groupid = "";
|
||||
}
|
||||
} else {
|
||||
$groupid = "";
|
||||
}
|
||||
}
|
||||
|
||||
$image_postfix = has_online_operators($groupid) ? "on" : "off";
|
||||
$filename = "locales/${lang}/button/${image}_${image_postfix}.gif";
|
||||
|
||||
$fp = fopen($filename, 'rb') or die("no image");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-Type: image/gif");
|
||||
header("Content-Length: ".filesize($filename));
|
||||
if(function_exists('fpassthru')){
|
||||
@fpassthru($fp);
|
||||
} else {
|
||||
while( (!feof($fp)) && (connection_status()==0)){
|
||||
print(fread($fp, 1024*8));
|
||||
flush();
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
?>
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*/
|
||||
|
||||
require_once('b.php');
|
||||
exit;
|
||||
?>
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('libs/common.php');
|
||||
require_once('libs/captcha.php');
|
||||
|
||||
$captchaCode = gen_captcha();
|
||||
$_SESSION["mibew_captcha"] = $captchaCode;
|
||||
draw_captcha($captchaCode);
|
||||
|
||||
exit;
|
||||
?>
|
@ -1,164 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('libs/common.php');
|
||||
require_once('libs/chat.php');
|
||||
require_once('libs/operator.php');
|
||||
require_once('libs/groups.php');
|
||||
require_once('libs/expand.php');
|
||||
require_once('libs/captcha.php');
|
||||
|
||||
loadsettings();
|
||||
if($settings['enablessl'] == "1" && $settings['forcessl'] == "1") {
|
||||
if(!is_secure_request()) {
|
||||
$requested = $_SERVER['PHP_SELF'];
|
||||
if($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['QUERY_STRING']) {
|
||||
header("Location: ".get_app_location(true,true)."/client.php?".$_SERVER['QUERY_STRING']);
|
||||
} else {
|
||||
die("only https connections are handled");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
||||
|
||||
$thread = NULL;
|
||||
if( isset($_SESSION['threadid']) ) {
|
||||
$thread = reopen_thread($_SESSION['threadid']);
|
||||
}
|
||||
|
||||
if( !$thread ) {
|
||||
$groupid = "";
|
||||
$groupname = "";
|
||||
if($settings['enablegroups'] == '1') {
|
||||
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||
if($groupid) {
|
||||
$group = group_by_id($groupid);
|
||||
if(!$group) {
|
||||
$groupid = "";
|
||||
} else {
|
||||
$groupname = get_group_name($group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$visitor = visitor_from_request();
|
||||
|
||||
if(isset($_POST['survey']) && $_POST['survey'] == 'on') {
|
||||
$firstmessage = getparam("message");
|
||||
$info = getparam("info");
|
||||
$email = getparam("email");
|
||||
$referrer = urldecode(getparam("referrer"));
|
||||
|
||||
if($settings['usercanchangename'] == "1" && isset($_POST['name'])) {
|
||||
$newname = getparam("name");
|
||||
if($newname != $visitor['name']) {
|
||||
$data = strtr(base64_encode(myiconv($webim_encoding,"utf-8",$newname)), '+/=', '-_,');
|
||||
setcookie($namecookie, $data, time()+60*60*24*365);
|
||||
$visitor['name'] = $newname;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$firstmessage = NULL;
|
||||
$info = getgetparam('info');
|
||||
$email = getgetparam('email');
|
||||
$referrer = isset($_GET['url']) ? $_GET['url'] :
|
||||
(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
|
||||
if(isset($_GET['referrer']) && $_GET['referrer']) {
|
||||
$referrer .= "\n".$_GET['referrer'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!has_online_operators($groupid)) {
|
||||
$page = array();
|
||||
setup_logo();
|
||||
setup_leavemessage($visitor['name'],$email,$firstmessage,$groupid,$groupname,$info,$referrer,can_show_captcha());
|
||||
expand("styles", getchatstyle(), "leavemessage.tpl");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($settings['enablepresurvey'] == '1' && !(isset($_POST['survey']) && $_POST['survey'] == 'on')) {
|
||||
$page = array();
|
||||
setup_logo();
|
||||
setup_survey($visitor['name'], $email, $groupid, $info, $referrer);
|
||||
expand("styles", getchatstyle(), "survey.tpl");
|
||||
exit;
|
||||
}
|
||||
|
||||
$remoteHost = get_remote_host();
|
||||
$userbrowser = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
$link = connect();
|
||||
if(!check_connections_from_remote($remoteHost, $link)) {
|
||||
mysql_close($link);
|
||||
die("number of connections from your IP is exceeded, try again later");
|
||||
}
|
||||
$thread = create_thread($groupid,$visitor['name'], $remoteHost, $referrer,$current_locale,$visitor['id'], $userbrowser,$state_loading,$link);
|
||||
$_SESSION['threadid'] = $thread['threadid'];
|
||||
|
||||
if( $referrer ) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.came.from',array($referrer)),$link);
|
||||
}
|
||||
post_message_($thread['threadid'],$kind_info,getstring('chat.wait'),$link);
|
||||
if($email) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.visitor.email',array($email)),$link);
|
||||
}
|
||||
if($info) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.visitor.info',array($info)),$link);
|
||||
}
|
||||
if($firstmessage) {
|
||||
$postedid = post_message_($thread['threadid'],$kind_user,$firstmessage,$link,$visitor['name']);
|
||||
commit_thread( $thread['threadid'], array('shownmessageid' => $postedid), $link);
|
||||
}
|
||||
mysql_close($link);
|
||||
}
|
||||
$threadid = $thread['threadid'];
|
||||
$token = $thread['ltoken'];
|
||||
$level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
|
||||
$chatstyle = verifyparam( "style", "/^\w+$/", "");
|
||||
header("Location: $webimroot/client.php?thread=$threadid&token=$token&level=$level".($chatstyle ? "&style=$chatstyle" : ""));
|
||||
exit;
|
||||
}
|
||||
|
||||
$token = verifyparam( "token", "/^\d{1,8}$/");
|
||||
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
||||
$level = verifyparam( "level", "/^(ajaxed|simple|old)$/");
|
||||
|
||||
$thread = thread_by_id($threadid);
|
||||
if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) {
|
||||
die("wrong thread");
|
||||
}
|
||||
|
||||
setup_chatview_for_user($thread, $level);
|
||||
|
||||
$pparam = verifyparam( "act", "/^(mailthread)$/", "default");
|
||||
if( $pparam == "mailthread" ) {
|
||||
expand("styles", getchatstyle(), "mail.tpl");
|
||||
} else if( $level == "ajaxed" ) {
|
||||
expand("styles", getchatstyle(), "chat.tpl");
|
||||
} else if( $level == "simple" ) {
|
||||
expand("styles", getchatstyle(), "chatsimple.tpl");
|
||||
} else if( $level == "old" ) {
|
||||
expand("styles", getchatstyle(), "nochat.tpl");
|
||||
}
|
||||
|
||||
?>
|
@ -1,901 +0,0 @@
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
All rights reserved. The contents of this file are subject to the terms of
|
||||
the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
the provisions of the GPL are applicable instead of those above. If you wish
|
||||
to allow use of your version of this file only under the terms of the GPL, and
|
||||
not to allow others to use your version of this file under the terms of the
|
||||
EPL, indicate your decision by deleting the provisions above and replace them
|
||||
with the notice and other provisions required by the GPL.
|
||||
*/
|
||||
|
||||
/* reset all */
|
||||
|
||||
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td { margin: 0; padding: 0; }
|
||||
table { border-collapse:collapse; border-spacing:0; }
|
||||
fieldset,img { border:0; }
|
||||
ol,ul { list-style:none; }
|
||||
h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; }
|
||||
q:before,q:after { content:''; }
|
||||
|
||||
body {
|
||||
background: #FFFFFF url(images/header.gif) repeat-x;
|
||||
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
|
||||
font-size: 0.8em;
|
||||
line-height: 140%;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
/* 100% height with footer, 200 px sidebar */
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
min-width: 750px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2f7599;
|
||||
}
|
||||
|
||||
#wrap400, #wrap700, #fixedwrap {
|
||||
position:relative;
|
||||
margin: 0px auto -41px;
|
||||
height:auto !important;
|
||||
height:100%;
|
||||
min-height:100%;
|
||||
}
|
||||
|
||||
#wrap400 {
|
||||
width: 100%;
|
||||
min-width:450px;
|
||||
}
|
||||
|
||||
#wrap700 {
|
||||
width: 100%;
|
||||
min-width:750px;
|
||||
}
|
||||
|
||||
#fixedwrap {
|
||||
width: 750px;
|
||||
}
|
||||
|
||||
.contentdiv {
|
||||
float:left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.contentinner {
|
||||
margin-right: 210px;
|
||||
padding: 10px 60px 10px 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.contentnomenu {
|
||||
padding: 10px 60px 10px 20px;
|
||||
}
|
||||
|
||||
.empty_inner {
|
||||
height:40px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
background: white url(images/footer.gif) bottom repeat-x;
|
||||
font-size:11px;
|
||||
position:relative;
|
||||
|
||||
min-height: 40px;
|
||||
height:40px;
|
||||
vertical-align:middle;
|
||||
|
||||
width:100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#legal {
|
||||
clear: both;
|
||||
line-height: 30px;
|
||||
padding-top:10px;
|
||||
text-align: center;
|
||||
color: #375C69;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
#footer .flink {
|
||||
color: #2f7599;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#togglediv {
|
||||
float:right;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
|
||||
#header {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
margin: 0px -2px 10px 0px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px;
|
||||
background: url(images/graydot.gif) repeat-x left bottom;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#header {
|
||||
float: left;
|
||||
}
|
||||
|
||||
img.left {
|
||||
float: left;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
font-size: 2em;
|
||||
line-height: 32px;
|
||||
color: #494949;
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
#header h1 a {
|
||||
color: #494949;
|
||||
}
|
||||
|
||||
#header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#title {
|
||||
float: left;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#path {
|
||||
float: right;
|
||||
padding: 10px 20px 0px 0px;
|
||||
line-height: 22px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
|
||||
#sidebar {
|
||||
float: left;
|
||||
width: 185px;
|
||||
margin-left: -210px;
|
||||
margin-top: 20px;
|
||||
position:relative;
|
||||
line-height: 180%
|
||||
}
|
||||
|
||||
#sidebar ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#sidebar li {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#sidebar li ul {
|
||||
}
|
||||
|
||||
#sidebar li li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#sidebar h2 {
|
||||
text-transform: lowercase;
|
||||
margin-bottom: 10px;
|
||||
background: url(images/graydot.gif) repeat-x left bottom;
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.locales a {
|
||||
color: #2f7599;
|
||||
font-size: 1em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.locales .active a {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.locales a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.submenu a {
|
||||
padding-left: 15px;
|
||||
color: #2f7599;
|
||||
font-size: 1em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.submenu a.inner { padding-left: 0px; }
|
||||
.submenu span.small { font-size: 80%; padding-left: 5px; }
|
||||
|
||||
.submenu .active a {
|
||||
background: url(images/li.gif) no-repeat left 1px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.submenu .active a.inner {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.submenu a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* form, tabbed form */
|
||||
|
||||
.mform {
|
||||
background: url(images/loginbg.gif);
|
||||
clear: both;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
float: right;
|
||||
display: inline;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.tabs li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.tabs a {
|
||||
display: block;
|
||||
float: left;
|
||||
padding: 2px 9px 3px 9px;
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #2f7599;
|
||||
}
|
||||
|
||||
.tabs li.active a {
|
||||
background: url(images/loginbg.gif);
|
||||
border-left:1px solid #bbbbbb;border-top:1px solid #bbbbbb;border-right:1px solid #bbbbbb;
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.formtop, .formbottom, .formtopi, .formbottomi { height: 15px;}
|
||||
.formtop { background: url(images/logincrnrt.gif) no-repeat top right;}
|
||||
.formtopi { background: url(images/logincrnlt.gif) no-repeat top left; }
|
||||
.formbottom { background: url(images/logincrnrb.gif) no-repeat bottom right; }
|
||||
.formbottomi { background: url(images/logincrnlb.gif) no-repeat bottom left; }
|
||||
.forminner { margin: 0px 15px;}
|
||||
.forminner p { margin-bottom: 1em; }
|
||||
|
||||
/* fieldForm */
|
||||
|
||||
.fieldForm {
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.packedFormField {
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
float:left;
|
||||
margin-right:25px;
|
||||
margin-bottom:8px;
|
||||
}
|
||||
|
||||
div.errinfo {
|
||||
color: #c13030;
|
||||
}
|
||||
|
||||
.field {
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.flabel {
|
||||
position: relative;
|
||||
margin: 8px auto 2px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.fleftlabel {
|
||||
float: left;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.flabel span.required {
|
||||
font-size:8.0pt;
|
||||
color:red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.field .subfield {
|
||||
padding-left: 30px;
|
||||
background: url(images/subitem.gif) no-repeat 10px 2px;
|
||||
}
|
||||
|
||||
.fieldinrow {
|
||||
min-width: 300px;
|
||||
display: inline;
|
||||
float:left;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.fvalue {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.fvaluewithta {
|
||||
float: left;
|
||||
width: 67%;
|
||||
}
|
||||
|
||||
.fvaluewithta textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fvaluenodesc {
|
||||
}
|
||||
|
||||
.fvalueframe {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fvalueframe iframe {
|
||||
border: solid 1px #999;
|
||||
}
|
||||
|
||||
.fdescr {
|
||||
float:left;
|
||||
padding-left:10px;
|
||||
color: #676767;
|
||||
font-size: 10px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.fbutton {
|
||||
background: url(images/formline.gif) repeat-x;
|
||||
margin-top: 20px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.fbutton .links {
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.fbutton .submitbutton {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.formauth {
|
||||
}
|
||||
|
||||
textarea.wide {
|
||||
border:1px solid #878787;
|
||||
overflow:auto;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
input.formauth {
|
||||
border: 1px solid #878787;
|
||||
color: #333;
|
||||
margin-right:15px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
#formmessage {
|
||||
border: 1px solid #4C96D4;
|
||||
background-color: #E7F1F9;
|
||||
padding: 8px 11px;
|
||||
font-size: 0.85em;
|
||||
font-weight:bold;
|
||||
max-width: 700px;
|
||||
margin: -10px 2px 10px;
|
||||
color: #515151;
|
||||
}
|
||||
|
||||
#offwarn {
|
||||
border: 1px solid #4CD496;
|
||||
background-color: #E7F9F1;
|
||||
color: #515151;
|
||||
padding: 8px 11px;
|
||||
font-size: 0.85em;
|
||||
font-weight:bold;
|
||||
line-height: 140%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#offwarn img {
|
||||
margin-top: .4em;
|
||||
float: left;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.asterisk {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
/* tables */
|
||||
|
||||
.tabletool {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.tabletool a {
|
||||
color: #296685;
|
||||
vertical-align: top;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.tabletitle {
|
||||
background: url(images/graydot.gif) repeat-x left bottom;
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
|
||||
font-size: 1.4em;
|
||||
margin: 10px 0px 20px;
|
||||
padding-bottom: 10px;
|
||||
color: #1D485E;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.list, table.translate, table.statistics {
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.list th, table.translate th, table.statistics th {
|
||||
font-size: 1.2em;
|
||||
font-weight: normal;
|
||||
padding: 10px 8px;
|
||||
border-bottom: 2px solid #2F7598;
|
||||
}
|
||||
|
||||
table.list th, table.translate th { color: #1D485E; }
|
||||
table.statistics th { color: #2F7598; }
|
||||
|
||||
table.list td, table.statistics td {
|
||||
color: #2f7599;
|
||||
padding: 10px 8px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
table.translate td {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #515151;
|
||||
padding: 2px 8px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
table.list td a.man {
|
||||
background: url(images/tbliclogin.gif) no-repeat left center;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
table.list tbody tr:hover td, table.list tbody tr:hover td a, table.statistics tbody tr:hover td {
|
||||
color: #1D485E;
|
||||
}
|
||||
|
||||
/* awaiting */
|
||||
|
||||
table.awaiting {
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.awaiting th {
|
||||
font-size: 1.2em;
|
||||
font-weight: normal;
|
||||
color: #1D485E;
|
||||
padding: 10px 8px;
|
||||
border-bottom: 2px solid #2F7598;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.awaiting th.first {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.awaiting table.inner {
|
||||
border: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.awaiting table.inner .icon {
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.awaiting td.visitor {
|
||||
color: #296685;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 10px 8px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.awaiting .visitor a { color: #296685; }
|
||||
.awaiting tr:hover .visitor, .awaiting tr:hover .visitor a { color: #1D485E; }
|
||||
|
||||
.awaiting tr.ban .visitor, .awaiting tr.ban .visitor a { color: #9AC8E0; }
|
||||
.awaiting tr.ban:hover .visitor, .awaiting tr.ban:hover .visitor a { color: #4C9CC8; }
|
||||
|
||||
.awaiting tr.inwait .visitor, .awaiting tr.inwait a { font-weight: bold; }
|
||||
.awaiting tr.inprio .visitor, .awaiting tr.inprio a { font-weight: bold; font-size: 1.05em; }
|
||||
.awaiting tr.inchat .visitor, .awaiting tr.inchat .visitor a { color: #777; }
|
||||
.awaiting tr.inchat:hover .visitor, .awaiting tr.inchat:hover .visitor a { color: #444; }
|
||||
.awaiting tr.inchat a { text-decoration: none; }
|
||||
|
||||
.firstmessage {
|
||||
text-align: right;
|
||||
font-size: 0.8em;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.firstmessage a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.firstmessage a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#connstatus {
|
||||
float:right;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
|
||||
#connlinks {
|
||||
margin: 10px 10px;
|
||||
}
|
||||
|
||||
#connlinks a {
|
||||
color: #777;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#connlinks a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* online operators */
|
||||
|
||||
#onlineoperators {
|
||||
padding-right: 10px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* search */
|
||||
|
||||
#searchtext {
|
||||
float:left;
|
||||
display: inline;
|
||||
margin:7px 20px 5px 0px;
|
||||
width:75%;
|
||||
padding-right:5px;
|
||||
}
|
||||
|
||||
.searchctrl {
|
||||
float: left;
|
||||
margin:7px 20px 5px 0px;
|
||||
padding-right:5px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#searchtext input {
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#searchbutton {
|
||||
float:left;
|
||||
}
|
||||
|
||||
/* login */
|
||||
|
||||
#loginsmallpane {
|
||||
float: right;
|
||||
padding: 10px 15px 0px 0px;
|
||||
margin-right: 0px;
|
||||
line-height: 22px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#loginsmallpane input {
|
||||
margin: 0px 3px;
|
||||
padding: 0px 2px;
|
||||
}
|
||||
|
||||
#loginsmallpane .butt {
|
||||
height: 1.3em;
|
||||
border: 0px;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#loginsmallpane .butt:hover {
|
||||
background: #aaa;
|
||||
}
|
||||
|
||||
#loginintro {
|
||||
width: 400px;
|
||||
margin: 10px 30px;
|
||||
}
|
||||
|
||||
#loginpane {
|
||||
width: 400px;
|
||||
margin: 30px 30px;
|
||||
}
|
||||
|
||||
#loginpane .header h2 {
|
||||
font-size: 2em;
|
||||
margin-bottom: 0.9em;
|
||||
padding-bottom: 0.8em;
|
||||
border-bottom: 2px solid #2F7598;
|
||||
}
|
||||
|
||||
/* nice button */
|
||||
|
||||
#confirmpane {
|
||||
width:450px;
|
||||
margin:0px auto 5px;
|
||||
padding-top: 70px;
|
||||
}
|
||||
|
||||
.nicebutton {
|
||||
border: none;
|
||||
float: left;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.submit a {
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
line-height: 35px;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.submit {
|
||||
background: url(images/submitbg.gif) repeat-x;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
/* thread log */
|
||||
|
||||
.logpane {
|
||||
margin: 10px 0px;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
.logpane .header {
|
||||
padding-bottom: 0.8em;
|
||||
border-bottom: 2px solid #2F7598;
|
||||
}
|
||||
|
||||
.logpane .wlabel {
|
||||
width: 10em;
|
||||
float: left;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.logpane .wvalue {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* dashboard */
|
||||
|
||||
#dashboard {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dashitem {
|
||||
width:33%;
|
||||
margin: 0px 2em 5em 0px;
|
||||
padding: 5px 2em 5em;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dashitem:hover {
|
||||
}
|
||||
|
||||
.dashitem a {
|
||||
padding-top:2px;
|
||||
padding-bottom: 10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dashitem img, #dashlocalesPopup h2 img {
|
||||
float: left;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
#dashlocalesPopup h2 img {
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
#dashlocalesPopup .locales {
|
||||
line-height: 180%;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
#dashlocalesPopup h2 {
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 0.9em;
|
||||
padding: 5px 30px 0.8em 0px;
|
||||
border-bottom: 2px solid #2F7598;
|
||||
}
|
||||
|
||||
#dashlocalesPopupClose {
|
||||
float: right;
|
||||
position:absolute;
|
||||
right:5px;
|
||||
top:5px;
|
||||
}
|
||||
|
||||
#dashlocalesPopup {
|
||||
display:none;
|
||||
position:fixed;
|
||||
_position:absolute; /* ie6*/
|
||||
background:#FFFFFF;
|
||||
border:2px solid #2F7598;
|
||||
z-index:110;
|
||||
padding:1em 1em;
|
||||
font-size:1em;
|
||||
}
|
||||
|
||||
#backgroundPopup{
|
||||
display:none;
|
||||
position:fixed;
|
||||
_position:absolute; /* ie6*/
|
||||
height:100%;
|
||||
opacity: .5;
|
||||
width:100%;
|
||||
top:0;
|
||||
left:0;
|
||||
background:#000000;
|
||||
border:1px solid #cecece;
|
||||
z-index:101;
|
||||
}
|
||||
|
||||
/* install */
|
||||
|
||||
#install li {
|
||||
list-style-type: circle;
|
||||
list-style-position: inside;
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
#check-nv, #check-nm {
|
||||
color: #2f7599;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#check-nv:hover, #check-nm:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
/* chat */
|
||||
|
||||
.message {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #4F4F4F;
|
||||
padding: 15px 0px 0px 0px;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
.message span.time {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.message span.nuser {
|
||||
color: #B11E23;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message span.nagent {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.message span.minf {
|
||||
color: #1E48B1;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.message span.mevent {
|
||||
color: #A1A1A1;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.message span.mhidden {
|
||||
color: #A1A1A1;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.message span.mconn {
|
||||
color: #A1A1A1;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* updates */
|
||||
|
||||
#news {
|
||||
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
margin-bottom:15px;
|
||||
padding:4px;
|
||||
}
|
||||
|
||||
.newstext {
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
/* rtl rules */
|
||||
|
||||
.lrtl .dashitem img, .lrtl #dashlocalesPopup h2 img, .lrtl #offwarn img {
|
||||
float: right;
|
||||
padding-right:0px;
|
||||
padding-left:10px;
|
||||
}
|
||||
|
||||
.lrtl .fleftlabel {
|
||||
float: right;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.lrtl .fdescr {
|
||||
float:right;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
|
||||
.lrtl .field .subfield {
|
||||
padding-right: 30px;
|
||||
background: url(images/subitem_rtl.gif) no-repeat 99% 2px;
|
||||
}
|
||||
|
||||
|
||||
.lrtl .fvalue {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.lrtl .logpane .wlabel {
|
||||
float: right;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
.lrtl .logpane .wvalue {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.lrtl .fvaluewithta {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.lrtl #togglediv {
|
||||
float:left;
|
||||
padding-left:10px;
|
||||
}
|
@ -1,328 +0,0 @@
|
||||
<html xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||||
xmlns="http://www.w3.org/TR/REC-html40">
|
||||
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
|
||||
<meta name=ProgId content=Word.Document>
|
||||
<meta name=Generator content="Microsoft Word 9">
|
||||
<meta name=Originator content="Microsoft Word 9">
|
||||
<link rel=File-List
|
||||
href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
|
||||
<title>Eclipse Public License - Version 1.0</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:Revision>2</o:Revision>
|
||||
<o:TotalTime>3</o:TotalTime>
|
||||
<o:Created>2004-03-05T23:03:00Z</o:Created>
|
||||
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
|
||||
<o:Pages>4</o:Pages>
|
||||
<o:Words>1626</o:Words>
|
||||
<o:Characters>9270</o:Characters>
|
||||
<o:Lines>77</o:Lines>
|
||||
<o:Paragraphs>18</o:Paragraphs>
|
||||
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
|
||||
<o:Version>9.4402</o:Version>
|
||||
</o:DocumentProperties>
|
||||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||||
<w:WordDocument>
|
||||
<w:TrackRevisions/>
|
||||
</w:WordDocument>
|
||||
</xml><![endif]-->
|
||||
<style>
|
||||
<!--
|
||||
/* Font Definitions */
|
||||
@font-face
|
||||
{font-family:Tahoma;
|
||||
panose-1:2 11 6 4 3 5 4 4 2 4;
|
||||
mso-font-charset:0;
|
||||
mso-generic-font-family:swiss;
|
||||
mso-font-pitch:variable;
|
||||
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p
|
||||
{margin-right:0in;
|
||||
mso-margin-top-alt:auto;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.BalloonText, li.BalloonText, div.BalloonText
|
||||
{mso-style-name:"Balloon Text";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:8.0pt;
|
||||
font-family:Tahoma;
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body lang=EN-US style='tab-interval:.5in'>
|
||||
|
||||
<div class=Section1>
|
||||
|
||||
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
|
||||
</p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
|
||||
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
|
||||
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
|
||||
OF THIS AGREEMENT.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
in the case of the initial Contributor, the initial code and documentation
|
||||
distributed under this Agreement, and<br clear=left>
|
||||
b) in the case of each subsequent Contributor:</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
|
||||
changes to the Program, and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
|
||||
additions to the Program;</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
|
||||
such changes and/or additions to the Program originate from and are distributed
|
||||
by that particular Contributor. A Contribution 'originates' from a Contributor
|
||||
if it was added to the Program by such Contributor itself or anyone acting on
|
||||
such Contributor's behalf. Contributions do not include additions to the
|
||||
Program which: (i) are separate modules of software distributed in conjunction
|
||||
with the Program under their own license agreement, and (ii) are not derivative
|
||||
works of the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Contributor" means any person or
|
||||
entity that distributes the Program.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
|
||||
claims licensable by a Contributor which are necessarily infringed by the use
|
||||
or sale of its Contribution alone or when combined with the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Program" means the Contributions
|
||||
distributed in accordance with this Agreement.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Recipient" means anyone who
|
||||
receives the Program under this Agreement, including all Contributors.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
|
||||
a non-exclusive, worldwide, royalty-free copyright license to<span
|
||||
style='color:red'> </span>reproduce, prepare derivative works of, publicly
|
||||
display, publicly perform, distribute and sublicense the Contribution of such
|
||||
Contributor, if any, and such derivative works, in source code and object code
|
||||
form.</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
|
||||
Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
|
||||
patent license under Licensed Patents to make, use, sell, offer to sell, import
|
||||
and otherwise transfer the Contribution of such Contributor, if any, in source
|
||||
code and object code form. This patent license shall apply to the combination
|
||||
of the Contribution and the Program if, at the time the Contribution is added
|
||||
by the Contributor, such addition of the Contribution causes such combination
|
||||
to be covered by the Licensed Patents. The patent license shall not apply to
|
||||
any other combinations which include the Contribution. No hardware per se is
|
||||
licensed hereunder. </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
|
||||
Recipient understands that although each Contributor grants the licenses to its
|
||||
Contributions set forth herein, no assurances are provided by any Contributor
|
||||
that the Program does not infringe the patent or other intellectual property
|
||||
rights of any other entity. Each Contributor disclaims any liability to Recipient
|
||||
for claims brought by any other entity based on infringement of intellectual
|
||||
property rights or otherwise. As a condition to exercising the rights and
|
||||
licenses granted hereunder, each Recipient hereby assumes sole responsibility
|
||||
to secure any other intellectual property rights needed, if any. For example,
|
||||
if a third party patent license is required to allow Recipient to distribute
|
||||
the Program, it is Recipient's responsibility to acquire that license before
|
||||
distributing the Program.</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
|
||||
Each Contributor represents that to its knowledge it has sufficient copyright
|
||||
rights in its Contribution, if any, to grant the copyright license set forth in
|
||||
this Agreement. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
|
||||
Program in object code form under its own license agreement, provided that:</span>
|
||||
</p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
it complies with the terms and conditions of this Agreement; and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
|
||||
its license agreement:</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
|
||||
effectively disclaims on behalf of all Contributors all warranties and
|
||||
conditions, express and implied, including warranties or conditions of title
|
||||
and non-infringement, and implied warranties or conditions of merchantability
|
||||
and fitness for a particular purpose; </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
|
||||
effectively excludes on behalf of all Contributors all liability for damages,
|
||||
including direct, indirect, special, incidental and consequential damages, such
|
||||
as lost profits; </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
|
||||
states that any provisions which differ from this Agreement are offered by that
|
||||
Contributor alone and not by any other party; and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
|
||||
states that source code for the Program is available from such Contributor, and
|
||||
informs licensees how to obtain it in a reasonable manner on or through a
|
||||
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>When the Program is made available in source
|
||||
code form:</span> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
it must be made available under this Agreement; and </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
|
||||
copy of this Agreement must be included with each copy of the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
|
||||
copyright notices contained within the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
|
||||
originator of its Contribution, if any, in a manner that reasonably allows
|
||||
subsequent Recipients to identify the originator of the Contribution. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Commercial distributors of software may
|
||||
accept certain responsibilities with respect to end users, business partners
|
||||
and the like. While this license is intended to facilitate the commercial use
|
||||
of the Program, the Contributor who includes the Program in a commercial
|
||||
product offering should do so in a manner which does not create potential
|
||||
liability for other Contributors. Therefore, if a Contributor includes the
|
||||
Program in a commercial product offering, such Contributor ("Commercial
|
||||
Contributor") hereby agrees to defend and indemnify every other
|
||||
Contributor ("Indemnified Contributor") against any losses, damages and
|
||||
costs (collectively "Losses") arising from claims, lawsuits and other
|
||||
legal actions brought by a third party against the Indemnified Contributor to
|
||||
the extent caused by the acts or omissions of such Commercial Contributor in
|
||||
connection with its distribution of the Program in a commercial product
|
||||
offering. The obligations in this section do not apply to any claims or Losses
|
||||
relating to any actual or alleged intellectual property infringement. In order
|
||||
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
|
||||
Contributor in writing of such claim, and b) allow the Commercial Contributor
|
||||
to control, and cooperate with the Commercial Contributor in, the defense and
|
||||
any related settlement negotiations. The Indemnified Contributor may participate
|
||||
in any such claim at its own expense.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
|
||||
Program in a commercial product offering, Product X. That Contributor is then a
|
||||
Commercial Contributor. If that Commercial Contributor then makes performance
|
||||
claims, or offers warranties related to Product X, those performance claims and
|
||||
warranties are such Commercial Contributor's responsibility alone. Under this
|
||||
section, the Commercial Contributor would have to defend claims against the
|
||||
other Contributors related to those performance claims and warranties, and if a
|
||||
court requires any other Contributor to pay any damages as a result, the
|
||||
Commercial Contributor must pay those damages.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
|
||||
AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
|
||||
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
|
||||
responsible for determining the appropriateness of using and distributing the
|
||||
Program and assumes all risks associated with its exercise of rights under this
|
||||
Agreement , including but not limited to the risks and costs of program errors,
|
||||
compliance with applicable laws, damage to or loss of data, programs or
|
||||
equipment, and unavailability or interruption of operations. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
|
||||
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
|
||||
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
|
||||
or unenforceable under applicable law, it shall not affect the validity or
|
||||
enforceability of the remainder of the terms of this Agreement, and without
|
||||
further action by the parties hereto, such provision shall be reformed to the
|
||||
minimum extent necessary to make such provision valid and enforceable.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
|
||||
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
||||
alleging that the Program itself (excluding combinations of the Program with
|
||||
other software or hardware) infringes such Recipient's patent(s), then such
|
||||
Recipient's rights granted under Section 2(b) shall terminate as of the date
|
||||
such litigation is filed. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
|
||||
shall terminate if it fails to comply with any of the material terms or
|
||||
conditions of this Agreement and does not cure such failure in a reasonable
|
||||
period of time after becoming aware of such noncompliance. If all Recipient's
|
||||
rights under this Agreement terminate, Recipient agrees to cease use and
|
||||
distribution of the Program as soon as reasonably practicable. However,
|
||||
Recipient's obligations under this Agreement and any licenses granted by
|
||||
Recipient relating to the Program shall continue and survive. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
|
||||
copies of this Agreement, but in order to avoid inconsistency the Agreement is
|
||||
copyrighted and may only be modified in the following manner. The Agreement
|
||||
Steward reserves the right to publish new versions (including revisions) of
|
||||
this Agreement from time to time. No one other than the Agreement Steward has
|
||||
the right to modify this Agreement. The Eclipse Foundation is the initial
|
||||
Agreement Steward. The Eclipse Foundation may assign the responsibility to
|
||||
serve as the Agreement Steward to a suitable separate entity. Each new version
|
||||
of the Agreement will be given a distinguishing version number. The Program
|
||||
(including Contributions) may always be distributed subject to the version of
|
||||
the Agreement under which it was received. In addition, after a new version of
|
||||
the Agreement is published, Contributor may elect to distribute the Program
|
||||
(including its Contributions) under the new version. Except as expressly stated
|
||||
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
|
||||
the intellectual property of any Contributor under this Agreement, whether
|
||||
expressly, by implication, estoppel or otherwise. All rights in the Program not
|
||||
expressly granted under this Agreement are reserved.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
|
||||
State of New York and the intellectual property laws of the United States of
|
||||
America. No party to this Agreement will bring a legal action under this
|
||||
Agreement more than one year after the cause of action arose. Each party waives
|
||||
its rights to a jury trial in any resulting litigation.</span> </p>
|
||||
|
||||
<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,339 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, 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.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
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
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
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
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
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
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
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
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 728 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 604 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
@ -1,19 +0,0 @@
|
||||
"34aL volume 3.1" icons set
|
||||
|
||||
Ammount of icons:
|
||||
60
|
||||
|
||||
Colors:
|
||||
Colored, grey
|
||||
|
||||
Icon Sizes:
|
||||
24x24
|
||||
|
||||
File Types:
|
||||
.ico (RGBA, 256 color, 16 color),
|
||||
.tiff (RGBA)
|
||||
.gif (indexed)
|
||||
.bmp (RGB - 1 color background),
|
||||
.png (RGBA)
|
||||
|
||||
Note: These icons are free for use.
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.4 KiB |
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
header("Location: operator/index.php");
|
||||
exit;
|
||||
|
||||
?>
|
@ -1,208 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
$dbtables = array(
|
||||
"${mysqlprefix}chatgroup" => array(
|
||||
"groupid" => "int NOT NULL auto_increment PRIMARY KEY",
|
||||
"vcemail" => "varchar(64)",
|
||||
"vclocalname" => "varchar(64) NOT NULL",
|
||||
"vccommonname" => "varchar(64) NOT NULL",
|
||||
"vclocaldescription" => "varchar(1024) NOT NULL",
|
||||
"vccommondescription" => "varchar(1024) NOT NULL",
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatthread" => array(
|
||||
"threadid" => "int NOT NULL auto_increment PRIMARY KEY",
|
||||
"userName" => "varchar(64) NOT NULL",
|
||||
"userid" => "varchar(255)",
|
||||
"agentName" => "varchar(64)",
|
||||
"agentId" => "int NOT NULL DEFAULT 0",
|
||||
"dtmcreated" => "datetime DEFAULT 0",
|
||||
"dtmmodified" => "datetime DEFAULT 0",
|
||||
"lrevision" => "int NOT NULL DEFAULT 0",
|
||||
"istate" => "int NOT NULL DEFAULT 0",
|
||||
"ltoken" => "int NOT NULL",
|
||||
"remote" => "varchar(255)",
|
||||
"referer" => "text",
|
||||
"nextagent" => "int NOT NULL DEFAULT 0",
|
||||
"locale" => "varchar(8)",
|
||||
"lastpinguser" => "datetime DEFAULT 0",
|
||||
"lastpingagent" => "datetime DEFAULT 0",
|
||||
"userTyping" => "int DEFAULT 0",
|
||||
"agentTyping" => "int DEFAULT 0",
|
||||
"shownmessageid" => "int NOT NULL DEFAULT 0",
|
||||
"userAgent" => "varchar(255)",
|
||||
"messageCount" => "varchar(16)",
|
||||
"groupid" => "int references ${mysqlprefix}chatgroup(groupid)",
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatmessage" => array(
|
||||
"messageid" => "int NOT NULL auto_increment PRIMARY KEY",
|
||||
"threadid" => "int NOT NULL references ${mysqlprefix}chatthread(threadid)",
|
||||
"ikind" => "int NOT NULL",
|
||||
"agentId" => "int NOT NULL DEFAULT 0",
|
||||
"tmessage" => "text NOT NULL",
|
||||
"dtmcreated" => "datetime DEFAULT 0",
|
||||
"tname" => "varchar(64)"
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatoperator" => array(
|
||||
"operatorid" => "int NOT NULL auto_increment PRIMARY KEY",
|
||||
"vclogin" => "varchar(64) NOT NULL",
|
||||
"vcpassword" => "varchar(64) NOT NULL",
|
||||
"vclocalename" => "varchar(64) NOT NULL",
|
||||
"vccommonname" => "varchar(64) NOT NULL",
|
||||
"vcemail" => "varchar(64)",
|
||||
"dtmlastvisited" => "datetime DEFAULT 0",
|
||||
"istatus" => "int DEFAULT 0", /* 0 - online, 1 - away */
|
||||
"vcavatar" => "varchar(255)",
|
||||
"vcjabbername" => "varchar(255)",
|
||||
"iperm" => "int DEFAULT 65535",
|
||||
"dtmrestore" => "datetime DEFAULT 0",
|
||||
"vcrestoretoken" => "varchar(64)",
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatrevision" => array(
|
||||
"id" => "INT NOT NULL"
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatgroupoperator" => array(
|
||||
"groupid" => "int NOT NULL references ${mysqlprefix}chatgroup(groupid)",
|
||||
"operatorid" => "int NOT NULL references ${mysqlprefix}chatoperator(operatorid)",
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatban" => array(
|
||||
"banid" => "INT NOT NULL auto_increment PRIMARY KEY",
|
||||
"dtmcreated" => "datetime DEFAULT 0",
|
||||
"dtmtill" => "datetime DEFAULT 0",
|
||||
"address" => "varchar(255)",
|
||||
"comment" => "varchar(255)",
|
||||
"blockedCount" => "int DEFAULT 0"
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatconfig" => array(
|
||||
"id" => "INT NOT NULL auto_increment PRIMARY KEY",
|
||||
"vckey" => "varchar(255)",
|
||||
"vcvalue" => "varchar(255)",
|
||||
),
|
||||
|
||||
"${mysqlprefix}chatresponses" => array(
|
||||
"id" => "INT NOT NULL auto_increment PRIMARY KEY",
|
||||
"locale" => "varchar(8)",
|
||||
"groupid" => "int references ${mysqlprefix}chatgroup(groupid)",
|
||||
"vcvalue" => "varchar(1024) NOT NULL",
|
||||
)
|
||||
);
|
||||
|
||||
$memtables = array();
|
||||
|
||||
$dbtables_can_update = array(
|
||||
"${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"),
|
||||
"${mysqlprefix}chatmessage" => array("agentId"),
|
||||
"${mysqlprefix}chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "vcemail", "dtmrestore", "vcrestoretoken"),
|
||||
"${mysqlprefix}chatban" => array(),
|
||||
"${mysqlprefix}chatgroup" => array("vcemail"),
|
||||
"${mysqlprefix}chatgroupoperator" => array(),
|
||||
"${mysqlprefix}chatresponses" => array(),
|
||||
);
|
||||
|
||||
function show_install_err($text)
|
||||
{
|
||||
global $page, $version, $errors, $webimroot;
|
||||
$page = array(
|
||||
'version' => $version,
|
||||
'localeLinks' => get_locale_links("$webimroot/install/index.php")
|
||||
);
|
||||
$errors = array($text);
|
||||
start_html_output();
|
||||
require('../view/install_err.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
function create_table($id, $link)
|
||||
{
|
||||
global $dbtables, $memtables, $dbencoding, $mysqlprefix;
|
||||
|
||||
if (!isset($dbtables[$id])) {
|
||||
show_install_err("Unknown table: $id, " . mysql_error($link));
|
||||
}
|
||||
|
||||
$query =
|
||||
"CREATE TABLE $id\n" .
|
||||
"(\n";
|
||||
foreach ($dbtables[$id] as $k => $v) {
|
||||
$query .= " $k $v,\n";
|
||||
}
|
||||
|
||||
$query = preg_replace("/,\n$/", "", $query);
|
||||
$query .= ") charset $dbencoding";
|
||||
if (in_array($id, $memtables)) {
|
||||
$query .= " ENGINE=MEMORY";
|
||||
} else {
|
||||
$query .= " ENGINE=InnoDb";
|
||||
}
|
||||
|
||||
mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
|
||||
if ($id == "${mysqlprefix}chatoperator") {
|
||||
create_operator_("admin", "", "", "Administrator", "Administrator", "", $link);
|
||||
} else if ($id == "${mysqlprefix}chatrevision") {
|
||||
perform_query("INSERT INTO ${mysqlprefix}chatrevision VALUES (1)", $link);
|
||||
}
|
||||
}
|
||||
|
||||
function get_tables($link)
|
||||
{
|
||||
global $mysqldb, $errors;
|
||||
$result = mysql_query("SHOW TABLES FROM `$mysqldb`", $link);
|
||||
if ($result) {
|
||||
$arr = array();
|
||||
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
|
||||
$arr[] = $row[0];
|
||||
}
|
||||
mysql_free_result($result);
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
$errors[] = "Cannot get tables from database. Error: " . mysql_error($link);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function get_columns($tablename, $link)
|
||||
{
|
||||
global $errors;
|
||||
$result = mysql_query("SHOW COLUMNS FROM $tablename", $link);
|
||||
if ($result) {
|
||||
$arr = array();
|
||||
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
|
||||
$arr[] = $row[0];
|
||||
}
|
||||
mysql_free_result($result);
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
$errors[] = "Cannot get columns from table \"$tablename\". Error: " . mysql_error($link);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,167 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('../libs/common.php');
|
||||
require_once('../libs/operator.php');
|
||||
require_once('dbinfo.php');
|
||||
|
||||
function runsql($query, $link)
|
||||
{
|
||||
$res = mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error());
|
||||
return $res;
|
||||
}
|
||||
|
||||
$act = verifyparam("act", "/^(silentcreateall|createdb|ct|dt|addcolumns)$/");
|
||||
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass)
|
||||
or show_install_err('Could not connect: ' . mysql_error($link));
|
||||
|
||||
if ($act == "silentcreateall") {
|
||||
mysql_query("CREATE DATABASE $mysqldb", $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
foreach ($dbtables as $id) {
|
||||
create_table($id, $link);
|
||||
}
|
||||
} else if ($act == "createdb") {
|
||||
mysql_query("CREATE DATABASE $mysqldb", $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
} else {
|
||||
mysql_select_db($mysqldb, $link) or show_install_err('Could not select database');
|
||||
if ($force_charset_in_connection) {
|
||||
mysql_query("SET character set $dbencoding", $link);
|
||||
}
|
||||
|
||||
if ($act == "ct") {
|
||||
$curr_tables = get_tables($link);
|
||||
if ($curr_tables === false) {
|
||||
show_install_err($errors[0]);
|
||||
}
|
||||
$tocreate = array_diff(array_keys($dbtables), $curr_tables);
|
||||
foreach ($tocreate as $id) {
|
||||
create_table($id, $link);
|
||||
}
|
||||
} else if ($act == "dt") {
|
||||
|
||||
# comment this line to be able to drop tables
|
||||
show_install_err("For security reasons, removing tables is disabled by default");
|
||||
|
||||
foreach (array_keys($dbtables) as $id) {
|
||||
mysql_query("DROP TABLE IF EXISTS $id", $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
}
|
||||
} else if ($act == "addcolumns") {
|
||||
$absent = array();
|
||||
foreach ($dbtables as $id => $columns) {
|
||||
$curr_columns = get_columns($id, $link);
|
||||
if ($curr_columns === false) {
|
||||
show_install_err($errors[0]);
|
||||
}
|
||||
$tocreate = array_diff(array_keys($columns), $curr_columns);
|
||||
foreach ($tocreate as $v) {
|
||||
$absent[] = "$id.$v";
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatmessage.agentId", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD agentId int NOT NULL DEFAULT 0 AFTER ikind", $link);
|
||||
runsql("update ${mysqlprefix}chatmessage,${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND ikind = 2 AND (vclocalename = tname OR vccommonname = tname)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.agentId", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD agentId int NOT NULL DEFAULT 0 AFTER agentName", $link);
|
||||
runsql("update ${mysqlprefix}chatthread,${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.agentTyping", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD agentTyping int DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.userTyping", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userTyping int DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.messageCount", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD messageCount varchar(16)", $link);
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_threadid_ikind (threadid, ikind)", $link);
|
||||
runsql("UPDATE ${mysqlprefix}chatthread t SET t.messageCount = (SELECT COUNT(*) FROM ${mysqlprefix}chatmessage WHERE ${mysqlprefix}chatmessage.threadid = t.threadid AND ikind = 1)", $link);
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatmessage DROP INDEX idx_threadid_ikind", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.nextagent", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD nextagent int NOT NULL DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.shownmessageid", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD shownmessageid int NOT NULL DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.userid", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userid varchar(255) DEFAULT \"\"", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.iperm", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD iperm int DEFAULT 65535", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.istatus", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD istatus int DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.vcavatar", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcavatar varchar(255)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.vcjabbername", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcjabbername varchar(255)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.vcemail", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcemail varchar(64)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.dtmrestore", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD dtmrestore datetime DEFAULT 0", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatoperator.vcrestoretoken", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcrestoretoken varchar(64)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.groupid", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD groupid int references ${mysqlprefix}chatgroup(groupid)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.userAgent", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userAgent varchar(255)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatgroup.vcemail", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD vcemail varchar(64)", $link);
|
||||
}
|
||||
|
||||
$res = mysql_query("select null from information_schema.statistics where table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link);
|
||||
if ($res && mysql_num_rows($res) == 0) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mysql_close($link);
|
||||
header("Location: $webimroot/install/index.php");
|
||||
exit;
|
||||
?>
|
@ -1,316 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('../libs/common.php');
|
||||
require_once('../libs/settings.php');
|
||||
require_once('dbinfo.php');
|
||||
|
||||
$page = array(
|
||||
'version' => $version,
|
||||
'localeLinks' => get_locale_links("$webimroot/install/index.php")
|
||||
);
|
||||
|
||||
$page['done'] = array();
|
||||
$page['nextstep'] = false;
|
||||
$page['nextnotice'] = false;
|
||||
$page['soundcheck'] = false;
|
||||
$errors = array();
|
||||
|
||||
function check_webimroot()
|
||||
{
|
||||
global $page, $errors, $webimroot;
|
||||
$requestUri = $_SERVER["REQUEST_URI"];
|
||||
if (!preg_match('/^(.*)\\/install(\\/[^\\/\\\\]*)?$/', $requestUri, $matches)) {
|
||||
$errors[] = "Cannot detect application location: $requestUri";
|
||||
return false;
|
||||
}
|
||||
$applocation = $matches[1];
|
||||
|
||||
if ($applocation != $webimroot) {
|
||||
$errors[] = "Please, check file ${applocation}/libs/config.php<br/>Wrong value of \$webimroot variable, should be \"$applocation\"";
|
||||
$webimroot = $applocation;
|
||||
return false;
|
||||
}
|
||||
|
||||
$page['done'][] = getlocal2("install.0.app", array($applocation));
|
||||
return true;
|
||||
}
|
||||
|
||||
function fpermissions($file)
|
||||
{
|
||||
$perms = fileperms($file);
|
||||
if (($perms & 0x8000) == 0x8000) {
|
||||
$info = '-';
|
||||
} elseif (($perms & 0x4000) == 0x4000) {
|
||||
$info = 'd';
|
||||
} else {
|
||||
$info = '?';
|
||||
}
|
||||
|
||||
// Owner
|
||||
$info .= (($perms & 0x0100) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0080) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0040) ?
|
||||
(($perms & 0x0800) ? 's' : 'x') :
|
||||
(($perms & 0x0800) ? 'S' : '-'));
|
||||
|
||||
// Group
|
||||
$info .= (($perms & 0x0020) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0010) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0008) ?
|
||||
(($perms & 0x0400) ? 's' : 'x') :
|
||||
(($perms & 0x0400) ? 'S' : '-'));
|
||||
|
||||
// World
|
||||
$info .= (($perms & 0x0004) ? 'r' : '-');
|
||||
$info .= (($perms & 0x0002) ? 'w' : '-');
|
||||
$info .= (($perms & 0x0001) ?
|
||||
(($perms & 0x0200) ? 't' : 'x') :
|
||||
(($perms & 0x0200) ? 'T' : '-'));
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
function check_files()
|
||||
{
|
||||
global $page, $errors, $webimroot;
|
||||
|
||||
$packageFile = dirname(__FILE__) . "/package";
|
||||
$fp = @fopen($packageFile, "r");
|
||||
if ($fp === FALSE) {
|
||||
$errors[] = getlocal2("install.cannot_read", array("$webimroot/install/package"));
|
||||
if (file_exists($packageFile)) {
|
||||
$errors[] = getlocal2("install.check_permissions", array(fpermissions($packageFile)));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$knownFiles = array();
|
||||
while (!feof($fp)) {
|
||||
$line = fgets($fp, 4096);
|
||||
$keyval = preg_split("/ /", $line, 2);
|
||||
if (isset($keyval[1])) {
|
||||
$knownFiles[$keyval[0]] = trim($keyval[1]);
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
foreach ($knownFiles as $file => $sum) {
|
||||
$relativeName = dirname(__FILE__) . "/../$file";
|
||||
if (!is_readable($relativeName)) {
|
||||
if (file_exists($relativeName)) {
|
||||
$errors[] = getlocal2("install.cannot_read", array("$webimroot/$file"));
|
||||
$errors[] = getlocal2("install.check_permissions", array(fpermissions($relativeName)));
|
||||
} else {
|
||||
$errors[] = getlocal2("install.no_file", array("$webimroot/$file"));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if ($sum != "-") {
|
||||
$result = md5_file($relativeName);
|
||||
if ($result != $sum) {
|
||||
// try without \r
|
||||
$result = md5(str_replace("\r", "", file_get_contents($relativeName)));
|
||||
}
|
||||
if ($result != $sum) {
|
||||
$errors[] = getlocal2("install.bad_checksum", array("$webimroot/$file"));
|
||||
$errors[] = getlocal("install.check_files");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$page['done'][] = getlocal("install.0.package");
|
||||
return true;
|
||||
}
|
||||
|
||||
function check_connection()
|
||||
{
|
||||
global $mysqlhost, $mysqllogin, $mysqlpass, $page, $errors, $webimroot;
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass);
|
||||
if ($link) {
|
||||
$result = mysql_query("SELECT VERSION() as c", $link);
|
||||
if ($result && $ver = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||
$page['done'][] = getlocal2("install.1.connected", array($ver['c']));
|
||||
mysql_free_result($result);
|
||||
} else {
|
||||
$errors[] = "Version of your SQL server is unknown. Please check. Error: " . mysql_error($link);
|
||||
mysql_close($link);
|
||||
return null;
|
||||
}
|
||||
return $link;
|
||||
} else {
|
||||
$errors[] = getlocal2("install.connection.error", array(mysql_error()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function check_database($link)
|
||||
{
|
||||
global $mysqldb, $force_charset_in_connection, $dbencoding, $page, $webimroot;
|
||||
if (mysql_select_db($mysqldb, $link)) {
|
||||
$page['done'][] = getlocal2("install.2.db_exists", array($mysqldb));
|
||||
if ($force_charset_in_connection) {
|
||||
mysql_query("SET character set $dbencoding", $link);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
$page['nextstep'] = getlocal2("install.2.create", array($mysqldb));
|
||||
$page['nextnotice'] = getlocal("install.2.notice");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=createdb";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function check_tables($link)
|
||||
{
|
||||
global $dbtables, $page, $webimroot;
|
||||
$curr_tables = get_tables($link);
|
||||
if ($curr_tables !== false) {
|
||||
$tocreate = array_diff(array_keys($dbtables), $curr_tables);
|
||||
if (count($tocreate) == 0) {
|
||||
$page['done'][] = getlocal("install.3.tables_exist");
|
||||
return true;
|
||||
} else {
|
||||
$page['nextstep'] = getlocal("install.3.create");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=ct";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function check_columns($link)
|
||||
{
|
||||
global $dbtables, $dbtables_can_update, $errors, $page, $webimroot;
|
||||
|
||||
$need_to_create_columns = false;
|
||||
foreach ($dbtables as $id => $columns) {
|
||||
$curr_columns = get_columns($id, $link);
|
||||
if ($curr_columns === false) {
|
||||
return false;
|
||||
}
|
||||
$tocreate = array_diff(array_keys($columns), $curr_columns);
|
||||
if (count($tocreate) != 0) {
|
||||
$cannot_update = array_diff($tocreate, $dbtables_can_update[$id]);
|
||||
if (count($cannot_update) != 0) {
|
||||
$errors[] = "Key columns are absent in table `$id'. Unable to continue installation.";
|
||||
$page['nextstep'] = getlocal("install.kill_tables");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=dt";
|
||||
$page['nextnotice'] = getlocal("install.kill_tables.notice");
|
||||
return false;
|
||||
}
|
||||
$need_to_create_columns = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($need_to_create_columns) {
|
||||
$page['nextstep'] = getlocal("install.4.create");
|
||||
$page['nextstepurl'] = "$webimroot/install/dbperform.php?act=addcolumns";
|
||||
$page['nextnotice'] = getlocal("install.4.notice");
|
||||
return false;
|
||||
}
|
||||
|
||||
$page['done'][] = getlocal("install.4.done");
|
||||
return true;
|
||||
}
|
||||
|
||||
function check_sound()
|
||||
{
|
||||
global $page;
|
||||
|
||||
$page['soundcheck'] = true;
|
||||
$page['done'][] = getlocal2("install.5.text", array(
|
||||
"<a id='check-nv' href='javascript:void(0)'>" . getlocal("install.5.newvisitor") . "</a>",
|
||||
"<a id='check-nm' href='javascript:void(0)'>" . getlocal("install.5.newmessage") . "</a>"
|
||||
));
|
||||
}
|
||||
|
||||
function check_admin($link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$result = mysql_query("select * from ${mysqlprefix}chatoperator where vclogin = 'admin'", $link);
|
||||
if ($result) {
|
||||
$line = mysql_fetch_array($result, MYSQL_ASSOC);
|
||||
mysql_free_result($result);
|
||||
return $line['vcpassword'] != md5('');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function check_status()
|
||||
{
|
||||
global $page, $webimroot, $settings, $dbversion;
|
||||
|
||||
$page['done'][] = getlocal2("install.0.php", array(phpversion()));
|
||||
|
||||
if (!check_webimroot()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_files()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$link = check_connection();
|
||||
if (!$link) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_database($link)) {
|
||||
mysql_close($link);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_tables($link)) {
|
||||
mysql_close($link);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_columns($link)) {
|
||||
mysql_close($link);
|
||||
return;
|
||||
}
|
||||
|
||||
check_sound();
|
||||
|
||||
$page['done'][] = getlocal("installed.message");
|
||||
|
||||
if (!check_admin($link)) {
|
||||
$page['nextstep'] = getlocal("installed.login_link");
|
||||
$page['nextnotice'] = getlocal2("installed.notice", array("${webimroot}/install/"));
|
||||
$page['nextstepurl'] = "$webimroot/";
|
||||
}
|
||||
|
||||
$page['show_small_login'] = true;
|
||||
|
||||
mysql_close($link);
|
||||
|
||||
loadsettings();
|
||||
$settings['dbversion'] = $dbversion;
|
||||
update_settings();
|
||||
}
|
||||
|
||||
check_status();
|
||||
|
||||
start_html_output();
|
||||
require('../view/install_index.php');
|
||||
?>
|
@ -1,176 +0,0 @@
|
||||
1.6.4
|
||||
-----
|
||||
[+] core UI improvements, "you are offline" and "new features" notification panels
|
||||
[+] online/away operators list (on "awaiting visitors" page) by Andrew Armstrong
|
||||
[+] several instances of mibew in one DB ($mysqlprefix variable)
|
||||
[+] ability to override notification email for group
|
||||
[!] various compatibility fixes: button image, captcha, check webimroot variable (installation)
|
||||
[!] check file permissions/checksum (installation)
|
||||
[!] fix speed of history search, fix redirection to groups
|
||||
[!] fix sound issues in windows
|
||||
|
||||
1.6.3
|
||||
-----
|
||||
[+] password restore functionality for agent
|
||||
[+] new Blue logo; new buttons: mgreen, mblue
|
||||
[!] fixed: button code conflicts with spam filters and mod_security
|
||||
[!] workarounds if some functions are disabled in php
|
||||
[!] compatibility with PHP 5.3.0
|
||||
[+] new domain: mibew.org
|
||||
|
||||
1.6.2
|
||||
-----
|
||||
[+] bi-licensed: EPL / GPL
|
||||
[+] operator is away status, show status on redirect/survey/operators pages
|
||||
[+] Captcha - Leave Message
|
||||
[+] groups page: last active column
|
||||
[+] pre-chat survey, redirect page: show group status - online/offline/away
|
||||
[!] do not show empty groups in redirect/survey
|
||||
[!] compatibility with the latest mod_security rules
|
||||
[+] performance options in settings: update intervals, operator online time threshold
|
||||
[+] information messages: visitor navigated to ...
|
||||
[!] html code in templates, better appearance in Safari
|
||||
|
||||
1.6.1
|
||||
-----
|
||||
[!] 404 installation problem
|
||||
[+] new permission: "Ability to modify profile"
|
||||
[+] new project name: Mibew Messenger
|
||||
[!] fixed localization of dates for all languages, nice formatting: Today/Yesterday
|
||||
[!] fixed online/offline image for groups
|
||||
[+] ability to delete operators, confirmation dialog when deleting group/operator/blocked address
|
||||
[+] Information about last activity for operators: Online, Today at 22, 01 Jan.., or Never
|
||||
[+] new theme: simplicity (by Sheldmandu)
|
||||
[!] chat templates are fixed according to html standards
|
||||
|
||||
1.6.0
|
||||
-----
|
||||
[+] completely new layout of all administrator pages, XHTML 1.0
|
||||
[+] New awaiting users and chat log pages
|
||||
[+] right menu, show/hide menu on awaiting users page, nice locale chooser
|
||||
[+] main page: warning if database is outdated (after install)
|
||||
[+] "Updates": news, link to the latest version
|
||||
[+] Operator's profile page
|
||||
[+] Configurable pre-chat survey
|
||||
[+] Create/edit/remove groups
|
||||
[+] Canned messages page
|
||||
[+] Statistics page
|
||||
[+] Popup dialog notification of the new visitor (turned off by default)
|
||||
[+] Send message option: enter vs ctrl-enter
|
||||
[!] Slow loading of awating visitors page
|
||||
|
||||
1.5.2
|
||||
-----
|
||||
[+] Ability to disable sound notifications for chat (toolbar button)
|
||||
[+] Switch to SSL in chat (should be enabled in "Settings -> Optional Services")
|
||||
[!] lost query parameters after login redirect
|
||||
[+] added referrer into button code
|
||||
[+] ability to add text for operator into button code, define visitor's name and email
|
||||
[!] geolocation on IPs in history
|
||||
[!] Translation UI: added sorting, filters, fixed several problems
|
||||
[+] New chat buttons
|
||||
|
||||
1.5.1
|
||||
-----
|
||||
[!] significant optimization of chat window (both themes), reduced number of images and their sizes
|
||||
[+] tabs in settings: Optional Services, Themes preview
|
||||
[+] better French and Spanish translations, additional languages are stored separately
|
||||
[+] detect Chrome browser, show its version
|
||||
[!] reverted order in title, removed available_locales variable from config.php (detect automatically)
|
||||
[!] return English message by default (when translation for other language is absent)
|
||||
[!] problems with styles, fixed error messages in avatar uploading
|
||||
[+] nice confirmation when form is saved
|
||||
|
||||
1.5.0
|
||||
-----
|
||||
[!] sound notifications: FF (mac,win), Opera (mac,win), IE, Safari (mac,win)
|
||||
[+] chat styles support: selectors in button generation and in settings
|
||||
[+] styles are applied as set of page templates
|
||||
[+] added styles preview page (the link from settings page) with "fake" chat
|
||||
[+] 2 styles are included: original (old one) and default (new green scheme)
|
||||
[+] new options in settings: user can change name, presentable name pattern
|
||||
[+] customizable geolocation link for IPs on pending users page
|
||||
[+] permissions support: Agents -> some agent -> Permissions
|
||||
[+] New permissions:
|
||||
[x] System administration: settings, operators management, button generation
|
||||
[x] Take over chat thread
|
||||
[x] View another operator's chat thread
|
||||
|
||||
1.4.2
|
||||
-----
|
||||
|
||||
[+] Operators photos (appears in users chat window)
|
||||
[+] pending users: show first user message (below the name)
|
||||
[+] pending users: show visitors's browser name and version
|
||||
[+] mark user with unique id to be able to see its dialogs later
|
||||
[+] special button in operator's thread to browse previous chats
|
||||
[+] Spam Blocking
|
||||
|
||||
1.4.1
|
||||
-----
|
||||
|
||||
[+] redirect visitor to another operator
|
||||
[+] predefined answers (without proper management yet)
|
||||
[+] play notification sounds (new message, new visitor)
|
||||
[+] confirmation when trying to intercept another operator's visitor
|
||||
[+] ability to view threads without taking
|
||||
|
||||
1.4.0
|
||||
-----
|
||||
|
||||
[+] introduce messenger settings page, persist several options in DB instead of config.php
|
||||
[+] improve history search speed
|
||||
[+] do not show typing notification for disconnected remote
|
||||
[!] monitor connection status, show reconnecing message when connection is low (pendings users and chat window)
|
||||
[!] support lang & language args in button code, create correct code for link
|
||||
[!] fix safari, opera 9.5+ (+ several others compatibility fixes)
|
||||
|
||||
1.0.10
|
||||
------
|
||||
|
||||
[+] Number of messages from visitor in history
|
||||
[+] State "loading" (means user is still loading his window)
|
||||
[+] Timers on peding users page are ticking now
|
||||
[!] Company logo link target is now an option in config
|
||||
[!] Mail encoding fixed (separate option)
|
||||
[!] Operator/user locale is stored in cookie
|
||||
[!] localized dates
|
||||
[!] fixed installing on DB with numeric name
|
||||
[!] empty and double messages
|
||||
[!] #1983764
|
||||
|
||||
1.0.9
|
||||
-----
|
||||
|
||||
[+] typing notifications in chat window
|
||||
[!] completly new encoding handling, default is utf-8, page encoding is set in resources
|
||||
[!] fixed user name storage in cookie (now utf8 in base64)
|
||||
[!] some fixes for Opera
|
||||
[!] force utf-8 for xml
|
||||
|
||||
1.0.8
|
||||
-----
|
||||
|
||||
[+] install/update wizard, can create database and update it if needed
|
||||
[+] leave message form when no operator is available
|
||||
[!] location of web application can be other than /webim (see config.php)
|
||||
[!] locale-specific resources extracted into /locales
|
||||
[!] some fixes for Safari browser
|
||||
[!] email validation in forms
|
||||
|
||||
1.0.7
|
||||
-----
|
||||
|
||||
[+] history search with pagination
|
||||
[+] advanced button generation: secure link, include hostname, choosing images
|
||||
[+] post referer into thread as a message (visible only for agent)
|
||||
[+] new config options: user can change name, company name, logo
|
||||
[+] notify operator if user closed his window
|
||||
[+] notify visitor if operator has connection problems and move it into priority queue
|
||||
[+] automatically take visitor if operator connection restored
|
||||
[!] encoding problems in Internet Explorer
|
||||
[!] quotes in messages & user names
|
||||
[!] do not reopen closed threads
|
||||
[!] some fixes in handling thread locale
|
||||
[!] version in menu, locales chooser in menu
|
||||
|
@ -1 +0,0 @@
|
||||
var myAgent="";var _j=0;var myRealAgent="";function mk(){var nk=["opera","msie","safari","firefox","netscape","mozilla"];var nj=navigator.userAgent.toLowerCase();for(var i=0;i<nk.length;i++){var qk=nk[i];if(nj.indexOf(qk)!=-1){myAgent=qk;if(!window.RegExp)break;var rk=new RegExp(qk+"[ \/]?([0-9]+(\.[0-9]+)?)");if(rk.exec(nj)!=null){_j=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="Gecko")myAgent="moz";} mk();function getEl(name){return document.getElementById(name);}
|
@ -1,11 +0,0 @@
|
||||
window.attachEvent('onload', mkwidth);
|
||||
window.attachEvent('onresize', mkwidth);
|
||||
|
||||
function mkwidth(){
|
||||
if(document.getElementById("wrap700")) {
|
||||
document.getElementById("wrap700").style.width = document.documentElement.clientWidth < 750 ? "750px" : "100%";
|
||||
}
|
||||
if(document.getElementById("wrap400")) {
|
||||
document.getElementById("wrap400").style.width = document.documentElement.clientWidth < 450 ? "450px" : "100%";
|
||||
}
|
||||
};
|
@ -1,61 +0,0 @@
|
||||
var popupStatus = 0;
|
||||
|
||||
function loadPopup(){
|
||||
if(popupStatus==0){
|
||||
$("#backgroundPopup").css({
|
||||
"opacity": "0.7"
|
||||
});
|
||||
$("#backgroundPopup").fadeIn("slow");
|
||||
$("#dashlocalesPopup").fadeIn("slow");
|
||||
popupStatus = 1;
|
||||
}
|
||||
}
|
||||
function disablePopup(){
|
||||
if(popupStatus==1){
|
||||
$("#backgroundPopup").fadeOut("slow");
|
||||
$("#dashlocalesPopup").fadeOut("slow");
|
||||
popupStatus = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function normpos(a) {
|
||||
if(a < 10) {
|
||||
return 10;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
function centerPopup(){
|
||||
var windowWidth = document.documentElement.clientWidth;
|
||||
var windowHeight = document.documentElement.clientHeight;
|
||||
var popupHeight = $("#dashlocalesPopup").height();
|
||||
var popupWidth = $("#dashlocalesPopup").width();
|
||||
$("#dashlocalesPopup").css({
|
||||
"position": "absolute",
|
||||
"top": normpos((windowHeight-popupHeight) * 0.2),
|
||||
"left": normpos(windowWidth/2-popupWidth/2)
|
||||
});
|
||||
$("#backgroundPopup").css({
|
||||
"height": windowHeight
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#changelang").click(function(){
|
||||
centerPopup();
|
||||
loadPopup();
|
||||
return false;
|
||||
});
|
||||
$("#dashlocalesPopupClose").click(function(){
|
||||
disablePopup();
|
||||
return false;
|
||||
});
|
||||
$("#backgroundPopup").click(function(){
|
||||
disablePopup();
|
||||
});
|
||||
$(document).keypress(function(e){
|
||||
if(e.keyCode==27 && popupStatus==1){
|
||||
disablePopup();
|
||||
}
|
||||
});
|
||||
});
|
@ -1 +0,0 @@
|
||||
pr.ir({'a#check-nv':function(bh){bh.onclick=function(){vs(wroot+'/sounds/new_user.wav');} ;} ,'a#check-nm':function(bh){bh.onclick=function(){vs(wroot+'/sounds/new_message.wav')} ;} } );
|
@ -1,33 +0,0 @@
|
||||
function loadNews() {
|
||||
if (typeof(window.webimNews) == "undefined" || typeof(window.webimNews.length) == "undefined")
|
||||
return;
|
||||
|
||||
var str = "<div>";
|
||||
for (var i = 0; i < window.webimNews.length; i++) {
|
||||
str += "<div class=\"newstitle\"><a hre" + "f=\"" + window.webimNews[i].link + "\">" + window.webimNews[i].title + "</a>, <span class=\"small\">" + window.webimNews[i].date + "</span></div>";
|
||||
str += "<div class=\"newstext\">" + window.webimNews[i].message+"</div>";
|
||||
}
|
||||
$("#news").html(str + "</div>");
|
||||
}
|
||||
|
||||
function loadVersion() {
|
||||
if(typeof(window.webimLatest) == "undefined" || typeof(window.webimLatest.version) == "undefined")
|
||||
return;
|
||||
|
||||
var current = $("#cver").html();
|
||||
|
||||
if(current != window.webimLatest.version) {
|
||||
if(current < window.webimLatest.version) {
|
||||
$("#cver").css("color","red");
|
||||
}
|
||||
$("#lver").html(window.webimLatest.version+", Download <a href=\""+window.webimLatest.download+"\">"+window.webimLatest.title+"</a>");
|
||||
} else {
|
||||
$("#cver").css("color","green");
|
||||
$("#lver").html(window.webimLatest.version);
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
loadNews();
|
||||
loadVersion();
|
||||
});
|
19
src/messenger/webim/js/jquery-1.3.2.min.js
vendored
@ -1,735 +0,0 @@
|
||||
/*
|
||||
* JavaScript Obfucator is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* JavaScript Obfucator is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Obfuscate the JavaScript code.
|
||||
* updated by Evgeny Gryaznov, March 2006
|
||||
* @author Shane Ng <gnenahs at poboxes dot com>
|
||||
*/
|
||||
public class JSO {
|
||||
|
||||
private Random randomizer = new Random(321);
|
||||
|
||||
public static final String[] reserved = {
|
||||
"abstract", "else", "instanceof", "switch", "boolean", "enum", "int",
|
||||
"synchronized", "break", "export", "interface", "this", "byte", "extends",
|
||||
"long", "throw", "case", "false", "native", "throws", "catch", "final",
|
||||
"new", "transient", "char", "finally", "null", "true", "class", "float",
|
||||
"package", "try", "const", "for", "private", "typeof", "continue", "function",
|
||||
"protected", "var", "debugger", "goto", "public", "void", "default", "if",
|
||||
"return", "volatile", "delete", "implements", "short", "while", "do", "import",
|
||||
"static", "with", "double", "in", "super", "undefined", "arguments"
|
||||
};
|
||||
|
||||
public static final String[] builtIn = {
|
||||
"history", "packages", "pageXOffset", "pageYOffset", "isNaN", "array", "java",
|
||||
"plugin", "clientInformation", "prototype", "layer", "layers", "crypto", "date", "secure",
|
||||
"embed", "navigator", "product", "netscape", "escape", "eval", "sun",
|
||||
"taint", "fileUpload", "toString", "unescape", "untaint", "frameRate",
|
||||
"valueOf", "getClass", "encodeURIComponent", "overrideMimeType",
|
||||
|
||||
// Types
|
||||
"Math", "Date", "Array", "RegExp", "Image", "Function", "ActiveXObject",
|
||||
"Number", "String", "Object", "JavaClass", "JavaObject", "JavaPackage", "JavaArray",
|
||||
|
||||
// DOM
|
||||
"anchor", "image", "area", "checkbox", "password", "radio", "textarea",
|
||||
"contentDocument", "contentWindow", "document",
|
||||
"window", "element", "location", "option", "style", "body",
|
||||
|
||||
// Properties
|
||||
"accessKey", "action", "activeElement", "align", "aLink", "aLinkColor", "alt",
|
||||
"altHTML", "altKey", "appCodeName", "appMinorVersion", "appName", "appVersion",
|
||||
"autocomplete", "availHeight", "availWidth", "background", "backgroundAttachment",
|
||||
"backgroundColor", "backgroundImage", "backgroundPosition", "backgroundPositionX",
|
||||
"backgroundPositionY", "backgroundRepeat", "balance", "behavior", "bgColor",
|
||||
"bgProperties", "border", "borderBottom", "borderBottomColor", "borderBottomStyle",
|
||||
"borderBottomWidth", "borderCollapse", "borderColor", "borderColorDark",
|
||||
"borderColorLight", "borderLeft", "borderLeftColor", "borderLeftStyle",
|
||||
"borderLeftWidth", "borderRight", "borderRightColor", "borderRightStyle",
|
||||
"borderRightWidth", "borderStyle", "borderTop", "borderTopColor", "borderTopStyle",
|
||||
"borderTopWidth", "borderWidth", "bottom", "bottomMargin", "boundingHeight", "boundingLeft",
|
||||
"boundingTop", "boundingWidth", "browserLanguage", "bufferDepth", "button",
|
||||
"cancelBubble", "canHaveChildren", "caption", "cellIndex", "cellPadding", "cellSpacing",
|
||||
"checked", "classid", "className", "clear", "clientHeight", "clientLeft", "clientTop",
|
||||
"clientWidth", "clientX", "clientY", "clip", "clipBottom", "clipLeft", "clipRight",
|
||||
"clipTop", "closed", "code", "codeBase", "codeType", "color", "colorDepth", "cols",
|
||||
"colSpan", "compact", "complete", "content", "cookie", "cookieEnabled", "coords",
|
||||
"cpuClass", "cssText", "ctrlKey", "cursor", "data", "dataFld", "dataFormatAs",
|
||||
"dataPageSize", "dataSrc", "defaultCharset", "defaultChecked", "defaultSelected",
|
||||
"defaultStatus", "defaultValue", "defer", "designMode", "dialogArguments", "dialogHeight",
|
||||
"dialogLeft", "dialogTop", "dialogWidth", "dir", "direction", "disabled", "display",
|
||||
"documentElement", "domain", "dropEffect", "dynsrc", "effectAllowed", "encoding", "event",
|
||||
"expando", "face", "fgColor", "fileCreatedDate", "fileModifiedDate", "fileSize",
|
||||
"fileUpdatedDate", "filter", "firstChild", "font", "fontFamily", "fontSize",
|
||||
"fontSmoothingEnabled", "fontStyle", "fontVariant", "fontWeight", "form", "frame",
|
||||
"frameBorder", "frameSpacing", "fromElement", "hash", "height", "hidden", "host",
|
||||
"hostname", "href", "hspace", "htmlFor", "htmlText", "httpEquiv", "id", "imeMode",
|
||||
"indeterminate", "index", "innerHTML", "innerText", "isMap", "isTextEdit", "keyCode",
|
||||
"lang", "language", "lastChild", "lastModified", "layoutGrid", "layoutGridChar",
|
||||
"layoutGridCharSpacing", "layoutGridLine", "layoutGridMode", "layoutGridType", "left",
|
||||
"leftMargin", "length", "letterSpacing", "lineBreak", "lineHeight", "link", "linkColor",
|
||||
"listStyle", "listStyleImage", "listStylePosition", "listStyleType", "loop", "lowsrc",
|
||||
"margin", "marginBottom", "marginHeight", "marginLeft", "marginRight", "marginTop",
|
||||
"marginWidth", "maxLength", "media", "menuArguments", "method", "Methods", "multiple",
|
||||
"name", "nameProp", "nextSibling", "nodeName", "nodeType", "nodeValue", "noHref",
|
||||
"noResize", "noShade", "noWrap", "object", "offscreenBuffering", "offsetHeight",
|
||||
"offsetLeft", "offsetParent", "offsetTop", "offsetWidth", "offsetX", "offsetY",
|
||||
"onLine", "opener", "outerHTML", "outerText", "overflow", "overflowX", "overflowY",
|
||||
"owningElement", "padding", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop",
|
||||
"pageBreakAfter", "pageBreakBefore", "palette", "parent", "parentElement", "parentNode",
|
||||
"parentStyleSheet", "parentTextEdit", "parentWindow", "pathname", "pixelBottom",
|
||||
"pixelHeight", "pixelLeft", "pixelRight", "pixelTop", "pixelWidth", "platform",
|
||||
"pluginspage", "port", "posBottom", "posHeight", "position", "posLeft", "posRight",
|
||||
"posTop", "posWidth", "previousSibling", "propertyName", "protocol", "qualifier",
|
||||
"readOnly", "reason", "recordNumber", "recordset", "referrer", "rel",
|
||||
"repeat", "returnValue", "rev", "right", "rightMargin", "rowIndex", "rowSpan",
|
||||
"rubyAlign", "rubyOverhang", "rubyPosition", "scopeName", "screenLeft",
|
||||
"screenTop", "screenX", "screenY", "scrollAmount", "scrollDelay",
|
||||
"scrollHeight", "scrolling", "scrollLeft", "scrollTop", "scrollWidth", "search",
|
||||
"sectionRowIndex", "selected", "selectedIndex", "selectorText", "self", "shape",
|
||||
"shiftKey", "size", "sourceIndex", "span", "specified", "src", "srcElement", "srcFilter",
|
||||
"srcUrn", "start", "status", "styleFloat", "systemLanguage", "tabIndex", "tableLayout",
|
||||
"tagName", "tagUrn", "target", "text", "textAlign", "textAutospace", "textDecoration",
|
||||
"textDecorationLineThrough", "textDecorationNone", "textDecorationOverline",
|
||||
"textDecorationUnderline", "textIndent", "textJustify", "textTransform", "tFoot", "tHead",
|
||||
"title", "toElement", "top", "topMargin", "trueSpeed", "type", "unicodeBidi", "uniqueID",
|
||||
"units", "updateInterval", "URL", "urn", "useMap", "userAgent", "userLanguage", "vAlign",
|
||||
"value", "vcard_name", "verticalAlign", "visibility", "vLink", "vlinkColor", "volume",
|
||||
"vspace", "whiteSpace", "width", "wordBreak", "wordSpacing", "wrap", "x",
|
||||
"XMLDocument", "y", "zIndex",
|
||||
// non-IE
|
||||
"outerHeight", "innerHeight", "outerWidth", "innerWidth",
|
||||
"which", "enabledPlugin",
|
||||
|
||||
// collections
|
||||
"all", "anchors", "applets", "areas", "attributes", "behaviorUrns",
|
||||
"bookmarks", "boundElements", "cells", "childNodes", "children",
|
||||
"controlRange", "elements", "embeds", "filters", "forms", "frames",
|
||||
"images", "imports", "links", "mimeTypes", "options", "plugins", "rows",
|
||||
"rules", "scripts", "styleSheets", "tBodies", "TextRectangle",
|
||||
|
||||
// Methods
|
||||
"add", "addBehavior", "AddFavorite", "addImport", "addRule", "alert",
|
||||
"appendChild", "apply", "applyElement", "assign", "attachEvent", "back", "blur",
|
||||
"clearAttributes", "clearData", "clearInterval", "clearRequest",
|
||||
"clearTimeout", "click", "cloneNode", "close", "collapse", "compareEndPoints",
|
||||
"componentFromPoint", "confirm", "contains", "createCaption", "createControlRange",
|
||||
"createElement", "createRange", "createStyleSheet", "createTextNode", "createTextRange",
|
||||
"createTFoot", "createTHead", "deleteCaption", "deleteCell", "deleteRow", "deleteTFoot",
|
||||
"deleteTHead", "detachEvent", "doScroll", "duplicate", "elementFromPoint",
|
||||
"empty", "execCommand", "execScript", "expand", "findText", "firstPage", "focus",
|
||||
"forward", "getAdjacentText", "getAttribute", "getBookmark", "getBoundingClientRect",
|
||||
"getClientRects", "getData", "getElementById", "getElementsByName", "getElementsByTagName",
|
||||
"getExpression", "go", "hasChildNodes", "inRange",
|
||||
"insertAdjacentElement", "insertAdjacentHTML", "insertAdjacentText", "insertBefore",
|
||||
"insertCell", "insertRow", "isEqual", "IsSubscribed", "item", "javaEnabled", "lastPage",
|
||||
"mergeAttributes", "move", "moveBy", "moveEnd", "moveRow", "moveStart", "moveTo",
|
||||
"moveToBookmark", "moveToElementText", "moveToPoint", "namedRecordset", "navigate",
|
||||
"NavigateAndFind", "nextPage", "open", "pasteHTML",
|
||||
"previousPage", "print", "prompt", "queryCommandEnabled", "queryCommandIndeterm",
|
||||
"queryCommandState", "queryCommandSupported", "queryCommandValue", "recalc", "refresh",
|
||||
"releaseCapture", "reload", "remove", "removeAttribute", "removeBehavior",
|
||||
"removeChild", "removeExpression", "removeNode", "removeRule", "replace",
|
||||
"replaceAdjacentText", "replaceChild", "replaceNode", "reset", "resizeBy",
|
||||
"resizeTo", "scroll", "scrollBy", "scrollIntoView", "scrollTo", "select",
|
||||
"setAttribute", "setCapture", "setData", "setEndPoint", "setExpression", "setInterval",
|
||||
"setTimeout", "ShowBrowserUI", "showHelp", "showModalDialog", "showModelessDialog",
|
||||
"splitText", "stop", "submit", "swapNode", "tags", "taintEnabled",
|
||||
"urns", "write", "writeln",
|
||||
// builtIn
|
||||
"toUpperCase", "toLowerCase", "match", "substring", "split", "indexOf",
|
||||
"parseFloat", "parseInt",
|
||||
"getYear", "getTime", "getMonth", "getFullYear", "getDay", "getDate",
|
||||
"exec", "join", "call", "floor", "toUTCString",
|
||||
|
||||
// events
|
||||
"onabort", "onafterprint", "onafterupdate", "onbeforecopy", "onbeforecut",
|
||||
"onbeforeeditfocus", "onbeforepaste", "onbeforeprint", "onbeforeunload",
|
||||
"onbeforeupdate", "onblur", "onbounce", "oncellchange", "onchange", "onclick",
|
||||
"oncontextmenu", "oncopy", "oncut", "ondataavailable", "ondatasetchanged", "ondatasetcomplete",
|
||||
"ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave", "ondragover",
|
||||
"ondragstart", "ondrop", "onerror", "onerrorupdate", "onfilterchange", "onfinish",
|
||||
"onfocus", "onhelp", "onkeydown", "onkeypress", "onkeyup", "onload",
|
||||
"onlosecapture", "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup",
|
||||
"onpaste", "onpropertychange", "onreset", "onresize", "onrowenter",
|
||||
"onrowexit", "onrowsdelete", "onrowsinserted", "onscroll", "onselect", "onselectstart",
|
||||
"onstart", "onstop", "onsubmit", "onunload",
|
||||
|
||||
// Ajax
|
||||
"XMLHttpRequest", "readyState", "onreadystatechange", "responseXML",
|
||||
"responseText", "responseBody", "statusText",
|
||||
"send", "abort", "setRequestHeader", "getResponseHeader", "getAllResponseHeaders",
|
||||
"timeout"
|
||||
};
|
||||
|
||||
public static final char[] DELIMITER = {'?', ':', '!', '=', '(', ')', '[', ']',
|
||||
'{', '}', '\r', '\n', '\t', ' ', '\"', '\'', '<', '>', ',', '.', '/',
|
||||
'\\', '+', '-', '*', '&', '|', '^', '%', ';'
|
||||
};
|
||||
|
||||
|
||||
public static final String[] alpha = {
|
||||
"m", "n", "q", "r", "s", "t", "u",
|
||||
"h", "i", "j", "k", "l", "o", "p",
|
||||
"d", "e", "f", "g", "a", "b", "c",
|
||||
"v", "w", "x", "y", "z", "$", "_"
|
||||
};
|
||||
|
||||
public static final HashSet exclusionTokenSet = new HashSet();
|
||||
public static final HashSet forceReplace = new HashSet();
|
||||
public static final HashSet forceReplaceInStrings = new HashSet();
|
||||
|
||||
public static final HashMap forceTextualReplace = new HashMap();
|
||||
|
||||
public static int ref = alpha.length;
|
||||
public static HashMap map = new HashMap();
|
||||
|
||||
public static final String ARG_EXCLUDE_TOKENS = "e=";
|
||||
public static final String ARG_DESTINATION_DIR = "d=";
|
||||
public static final String ARG_OBFUSCATE_STRING = "o=";
|
||||
public static final String ARG_DEBUG = "debug";
|
||||
public static final String ARG_DEBUGEXCLUDE = "debugnames";
|
||||
public static final String ARG_REPLACE = "textrepl=";
|
||||
|
||||
private double[] stringObfuscationParameter = {0, 0, 0.5};
|
||||
private String[] file = null;
|
||||
public static boolean isDebug = false;
|
||||
public static boolean isExcludeAll = false;
|
||||
private String destinationDir = null;
|
||||
private JSOState state = new JSOState();
|
||||
private String delimiter = new String(DELIMITER);
|
||||
private HashSet encounteredInStrings = new HashSet();
|
||||
private HashMap encounteredInStringsFiles = new HashMap();
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ArrayList fileList = new ArrayList(args.length);
|
||||
String[] file = null;
|
||||
String destinationDir = null;
|
||||
double[] stringObfuscationParameter = {1, .59, 0.5};
|
||||
|
||||
if (args.length == 0) {
|
||||
printUsage();
|
||||
return;
|
||||
} else if (args.length > 1) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
if( args[i].equals(ARG_DEBUG)) {
|
||||
isDebug = true;
|
||||
} else if( args[i].equals(ARG_DEBUGEXCLUDE) ) {
|
||||
isExcludeAll = true;
|
||||
} else if (args[i].startsWith(ARG_EXCLUDE_TOKENS)) {
|
||||
readexclusionTokenSet(args[i].substring(ARG_EXCLUDE_TOKENS.length()));
|
||||
} else if (args[i].startsWith(ARG_DESTINATION_DIR) && destinationDir == null) {
|
||||
File dir = new File(args[i].substring(ARG_DESTINATION_DIR.length()));
|
||||
if (!dir.exists() && !dir.mkdirs()) {
|
||||
System.err.println("Cannot create the output directory \"" + dir.getName() + "\"");
|
||||
return;
|
||||
} else if (dir.exists() && dir.isFile()) {
|
||||
System.err.println("The output parameter \"" + args[i] + "\" is not a directory");
|
||||
return;
|
||||
}
|
||||
destinationDir = dir.getAbsolutePath();
|
||||
} else if (args[i].startsWith(ARG_OBFUSCATE_STRING)) {
|
||||
String[] param = args[i].substring(ARG_OBFUSCATE_STRING.length()).split(",", 3);
|
||||
if (param.length >= 2) {
|
||||
try {
|
||||
stringObfuscationParameter[0] = Double.parseDouble(param[0]);
|
||||
stringObfuscationParameter[1] = Double.parseDouble(param[1]);
|
||||
if (param.length == 3) {
|
||||
stringObfuscationParameter[2] = Double.parseDouble(param[2]);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("The obfuscation parameters are not numbers.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
System.err.println("At least 2 obfuscation parameters are required, e.g. o=0.4,0.7.");
|
||||
return;
|
||||
}
|
||||
} else if( args[i].startsWith(ARG_REPLACE) ) {
|
||||
String[] param = args[i].substring(ARG_REPLACE.length()).split(",", 3);
|
||||
if (param.length == 2) {
|
||||
forceTextualReplace.put(param[0], param[1]);
|
||||
} else {
|
||||
System.err.println("2 parameters are required, e.g. textrepl=a,b");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
fileList.add(args[i]);
|
||||
}
|
||||
}
|
||||
file = new String[fileList.size()];
|
||||
fileList.toArray(file);
|
||||
} else {
|
||||
file = new String[]{args[0]};
|
||||
}
|
||||
addexclusionTokenSet(reserved);
|
||||
addexclusionTokenSet(builtIn);
|
||||
|
||||
JSO obfuscator = new JSO(file, destinationDir, stringObfuscationParameter);
|
||||
obfuscator.run();
|
||||
}
|
||||
|
||||
private static void printUsage() {
|
||||
System.err.println("Usage: java JSO <list of javascript file> [options]");
|
||||
System.err.println("");
|
||||
System.err.println("where the options are:");
|
||||
System.err.println("\te=<exception list file>");
|
||||
System.err.println("\t\t- filename of the exception list");
|
||||
System.err.println("\t\t- exception tokens are delimited by tab, space, dot, comma, ");
|
||||
System.err.println("\t\t single quote and double quote");
|
||||
System.err.println("\td=<destination directory>");
|
||||
System.err.println("\t\t- the output directory");
|
||||
System.err.println("\t\t- print to the STDOUT if not specified");
|
||||
System.err.println("\to=<obfuscation parameters of string literals>");
|
||||
System.err.println("\t\t- If it is specified, the characters in string literals will be ");
|
||||
System.err.println("\t\t encoded to either \\uXXXX (hexidemcial) or \\XXX (octal) format");
|
||||
System.err.println("\t\t- The parameters are a 2 or 3 floating point values delimited ");
|
||||
System.err.println(" by commas. e.g. 0.5,0.3 or 0.5,0.3,0.9");
|
||||
System.err.println("\t\t- The values are ");
|
||||
System.err.println("\t\t * probability to encode a string");
|
||||
System.err.println("\t\t * probability to encode a character in a candidate string");
|
||||
System.err.println("\t\t * probability to encode a character into \\uXXXX format");
|
||||
System.err.println("\t\t- The last parameter is set to 0.5 if not specified");
|
||||
System.err.println("");
|
||||
System.err.println("Press Enter to read the examples...");
|
||||
try{
|
||||
System.in.read();
|
||||
} catch (Exception e){}
|
||||
System.err.println("Examples:");
|
||||
System.err.println("");
|
||||
System.err.println(" Obfuscate all scripts in the current directory and output to ./out directory:");
|
||||
System.err.println("\tjava JSO *.js d=out");
|
||||
System.err.println("");
|
||||
System.err.println(" Pipe the STDOUT output to x.o.js:");
|
||||
System.err.println("\tjava JSO x.js > x.o.js ");
|
||||
System.err.println("");
|
||||
System.err.println(" Merge a.js and b.js and pipe the merged output to script.js. Tokens in ");
|
||||
System.err.println(" exception list, noReplace.txt will not be replaced:");
|
||||
System.err.println("\tjava JSO a.js b.js e=noReplace.txt > script.js");
|
||||
System.err.println("");
|
||||
System.err.println(" Obfuscate the 100% of string literals, 68% of the characters will be encoded. ");
|
||||
System.err.println(" 50% of the characters will be encoded as \\uXXXX format (default):");
|
||||
System.err.println("\tjava JSO x.js o=1,0.68");
|
||||
}
|
||||
|
||||
public JSO(String[] file, String destinationDir, double[] stringObfuscationParameter){
|
||||
this.file = file;
|
||||
this.destinationDir = destinationDir;
|
||||
if (stringObfuscationParameter != null && stringObfuscationParameter.length >= 2) {
|
||||
this.stringObfuscationParameter = stringObfuscationParameter;
|
||||
}
|
||||
}
|
||||
|
||||
public void run() throws IOException {
|
||||
for (int i = 0; i < file.length; i++) {
|
||||
BufferedReader in = new BufferedReader(new FileReader(file[i]));
|
||||
PrintWriter out = null;
|
||||
File f = new File(file[i]);
|
||||
|
||||
if (destinationDir == null) {
|
||||
out = new PrintWriter(System.out, true);
|
||||
} else {
|
||||
out = new PrintWriter(new FileWriter(new File(destinationDir + File.separator + f.getName())));
|
||||
}
|
||||
|
||||
this.obfuscate(in, out, f.getName());
|
||||
System.out.println("obfuscated " + f.getName());
|
||||
|
||||
in.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
|
||||
System.err.println( "Obfuscated" );
|
||||
System.err.println(map.toString().replace(',', '\n'));
|
||||
|
||||
encounteredInStrings.retainAll(map.keySet());
|
||||
System.err.println( "Not Obfuscated in strings:" );
|
||||
for( Iterator it = encounteredInStrings.iterator(); it.hasNext(); ) {
|
||||
String s = (String)it.next();
|
||||
System.err.println( "\t"+s+": " + (String)encounteredInStringsFiles.get(s) );
|
||||
}
|
||||
}
|
||||
|
||||
private void obfuscate(BufferedReader in, PrintWriter out, String fname) throws IOException {
|
||||
state.reset();
|
||||
|
||||
int line_counter = 0;
|
||||
for (String line = in.readLine(); line != null; line = in.readLine()) {
|
||||
line_counter++;
|
||||
if( !isDebug )
|
||||
line = line.trim();
|
||||
if (line.length() == 0) {
|
||||
if( isDebug )
|
||||
out.println();
|
||||
continue;
|
||||
}
|
||||
if( line.startsWith( "//-" ) ) {
|
||||
String[] toAdd = line.substring(3).split(",");
|
||||
for( int i = 0; i < toAdd.length; i++ )
|
||||
exclusionTokenSet.add(toAdd[i].trim());
|
||||
continue;
|
||||
} else if( line.startsWith("//+")) {
|
||||
String[] toAdd = line.substring(3).split(",");
|
||||
for( int i = 0; i < toAdd.length; i++ )
|
||||
forceReplace.add(toAdd[i].trim());
|
||||
continue;
|
||||
} else if( line.startsWith("//'")) {
|
||||
String[] toAdd = line.substring(3).split(",");
|
||||
for( int i = 0; i < toAdd.length; i++ ) {
|
||||
forceReplace.add(toAdd[i].trim());
|
||||
forceReplaceInStrings.add(toAdd[i].trim());
|
||||
}
|
||||
}
|
||||
|
||||
for( Iterator it = forceTextualReplace.keySet().iterator(); it.hasNext(); ) {
|
||||
String key = (String)it.next();
|
||||
line = line.replaceAll(key, (String)forceTextualReplace.get(key));
|
||||
}
|
||||
|
||||
StringTokenizer st = new StringTokenizer(line, delimiter, true);
|
||||
|
||||
if (st.hasMoreTokens()) {
|
||||
state.setToken(st.nextToken());
|
||||
}
|
||||
|
||||
for (; state.token != null; state.skipToken()) {
|
||||
if (st.hasMoreTokens()) {
|
||||
state.setNextToken(st.nextToken());
|
||||
} else {
|
||||
state.noToken();
|
||||
}
|
||||
|
||||
boolean doubleSlashed = state.flipFlags();
|
||||
if (doubleSlashed) {
|
||||
break;
|
||||
}
|
||||
|
||||
handleToken(out, fname, line_counter);
|
||||
}
|
||||
|
||||
if( isDebug )
|
||||
out.println();
|
||||
else if (!state.delimiter && !state.commented )
|
||||
out.print(" ");
|
||||
}
|
||||
}
|
||||
|
||||
private void handleToken(PrintWriter out, String fname, int line ) {
|
||||
if (state.token.length() > 0) {
|
||||
if (state.delimiter) {
|
||||
if (state.inString() && !state.backslashed && state.c != '\\' &&
|
||||
state.c != '\"' && state.c != '\'') {
|
||||
state.token = obfuscateQuotedString(state.token);
|
||||
}
|
||||
} else {
|
||||
if (state.inString()) {
|
||||
if( forceReplaceInStrings.contains(state.token) && canReplace(state.token) ) {
|
||||
state.token = generateToken(state.token);
|
||||
} else if( Character.isJavaIdentifierStart(state.token.charAt(0))) {
|
||||
encounteredInStrings.add(state.token);
|
||||
String s = (String)encounteredInStringsFiles.get(state.token);
|
||||
s = ( s == null ) ? "" : s + ", ";
|
||||
s += fname +"[" + line + "]";
|
||||
encounteredInStringsFiles.put(state.token, s);
|
||||
}
|
||||
if (!state.backslashed) {
|
||||
state.token = obfuscateQuotedString(state.token);
|
||||
}
|
||||
} else if( !state.commented ) {
|
||||
if(canReplace(state.token)){
|
||||
state.token = generateToken(state.token);
|
||||
} else if( state.token.length() > 0 && Character.isDigit( state.token.charAt(0) ) ) {
|
||||
try {
|
||||
int i = Integer.parseInt( state.token );
|
||||
double res = randomizer.nextDouble();
|
||||
int e = (int)(i * res);
|
||||
|
||||
if( i > 3 ) {
|
||||
if( res < 0.2 && i >= 16 )
|
||||
state.token = "0x"+Integer.toHexString(i);
|
||||
else if( res < 0.6 && i >= 8 )
|
||||
state.token = "0" + Integer.toOctalString(i);
|
||||
else
|
||||
state.token = "(" + e + "+" + (i-e) + ")";
|
||||
}
|
||||
|
||||
} catch( NumberFormatException ex ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!state.commented && (state.printToken || state.inString())) {
|
||||
out.print(state.token);
|
||||
}
|
||||
|
||||
if (state.c == '}' && !state.commented && !isDebug) {
|
||||
out.print(" ");
|
||||
}
|
||||
}
|
||||
|
||||
private static void readexclusionTokenSet(String file) throws IOException {
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new FileReader(file));
|
||||
for (String line = in.readLine(); line != null; line = in.readLine()) {
|
||||
StringTokenizer st = new StringTokenizer(line, "\t ,.\"\'");
|
||||
for (; st.hasMoreTokens();) {
|
||||
exclusionTokenSet.add(st.nextToken());
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String obfuscateQuotedString(String token) {
|
||||
if (randomizer.nextDouble() < stringObfuscationParameter[0]) {
|
||||
StringBuffer buffer = new StringBuffer(token.length());
|
||||
int n = token.length();
|
||||
int pos = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (randomizer.nextDouble() < stringObfuscationParameter[1]) {
|
||||
buffer.append(token.substring(pos, i));
|
||||
encode(token.charAt(i), buffer);
|
||||
pos = i + 1;
|
||||
}
|
||||
}
|
||||
if (pos < n) {
|
||||
buffer.append(token.substring(pos));
|
||||
}
|
||||
return buffer.toString();
|
||||
} else {
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
private void encode(char c, StringBuffer buffer) {
|
||||
if (randomizer.nextDouble() < stringObfuscationParameter[2] || c > 0777) {
|
||||
buffer.append("\\u");
|
||||
encode(c, 16, 4, buffer);
|
||||
} else {
|
||||
buffer.append("\\");
|
||||
encode(c, 8, 3, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
private void encode(char c, int radix, int length, StringBuffer buffer) {
|
||||
String value = Integer.toString(c, radix);
|
||||
int n = length - value.length();
|
||||
|
||||
if (n > 0) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
buffer.append('0');
|
||||
}
|
||||
buffer.append(value);
|
||||
} else {
|
||||
buffer.append(value.substring(-n));
|
||||
}
|
||||
}
|
||||
|
||||
private static String generateToken(String token) {
|
||||
if (map.containsKey(token)) {
|
||||
return (String) map.get(token);
|
||||
} else {
|
||||
String result = null;
|
||||
do {
|
||||
StringBuffer buffer = new StringBuffer(token.length());
|
||||
for (int i = ref; i > 0; i = i / alpha.length) {
|
||||
buffer.append(alpha[i % alpha.length]);
|
||||
}
|
||||
|
||||
ref++;
|
||||
result = buffer.toString();
|
||||
} while (exclusionTokenSet.contains(result) || map.containsValue(result));
|
||||
|
||||
map.put(token, result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean canReplace(String token) {
|
||||
if (token.length() <= 1 || token.charAt(0) == '$' )
|
||||
return false;
|
||||
if (map.containsKey(token))
|
||||
return true;
|
||||
if( isExcludeAll )
|
||||
return false;
|
||||
if( forceReplace.contains(token) )
|
||||
return true;
|
||||
if (exclusionTokenSet.contains(token) )
|
||||
return false;
|
||||
if (Character.isDigit(token.charAt(0)))
|
||||
return false;
|
||||
if( token.charAt(0) == '_' )
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void addexclusionTokenSet(String[] array) {
|
||||
if (array != null) {
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
if( exclusionTokenSet.contains(array[i]) )
|
||||
System.err.println( "warn, already excluded: " + array[i] );
|
||||
exclusionTokenSet.add(array[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDelimiter(String token) {
|
||||
if (token != null && token.length() > 0) {
|
||||
for (int i = 0; i < DELIMITER.length; i++) {
|
||||
if (token.charAt(0) == DELIMITER[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class JSOState {
|
||||
boolean dotted = false;
|
||||
boolean doubleQuoted = false;
|
||||
boolean singleQuoted = false;
|
||||
boolean backslashed = false;
|
||||
boolean commented = false;
|
||||
boolean printToken = true;
|
||||
boolean delimiter = false;
|
||||
|
||||
String token;
|
||||
String lastToken;
|
||||
String nextToken;
|
||||
|
||||
char c0 = 0;
|
||||
char c = 0;
|
||||
char c2 = 0;
|
||||
|
||||
void reset() {
|
||||
dotted = false;
|
||||
doubleQuoted = false;
|
||||
singleQuoted = false;
|
||||
backslashed = false;
|
||||
commented = false;
|
||||
printToken = true;
|
||||
delimiter = false;
|
||||
|
||||
token = null;
|
||||
lastToken = null;
|
||||
nextToken = null;
|
||||
|
||||
c0 = 0;
|
||||
c = 0;
|
||||
c2 = 0;
|
||||
}
|
||||
|
||||
boolean printable() {
|
||||
return !commented && (printToken || inString());
|
||||
}
|
||||
|
||||
boolean inString() {
|
||||
return doubleQuoted || singleQuoted;
|
||||
}
|
||||
|
||||
boolean delimiterSurrounded() {
|
||||
return !JSO.isDelimiter(nextToken) && !JSO.isDelimiter(lastToken);
|
||||
}
|
||||
|
||||
boolean isWhitespace(){
|
||||
return Character.isWhitespace(c);
|
||||
}
|
||||
|
||||
String setToken(String value) {
|
||||
String oldToken = lastToken;
|
||||
lastToken = token;
|
||||
token = value;
|
||||
nextToken = null;
|
||||
|
||||
if (value != null) {
|
||||
c0 = c;
|
||||
c = token == null ? 0 : token.charAt(0);
|
||||
c2 = 0;
|
||||
|
||||
backslashed = c0 == '\\';
|
||||
dotted = c0 == '.';
|
||||
delimiter = JSO.isDelimiter(token);
|
||||
printToken = true;
|
||||
}
|
||||
|
||||
return oldToken;
|
||||
}
|
||||
|
||||
String tokenBackslashed() {
|
||||
String result = null;
|
||||
int index = 0;
|
||||
if (c == 'u') {
|
||||
index = 4;
|
||||
} else if (Character.isDigit(c)) {
|
||||
index = 3;
|
||||
} else {
|
||||
throw new IllegalStateException("Token not backslashed or invalid JavaScript syntax.");
|
||||
}
|
||||
result = token.substring(0, index);
|
||||
token = token.substring(index);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void setNextToken(String value) {
|
||||
nextToken = value;
|
||||
c2 = value.charAt(0);
|
||||
}
|
||||
|
||||
void skipToken() {
|
||||
this.setToken(nextToken);
|
||||
}
|
||||
|
||||
void noToken() {
|
||||
nextToken = null;
|
||||
c2 = 0;
|
||||
}
|
||||
|
||||
boolean flipFlags() {
|
||||
if (isWhitespace()) {
|
||||
printToken = delimiterSurrounded() || JSO.isDebug;
|
||||
} else if (c == '/') {
|
||||
if (!commented && c2 == '/') {
|
||||
return true;
|
||||
} else if (!commented && c2 == '*' &&
|
||||
!inString()) {
|
||||
commented = true;
|
||||
} else if (commented && c0 == '*') {
|
||||
commented = false;
|
||||
printToken = false;
|
||||
}
|
||||
} else if (c == '\"' && !singleQuoted && !backslashed && !commented) {
|
||||
doubleQuoted = !doubleQuoted;
|
||||
} else if (c == '\'' && !doubleQuoted && !backslashed && !commented) {
|
||||
singleQuoted = !singleQuoted;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
var myAgent = "";
|
||||
var myVer = 0;
|
||||
var myRealAgent = "";
|
||||
|
||||
function detectAgent() {
|
||||
var AGENTS = ["opera","msie","safari","firefox","netscape","mozilla"];
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
for (var i = 0; i < AGENTS.length; i++) {
|
||||
var agentStr = AGENTS[i];
|
||||
if (agent.indexOf(agentStr) != -1) {
|
||||
myAgent = agentStr;
|
||||
if (!window.RegExp)
|
||||
break;
|
||||
|
||||
var versionExpr = new RegExp(agentStr + "[ \/]?([0-9]+(\.[0-9]+)?)");
|
||||
if (versionExpr.exec(agent) != null) {
|
||||
myVer = parseFloat(RegExp.$1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
myRealAgent = myAgent;
|
||||
if( navigator.product == "Gecko")
|
||||
myAgent = "moz";
|
||||
}
|
||||
detectAgent();
|
||||
|
||||
function getEl(name) {
|
||||
return document.getElementById(name);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE project [<!ENTITY buildfile SYSTEM "file:./build-user.xml">]>
|
||||
|
||||
<project basedir="." default="update" name="Obfuscator">
|
||||
<property name="obfuscator.location" value="."/>
|
||||
<property name="webim.location" value="../164"/>
|
||||
|
||||
<target name="update" depends="build">
|
||||
<java classname="JSO" fork="true" error="${obfuscator.location}/bin/obfuscation.log">
|
||||
<arg value="${obfuscator.location}/common.js"/>
|
||||
<arg value="${obfuscator.location}/chat.js"/>
|
||||
<arg value="${obfuscator.location}/users.js"/>
|
||||
<arg value="${obfuscator.location}/brws.js"/>
|
||||
<arg value="${obfuscator.location}/soundcheck.js"/>
|
||||
<arg value="d=${webim.location}"/>
|
||||
<!-- <arg value="debug"/> -->
|
||||
<!-- <arg value="debugnames"/> -->
|
||||
<arg value="o=0,0"/>
|
||||
<classpath>
|
||||
<pathelement location="${obfuscator.location}/bin/"/>
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="init">
|
||||
<javac destdir="${obfuscator.location}/bin" fork="false">
|
||||
<src path="${obfuscator.location}"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="init">
|
||||
<mkdir dir="${obfuscator.location}/bin"/>
|
||||
</target>
|
||||
|
||||
</project>
|
@ -1,389 +0,0 @@
|
||||
var FrameUtils = {
|
||||
getDocument: function(frm) {
|
||||
if (frm.contentDocument) {
|
||||
return frm.contentDocument;
|
||||
} else if (frm.contentWindow) {
|
||||
return frm.contentWindow.document;
|
||||
} else if (frm.document) {
|
||||
return frm.document;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
initFrame: function(frm) {
|
||||
var doc = this.getDocument(frm);
|
||||
doc.open();
|
||||
doc.write("<html><head>");
|
||||
doc.write("<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\""+Chat.cssfile+"\">");
|
||||
doc.write("</head><body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400'>");
|
||||
doc.write("<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message' id='content'></td></tr></table><a id='bottom'></a>");
|
||||
doc.write("</body></html>");
|
||||
doc.close();
|
||||
frm.onload = function() {
|
||||
if( frm./**/myHtml ) {
|
||||
FrameUtils.getDocument(frm).getElementById('content').innerHTML += frm.myHtml;
|
||||
FrameUtils.scrollDown(frm);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
insertIntoFrame: function(frm, htmlcontent) {
|
||||
var vcontent = this.getDocument(frm).getElementById('content');
|
||||
if( vcontent == null ) {
|
||||
if( !frm.myHtml ) frm.myHtml = "";
|
||||
frm.myHtml += htmlcontent;
|
||||
} else {
|
||||
vcontent.innerHTML += htmlcontent;
|
||||
}
|
||||
},
|
||||
|
||||
scrollDown: function(frm) {
|
||||
var vbottom = this.getDocument(frm).getElementById('bottom');
|
||||
if( myAgent == 'opera' ) {
|
||||
try {
|
||||
frm.contentWindow.scrollTo(0,this.getDocument(frm).getElementById('content').clientHeight);
|
||||
} catch(e) {}
|
||||
}
|
||||
if( vbottom ) {
|
||||
vbottom.scrollIntoView(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Ajax.ChatThreadUpdater = Class.create();
|
||||
Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
|
||||
initialize: function(_options) {
|
||||
this.setOptions(_options);
|
||||
this._options.onComplete = this.requestComplete.bind(this);
|
||||
this._options.onException = this.handleException.bind(this);
|
||||
this._options.onTimeout = this.handleTimeout.bind(this);
|
||||
this._options.timeout = 5000;
|
||||
this.updater = {};
|
||||
this.frequency = (this._options.frequency || 2);
|
||||
this.lastupdate = 0;
|
||||
this.cansend = true;
|
||||
this.skipNextsound = true;
|
||||
this.focused = true;
|
||||
this.ownThread = this._options.message != null;
|
||||
FrameUtils.initFrame(this._options.container);
|
||||
if( this._options.message ) {
|
||||
this._options.message.onkeydown = this.handleKeyDown.bind(this);
|
||||
this._options.message.onfocus = (function() { this.focused = true; }).bind(this);
|
||||
this._options.message.onblur = (function() { this.focused = false; }).bind(this)
|
||||
}
|
||||
this.update();
|
||||
},
|
||||
|
||||
handleException: function(_request, ex) {
|
||||
this.setStatus("offline, reconnecting");
|
||||
this.stopUpdate();
|
||||
this.timer = setTimeout(this.update.bind(this), 1000);
|
||||
},
|
||||
|
||||
handleTimeout: function(_request) {
|
||||
this.setStatus("timeout, reconnecting");
|
||||
this.stopUpdate();
|
||||
this.timer = setTimeout(this.update.bind(this), 1000);
|
||||
},
|
||||
|
||||
updateOptions: function(act) {
|
||||
this._options.parameters = 'act='+act+'&thread=' + (this._options.threadid || 0) +
|
||||
'&token=' + (this._options.token || 0)+
|
||||
'&lastid=' + (this._options.lastid || 0);
|
||||
if( this._options.user )
|
||||
this._options.parameters += "&user=true";
|
||||
if( act == 'refresh' && this._options.message && this._options.message.value != '' )
|
||||
this._options.parameters += "&typed=1";
|
||||
},
|
||||
|
||||
enableInput: function(val) {
|
||||
if( this._options.message )
|
||||
this._options.message.disabled = !val;
|
||||
},
|
||||
|
||||
stopUpdate: function() {
|
||||
this.enableInput(true);
|
||||
if( this.updater._options )
|
||||
this.updater._options.onComplete = undefined;
|
||||
clearTimeout(this.timer);
|
||||
},
|
||||
|
||||
update: function() {
|
||||
this.updateOptions("refresh");
|
||||
this.updater = new Ajax.Request(this._options.servl, this._options);
|
||||
},
|
||||
|
||||
requestComplete: function(_response) {
|
||||
try {
|
||||
this.enableInput(true);
|
||||
this.cansend = true;
|
||||
var xmlRoot = Ajax.getXml(_response);
|
||||
if( xmlRoot && xmlRoot.tagName == 'thread' ) {
|
||||
this.updateContent( xmlRoot );
|
||||
} else {
|
||||
this.handleError(_response, xmlRoot, 'refresh messages failed');
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
this.skipNextsound = false;
|
||||
this.timer = setTimeout(this.update.bind(this), this.frequency * 1000);
|
||||
},
|
||||
|
||||
postMessage: function(msg) {
|
||||
if( msg == "" || !this.cansend) {
|
||||
return;
|
||||
}
|
||||
this.cansend = false;
|
||||
this.stopUpdate();
|
||||
this.skipNextsound = true;
|
||||
this.updateOptions("post");
|
||||
var postOptions = {}.extend(this._options);
|
||||
postOptions.parameters += "&message=" + encodeURIComponent(msg);
|
||||
postOptions.onComplete = (function(presponse) {
|
||||
this.requestComplete( presponse );
|
||||
if( this._options.message ) {
|
||||
this._options.message.value = '';
|
||||
this._options.message.focus();
|
||||
}
|
||||
}).bind(this);
|
||||
if( myRealAgent != 'opera' )
|
||||
this.enableInput(false);
|
||||
this.updater = new Ajax.Request(this._options.servl, postOptions);
|
||||
},
|
||||
|
||||
changeName: function(newname) {
|
||||
this.skipNextsound = true;
|
||||
new Ajax.Request(this._options.servl, {parameters:'act=rename&thread=' + (this._options.threadid || 0) +
|
||||
'&token=' + (this._options.token || 0) + '&name=' + encodeURIComponent(newname)});
|
||||
},
|
||||
|
||||
onThreadClosed: function(_response) {
|
||||
var xmlRoot = Ajax.getXml(_response);
|
||||
if( xmlRoot && xmlRoot.tagName == 'closed' ) {
|
||||
setTimeout('window.close()', 2000);
|
||||
} else {
|
||||
this.handleError(_response, xmlRoot, 'cannot close');
|
||||
}
|
||||
},
|
||||
|
||||
closeThread: function() {
|
||||
var _params = 'act=close&thread=' + (this._options.threadid || 0) + '&token=' + (this._options.token || 0);
|
||||
if( this._options.user )
|
||||
_params += "&user=true";
|
||||
new Ajax.Request(this._options.servl, {parameters:_params, onComplete: this.onThreadClosed.bind(this)});
|
||||
},
|
||||
|
||||
processMessage: function(_target, message) {
|
||||
var destHtml = NodeUtils.getNodeText(message);
|
||||
FrameUtils.insertIntoFrame(_target, destHtml );
|
||||
},
|
||||
|
||||
showTyping: function(istyping) {
|
||||
if( $("typingdiv") ) {
|
||||
$("typingdiv").style.display=istyping ? 'inline' : 'none';
|
||||
}
|
||||
},
|
||||
|
||||
setupAvatar: function(avatar) {
|
||||
var imageLink = NodeUtils.getNodeText(avatar);
|
||||
if( this._options.avatar && this._options.user ) {
|
||||
this._options.avatar.innerHTML = imageLink != ""
|
||||
? "<img src=\""+Chat.webimRoot+"/images/free.gif\" width=\"7\" height=\"1\" border=\"0\" alt=\"\" /><img src=\""
|
||||
+imageLink+ "\" border=\"0\" alt=\"\"/>"
|
||||
: "";
|
||||
}
|
||||
},
|
||||
|
||||
updateContent: function(xmlRoot) {
|
||||
var haveMessage = false;
|
||||
|
||||
var result_div = this._options.container;
|
||||
var _lastid = NodeUtils.getAttrValue(xmlRoot, "lastid");
|
||||
if( _lastid ) {
|
||||
this._options.lastid = _lastid;
|
||||
}
|
||||
|
||||
var typing = NodeUtils.getAttrValue(xmlRoot, "typing");
|
||||
if( typing ) {
|
||||
this.showTyping(typing == '1');
|
||||
}
|
||||
|
||||
var canpost = NodeUtils.getAttrValue(xmlRoot, "canpost");
|
||||
if( canpost ) {
|
||||
if( canpost == '1' && !this.ownThread || this.ownThread && canpost != '1' ) {
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
}
|
||||
|
||||
for( var i = 0; i < xmlRoot.childNodes.length; i++ ) {
|
||||
var node = xmlRoot.childNodes[i];
|
||||
if( node.tagName == 'message' ) {
|
||||
haveMessage = true;
|
||||
this.processMessage(result_div, node);
|
||||
} else if( node.tagName == 'avatar' ) {
|
||||
this.setupAvatar(node);
|
||||
}
|
||||
}
|
||||
if(window.location.search.indexOf('trace=on')>=0) {
|
||||
var val = "updated";
|
||||
if(this.lastupdate > 0) {
|
||||
var seconds = ((new Date()).getTime() - this.lastupdate)/1000;
|
||||
val = val + ", " + seconds + " secs";
|
||||
if(seconds > 10) {
|
||||
alert(val);
|
||||
}
|
||||
}
|
||||
this.lastupdate = (new Date()).getTime();
|
||||
this.setStatus(val);
|
||||
} else {
|
||||
this.clearStatus();
|
||||
}
|
||||
if( haveMessage ) {
|
||||
FrameUtils.scrollDown(this._options.container);
|
||||
if(!this.skipNextsound) {
|
||||
var tsound = $('soundimg');
|
||||
if(tsound == null || tsound.className.match(new RegExp("\\bisound\\b")) ) {
|
||||
playSound(Chat.webimRoot+'/sounds/new_message.wav');
|
||||
}
|
||||
}
|
||||
if( !this.focused ) {
|
||||
window.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
isSendkey: function(ctrlpressed, key) {
|
||||
return ((key==13 && (ctrlpressed || this._options.ignorectrl)) || (key==10));
|
||||
},
|
||||
|
||||
handleKeyDown: function(k) {
|
||||
if( k ){ ctrl=k.ctrlKey;k=k.which; } else { k=event.keyCode;ctrl=event.ctrlKey; }
|
||||
if( this._options.message && this.isSendkey(ctrl, k) ) {
|
||||
var mmsg = this._options.message.value;
|
||||
if( this._options.ignorectrl ) {
|
||||
mmsg = mmsg.replace(/[\r\n]+$/,'');
|
||||
}
|
||||
this.postMessage( mmsg );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
handleError: function(_response, xmlRoot, _action) {
|
||||
if( xmlRoot && xmlRoot.tagName == 'error' ) {
|
||||
this.setStatus(NodeUtils.getNodeValue(xmlRoot,"descr"));
|
||||
} else {
|
||||
this.setStatus("reconnecting");
|
||||
}
|
||||
},
|
||||
|
||||
showStatusDiv: function(k) {
|
||||
if( $("engineinfo") ) {
|
||||
$("engineinfo").style.display='inline';
|
||||
$("engineinfo").innerHTML = k;
|
||||
}
|
||||
},
|
||||
|
||||
setStatus: function(k) {
|
||||
if( this.statusTimeout )
|
||||
clearTimeout(this.statusTimeout);
|
||||
this.showStatusDiv(k);
|
||||
this.statusTimeout = setTimeout(this.clearStatus.bind(this), 4000);
|
||||
},
|
||||
|
||||
clearStatus: function() {
|
||||
$("engineinfo").style.display='none';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var Chat = {
|
||||
threadUpdater : {},
|
||||
|
||||
applyName: function() {
|
||||
Chat.threadUpdater.changeName($('uname').value);
|
||||
$('changename1').style.display='none';
|
||||
$('changename2').style.display='inline';
|
||||
$('unamelink').innerHTML = htmlescape($('uname').value);
|
||||
},
|
||||
|
||||
showNameField: function() {
|
||||
$('changename1').style.display='inline';
|
||||
$('changename2').style.display='none';
|
||||
}
|
||||
};
|
||||
|
||||
Behaviour.register({
|
||||
'#postmessage a' : function(el) {
|
||||
el.onclick = function() {
|
||||
var message = $('msgwnd');
|
||||
if( message )
|
||||
Chat.threadUpdater.postMessage(message.value);
|
||||
};
|
||||
},
|
||||
'select#predefined' : function(el) {
|
||||
el.onchange = function() {
|
||||
var message = $('msgwnd');
|
||||
if(this.selectedIndex!=0) {
|
||||
message.value = this.options[this.selectedIndex].innerText || this.options[this.selectedIndex].innerHTML;
|
||||
}
|
||||
this.selectedIndex = 0;
|
||||
message.focus();
|
||||
};
|
||||
},
|
||||
'div#changename2 a' : function(el) {
|
||||
el.onclick = function() {
|
||||
Chat.showNameField();
|
||||
return false;
|
||||
};
|
||||
},
|
||||
'div#changename1 a' : function(el) {
|
||||
el.onclick = function() {
|
||||
Chat.applyName();
|
||||
return false;
|
||||
};
|
||||
},
|
||||
'div#changename1 input#uname' : function(el) {
|
||||
el.onkeydown = function(e) {
|
||||
var ev = e || event;
|
||||
if( ev.keyCode == 13 ) {
|
||||
Chat.applyName();
|
||||
}
|
||||
};
|
||||
},
|
||||
'a#refresh' : function(el) {
|
||||
el.onclick = function() {
|
||||
Chat.threadUpdater.stopUpdate();
|
||||
Chat.threadUpdater.update();
|
||||
};
|
||||
},
|
||||
'a#togglesound' : function(el) {
|
||||
el.onclick = function() {
|
||||
var tsound = $('soundimg');
|
||||
if(!tsound) {
|
||||
return;
|
||||
}
|
||||
if(tsound.className.match(new RegExp("\\bisound\\b"))) {
|
||||
tsound.className = "tplimage inosound";
|
||||
} else {
|
||||
tsound.className = "tplimage isound";
|
||||
}
|
||||
var messagePane = $('msgwnd');
|
||||
if(messagePane)
|
||||
messagePane.focus();
|
||||
};
|
||||
},
|
||||
'a.closethread' : function(el) {
|
||||
el.onclick = function() {
|
||||
Chat.threadUpdater.closeThread();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
EventHelper.register(window, 'onload', function(){
|
||||
Chat.webimRoot = threadParams.wroot;
|
||||
Chat.cssfile = threadParams.cssfile;
|
||||
Chat.threadUpdater = new Ajax.ChatThreadUpdater(({ignorectrl:-1,container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} ));
|
||||
});
|
@ -1,516 +0,0 @@
|
||||
/*
|
||||
* Mibew Messenger common script
|
||||
* http://sourceforge.net/projects/webim
|
||||
*
|
||||
* Based on Prototype JavaScript framework, version 1.3.1
|
||||
* http://prototype.conio.net/ (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*/
|
||||
|
||||
//- getEl, myAgent, myRealAgent
|
||||
|
||||
//- localized
|
||||
|
||||
//- onComplete, showonline
|
||||
//- threadParams, servl, frequency, user, threadid, token, cssfile
|
||||
//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus
|
||||
|
||||
|
||||
var Class = {
|
||||
create: function() {
|
||||
return function() {
|
||||
this./**/initialize./**/apply(this, arguments);
|
||||
};
|
||||
},
|
||||
|
||||
inherit: function(child,parent,body) {
|
||||
Object./**/extend(Object.extend(child.prototype, parent.prototype), body );
|
||||
}
|
||||
};
|
||||
|
||||
Object.extend = function(destination, source) {
|
||||
for (property in source) {
|
||||
destination[property] = source[property];
|
||||
}
|
||||
return destination;
|
||||
};
|
||||
|
||||
Object.prototype.extend = function(_object) {
|
||||
return Object.extend.apply(this, [this, _object]);
|
||||
};
|
||||
|
||||
Function.prototype./**/bind = function(_object) {
|
||||
var __method = this;
|
||||
return function() {
|
||||
return __method.apply(_object, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
Function.prototype./**/bindAsEventListener = function(_object) {
|
||||
var __method = this;
|
||||
return function(event) {
|
||||
__method.call(_object, event || window.event);
|
||||
}
|
||||
};
|
||||
|
||||
Number.prototype./**/toColorPart = function() {
|
||||
var digits = this.toString(16);
|
||||
if (this < 16) return '0' + digits;
|
||||
return digits;
|
||||
};
|
||||
|
||||
var Try = {
|
||||
these: function() {
|
||||
var returnValue;
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var lambda = arguments[i];
|
||||
try {
|
||||
returnValue = lambda();
|
||||
break;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var PeriodicalExecuter = Class.create();
|
||||
PeriodicalExecuter.prototype = {
|
||||
initialize: function(callback, frequency) {
|
||||
this.callback = callback;
|
||||
this.frequency = frequency;
|
||||
this./**/currentlyExecuting = false;
|
||||
|
||||
this./**/registerCallback();
|
||||
},
|
||||
|
||||
registerCallback: function() {
|
||||
setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
|
||||
},
|
||||
|
||||
onTimerEvent: function() {
|
||||
if (!this.currentlyExecuting) {
|
||||
try {
|
||||
this.currentlyExecuting = true;
|
||||
this.callback();
|
||||
} finally {
|
||||
this.currentlyExecuting = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
function findObj( id )
|
||||
{
|
||||
var x;
|
||||
if( !( x = document[ id ] ) && document.all ) x = document.all[ id ];
|
||||
if( !x && document.getElementById ) x = document.getElementById( id );
|
||||
if( !x && !document.all && document.getElementsByName )
|
||||
{
|
||||
x = document.getElementsByName( id );
|
||||
if( x.length == 0 ) return null;
|
||||
if( x.length == 1 ) return x[ 0 ];
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
if (!Array.prototype./**/push) {
|
||||
Array.prototype.push = function() {
|
||||
var startLength = this.length;
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
this[startLength + i] = arguments[i];
|
||||
return this.length;
|
||||
};
|
||||
}
|
||||
|
||||
function $() {
|
||||
var elems = new Array();
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var elem = arguments[i];
|
||||
if (typeof elem == 'string')
|
||||
elem = findObj(elem);
|
||||
|
||||
if (arguments.length == 1)
|
||||
return elem;
|
||||
|
||||
elems.push(elem);
|
||||
}
|
||||
|
||||
return elems;
|
||||
}
|
||||
|
||||
var Ajax = {
|
||||
getTransport: function() {
|
||||
return Try.these(
|
||||
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
||||
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
|
||||
function() {return new XMLHttpRequest()}
|
||||
) || false;
|
||||
},
|
||||
|
||||
getXml: function(_response) {
|
||||
if( _response &&
|
||||
_response.status >= 200 &&
|
||||
_response.status < 300 ) {
|
||||
var xmlDoc = _response.responseXML;
|
||||
if( xmlDoc && xmlDoc.documentElement )
|
||||
return xmlDoc.documentElement;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
getError: function(_response) {
|
||||
return _response.statusText || "connection error N" + _response.status;
|
||||
},
|
||||
|
||||
emptyFunction: function() {}
|
||||
};
|
||||
|
||||
Ajax./**/Base = function() {};
|
||||
Ajax.Base.prototype = {
|
||||
setOptions: function(_options) {
|
||||
this._options = {
|
||||
_method: 'post',
|
||||
asynchronous: true,
|
||||
parameters: ''
|
||||
}.extend(_options || {});
|
||||
},
|
||||
|
||||
getStatus: function() {
|
||||
try {
|
||||
return this.transport.status || 0;
|
||||
} catch (e) { return 0 }
|
||||
},
|
||||
|
||||
responseIsSuccess: function() {
|
||||
var status = this.getStatus();
|
||||
return !status || (status >= 200 && status < 300);
|
||||
},
|
||||
|
||||
responseIsFailure: function() {
|
||||
return !this.responseIsSuccess();
|
||||
}
|
||||
};
|
||||
|
||||
Ajax./**/Request = Class.create();
|
||||
Ajax.Request./**/Events =
|
||||
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
||||
|
||||
Class.inherit( Ajax.Request, Ajax.Base, {
|
||||
initialize: function(url, _options) {
|
||||
this.transport = Ajax.getTransport();
|
||||
this.setOptions(_options);
|
||||
this.transportTimer = {};
|
||||
this.finished = false;
|
||||
this.request(url);
|
||||
},
|
||||
|
||||
request: function(url) {
|
||||
var parameters = this._options.parameters || '';
|
||||
if (parameters.length > 0) parameters += '&_=';
|
||||
|
||||
try {
|
||||
if (this._options._method == 'get' && parameters.length > 0)
|
||||
url += '?' + parameters;
|
||||
|
||||
this.transport.open(this._options._method.toUpperCase(), url, this._options.asynchronous);
|
||||
|
||||
if (this._options.asynchronous) {
|
||||
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
||||
if(this._options.timeout) {
|
||||
this.transportTimer = setTimeout(this.handleTimeout.bind(this), this._options.timeout);
|
||||
}
|
||||
}
|
||||
|
||||
this.setRequestHeaders();
|
||||
|
||||
var pbody = this._options.postBody ? this._options.postBody : parameters;
|
||||
this.transport.send(this._options._method == 'post' ? pbody : null);
|
||||
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
},
|
||||
|
||||
setRequestHeaders: function() {
|
||||
var requestHeaders =
|
||||
['X-Requested-With', 'XMLHttpRequest'];
|
||||
|
||||
if (this._options._method == 'post') {
|
||||
requestHeaders.push('Content-type',
|
||||
'application/x-www-form-urlencoded');
|
||||
|
||||
/* Force "Connection: close" for older Mozilla browsers to work
|
||||
* around a bug where XMLHttpRequest sends an incorrect
|
||||
* Content-length header. See Mozilla Bugzilla #246651.
|
||||
*/
|
||||
if (this.transport.overrideMimeType &&
|
||||
(navigator.userAgent.match("/Gecko\/(\d{4})/") || [0,2005])[1] < 2005)
|
||||
requestHeaders.push('Connection', 'close');
|
||||
}
|
||||
|
||||
if (this._options.requestHeaders)
|
||||
requestHeaders.push.apply(requestHeaders, this._options.requestHeaders);
|
||||
|
||||
for (var i = 0; i < requestHeaders.length; i += 2)
|
||||
this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
|
||||
},
|
||||
|
||||
onStateChange: function() {
|
||||
var readystate = this.transport.readyState;
|
||||
if (readystate != 1)
|
||||
this.respondToReadyState(this.transport.readyState);
|
||||
},
|
||||
|
||||
handleTimeout: function() {
|
||||
if(this.finished) { return; }
|
||||
this.finished = true;
|
||||
(this._options.onTimeout || Ajax.emptyFunction)(this);
|
||||
},
|
||||
|
||||
respondToReadyState: function(readystate) {
|
||||
var event = Ajax.Request.Events[readystate];
|
||||
|
||||
if (event == 'Complete') {
|
||||
try {
|
||||
if(!this.finished) {
|
||||
this.finished = true;
|
||||
if(this._options.timeout) { clearTimeout(this.transportTimer); }
|
||||
(this._options.onComplete || Ajax.emptyFunction)(this.transport);
|
||||
}
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
|
||||
/* Avoid memory leak in MSIE: clean up the oncomplete event handler */
|
||||
this.transport.onreadystatechange = Ajax.emptyFunction;
|
||||
}
|
||||
},
|
||||
|
||||
dispatchException: function(exception) {
|
||||
(this._options.onException || Ajax.emptyFunction)(this, exception);
|
||||
}
|
||||
});
|
||||
|
||||
var EventHelper = {
|
||||
register : function(obj, ev,func){
|
||||
var oldev = obj[ev];
|
||||
|
||||
if (typeof oldev != 'function') {
|
||||
obj[ev] = func;
|
||||
} else {
|
||||
obj[ev] = function() {
|
||||
oldev();
|
||||
func();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work
|
||||
of Simon Willison (see comments by Simon below).
|
||||
http://ripcord.co.nz/behaviour/
|
||||
*/
|
||||
|
||||
var Behaviour = {
|
||||
list : new Array,
|
||||
|
||||
register : function(sheet){
|
||||
Behaviour.list.push(sheet);
|
||||
},
|
||||
|
||||
init : function(){
|
||||
EventHelper.register(window, 'onload', function(){
|
||||
Behaviour.apply();
|
||||
});
|
||||
},
|
||||
|
||||
apply : function(){
|
||||
for (h=0;sheet=Behaviour.list[h];h++){
|
||||
for (selector in sheet) {
|
||||
list = document.getElementsBySelector(selector);
|
||||
if (!list)
|
||||
continue;
|
||||
for( i = 0; element = list[i]; i++ ) {
|
||||
sheet[selector]( element );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Behaviour.init();
|
||||
|
||||
function getAllChildren(e) {
|
||||
// Returns all children of element. Workaround required for IE5/Windows. Ugh.
|
||||
return e.all ? e.all : e.getElementsByTagName('*');
|
||||
}
|
||||
|
||||
document.getElementsBySelector = function(selector) {
|
||||
// Attempt to fail gracefully in lesser browsers
|
||||
if (!document.getElementsByTagName) {
|
||||
return new Array();
|
||||
}
|
||||
// Split selector in to tokens
|
||||
var tokens = selector.split(' ');
|
||||
var currentContext = new Array(document);
|
||||
for (var i = 0; i < tokens.length; i++) {
|
||||
token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
|
||||
if (token.indexOf('#') > -1) {
|
||||
// Token is an ID selector
|
||||
var bits = token.split('#');
|
||||
var tag_name = bits[0];
|
||||
var id = bits[1];
|
||||
var element = document.getElementById(id);
|
||||
if (element == null || tag_name && element.nodeName.toLowerCase() != tag_name ) {
|
||||
// tag with that ID not found, return false
|
||||
return new Array();
|
||||
}
|
||||
// Set currentContext to contain just this element
|
||||
currentContext = new Array(element);
|
||||
continue; // Skip to next token
|
||||
}
|
||||
if (token.indexOf('.') > -1) {
|
||||
// Token contains a class selector
|
||||
var bits = token.split('.');
|
||||
var tag_name = bits[0];
|
||||
var class_name = bits[1];
|
||||
if (!tag_name) {
|
||||
tag_name = '*';
|
||||
}
|
||||
// Get elements matching tag, filter them for class selector
|
||||
var found = new Array;
|
||||
var foundCount = 0;
|
||||
for (var h = 0; h < currentContext.length; h++) {
|
||||
var elements;
|
||||
if (tag_name == '*') {
|
||||
elements = getAllChildren(currentContext[h]);
|
||||
} else {
|
||||
elements = currentContext[h].getElementsByTagName(tag_name);
|
||||
}
|
||||
if( elements == null )
|
||||
continue;
|
||||
for (var j = 0; j < elements.length; j++) {
|
||||
found[foundCount++] = elements[j];
|
||||
}
|
||||
}
|
||||
currentContext = new Array;
|
||||
var currentContextIndex = 0;
|
||||
for (var k = 0; k < found.length; k++) {
|
||||
if (found[k].className && found[k].className.match(new RegExp("\\b"+class_name+"\\b"))) {
|
||||
currentContext[currentContextIndex++] = found[k];
|
||||
}
|
||||
}
|
||||
continue; // Skip to next token
|
||||
}
|
||||
|
||||
// [evgeny] code for attribute selection is removed...
|
||||
|
||||
if (!currentContext[0]){
|
||||
return;
|
||||
}
|
||||
|
||||
// If we get here, token is JUST an element (not a class or ID selector)
|
||||
tag_name = token;
|
||||
var found = new Array;
|
||||
var foundCount = 0;
|
||||
for (var h = 0; h < currentContext.length; h++) {
|
||||
var elements = currentContext[h].getElementsByTagName(tag_name);
|
||||
for (var j = 0; j < elements.length; j++) {
|
||||
found[foundCount++] = elements[j];
|
||||
}
|
||||
}
|
||||
currentContext = found;
|
||||
}
|
||||
return currentContext;
|
||||
};
|
||||
|
||||
var NodeUtils = {
|
||||
|
||||
getNodeValue: function(parent,name) {
|
||||
var nodes = parent.getElementsByTagName( name );
|
||||
if( nodes.length == 0 )
|
||||
return "";
|
||||
nodes = nodes[0].childNodes;
|
||||
var reslt = "";
|
||||
for( i = 0; i < nodes.length; i++ )
|
||||
reslt += nodes[i].nodeValue;
|
||||
return reslt;
|
||||
},
|
||||
|
||||
getNodeText: function(_node) {
|
||||
var _nodes = _node.childNodes;
|
||||
var _text = "";
|
||||
for( i = 0; i < _nodes.length; i++ )
|
||||
_text += _nodes[i].nodeValue;
|
||||
return _text;
|
||||
},
|
||||
|
||||
getAttrValue: function(parent,name) {
|
||||
for( k=0; k < parent.attributes.length; k++ )
|
||||
if( parent.attributes[k].nodeName == name )
|
||||
return parent.attributes[k].nodeValue;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
var CommonUtils = {
|
||||
getRow: function(_id,_table) {
|
||||
var _row = _table.rows[_id];
|
||||
if( _row != null )
|
||||
return _row;
|
||||
if( _table.rows['head'] != null )
|
||||
return null;
|
||||
|
||||
for( k=0; k < _table.rows.length; k++ ) {
|
||||
if( _table.rows[k].id == _id )
|
||||
return _table.rows[k];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
getCell: function(_id,_row,_table) {
|
||||
var _cell = _row.cells[_id];
|
||||
if( _cell != null )
|
||||
return _cell;
|
||||
if( _table.rows['head'] != null )
|
||||
return null;
|
||||
for( k=0; k < _row.cells.length; k++ ) {
|
||||
if( _row.cells[k].id == _id )
|
||||
return _row.cells[k];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
insertCell: function(_row,_id,_className,_align,_height, _inner) {
|
||||
var cell = _row.insertCell(-1);
|
||||
cell.id = _id;
|
||||
if(_align)
|
||||
cell.align = _align;
|
||||
cell.className = _className;
|
||||
if(_height)
|
||||
cell.height = _height;
|
||||
cell.innerHTML = _inner;
|
||||
}
|
||||
};
|
||||
|
||||
function playSound(wav_file) {
|
||||
var player = document.createElement("div");
|
||||
var agt = navigator.userAgent.toLowerCase();
|
||||
if(agt.indexOf('opera') != -1) {
|
||||
player.style = "position: absolute; left: 0px; top: -200px;";
|
||||
}
|
||||
document.body.appendChild(player);
|
||||
player.innerHTML = '<embed src="'+wav_file+'" hidden="true" autostart="true" loop="false">';
|
||||
}
|
||||
|
||||
function htmlescape(str) {
|
||||
return str.replace('&','&').replace('<','<').replace('>','>').replace('"','"');
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
Behaviour.register({
|
||||
'a#check-nv' : function(el) {
|
||||
el.onclick = function() {
|
||||
playSound(wroot + '/sounds/new_user.wav');
|
||||
};
|
||||
},
|
||||
'a#check-nm' : function(el) {
|
||||
el.onclick = function() {
|
||||
playSound(wroot + '/sounds/new_message.wav')
|
||||
};
|
||||
}
|
||||
});
|
@ -1,376 +0,0 @@
|
||||
Ajax.PeriodicalUpdater = Class.create();
|
||||
Class.inherit( Ajax.PeriodicalUpdater, Ajax.Base, {
|
||||
|
||||
initialize: function(_options) {
|
||||
this.setOptions(_options);
|
||||
this._options.onComplete = this.requestComplete.bind(this);
|
||||
this._options.onException = this.handleException.bind(this);
|
||||
this._options.onTimeout = this.handleTimeout.bind(this);
|
||||
this._options.timeout = 5000;
|
||||
this.frequency = (this._options.frequency || 2);
|
||||
this.updater = {};
|
||||
this.update();
|
||||
},
|
||||
|
||||
handleException: function(_request, ex) {
|
||||
if( this._options.handleError )
|
||||
this._options.handleError("offline, reconnecting");
|
||||
this.stopUpdate();
|
||||
this.timer = setTimeout(this.update.bind(this), 1000);
|
||||
},
|
||||
|
||||
handleTimeout: function(_request) {
|
||||
if( this._options.handleError )
|
||||
this._options.handleError("timeout, reconnecting");
|
||||
this.stopUpdate();
|
||||
this.timer = setTimeout(this.update.bind(this), 1000);
|
||||
},
|
||||
|
||||
stopUpdate: function() {
|
||||
if( this.updater._options )
|
||||
this.updater._options.onComplete = undefined;
|
||||
clearTimeout(this.timer);
|
||||
},
|
||||
|
||||
update: function() {
|
||||
if( this._options.updateParams )
|
||||
this._options.parameters = (this._options.updateParams)();
|
||||
this.updater = new Ajax.Request(this._options.url, this._options);
|
||||
},
|
||||
|
||||
requestComplete: function(presponse) {
|
||||
try {
|
||||
var xmlRoot = Ajax.getXml(presponse);
|
||||
if( xmlRoot ) {
|
||||
(this._options.updateContent || Ajax.emptyFunction)( xmlRoot );
|
||||
} else {
|
||||
if( this._options.handleError )
|
||||
this._options.handleError("reconnecting");
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
this.timer = setTimeout(this.update.bind(this), this.frequency * 1000);
|
||||
}
|
||||
});
|
||||
|
||||
var HtmlGenerationUtils = {
|
||||
|
||||
popupLink: function(link, title, wndid, inner, width, height,linkclass) {
|
||||
return '<a href="'+link+'"'+(linkclass != null ? ' class="'+linkclass+'"' : '')+' target="_blank" title="'+title+'" onclick="this.newWindow = window.open(\''+link+'\', \''+
|
||||
wndid+'\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width='+width+',height='+height+',resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;">'+
|
||||
inner+'</a>';
|
||||
},
|
||||
|
||||
generateOneRowTable: function(content) {
|
||||
return '<table class="inner"><tr>' + content + '</tr></table>';
|
||||
},
|
||||
|
||||
viewOpenCell: function(username,servlet,id,canview,canopen,ban,message,cantakenow) {
|
||||
var cellsCount = 2;
|
||||
var link = servlet+"?thread="+id;
|
||||
var gen = '<td>';
|
||||
if(canopen || canview ) {
|
||||
gen += HtmlGenerationUtils.popupLink( (cantakenow||!canview) ? link : link+"&viewonly=true", localized[canopen ? 0 : 1], "ImCenter"+id, username, 640, 480, null);
|
||||
} else {
|
||||
gen += '<a href="#">' + username + '</a>';
|
||||
}
|
||||
gen += '</td>';
|
||||
if( canopen ) {
|
||||
gen += '<td class="icon">';
|
||||
gen += HtmlGenerationUtils.popupLink( link, localized[0], "ImCenter"+id, '<img src="'+webimRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">', 640, 480, null);
|
||||
gen += '</td>';
|
||||
cellsCount++;
|
||||
}
|
||||
if( canview ) {
|
||||
gen += '<td class="icon">';
|
||||
gen += HtmlGenerationUtils.popupLink( link+"&viewonly=true", localized[1], "ImCenter"+id, '<img src="'+webimRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">', 640, 480, null);
|
||||
gen += '</td>';
|
||||
cellsCount++;
|
||||
}
|
||||
if( message != "" ) {
|
||||
gen += '</tr><tr><td class="firstmessage" colspan="'+cellsCount+'"><a href="javascript:void(0)" title="'+message+'" onclick="alert(this.title);return false;">';
|
||||
gen += message.length > 30 ? message.substring(0,30) + '...' : message;
|
||||
gen += '</a></td>';
|
||||
}
|
||||
return HtmlGenerationUtils.generateOneRowTable(gen);
|
||||
},
|
||||
banCell: function(id,banid){
|
||||
return '<td class="icon">'+
|
||||
HtmlGenerationUtils.popupLink( webimRoot+'/operator/ban.php?'+(banid ? 'id='+banid : 'thread='+id), localized[2], "ban"+id, '<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">', 720, 480, null)+
|
||||
'</td>';
|
||||
}
|
||||
};
|
||||
|
||||
Ajax.ThreadListUpdater = Class.create();
|
||||
Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
|
||||
|
||||
initialize: function(_options) {
|
||||
this.setOptions(_options);
|
||||
this._options.updateParams = this.updateParams.bind(this);
|
||||
this._options.handleError = this.handleError.bind(this);
|
||||
this._options.updateContent = this.updateContent.bind(this);
|
||||
this._options.lastrevision = 0;
|
||||
this.threadTimers = new Object();
|
||||
this.delta = 0;
|
||||
this.t = this._options.table;
|
||||
this.periodicalUpdater = new Ajax.PeriodicalUpdater(this._options);
|
||||
},
|
||||
|
||||
updateParams: function() {
|
||||
return "since=" + this._options.lastrevision + "&status=" + this._options.istatus + (this._options.showonline ? "&showonline=1" : "");
|
||||
},
|
||||
|
||||
setStatus: function(msg) {
|
||||
this._options.status.innerHTML = msg;
|
||||
},
|
||||
|
||||
handleError: function(s) {
|
||||
this.setStatus( s );
|
||||
},
|
||||
|
||||
updateThread: function(node) {
|
||||
var id, stateid, vstate, canview = false, canopen = false, canban = false, ban = null, banid = null;
|
||||
|
||||
for( var i = 0; i < node.attributes.length; i++ ) {
|
||||
var attr = node.attributes[i];
|
||||
if( attr.nodeName == "id" )
|
||||
id = attr.nodeValue;
|
||||
else if( attr.nodeName == "stateid" )
|
||||
stateid = attr.nodeValue;
|
||||
else if( attr.nodeName == "state" )
|
||||
vstate = attr.nodeValue;
|
||||
else if( attr.nodeName == "canopen" )
|
||||
canopen = true;
|
||||
else if( attr.nodeName == "canview" )
|
||||
canview = true;
|
||||
else if( attr.nodeName == "canban" )
|
||||
canban = true;
|
||||
else if( attr.nodeName == "ban" )
|
||||
ban = attr.nodeValue;
|
||||
else if( attr.nodeName == "banid" )
|
||||
banid = attr.nodeValue;
|
||||
}
|
||||
|
||||
function setcell(_table, row,id,pcontent) {
|
||||
var cell = CommonUtils.getCell( id, row, _table );
|
||||
if( cell )
|
||||
cell.innerHTML = pcontent;
|
||||
}
|
||||
|
||||
var row = CommonUtils.getRow("thr"+id, this.t);
|
||||
if( stateid == "closed" ) {
|
||||
if( row ) {
|
||||
this.t.deleteRow(row.rowIndex);
|
||||
}
|
||||
this.threadTimers[id] = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var vname = NodeUtils.getNodeValue(node,"name");
|
||||
var vaddr = NodeUtils.getNodeValue(node,"addr");
|
||||
var vtime = NodeUtils.getNodeValue(node,"time");
|
||||
var agent = NodeUtils.getNodeValue(node,"agent");
|
||||
var modified = NodeUtils.getNodeValue(node,"modified");
|
||||
var message = NodeUtils.getNodeValue(node,"message");
|
||||
var etc = '<td>'+NodeUtils.getNodeValue(node,"useragent")+'</td>';
|
||||
|
||||
if(ban != null) {
|
||||
etc = '<td>'+NodeUtils.getNodeValue(node,"reason")+'</td>';
|
||||
}
|
||||
|
||||
if(canban) {
|
||||
etc += HtmlGenerationUtils.banCell(id,banid);
|
||||
}
|
||||
etc = HtmlGenerationUtils.generateOneRowTable(etc);
|
||||
|
||||
var startRow = CommonUtils.getRow("t"+stateid, this.t);
|
||||
var endRow = CommonUtils.getRow("t"+stateid+"end", this.t);
|
||||
|
||||
if( row != null && (row.rowIndex <= startRow.rowIndex || row.rowIndex >= endRow.rowIndex ) ) {
|
||||
this.t.deleteRow(row.rowIndex);
|
||||
this.threadTimers[id] = null;
|
||||
row = null;
|
||||
}
|
||||
if( row == null ) {
|
||||
row = this.t.insertRow(startRow.rowIndex+1);
|
||||
row.className = (ban == "blocked" && stateid != "chat") ? "ban" : "in"+stateid;
|
||||
row.id = "thr"+id;
|
||||
this.threadTimers[id] = new Array(vtime,modified,stateid);
|
||||
CommonUtils.insertCell(row, "name", "visitor", null, null, HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message,stateid!='chat'));
|
||||
CommonUtils.insertCell(row, "contid", "visitor", "center", null, vaddr );
|
||||
CommonUtils.insertCell(row, "state", "visitor", "center", null, vstate );
|
||||
CommonUtils.insertCell(row, "op", "visitor", "center", null, agent );
|
||||
CommonUtils.insertCell(row, "time", "visitor", "center", null, this.getTimeSince(vtime) );
|
||||
CommonUtils.insertCell(row, "wait", "visitor", "center", null, (stateid!='chat' ? this.getTimeSince(modified) : '-') );
|
||||
CommonUtils.insertCell(row, "etc", "visitor", "center", null, etc );
|
||||
|
||||
if( stateid == 'wait' || stateid == 'prio' )
|
||||
return true;
|
||||
} else {
|
||||
this.threadTimers[id] = new Array(vtime,modified,stateid);
|
||||
row.className = (ban == "blocked" && stateid != "chat") ? "ban" : "in"+stateid;
|
||||
setcell(this.t, row,"name",HtmlGenerationUtils.viewOpenCell(vname,this._options.agentservl,id,canview,canopen,ban,message,stateid!='chat'));
|
||||
setcell(this.t, row,"contid",vaddr);
|
||||
setcell(this.t, row,"state",vstate);
|
||||
setcell(this.t, row,"op",agent);
|
||||
setcell(this.t, row,"time",this.getTimeSince(vtime));
|
||||
setcell(this.t, row,"wait",(stateid!='chat' ? this.getTimeSince(modified) : '-'));
|
||||
setcell(this.t, row,"etc",etc);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
updateQueueMessages: function() {
|
||||
function queueNotEmpty(t,id) {
|
||||
var startRow = $(id);
|
||||
var endRow = $(id+"end");
|
||||
if( startRow == null || endRow == null ) {
|
||||
return false;
|
||||
}
|
||||
return startRow.rowIndex+1 < endRow.rowIndex;
|
||||
}
|
||||
var _status = $("statustd");
|
||||
if( _status) {
|
||||
var notempty = queueNotEmpty(this.t, "twait") || queueNotEmpty(this.t, "tprio") || queueNotEmpty(this.t, "tchat");
|
||||
_status.innerHTML = notempty ? "" : this._options.noclients;
|
||||
_status.height = notempty ? 5 : 30;
|
||||
}
|
||||
},
|
||||
|
||||
getTimeSince: function(srvtime) {
|
||||
var secs = Math.floor(((new Date()).getTime()-srvtime-this.delta)/1000);
|
||||
var minutes = Math.floor(secs/60);
|
||||
var prefix = "";
|
||||
secs = secs % 60;
|
||||
if( secs < 10 )
|
||||
secs = "0" + secs;
|
||||
if( minutes >= 60 ) {
|
||||
var hours = Math.floor(minutes/60);
|
||||
minutes = minutes % 60;
|
||||
if( minutes < 10 )
|
||||
minutes = "0" + minutes;
|
||||
prefix = hours + ":";
|
||||
}
|
||||
|
||||
return prefix + minutes+":"+secs;
|
||||
},
|
||||
|
||||
updateTimers: function() {
|
||||
for (var i in this.threadTimers) {
|
||||
if (this.threadTimers[i] != null) {
|
||||
var value = this.threadTimers[i];
|
||||
var row = CommonUtils.getRow("thr"+i, this.t);
|
||||
if( row != null ) {
|
||||
function setcell(_table, row,id,pcontent) {
|
||||
var cell = CommonUtils.getCell( id, row, _table );
|
||||
if( cell )
|
||||
cell.innerHTML = pcontent;
|
||||
}
|
||||
setcell(this.t, row,"time",this.getTimeSince(value[0]));
|
||||
setcell(this.t, row,"wait",(value[2]!='chat' ? this.getTimeSince(value[1]) : '-'));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updateThreads: function(root) {
|
||||
var newAdded = false;
|
||||
var _time = NodeUtils.getAttrValue(root, "time");
|
||||
var _revision = NodeUtils.getAttrValue(root, "revision" );
|
||||
|
||||
if( _time )
|
||||
this.delta = (new Date()).getTime() - _time;
|
||||
if( _revision )
|
||||
this._options.lastrevision = _revision;
|
||||
|
||||
for( var i = 0; i < root.childNodes.length; i++ ) {
|
||||
var node = root.childNodes[i];
|
||||
if( node.tagName == 'thread' )
|
||||
if( this.updateThread(node) )
|
||||
newAdded = true;
|
||||
}
|
||||
this.updateQueueMessages();
|
||||
this.updateTimers();
|
||||
this.setStatus(this._options.istatus ? "Away" : "Up to date");
|
||||
if( newAdded ) {
|
||||
playSound(webimRoot+'/sounds/new_user.wav');
|
||||
window.focus();
|
||||
if(updaterOptions.showpopup) {
|
||||
alert(localized[5]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updateOperators: function(root) {
|
||||
var div = $('onlineoperators');
|
||||
if (!div)
|
||||
return;
|
||||
|
||||
var names = [];
|
||||
|
||||
for( var i = 0; i < root.childNodes.length; i++ ) {
|
||||
var node = root.childNodes[i];
|
||||
if(node.tagName != 'operator')
|
||||
continue;
|
||||
|
||||
var name = NodeUtils.getAttrValue(node, 'name');
|
||||
var isAway = NodeUtils.getAttrValue(node, 'away') != null;
|
||||
|
||||
names[names.length] =
|
||||
'<img src="'+webimRoot+'/images/op'+(isAway ? 'away' : 'online')+
|
||||
'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+ name;
|
||||
}
|
||||
|
||||
div.innerHTML = names.join(', ');
|
||||
},
|
||||
|
||||
updateContent: function(root) {
|
||||
if( root.tagName == 'update' ) {
|
||||
for( var i = 0; i < root.childNodes.length; i++ ) {
|
||||
var node = root.childNodes[i];
|
||||
|
||||
if (node.tagName == 'threads') {
|
||||
this.updateThreads(node);
|
||||
} else if (node.tagName == 'operators') {
|
||||
this.updateOperators(node);
|
||||
}
|
||||
}
|
||||
} else if( root.tagName == 'error' ) {
|
||||
this.setStatus(NodeUtils.getNodeValue(root,"descr") );
|
||||
} else {
|
||||
this.setStatus( "reconnecting" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function togglemenu() {
|
||||
if($("sidebar") && $("wcontent") && $("togglemenu")) {
|
||||
if($("wcontent").className == "contentnomenu") {
|
||||
$("sidebar").style.display = "block";
|
||||
$("wcontent").className = "contentinner";
|
||||
$("togglemenu").innerHTML = localized[4];
|
||||
} else {
|
||||
$("sidebar").style.display = "none";
|
||||
$("wcontent").className = "contentnomenu";
|
||||
$("togglemenu").innerHTML = localized[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var webimRoot = "";
|
||||
|
||||
Behaviour.register({
|
||||
'#togglemenu' : function(el) {
|
||||
el.onclick = function() {
|
||||
togglemenu();
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
EventHelper.register(window, 'onload', function(){
|
||||
webimRoot = updaterOptions.wroot;
|
||||
new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus"),istatus:0}).extend(updaterOptions || {}));
|
||||
if(!updaterOptions.havemenu) {
|
||||
togglemenu();
|
||||
}
|
||||
});
|
@ -1,126 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
require_once('libs/common.php');
|
||||
require_once('libs/chat.php');
|
||||
require_once('libs/expand.php');
|
||||
require_once('libs/groups.php');
|
||||
require_once('libs/captcha.php');
|
||||
require_once('libs/notify.php');
|
||||
|
||||
$errors = array();
|
||||
$page = array();
|
||||
|
||||
function store_message($name, $email, $info, $message,$groupid,$referrer) {
|
||||
global $state_left, $current_locale, $kind_for_agent, $kind_user;
|
||||
$remoteHost = get_remote_host();
|
||||
$userbrowser = $_SERVER['HTTP_USER_AGENT'];
|
||||
$visitor = visitor_from_request();
|
||||
$link = connect();
|
||||
$thread = create_thread($groupid,$name,$remoteHost,$referrer,$current_locale,$visitor['id'], $userbrowser,$state_left,$link);
|
||||
if( $referrer ) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.came.from',array($referrer)),$link);
|
||||
}
|
||||
if($email) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.visitor.email',array($email)),$link);
|
||||
}
|
||||
if($info) {
|
||||
post_message_($thread['threadid'],$kind_for_agent,getstring2('chat.visitor.info',array($info)),$link);
|
||||
}
|
||||
post_message_($thread['threadid'],$kind_user,$message,$link,$name);
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
$groupid = "";
|
||||
$groupname = "";
|
||||
$group = NULL;
|
||||
loadsettings();
|
||||
if($settings['enablegroups'] == '1') {
|
||||
$groupid = verifyparam( "group", "/^\d{1,8}$/", "");
|
||||
if($groupid) {
|
||||
$group = group_by_id($groupid);
|
||||
if(!$group) {
|
||||
$groupid = "";
|
||||
} else {
|
||||
$groupname = get_group_name($group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$email = getparam('email');
|
||||
$visitor_name = getparam('name');
|
||||
$message = getparam('message');
|
||||
$info = getparam('info');
|
||||
$referrer = urldecode(getparam("referrer"));
|
||||
|
||||
if( !$email ) {
|
||||
$errors[] = no_field("form.field.email");
|
||||
} else if( !$visitor_name ) {
|
||||
$errors[] = no_field("form.field.name");
|
||||
} else if( !$message ) {
|
||||
$errors[] = no_field("form.field.message");
|
||||
} else {
|
||||
if( !is_valid_email($email)) {
|
||||
$errors[] = wrong_field("form.field.email");
|
||||
}
|
||||
}
|
||||
|
||||
if($settings["enablecaptcha"] == "1" && can_show_captcha()) {
|
||||
$captcha = getparam('captcha');
|
||||
$original = isset($_SESSION["mibew_captcha"]) ? $_SESSION["mibew_captcha"] : "";
|
||||
if(empty($original) || empty($captcha) || $captcha != $original) {
|
||||
$errors[] = getlocal('errors.captcha');
|
||||
}
|
||||
unset($_SESSION['mibew_captcha']);
|
||||
}
|
||||
|
||||
if( count($errors) > 0 ) {
|
||||
setup_leavemessage($visitor_name,$email,$message,$groupid,$groupname,$info,$referrer,can_show_captcha());
|
||||
setup_logo();
|
||||
expand("styles", getchatstyle(), "leavemessage.tpl");
|
||||
exit;
|
||||
}
|
||||
|
||||
$message_locale = $settings['left_messages_locale'];
|
||||
if(!locale_exists($message_locale)) {
|
||||
$message_locale = $home_locale;
|
||||
}
|
||||
|
||||
store_message($visitor_name, $email, $info, $message, $groupid, $referrer);
|
||||
|
||||
$subject = getstring2_("leavemail.subject", array($visitor_name), $message_locale);
|
||||
$body = getstring2_("leavemail.body", array($visitor_name,$email,$message,$info ? "$info\n" : ""), $message_locale);
|
||||
|
||||
if (isset($group) && !empty($group['vcemail'])) {
|
||||
$inbox_mail = $group['vcemail'];
|
||||
} else {
|
||||
$inbox_mail = $settings['email'];
|
||||
}
|
||||
|
||||
if($inbox_mail) {
|
||||
$link = connect();
|
||||
webim_mail($inbox_mail, $email, $subject, $body, $link);
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
setup_logo();
|
||||
expand("styles", getchatstyle(), "leavemessagesent.tpl");
|
||||
?>
|
@ -1,71 +0,0 @@
|
||||
<?php
|
||||
/* [external]
|
||||
|
||||
This is PHP file that generates CAPTCHA image for the How to Create CAPTCHA
|
||||
Protection using PHP and AJAX Tutorial
|
||||
|
||||
You may use this code in your own projects as long as this
|
||||
copyright is left in place. All code is provided AS-IS.
|
||||
This code is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
For the rest of the code visit http://www.WebCheatSheet.com
|
||||
|
||||
Copyright 2006 WebCheatSheet.com
|
||||
*/
|
||||
|
||||
function can_show_captcha()
|
||||
{
|
||||
return extension_loaded("gd");
|
||||
}
|
||||
|
||||
function gen_captcha()
|
||||
{
|
||||
$md5_hash = md5(rand(0, 9999));
|
||||
return substr($md5_hash, 15, 5);
|
||||
}
|
||||
|
||||
function draw_captcha($security_code)
|
||||
{
|
||||
|
||||
//Set the image width and height
|
||||
$width = 100;
|
||||
$height = 25;
|
||||
|
||||
//Create the image resource
|
||||
$image = ImageCreate($width, $height);
|
||||
if (function_exists('imageantialias')) {
|
||||
imageantialias($image, true);
|
||||
}
|
||||
|
||||
//We are making three colors, white, black and gray
|
||||
$white = ImageColorAllocate($image, 255, 255, 255);
|
||||
$black = ImageColorAllocate($image, 15, 50, 15);
|
||||
$grey = ImageColorAllocate($image, 204, 204, 204);
|
||||
$ellipsec = ImageColorAllocate($image, 0, 100, 60);
|
||||
|
||||
//Make the background black
|
||||
ImageFill($image, 0, 0, $black);
|
||||
imagefilledellipse($image, 56, 15, 30, 17, $ellipsec);
|
||||
|
||||
//Add randomly generated string in white to the image
|
||||
ImageString($image, 5, 30, 4, $security_code, $white);
|
||||
|
||||
//Throw in some lines to make it a little bit harder for any bots to break
|
||||
ImageRectangle($image, 0, 0, $width - 1, $height - 1, $grey);
|
||||
imageline($image, 0, $height / 2 + 3, $width, $height / 2 + 5, $grey);
|
||||
imageline($image, $width / 2 - 14, 0, $width / 2 + 7, $height, $grey);
|
||||
|
||||
|
||||
//Tell the browser what kind of file is come in
|
||||
header("Content-Type: image/jpeg");
|
||||
|
||||
//Output the newly created image in jpeg format
|
||||
ImageJpeg($image);
|
||||
|
||||
//Free up resources
|
||||
ImageDestroy($image);
|
||||
}
|
||||
|
||||
?>
|
@ -1,740 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
* Pavel Petroshenko - history search
|
||||
*/
|
||||
|
||||
$connection_timeout = 30; // sec
|
||||
|
||||
$namecookie = "WEBIM_Data";
|
||||
$usercookie = "WEBIM_UserID";
|
||||
|
||||
$state_queue = 0;
|
||||
$state_waiting = 1;
|
||||
$state_chatting = 2;
|
||||
$state_closed = 3;
|
||||
$state_loading = 4;
|
||||
$state_left = 5;
|
||||
|
||||
$kind_user = 1;
|
||||
$kind_agent = 2;
|
||||
$kind_for_agent = 3;
|
||||
$kind_info = 4;
|
||||
$kind_conn = 5;
|
||||
$kind_events = 6;
|
||||
$kind_avatar = 7;
|
||||
|
||||
$kind_to_string = array($kind_user => "user", $kind_agent => "agent", $kind_for_agent => "hidden",
|
||||
$kind_info => "inf", $kind_conn => "conn", $kind_events => "event", $kind_avatar => "avatar");
|
||||
|
||||
function get_user_id()
|
||||
{
|
||||
return (time() + microtime()) . rand(0, 99999999);
|
||||
}
|
||||
|
||||
function next_token()
|
||||
{
|
||||
return rand(99999, 99999999);
|
||||
}
|
||||
|
||||
function next_revision($link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
perform_query("update ${mysqlprefix}chatrevision set id=LAST_INSERT_ID(id+1)", $link);
|
||||
$val = mysql_insert_id($link);
|
||||
return $val;
|
||||
}
|
||||
|
||||
function post_message_($threadid, $kind, $message, $link, $from = null, $utime = null, $opid = null)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$query = sprintf(
|
||||
"insert into ${mysqlprefix}chatmessage (threadid,ikind,tmessage,tname,agentId,dtmcreated) values (%s, %s,'%s',%s,%s,%s)",
|
||||
$threadid,
|
||||
$kind,
|
||||
mysql_real_escape_string($message, $link),
|
||||
$from ? "'" . mysql_real_escape_string($from, $link) . "'" : "null",
|
||||
$opid ? $opid : "0",
|
||||
$utime ? "FROM_UNIXTIME($utime)" : "CURRENT_TIMESTAMP");
|
||||
|
||||
perform_query($query, $link);
|
||||
return mysql_insert_id($link);
|
||||
}
|
||||
|
||||
function post_message($threadid, $kind, $message, $from = null, $agentid = null)
|
||||
{
|
||||
$link = connect();
|
||||
$id = post_message_($threadid, $kind, $message, $link, $from, null, $agentid);
|
||||
mysql_close($link);
|
||||
return $id;
|
||||
}
|
||||
|
||||
function prepare_html_message($text)
|
||||
{
|
||||
$escaped_text = htmlspecialchars($text);
|
||||
$text_w_links = preg_replace('/(http|ftp):\/\/\S*/', '<a href="$0" target="_blank">$0</a>', $escaped_text);
|
||||
$multiline = str_replace("\n", "<br/>", $text_w_links);
|
||||
return $multiline;
|
||||
}
|
||||
|
||||
function message_to_html($msg)
|
||||
{
|
||||
global $kind_to_string, $kind_avatar;
|
||||
if ($msg['ikind'] == $kind_avatar) return "";
|
||||
$message = "<span>" . date("H:i:s", $msg['created']) . "</span> ";
|
||||
$kind = $kind_to_string{$msg['ikind']};
|
||||
if ($msg['tname'])
|
||||
$message .= "<span class='n$kind'>" . htmlspecialchars($msg['tname']) . "</span>: ";
|
||||
$message .= "<span class='m$kind'>" . prepare_html_message($msg['tmessage']) . "</span><br/>";
|
||||
return $message;
|
||||
}
|
||||
|
||||
function message_to_text($msg)
|
||||
{
|
||||
global $kind_user, $kind_agent, $kind_info, $kind_avatar;
|
||||
if ($msg['ikind'] == $kind_avatar) return "";
|
||||
$message_time = date("H:i:s ", $msg['created']);
|
||||
if ($msg['ikind'] == $kind_user || $msg['ikind'] == $kind_agent) {
|
||||
if ($msg['tname'])
|
||||
return $message_time . $msg['tname'] . ": " . $msg['tmessage'] . "\n";
|
||||
else
|
||||
return $message_time . $msg['tmessage'] . "\n";
|
||||
} else if ($msg['ikind'] == $kind_info) {
|
||||
return $message_time . $msg['tmessage'] . "\n";
|
||||
} else {
|
||||
return $message_time . "[" . $msg['tmessage'] . "]\n";
|
||||
}
|
||||
}
|
||||
|
||||
function get_messages($threadid, $meth, $isuser, &$lastid)
|
||||
{
|
||||
global $kind_for_agent, $kind_avatar, $webim_encoding, $mysqlprefix;
|
||||
$link = connect();
|
||||
|
||||
$query = sprintf(
|
||||
"select messageid,ikind,unix_timestamp(dtmcreated) as created,tname,tmessage from ${mysqlprefix}chatmessage " .
|
||||
"where threadid = %s and messageid > %s %s order by messageid",
|
||||
$threadid, $lastid, $isuser ? "and ikind <> $kind_for_agent" : "");
|
||||
|
||||
$messages = array();
|
||||
$msgs = select_multi_assoc($query, $link);
|
||||
foreach ($msgs as $msg) {
|
||||
$message = "";
|
||||
if ($meth == 'xml') {
|
||||
switch ($msg['ikind']) {
|
||||
case $kind_avatar:
|
||||
$message = "<avatar>" . myiconv($webim_encoding, "utf-8", escape_with_cdata($msg['tmessage'])) . "</avatar>";
|
||||
break;
|
||||
default:
|
||||
$message = "<message>" . myiconv($webim_encoding, "utf-8", escape_with_cdata(message_to_html($msg))) . "</message>\n";
|
||||
}
|
||||
} else {
|
||||
if ($msg['ikind'] != $kind_avatar) {
|
||||
$message = (($meth == 'text') ? message_to_text($msg) : topage(message_to_html($msg)));
|
||||
}
|
||||
}
|
||||
|
||||
$messages[] = $message;
|
||||
if ($msg['messageid'] > $lastid) {
|
||||
$lastid = $msg['messageid'];
|
||||
}
|
||||
}
|
||||
|
||||
mysql_close($link);
|
||||
return $messages;
|
||||
}
|
||||
|
||||
function print_thread_messages($thread, $token, $lastid, $isuser, $format, $agentid = null)
|
||||
{
|
||||
global $webim_encoding, $webimroot, $connection_timeout, $settings;
|
||||
$threadid = $thread['threadid'];
|
||||
$istyping = abs($thread['current'] - $thread[$isuser ? "lpagent" : "lpuser"]) < $connection_timeout
|
||||
&& $thread[$isuser ? "agentTyping" : "userTyping"] == "1" ? "1" : "0";
|
||||
|
||||
if ($format == "xml") {
|
||||
$output = get_messages($threadid, "xml", $isuser, $lastid);
|
||||
|
||||
start_xml_output();
|
||||
print("<thread lastid=\"$lastid\" typing=\"" . $istyping . "\" canpost=\"" . (($isuser || $agentid != null && $agentid == $thread['agentId']) ? 1 : 0) . "\">");
|
||||
foreach ($output as $msg) {
|
||||
print $msg;
|
||||
}
|
||||
print("</thread>");
|
||||
} else if ($format == "html") {
|
||||
loadsettings();
|
||||
$output = get_messages($threadid, "html", $isuser, $lastid);
|
||||
|
||||
start_html_output();
|
||||
$url = "$webimroot/thread.php?act=refresh&thread=$threadid&token=$token&html=on&user=" . ($isuser ? "true" : "false");
|
||||
|
||||
print(
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" .
|
||||
"<html>\n<head>\n" .
|
||||
"<link href=\"$webimroot/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" .
|
||||
"<meta http-equiv=\"Refresh\" content=\"" . $settings['updatefrequency_oldchat'] . "; URL=$url&sn=11\">\n" .
|
||||
"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" .
|
||||
"<title>chat</title>\n" .
|
||||
"</head>\n" .
|
||||
"<body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400' onload=\"if( location.hash != '#aend' ){location.hash='#aend';}\">" .
|
||||
"<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message'>");
|
||||
|
||||
foreach ($output as $msg) {
|
||||
print $msg;
|
||||
}
|
||||
|
||||
print(
|
||||
"</td></tr></table><a name='aend'></a>" .
|
||||
"</body></html>");
|
||||
}
|
||||
}
|
||||
|
||||
function get_user_name($username, $addr, $id)
|
||||
{
|
||||
global $settings;
|
||||
loadsettings();
|
||||
return str_replace("{addr}", $addr,
|
||||
str_replace("{id}", $id,
|
||||
str_replace("{name}", $username, $settings['usernamepattern'])));
|
||||
}
|
||||
|
||||
function is_ajax_browser($browserid, $ver, $useragent)
|
||||
{
|
||||
if ($browserid == "opera")
|
||||
return $ver >= 8.02;
|
||||
if ($browserid == "safari")
|
||||
return $ver >= 125;
|
||||
if ($browserid == "msie")
|
||||
return $ver >= 5.5 && !strstr($useragent, "powerpc");
|
||||
if ($browserid == "netscape")
|
||||
return $ver >= 7.1;
|
||||
if ($browserid == "mozilla")
|
||||
return $ver >= 1.4;
|
||||
if ($browserid == "firefox")
|
||||
return $ver >= 1.0;
|
||||
if ($browserid == "chrome")
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_old_browser($browserid, $ver)
|
||||
{
|
||||
if ($browserid == "opera")
|
||||
return $ver < 7.0;
|
||||
if ($browserid == "msie")
|
||||
return $ver < 5.0;
|
||||
return false;
|
||||
}
|
||||
|
||||
$knownAgents = array("opera", "msie", "chrome", "safari", "firefox", "netscape", "mozilla");
|
||||
|
||||
function get_remote_level($useragent)
|
||||
{
|
||||
global $knownAgents;
|
||||
$useragent = strtolower($useragent);
|
||||
foreach ($knownAgents as $agent) {
|
||||
if (strstr($useragent, $agent)) {
|
||||
if (preg_match("/" . $agent . "[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent, $matches)) {
|
||||
$ver = $matches[1];
|
||||
|
||||
if (is_ajax_browser($agent, $ver, $useragent))
|
||||
return "ajaxed";
|
||||
else if (is_old_browser($agent, $ver))
|
||||
return "old";
|
||||
|
||||
return "simple";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "simple";
|
||||
}
|
||||
|
||||
function is_agent_opera95()
|
||||
{
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (strstr($useragent, "opera")) {
|
||||
if (preg_match("/opera[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent, $matches)) {
|
||||
$ver = $matches[1];
|
||||
|
||||
if ($ver >= "9.5")
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_mac_opera()
|
||||
{
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
return strstr($useragent, "opera") && strstr($useragent, "mac");
|
||||
}
|
||||
|
||||
function needsFramesrc()
|
||||
{
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
return strstr($useragent, "safari/");
|
||||
}
|
||||
|
||||
function setup_logo()
|
||||
{
|
||||
global $page, $settings;
|
||||
loadsettings();
|
||||
$page['ct.company.name'] = topage($settings['title']);
|
||||
$page['ct.company.chatLogoURL'] = topage($settings['logo']);
|
||||
$page['webimHost'] = topage($settings['hosturl']);
|
||||
}
|
||||
|
||||
function setup_leavemessage($name, $email, $message, $groupid, $groupname, $info, $referrer, $canshowcaptcha)
|
||||
{
|
||||
global $settings, $page;
|
||||
$page['formname'] = topage($name);
|
||||
$page['formemail'] = topage($email);
|
||||
$page['formmessage'] = $message ? topage($message) : "";
|
||||
$page['showcaptcha'] = $settings["enablecaptcha"] == "1" && $canshowcaptcha ? "1" : "";
|
||||
$page['formgroupid'] = $groupid;
|
||||
$page['formgroupname'] = $groupname;
|
||||
$page['forminfo'] = topage($info);
|
||||
$page['referrer'] = urlencode(topage($referrer));
|
||||
}
|
||||
|
||||
function setup_survey($name, $email, $groupid, $info, $referrer)
|
||||
{
|
||||
global $settings, $page;
|
||||
|
||||
$page['formname'] = topage($name);
|
||||
$page['formemail'] = topage($email);
|
||||
$page['formgroupid'] = $groupid;
|
||||
$page['forminfo'] = topage($info);
|
||||
$page['referrer'] = urlencode(topage($referrer));
|
||||
|
||||
if ($settings['enablegroups'] == '1' && $settings["surveyaskgroup"] == "1") {
|
||||
$link = connect();
|
||||
$allgroups = get_groups($link, false);
|
||||
mysql_close($link);
|
||||
$val = "";
|
||||
foreach ($allgroups as $k) {
|
||||
$groupname = $k['vclocalname'];
|
||||
if ($k['inumofagents'] == 0) {
|
||||
continue;
|
||||
}
|
||||
if ($k['ilastseen'] !== NULL && $k['ilastseen'] < $settings['online_timeout']) {
|
||||
if (!$groupid) {
|
||||
$groupid = $k['groupid']; // select first online group
|
||||
}
|
||||
} else {
|
||||
$groupname .= " (offline)";
|
||||
}
|
||||
$isselected = $k['groupid'] == $groupid;
|
||||
$val .= "<option value=\"" . $k['groupid'] . "\"" . ($isselected ? " selected=\"selected\"" : "") . ">$groupname</option>";
|
||||
}
|
||||
$page['groups'] = $val;
|
||||
}
|
||||
|
||||
$page['showemail'] = $settings["surveyaskmail"] == "1" ? "1" : "";
|
||||
$page['showmessage'] = $settings["surveyaskmessage"] == "1" ? "1" : "";
|
||||
$page['showname'] = $settings['usercanchangename'] == "1" ? "1" : "";
|
||||
}
|
||||
|
||||
function setup_chatview_for_user($thread, $level)
|
||||
{
|
||||
global $page, $webimroot, $settings;
|
||||
loadsettings();
|
||||
$page = array();
|
||||
$page['agent'] = false;
|
||||
$page['user'] = true;
|
||||
$page['canpost'] = true;
|
||||
$nameisset = getstring("chat.default.username") != $thread['userName'];
|
||||
$page['displ1'] = $nameisset ? "none" : "inline";
|
||||
$page['displ2'] = $nameisset ? "inline" : "none";
|
||||
$page['level'] = $level;
|
||||
$page['ct.chatThreadId'] = $thread['threadid'];
|
||||
$page['ct.token'] = $thread['ltoken'];
|
||||
$page['ct.user.name'] = htmlspecialchars(topage($thread['userName']));
|
||||
$page['canChangeName'] = $settings['usercanchangename'] == "1";
|
||||
$page['chat.title'] = topage($settings['chattitle']);
|
||||
|
||||
setup_logo();
|
||||
if ($settings['sendmessagekey'] == 'enter') {
|
||||
$page['send_shortcut'] = "Enter";
|
||||
$page['ignorectrl'] = 1;
|
||||
} else {
|
||||
$page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter";
|
||||
$page['ignorectrl'] = 0;
|
||||
}
|
||||
|
||||
$params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
|
||||
$page['mailLink'] = "$webimroot/client.php?" . $params . "&level=$level&act=mailthread";
|
||||
|
||||
if ($settings['enablessl'] == "1" && !is_secure_request()) {
|
||||
$page['sslLink'] = get_app_location(true, true) . "/client.php?" . $params . "&level=$level";
|
||||
}
|
||||
|
||||
$page['isOpera95'] = is_agent_opera95();
|
||||
$page['neediframesrc'] = needsFramesrc();
|
||||
|
||||
$page['frequency'] = $settings['updatefrequency_chat'];
|
||||
}
|
||||
|
||||
function load_canned_messages($locale, $groupid)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$link = connect();
|
||||
$result = select_multi_assoc(
|
||||
"select vcvalue from ${mysqlprefix}chatresponses where locale = '$locale' " .
|
||||
"AND (groupid is NULL OR groupid = 0) order by vcvalue", $link);
|
||||
if (count($result) == 0) {
|
||||
foreach (explode("\n", getstring_('chat.predefined_answers', $locale)) as $answer) {
|
||||
$result[] = array('vcvalue' => $answer);
|
||||
}
|
||||
}
|
||||
if ($groupid) {
|
||||
$result2 = select_multi_assoc(
|
||||
"select vcvalue from ${mysqlprefix}chatresponses where locale = '$locale' " .
|
||||
"AND groupid = $groupid order by vcvalue", $link);
|
||||
foreach ($result as $r) {
|
||||
$result2[] = $r;
|
||||
}
|
||||
$result = $result2;
|
||||
}
|
||||
mysql_close($link);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function setup_chatview_for_operator($thread, $operator)
|
||||
{
|
||||
global $page, $webimroot, $company_logo_link, $company_name, $settings;
|
||||
loadsettings();
|
||||
$page = array();
|
||||
$page['agent'] = true;
|
||||
$page['user'] = false;
|
||||
$page['canpost'] = $thread['agentId'] == $operator['operatorid'];
|
||||
$page['ct.chatThreadId'] = $thread['threadid'];
|
||||
$page['ct.token'] = $thread['ltoken'];
|
||||
$page['ct.user.name'] = htmlspecialchars(topage(get_user_name($thread['userName'], $thread['remote'], $thread['userid'])));
|
||||
$page['chat.title'] = topage($settings['chattitle']);
|
||||
|
||||
setup_logo();
|
||||
if ($settings['sendmessagekey'] == 'enter') {
|
||||
$page['send_shortcut'] = "Enter";
|
||||
$page['ignorectrl'] = 1;
|
||||
} else {
|
||||
$page['send_shortcut'] = is_mac_opera() ? "⌘-Enter" : "Ctrl-Enter";
|
||||
$page['ignorectrl'] = 0;
|
||||
}
|
||||
|
||||
if ($settings['enablessl'] == "1" && !is_secure_request()) {
|
||||
$page['sslLink'] = get_app_location(true, true) . "/operator/agent.php?thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
|
||||
}
|
||||
$page['isOpera95'] = is_agent_opera95();
|
||||
$page['neediframesrc'] = needsFramesrc();
|
||||
$page['historyParams'] = array("userid" => "" . $thread['userid']);
|
||||
$page['historyParamsLink'] = add_params($webimroot . "/operator/userhistory.php", $page['historyParams']);
|
||||
$predefinedres = "";
|
||||
$canned_messages = load_canned_messages($thread['locale'], $thread['groupid']);
|
||||
foreach ($canned_messages as $answer) {
|
||||
$predefinedres .= "<option>" . htmlspecialchars(topage($answer['vcvalue'])) . "</option>";
|
||||
}
|
||||
$page['predefinedAnswers'] = $predefinedres;
|
||||
$params = "thread=" . $thread['threadid'] . "&token=" . $thread['ltoken'];
|
||||
$page['redirectLink'] = "$webimroot/operator/agent.php?" . $params . "&act=redirect";
|
||||
|
||||
$page['namePostfix'] = "";
|
||||
$page['frequency'] = $settings['updatefrequency_chat'];
|
||||
}
|
||||
|
||||
function update_thread_access($threadid, $params, $link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$clause = "";
|
||||
foreach ($params as $k => $v) {
|
||||
if (strlen($clause) > 0)
|
||||
$clause .= ", ";
|
||||
$clause .= $k . "=" . $v;
|
||||
}
|
||||
perform_query(
|
||||
"update ${mysqlprefix}chatthread set $clause " .
|
||||
"where threadid = $threadid", $link);
|
||||
}
|
||||
|
||||
function ping_thread($thread, $isuser, $istyping)
|
||||
{
|
||||
global $kind_for_agent, $state_queue, $state_loading, $state_chatting, $state_waiting, $kind_conn, $connection_timeout;
|
||||
$link = connect();
|
||||
$params = array(($isuser ? "lastpinguser" : "lastpingagent") => "CURRENT_TIMESTAMP",
|
||||
($isuser ? "userTyping" : "agentTyping") => ($istyping ? "1" : "0"));
|
||||
|
||||
$lastping = $thread[$isuser ? "lpagent" : "lpuser"];
|
||||
$current = $thread['current'];
|
||||
|
||||
if ($thread['istate'] == $state_loading && $isuser) {
|
||||
$params['istate'] = $state_queue;
|
||||
commit_thread($thread['threadid'], $params, $link);
|
||||
mysql_close($link);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lastping > 0 && abs($current - $lastping) > $connection_timeout) {
|
||||
$params[$isuser ? "lastpingagent" : "lastpinguser"] = "0";
|
||||
if (!$isuser) {
|
||||
$message_to_post = getstring_("chat.status.user.dead", $thread['locale']);
|
||||
post_message_($thread['threadid'], $kind_for_agent, $message_to_post, $link, null, $lastping + $connection_timeout);
|
||||
} else if ($thread['istate'] == $state_chatting) {
|
||||
|
||||
$message_to_post = getstring_("chat.status.operator.dead", $thread['locale']);
|
||||
post_message_($thread['threadid'], $kind_conn, $message_to_post, $link, null, $lastping + $connection_timeout);
|
||||
$params['istate'] = $state_waiting;
|
||||
$params['nextagent'] = 0;
|
||||
commit_thread($thread['threadid'], $params, $link);
|
||||
mysql_close($link);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
update_thread_access($thread['threadid'], $params, $link);
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
function commit_thread($threadid, $params, $link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$query = "update ${mysqlprefix}chatthread t set lrevision = " . next_revision($link) . ", dtmmodified = CURRENT_TIMESTAMP";
|
||||
foreach ($params as $k => $v) {
|
||||
$query .= ", " . $k . "=" . $v;
|
||||
}
|
||||
$query .= " where threadid = $threadid";
|
||||
|
||||
perform_query($query, $link);
|
||||
}
|
||||
|
||||
function rename_user($thread, $newname)
|
||||
{
|
||||
global $kind_events;
|
||||
|
||||
$link = connect();
|
||||
commit_thread($thread['threadid'], array('userName' => "'" . mysql_real_escape_string($newname, $link) . "'"), $link);
|
||||
|
||||
if ($thread['userName'] != $newname) {
|
||||
post_message_($thread['threadid'], $kind_events,
|
||||
getstring2_("chat.status.user.changedname", array($thread['userName'], $newname), $thread['locale']), $link);
|
||||
}
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
function close_thread($thread, $isuser)
|
||||
{
|
||||
global $state_closed, $kind_events, $mysqlprefix;
|
||||
|
||||
$link = connect();
|
||||
if ($thread['istate'] != $state_closed) {
|
||||
commit_thread($thread['threadid'], array('istate' => $state_closed,
|
||||
'messageCount' => "(SELECT COUNT(*) FROM ${mysqlprefix}chatmessage WHERE ${mysqlprefix}chatmessage.threadid = t.threadid AND ikind = 1)"), $link);
|
||||
}
|
||||
|
||||
$message = $isuser ? getstring2_("chat.status.user.left", array($thread['userName']), $thread['locale'])
|
||||
: getstring2_("chat.status.operator.left", array($thread['agentName']), $thread['locale']);
|
||||
post_message_($thread['threadid'], $kind_events, $message, $link);
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
function thread_by_id_($id, $link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
return select_one_row("select threadid,userName,agentName,agentId,lrevision,istate,ltoken,userTyping,agentTyping" .
|
||||
",unix_timestamp(dtmmodified) as modified, unix_timestamp(dtmcreated) as created" .
|
||||
",remote,referer,locale,unix_timestamp(lastpinguser) as lpuser,unix_timestamp(lastpingagent) as lpagent, unix_timestamp(CURRENT_TIMESTAMP) as current,nextagent,shownmessageid,userid,userAgent,groupid" .
|
||||
" from ${mysqlprefix}chatthread where threadid = " . $id, $link);
|
||||
}
|
||||
|
||||
function ban_for_addr_($addr, $link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
return select_one_row("select banid,comment from ${mysqlprefix}chatban where unix_timestamp(dtmtill) > unix_timestamp(CURRENT_TIMESTAMP) AND address = '" . mysql_real_escape_string($addr, $link) . "'", $link);
|
||||
}
|
||||
|
||||
function thread_by_id($id)
|
||||
{
|
||||
$link = connect();
|
||||
$thread = thread_by_id_($id, $link);
|
||||
mysql_close($link);
|
||||
return $thread;
|
||||
}
|
||||
|
||||
function create_thread($groupid, $username, $remoteHost, $referer, $lang, $userid, $userbrowser, $initialState, $link)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$query = sprintf(
|
||||
"insert into ${mysqlprefix}chatthread (userName,userid,ltoken,remote,referer,lrevision,locale,userAgent,dtmcreated,dtmmodified,istate" . ($groupid ? ",groupid" : "") . ") values " .
|
||||
"('%s','%s',%s,'%s','%s',%s,'%s','%s',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,$initialState" . ($groupid ? ",$groupid" : "") . ")",
|
||||
mysql_real_escape_string($username, $link),
|
||||
mysql_real_escape_string($userid, $link),
|
||||
next_token(),
|
||||
mysql_real_escape_string($remoteHost, $link),
|
||||
mysql_real_escape_string($referer, $link),
|
||||
next_revision($link),
|
||||
mysql_real_escape_string($lang, $link),
|
||||
mysql_real_escape_string($userbrowser, $link));
|
||||
|
||||
perform_query($query, $link);
|
||||
$id = mysql_insert_id($link);
|
||||
|
||||
$newthread = thread_by_id_($id, $link);
|
||||
return $newthread;
|
||||
}
|
||||
|
||||
function do_take_thread($threadid, $operatorId, $operatorName)
|
||||
{
|
||||
global $state_chatting;
|
||||
$link = connect();
|
||||
commit_thread($threadid,
|
||||
array("istate" => $state_chatting,
|
||||
"nextagent" => 0,
|
||||
"agentId" => $operatorId,
|
||||
"agentName" => "'" . mysql_real_escape_string($operatorName, $link) . "'"), $link);
|
||||
mysql_close($link);
|
||||
}
|
||||
|
||||
function reopen_thread($threadid)
|
||||
{
|
||||
global $state_queue, $state_loading, $state_waiting, $state_chatting, $state_closed, $state_left, $kind_events;
|
||||
$link = connect();
|
||||
$thread = thread_by_id_($threadid, $link);
|
||||
|
||||
if (!$thread)
|
||||
return FALSE;
|
||||
|
||||
if ($thread['istate'] == $state_closed || $thread['istate'] == $state_left)
|
||||
return FALSE;
|
||||
|
||||
if ($thread['istate'] != $state_chatting && $thread['istate'] != $state_queue && $thread['istate'] != $state_loading) {
|
||||
commit_thread($threadid,
|
||||
array("istate" => $state_waiting, "nextagent" => 0), $link);
|
||||
}
|
||||
|
||||
post_message_($thread['threadid'], $kind_events, getstring_("chat.status.user.reopenedthread", $thread['locale']), $link);
|
||||
mysql_close($link);
|
||||
return $thread;
|
||||
}
|
||||
|
||||
function take_thread($thread, $operator)
|
||||
{
|
||||
global $state_queue, $state_loading, $state_waiting, $state_chatting, $kind_events, $kind_avatar, $home_locale;
|
||||
|
||||
$state = $thread['istate'];
|
||||
$threadid = $thread['threadid'];
|
||||
$message_to_post = "";
|
||||
|
||||
$operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname'];
|
||||
|
||||
if ($state == $state_queue || $state == $state_waiting || $state == $state_loading) {
|
||||
do_take_thread($threadid, $operator['operatorid'], $operatorName);
|
||||
|
||||
if ($state == $state_waiting) {
|
||||
if ($operatorName != $thread['agentName']) {
|
||||
$message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']);
|
||||
} else {
|
||||
$message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale']);
|
||||
}
|
||||
} else {
|
||||
$message_to_post = getstring2_("chat.status.operator.joined", array($operatorName), $thread['locale']);
|
||||
}
|
||||
} else if ($state == $state_chatting) {
|
||||
if ($operator['operatorid'] != $thread['agentId']) {
|
||||
do_take_thread($threadid, $operator['operatorid'], $operatorName);
|
||||
$message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']);
|
||||
}
|
||||
} else {
|
||||
die("cannot take thread");
|
||||
}
|
||||
|
||||
if ($message_to_post) {
|
||||
post_message($threadid, $kind_events, $message_to_post);
|
||||
post_message($threadid, $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : "");
|
||||
}
|
||||
}
|
||||
|
||||
function check_for_reassign($thread, $operator)
|
||||
{
|
||||
global $state_waiting, $home_locale, $kind_events, $kind_avatar;
|
||||
$operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname'];
|
||||
if ($thread['istate'] == $state_waiting &&
|
||||
($thread['nextagent'] == $operator['operatorid']
|
||||
|| $thread['agentId'] == $operator['operatorid'])) {
|
||||
do_take_thread($thread['threadid'], $operator['operatorid'], $operatorName);
|
||||
if ($operatorName != $thread['agentName']) {
|
||||
$message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']);
|
||||
} else {
|
||||
$message_to_post = getstring2_("chat.status.operator.returned", array($operatorName), $thread['locale']);
|
||||
}
|
||||
|
||||
post_message($thread['threadid'], $kind_events, $message_to_post);
|
||||
post_message($thread['threadid'], $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : "");
|
||||
}
|
||||
}
|
||||
|
||||
function check_connections_from_remote($remote, $link)
|
||||
{
|
||||
global $settings, $state_closed, $state_left, $mysqlprefix;
|
||||
if ($settings['max_connections_from_one_host'] == 0) {
|
||||
return true;
|
||||
}
|
||||
$result = select_one_row(
|
||||
"select count(*) as opened from ${mysqlprefix}chatthread " .
|
||||
"where remote = '" . mysql_real_escape_string($remote, $link) . "' AND istate <> $state_closed AND istate <> $state_left", $link);
|
||||
if ($result && isset($result['opened'])) {
|
||||
return $result['opened'] < $settings['max_connections_from_one_host'];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function visitor_from_request()
|
||||
{
|
||||
global $namecookie, $webim_encoding, $usercookie;
|
||||
$defaultName = getstring("chat.default.username");
|
||||
$userName = $defaultName;
|
||||
if (isset($_COOKIE[$namecookie])) {
|
||||
$data = base64_decode(strtr($_COOKIE[$namecookie], '-_,', '+/='));
|
||||
if (strlen($data) > 0) {
|
||||
$userName = myiconv("utf-8", $webim_encoding, $data);
|
||||
}
|
||||
}
|
||||
|
||||
if ($userName == $defaultName) {
|
||||
$userName = getgetparam('name', $userName);
|
||||
}
|
||||
|
||||
if (isset($_COOKIE[$usercookie])) {
|
||||
$userId = $_COOKIE[$usercookie];
|
||||
} else {
|
||||
$userId = get_user_id();
|
||||
setcookie($usercookie, $userId, time() + 60 * 60 * 24 * 365);
|
||||
}
|
||||
return array('id' => $userId, 'name' => $userName);
|
||||
}
|
||||
|
||||
function get_remote_host()
|
||||
{
|
||||
$extAddr = $_SERVER['REMOTE_ADDR'];
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
|
||||
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
|
||||
$extAddr = $_SERVER['REMOTE_ADDR'] . ' (' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ')';
|
||||
}
|
||||
return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $extAddr;
|
||||
}
|
||||
|
||||
?>
|
@ -1,690 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
session_start();
|
||||
|
||||
require_once(dirname(__FILE__) . '/converter.php');
|
||||
require_once(dirname(__FILE__) . '/config.php');
|
||||
|
||||
$version = '1.6.4';
|
||||
$jsver = "164";
|
||||
|
||||
function myiconv($in_enc, $out_enc, $string)
|
||||
{
|
||||
global $_utf8win1251, $_win1251utf8;
|
||||
if ($in_enc == $out_enc) {
|
||||
return $string;
|
||||
}
|
||||
if (function_exists('iconv')) {
|
||||
$converted = @iconv($in_enc, $out_enc, $string);
|
||||
if ($converted !== FALSE) {
|
||||
return $converted;
|
||||
}
|
||||
}
|
||||
if ($in_enc == "cp1251" && $out_enc == "utf-8")
|
||||
return strtr($string, $_win1251utf8);
|
||||
if ($in_enc == "utf-8" && $out_enc == "cp1251")
|
||||
return strtr($string, $_utf8win1251);
|
||||
|
||||
return $string; // do not know how to convert
|
||||
}
|
||||
|
||||
function verifyparam($name, $regexp, $default = null)
|
||||
{
|
||||
if (isset($_GET[$name])) {
|
||||
$val = $_GET[$name];
|
||||
if (preg_match($regexp, $val))
|
||||
return $val;
|
||||
|
||||
} else if (isset($_POST[$name])) {
|
||||
$val = $_POST[$name];
|
||||
if (preg_match($regexp, $val))
|
||||
return $val;
|
||||
|
||||
} else {
|
||||
if (isset($default))
|
||||
return $default;
|
||||
}
|
||||
echo "<html><head></head><body>Wrong parameter used or absent: " . $name . "</body></html>";
|
||||
exit;
|
||||
}
|
||||
|
||||
function debugexit_print($var)
|
||||
{
|
||||
echo "<html><body><pre>";
|
||||
print_r($var);
|
||||
echo "</pre></body></html>";
|
||||
exit;
|
||||
}
|
||||
|
||||
$locale_pattern = "/^[\w-]{2,5}$/";
|
||||
|
||||
function locale_exists($locale)
|
||||
{
|
||||
return file_exists(dirname(__FILE__) . "/../locales/$locale/properties");
|
||||
}
|
||||
|
||||
function get_available_locales()
|
||||
{
|
||||
global $locale_pattern;
|
||||
$list = array();
|
||||
$folder = dirname(__FILE__) . "/../locales";
|
||||
if ($handle = opendir($folder)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (preg_match($locale_pattern, $file) && $file != 'names' && is_dir("$folder/$file")) {
|
||||
$list[] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
sort($list);
|
||||
return $list;
|
||||
}
|
||||
|
||||
function get_user_locale()
|
||||
{
|
||||
global $default_locale;
|
||||
|
||||
if (isset($_COOKIE['webim_locale'])) {
|
||||
$requested_lang = $_COOKIE['webim_locale'];
|
||||
if (locale_exists($requested_lang))
|
||||
return $requested_lang;
|
||||
}
|
||||
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
$requested_langs = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
foreach ($requested_langs as $requested_lang) {
|
||||
if (strlen($requested_lang) > 2)
|
||||
$requested_lang = substr($requested_lang, 0, 2);
|
||||
|
||||
if (locale_exists($requested_lang))
|
||||
return $requested_lang;
|
||||
}
|
||||
}
|
||||
|
||||
if (locale_exists($default_locale))
|
||||
return $default_locale;
|
||||
|
||||
return 'en';
|
||||
}
|
||||
|
||||
function get_locale()
|
||||
{
|
||||
global $webimroot, $locale_pattern;
|
||||
|
||||
$locale = verifyparam("locale", $locale_pattern, "");
|
||||
|
||||
if ($locale && locale_exists($locale)) {
|
||||
$_SESSION['locale'] = $locale;
|
||||
setcookie('webim_locale', $locale, time() + 60 * 60 * 24 * 1000, "$webimroot/");
|
||||
} else if (isset($_SESSION['locale'])) {
|
||||
$locale = $_SESSION['locale'];
|
||||
}
|
||||
|
||||
if (!$locale || !locale_exists($locale))
|
||||
$locale = get_user_locale();
|
||||
return $locale;
|
||||
}
|
||||
|
||||
$current_locale = get_locale();
|
||||
$messages = array();
|
||||
$output_encoding = array();
|
||||
|
||||
if (function_exists("date_default_timezone_set")) {
|
||||
// TODO try to get timezone from config.php/session etc.
|
||||
// autodetect timezone
|
||||
@date_default_timezone_set(function_exists("date_default_timezone_get") ? @date_default_timezone_get() : "GMT");
|
||||
}
|
||||
|
||||
function get_locale_links($href)
|
||||
{
|
||||
global $current_locale;
|
||||
$localeLinks = array();
|
||||
$allLocales = get_available_locales();
|
||||
if (count($allLocales) < 2) {
|
||||
return null;
|
||||
}
|
||||
foreach ($allLocales as $k) {
|
||||
$localeLinks[$k] = getlocal_($k, "names");
|
||||
}
|
||||
return $localeLinks;
|
||||
}
|
||||
|
||||
function load_messages($locale)
|
||||
{
|
||||
global $messages, $webim_encoding, $output_encoding;
|
||||
$hash = array();
|
||||
$current_encoding = $webim_encoding;
|
||||
$fp = fopen(dirname(__FILE__) . "/../locales/$locale/properties", "r");
|
||||
while (!feof($fp)) {
|
||||
$line = fgets($fp, 4096);
|
||||
$keyval = preg_split("/=/", $line, 2);
|
||||
if (isset($keyval[1])) {
|
||||
if ($keyval[0] == 'encoding') {
|
||||
$current_encoding = trim($keyval[1]);
|
||||
} else if ($keyval[0] == 'output_encoding') {
|
||||
$output_encoding[$locale] = trim($keyval[1]);
|
||||
} else if ($current_encoding == $webim_encoding) {
|
||||
$hash[$keyval[0]] = str_replace("\\n", "\n", trim($keyval[1]));
|
||||
} else {
|
||||
$hash[$keyval[0]] = myiconv($current_encoding, $webim_encoding, str_replace("\\n", "\n", trim($keyval[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
$messages[$locale] = $hash;
|
||||
}
|
||||
|
||||
function getoutputenc()
|
||||
{
|
||||
global $current_locale, $output_encoding, $webim_encoding, $messages;
|
||||
if (!isset($messages[$current_locale]))
|
||||
load_messages($current_locale);
|
||||
return isset($output_encoding[$current_locale]) ? $output_encoding[$current_locale] : $webim_encoding;
|
||||
}
|
||||
|
||||
function getstring_($text, $locale)
|
||||
{
|
||||
global $messages;
|
||||
if (!isset($messages[$locale]))
|
||||
load_messages($locale);
|
||||
|
||||
$localized = $messages[$locale];
|
||||
if (isset($localized[$text]))
|
||||
return $localized[$text];
|
||||
if ($locale != 'en') {
|
||||
return getstring_($text, 'en');
|
||||
}
|
||||
|
||||
return "!" . $text;
|
||||
}
|
||||
|
||||
function getstring($text)
|
||||
{
|
||||
global $current_locale;
|
||||
return getstring_($text, $current_locale);
|
||||
}
|
||||
|
||||
function getlocal($text)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
return myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale));
|
||||
}
|
||||
|
||||
function getlocal_($text, $locale)
|
||||
{
|
||||
global $webim_encoding;
|
||||
return myiconv($webim_encoding, getoutputenc(), getstring_($text, $locale));
|
||||
}
|
||||
|
||||
function topage($text)
|
||||
{
|
||||
global $webim_encoding;
|
||||
return myiconv($webim_encoding, getoutputenc(), $text);
|
||||
}
|
||||
|
||||
function getstring2_($text, $params, $locale)
|
||||
{
|
||||
$string = getstring_($text, $locale);
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$string = str_replace("{" . $i . "}", $params[$i], $string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
function getstring2($text, $params)
|
||||
{
|
||||
global $current_locale;
|
||||
return getstring2_($text, $params, $current_locale);
|
||||
}
|
||||
|
||||
function getlocal2($text, $params)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale));
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$string = str_replace("{" . $i . "}", $params[$i], $string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/* prepares for Javascript string */
|
||||
function getlocalforJS($text, $params)
|
||||
{
|
||||
global $current_locale, $webim_encoding;
|
||||
$string = myiconv($webim_encoding, getoutputenc(), getstring_($text, $current_locale));
|
||||
$string = str_replace("\"", "\\\"", str_replace("\n", "\\n", $string));
|
||||
for ($i = 0; $i < count($params); $i++) {
|
||||
$string = str_replace("{" . $i . "}", $params[$i], $string);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/* ajax server actions use utf-8 */
|
||||
function getrawparam($name)
|
||||
{
|
||||
global $webim_encoding;
|
||||
if (isset($_POST[$name])) {
|
||||
$value = myiconv("utf-8", $webim_encoding, $_POST[$name]);
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
die("no " . $name . " parameter");
|
||||
}
|
||||
|
||||
/* form processors use current Output encoding */
|
||||
function getparam($name)
|
||||
{
|
||||
global $webim_encoding;
|
||||
if (isset($_POST[$name])) {
|
||||
$value = myiconv(getoutputenc(), $webim_encoding, $_POST[$name]);
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
die("no " . $name . " parameter");
|
||||
}
|
||||
|
||||
function unicode_urldecode($url)
|
||||
{
|
||||
preg_match_all('/%u([[:alnum:]]{4})/', $url, $a);
|
||||
|
||||
foreach ($a[1] as $uniord) {
|
||||
$dec = hexdec($uniord);
|
||||
$utf = '';
|
||||
|
||||
if ($dec < 128) {
|
||||
$utf = chr($dec);
|
||||
} else if ($dec < 2048) {
|
||||
$utf = chr(192 + (($dec - ($dec % 64)) / 64));
|
||||
$utf .= chr(128 + ($dec % 64));
|
||||
} else {
|
||||
$utf = chr(224 + (($dec - ($dec % 4096)) / 4096));
|
||||
$utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64));
|
||||
$utf .= chr(128 + ($dec % 64));
|
||||
}
|
||||
$url = str_replace('%u' . $uniord, $utf, $url);
|
||||
}
|
||||
return urldecode($url);
|
||||
}
|
||||
|
||||
function getgetparam($name, $default = '')
|
||||
{
|
||||
global $webim_encoding;
|
||||
if (!isset($_GET[$name]) || !$_GET[$name]) {
|
||||
return $default;
|
||||
}
|
||||
$value = myiconv("utf-8", $webim_encoding, unicode_urldecode($_GET[$name]));
|
||||
if (get_magic_quotes_gpc()) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function connect()
|
||||
{
|
||||
global $mysqlhost, $mysqllogin, $mysqlpass, $mysqldb, $dbencoding, $force_charset_in_connection;
|
||||
if (!extension_loaded("mysql")) {
|
||||
die('Mysql extension is not loaded');
|
||||
}
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass)
|
||||
or die('Could not connect: ' . mysql_error());
|
||||
mysql_select_db($mysqldb, $link) or die('Could not select database');
|
||||
if ($force_charset_in_connection) {
|
||||
mysql_query("SET NAMES '$dbencoding'", $link);
|
||||
}
|
||||
return $link;
|
||||
}
|
||||
|
||||
function perform_query($query, $link)
|
||||
{
|
||||
mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));
|
||||
}
|
||||
|
||||
function select_one_row($query, $link)
|
||||
{
|
||||
$result = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));
|
||||
$line = mysql_fetch_array($result, MYSQL_ASSOC);
|
||||
mysql_free_result($result);
|
||||
return $line;
|
||||
}
|
||||
|
||||
function select_multi_assoc($query, $link)
|
||||
{
|
||||
$sqlresult = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));
|
||||
|
||||
$result = array();
|
||||
while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) {
|
||||
$result[] = $row;
|
||||
}
|
||||
mysql_free_result($sqlresult);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function db_build_select($fields, $table, $conditions, $orderandgroup)
|
||||
{
|
||||
$condition = count($conditions) > 0 ? " where " . implode(" and ", $conditions) : "";
|
||||
if ($orderandgroup) $orderandgroup = " " . $orderandgroup;
|
||||
return "select $fields from $table$condition$orderandgroup";
|
||||
}
|
||||
|
||||
function db_rows_count($table, $conditions, $countfields, $link)
|
||||
{
|
||||
$result = mysql_query(db_build_select("count(" . ($countfields ? $countfields : "*") . ")", $table, $conditions, ""), $link)
|
||||
or die(' Count query failed: ' . mysql_error($link));
|
||||
$line = mysql_fetch_array($result, MYSQL_NUM);
|
||||
mysql_free_result($result);
|
||||
return $line[0];
|
||||
}
|
||||
|
||||
function start_xml_output()
|
||||
{
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: text/xml; charset=utf-8");
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
}
|
||||
|
||||
function start_html_output()
|
||||
{
|
||||
$charset = getstring("output_charset");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: text/html" . (isset($charset) ? "; charset=" . $charset : ""));
|
||||
}
|
||||
|
||||
function escape_with_cdata($text)
|
||||
{
|
||||
return "<![CDATA[" . str_replace("]]>", "]]>]]><![CDATA[", $text) . "]]>";
|
||||
}
|
||||
|
||||
function form_value($key)
|
||||
{
|
||||
global $page;
|
||||
if (isset($page) && isset($page["form$key"]))
|
||||
return htmlspecialchars($page["form$key"]);
|
||||
return "";
|
||||
}
|
||||
|
||||
function form_value_cb($key)
|
||||
{
|
||||
global $page;
|
||||
if (isset($page) && isset($page["form$key"]))
|
||||
return $page["form$key"] === true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function form_value_mb($key, $id)
|
||||
{
|
||||
global $page;
|
||||
if (isset($page) && isset($page["form$key"]) && is_array($page["form$key"])) {
|
||||
return in_array($id, $page["form$key"]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function no_field($key)
|
||||
{
|
||||
return getlocal2("errors.required", array(getlocal($key)));
|
||||
}
|
||||
|
||||
function failed_uploading_file($filename, $key)
|
||||
{
|
||||
return getlocal2("errors.failed.uploading.file",
|
||||
array($filename, getlocal($key)));
|
||||
}
|
||||
|
||||
function wrong_field($key)
|
||||
{
|
||||
return getlocal2("errors.wrong_field", array(getlocal($key)));
|
||||
}
|
||||
|
||||
function get_popup($href, $jshref, $message, $title, $wndName, $options)
|
||||
{
|
||||
if (!$jshref) {
|
||||
$jshref = "'$href'";
|
||||
}
|
||||
return "<a href=\"$href\" target=\"_blank\" " . ($title ? "title=\"$title\" " : "") . "onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open($jshref, '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";
|
||||
}
|
||||
|
||||
function get_image($href, $width, $height)
|
||||
{
|
||||
if ($width != 0 && $height != 0)
|
||||
return "<img src=\"$href\" border=\"0\" width=\"$width\" height=\"$height\" alt=\"\"/>";
|
||||
return "<img src=\"$href\" border=\"0\" alt=\"\"/>";
|
||||
}
|
||||
|
||||
function get_gifimage_size($filename)
|
||||
{
|
||||
if (function_exists('gd_info')) {
|
||||
$info = gd_info();
|
||||
if (isset($info['GIF Read Support']) && $info['GIF Read Support']) {
|
||||
$img = @imagecreatefromgif($filename);
|
||||
if ($img) {
|
||||
$height = imagesy($img);
|
||||
$width = imagesx($img);
|
||||
imagedestroy($img);
|
||||
return array($width, $height);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array(0, 0);
|
||||
}
|
||||
|
||||
function add_params($servlet, $params)
|
||||
{
|
||||
$infix = '?';
|
||||
if (strstr($servlet, $infix) !== FALSE)
|
||||
$infix = '&';
|
||||
foreach ($params as $k => $v) {
|
||||
$servlet .= $infix . $k . "=" . $v;
|
||||
$infix = '&';
|
||||
}
|
||||
return $servlet;
|
||||
}
|
||||
|
||||
function div($a, $b)
|
||||
{
|
||||
return ($a - ($a % $b)) / $b;
|
||||
}
|
||||
|
||||
function date_diff_to_text($seconds)
|
||||
{
|
||||
$minutes = div($seconds, 60);
|
||||
$seconds = $seconds % 60;
|
||||
if ($minutes < 60) {
|
||||
return sprintf("%02d:%02d", $minutes, $seconds);
|
||||
} else {
|
||||
$hours = div($minutes, 60);
|
||||
$minutes = $minutes % 60;
|
||||
return sprintf("%02d:%02d:%02d", $hours, $minutes, $seconds);
|
||||
}
|
||||
}
|
||||
|
||||
function is_valid_email($email)
|
||||
{
|
||||
return preg_match("/^[^@]+@[^\.]+(\.[^\.]+)*$/", $email);
|
||||
}
|
||||
|
||||
function get_app_location($showhost, $issecure)
|
||||
{
|
||||
global $webimroot;
|
||||
if ($showhost) {
|
||||
return ($issecure ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $webimroot;
|
||||
} else {
|
||||
return $webimroot;
|
||||
}
|
||||
}
|
||||
|
||||
function is_secure_request()
|
||||
{
|
||||
return
|
||||
isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443'
|
||||
|| isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on"
|
||||
|| isset($_SERVER["HTTP_HTTPS"]) && $_SERVER["HTTP_HTTPS"] == "on";
|
||||
}
|
||||
|
||||
function get_month_selection($fromtime, $totime)
|
||||
{
|
||||
$start = getdate($fromtime);
|
||||
$month = $start['mon'];
|
||||
$year = $start['year'];
|
||||
$result = array();
|
||||
do {
|
||||
$current = mktime(0, 0, 0, $month, 1, $year);
|
||||
$result[date("m.y", $current)] = strftime("%B, %Y", $current);
|
||||
$month++;
|
||||
if ($month > 12) {
|
||||
$month = 1;
|
||||
$year++;
|
||||
}
|
||||
} while ($current < $totime);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_form_date($day, $month)
|
||||
{
|
||||
if (preg_match('/^(\d{2}).(\d{2})$/', $month, $matches)) {
|
||||
return mktime(0, 0, 0, $matches[1], $day, $matches[2]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function set_form_date($utime, $prefix)
|
||||
{
|
||||
global $page;
|
||||
$page["form${prefix}day"] = date("d", $utime);
|
||||
$page["form${prefix}month"] = date("m.y", $utime);
|
||||
}
|
||||
|
||||
function date_to_text($unixtime)
|
||||
{
|
||||
if ($unixtime < 60 * 60 * 24 * 30)
|
||||
return getlocal("time.never");
|
||||
|
||||
$then = getdate($unixtime);
|
||||
$now = getdate();
|
||||
|
||||
if ($then['yday'] == $now['yday'] && $then['year'] == $now['year']) {
|
||||
$date_format = getlocal("time.today.at");
|
||||
} else if (($then['yday'] + 1) == $now['yday'] && $then['year'] == $now['year']) {
|
||||
$date_format = getlocal("time.yesterday.at");
|
||||
} else {
|
||||
$date_format = getlocal("time.dateformat");
|
||||
}
|
||||
|
||||
return strftime($date_format . " " . getlocal("time.timeformat"), $unixtime);
|
||||
}
|
||||
|
||||
$dbversion = '1.6.3';
|
||||
$featuresversion = '1.6.4';
|
||||
|
||||
$settings = array(
|
||||
'dbversion' => 0,
|
||||
'featuresversion' => 0,
|
||||
'title' => 'Your Company',
|
||||
'hosturl' => 'http://mibew.org',
|
||||
'logo' => '',
|
||||
'usernamepattern' => '{name}',
|
||||
'chatstyle' => 'default',
|
||||
'chattitle' => 'Live Support',
|
||||
'geolink' => 'http://api.hostip.info/get_html.php?ip={ip}',
|
||||
'geolinkparams' => 'width=440,height=100,toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1',
|
||||
'max_uploaded_file_size' => 100000,
|
||||
'max_connections_from_one_host' => 10,
|
||||
|
||||
'email' => '', /* inbox for left messages */
|
||||
'left_messages_locale' => $home_locale,
|
||||
'sendmessagekey' => 'center',
|
||||
|
||||
'enableban' => '0',
|
||||
'enablessl' => '0',
|
||||
'forcessl' => '0',
|
||||
'usercanchangename' => '1',
|
||||
'enablegroups' => '0',
|
||||
'enablestatistics' => '1',
|
||||
'enablepresurvey' => '1',
|
||||
'surveyaskmail' => '0',
|
||||
'surveyaskgroup' => '1',
|
||||
'surveyaskmessage' => '0',
|
||||
'enablepopupnotification' => '0',
|
||||
'showonlineoperators' => '0',
|
||||
'enablecaptcha' => '0',
|
||||
|
||||
'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */
|
||||
'updatefrequency_operator' => 2,
|
||||
'updatefrequency_chat' => 2,
|
||||
'updatefrequency_oldchat' => 7,
|
||||
);
|
||||
$settingsloaded = false;
|
||||
$settings_in_db = array();
|
||||
|
||||
function loadsettings_($link)
|
||||
{
|
||||
global $settingsloaded, $settings_in_db, $settings, $mysqlprefix;
|
||||
if ($settingsloaded) {
|
||||
return;
|
||||
}
|
||||
$settingsloaded = true;
|
||||
|
||||
$sqlresult = mysql_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link) or die(' Query failed: ' . mysql_error($link));
|
||||
|
||||
while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) {
|
||||
$name = $row['vckey'];
|
||||
$settings[$name] = $row['vcvalue'];
|
||||
$settings_in_db[$name] = true;
|
||||
}
|
||||
mysql_free_result($sqlresult);
|
||||
}
|
||||
|
||||
function loadsettings()
|
||||
{
|
||||
global $settingsloaded;
|
||||
if (!$settingsloaded) {
|
||||
$link = connect();
|
||||
loadsettings_($link);
|
||||
mysql_close($link);
|
||||
}
|
||||
}
|
||||
|
||||
function getchatstyle()
|
||||
{
|
||||
global $settings;
|
||||
$chatstyle = verifyparam("style", "/^\w+$/", "");
|
||||
if ($chatstyle) {
|
||||
return $chatstyle;
|
||||
}
|
||||
loadsettings();
|
||||
return $settings['chatstyle'];
|
||||
}
|
||||
|
||||
function jspath()
|
||||
{
|
||||
global $jsver;
|
||||
return "js/$jsver";
|
||||
}
|
||||
|
||||
?>
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* the GNU General Public License Version 2 or later (the "GPL"), in which case
|
||||
* the provisions of the GPL are applicable instead of those above. If you wish
|
||||
* to allow use of your version of this file only under the terms of the GPL, and
|
||||
* not to allow others to use your version of this file under the terms of the
|
||||
* EPL, indicate your decision by deleting the provisions above and replace them
|
||||
* with the notice and other provisions required by the GPL.
|
||||
*
|
||||
* Contributors:
|
||||
* Evgeny Gryaznov - initial API and implementation
|
||||
*/
|
||||
|
||||
/*
|
||||
* Application path on server
|
||||
*/
|
||||
$webimroot = "/webim";
|
||||
|
||||
/*
|
||||
* Internal encoding
|
||||
*/
|
||||
$webim_encoding = "utf-8";
|
||||
|
||||
/*
|
||||
* MySQL Database parameters
|
||||
*/
|
||||
$mysqlhost = "localhost";
|
||||
$mysqldb = "webim_db";
|
||||
$mysqllogin = "webim_lite";
|
||||
$mysqlpass = "123";
|
||||
$mysqlprefix = "";
|
||||
|
||||
$dbencoding = "utf8";
|
||||
$force_charset_in_connection = true;
|
||||
|
||||
/*
|
||||
* Mailbox
|
||||
*/
|
||||
$webim_mailbox = "webim@yourdomain.com";
|
||||
$mail_encoding = "utf-8";
|
||||
|
||||
/*
|
||||
* Locales
|
||||
*/
|
||||
$home_locale = "en"; /* native name will be used in this locale */
|
||||
$default_locale = "en"; /* if user does not provide known lang */
|
||||
|
||||
?>
|