Compare commits
1484 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b655d04b34 | ||
|
|
7f84933cab | ||
|
|
5fa3e10701 | ||
|
|
95355ddec0 | ||
|
|
cbab7d2150 | ||
|
|
4284088611 | ||
|
|
f808a2b5a1 | ||
|
|
3fc955abfd | ||
|
|
615fa1119f | ||
|
|
fdf920b374 | ||
|
|
dffd82cb24 | ||
|
|
9840d1ce73 | ||
|
|
6a45bd4372 | ||
|
|
530bc996ca | ||
|
|
2f2bd03b15 | ||
|
|
53363d6808 | ||
|
|
86c0abe67e | ||
|
|
2f7dfb0286 | ||
|
|
688c5bdd20 | ||
|
|
752a9d904c | ||
|
|
a5b9fbaf00 | ||
|
|
d841303c04 | ||
|
|
5e5b9895df | ||
|
|
ac8f798e56 | ||
|
|
5c8ec5cce4 | ||
|
|
19e509d997 | ||
|
|
38b230a128 | ||
|
|
5deecfea28 | ||
|
|
009ecb0ff4 | ||
|
|
68ffddafb1 | ||
|
|
d3f741a8b6 | ||
|
|
9d664df993 | ||
|
|
89ecc07eb0 | ||
|
|
4aa9549828 | ||
|
|
9655b27f81 | ||
|
|
13b3594ff3 | ||
|
|
fb060c27ef | ||
|
|
2599d78d0c | ||
|
|
1da0042ee5 | ||
|
|
4610fa2774 | ||
|
|
5b48eb3657 | ||
|
|
43f04e4bc0 | ||
|
|
649260ce44 | ||
|
|
f091a3c9fc | ||
|
|
18338495af | ||
|
|
a3f9cf7e97 | ||
|
|
ef0f195fe8 | ||
|
|
23b53cd1ce | ||
|
|
d0d14579d1 | ||
|
|
8733d9f2a6 | ||
|
|
29da06c298 | ||
|
|
da460ff32f | ||
|
|
1509c9682b | ||
|
|
e7287152a2 | ||
|
|
082bd58805 | ||
|
|
e288f46967 | ||
|
|
984de8f46f | ||
|
|
6ad4ed87a3 | ||
|
|
be4c9a9598 | ||
|
|
be852ba857 | ||
|
|
3370e8516f | ||
|
|
108cc7b270 | ||
|
|
94316da63e | ||
|
|
2f9a044559 | ||
|
|
1f429a0033 | ||
|
|
a3ed0b94cd | ||
|
|
dd806bd031 | ||
|
|
40db68886d | ||
|
|
d5088549f8 | ||
|
|
03851ee7cc | ||
|
|
2d460117fc | ||
|
|
73cabbf822 | ||
|
|
411b7964ab | ||
|
|
bc45c5368e | ||
|
|
7a65b6cfe4 | ||
|
|
ee464c6589 | ||
|
|
a9b71f5b4a | ||
|
|
c99fb4b7f1 | ||
|
|
b28279241b | ||
|
|
5c5ae2969e | ||
|
|
3af691043d | ||
|
|
12c9e64463 | ||
|
|
875597cde1 | ||
|
|
f15c12376a | ||
|
|
e1738e8021 | ||
|
|
a33dfff188 | ||
|
|
f897cd6bc8 | ||
|
|
dfce7c6ca4 | ||
|
|
eabed9d0e5 | ||
|
|
0992822ce5 | ||
|
|
472ed909cd | ||
|
|
a60b91b21e | ||
|
|
02459ebde0 | ||
|
|
7bb69e20f5 | ||
|
|
5dd291fc60 | ||
|
|
630ccf3810 | ||
|
|
05c137c1ab | ||
|
|
a48e795f8a | ||
|
|
f620274c6a | ||
|
|
ae5b3a83f1 | ||
|
|
5e23640563 | ||
|
|
94df121e0a | ||
|
|
31e9efdae0 | ||
|
|
bb2103ac45 | ||
|
|
feb03dc194 | ||
|
|
02da3adb5a | ||
|
|
051ab698ed | ||
|
|
9014524477 | ||
|
|
9387be1aa7 | ||
|
|
d0ba2cf6d4 | ||
|
|
e33d8c288b | ||
|
|
34fbcfdfaa | ||
|
|
a85b1efa4f | ||
|
|
a5a6488757 | ||
|
|
b8aabde6c3 | ||
|
|
44d4f0a484 | ||
|
|
a124c120f4 | ||
|
|
7283e2e279 | ||
|
|
352dd364d2 | ||
|
|
fe318d4eb8 | ||
|
|
ebf540ffbc | ||
|
|
4f1031f92b | ||
|
|
705ff97892 | ||
|
|
da775d182a | ||
|
|
0f836c9d5e | ||
|
|
25f34d8ad3 | ||
|
|
edd91a7ed1 | ||
|
|
4bb93c4327 | ||
|
|
2dce7c212f | ||
|
|
d401e5e7c4 | ||
|
|
67ce5f4c9c | ||
|
|
5bd1ea0b95 | ||
|
|
9ac67b44e4 | ||
|
|
bc4a1ee500 | ||
|
|
78816f2f74 | ||
|
|
fedb5fbcf5 | ||
|
|
bb61e672b0 | ||
|
|
de6f07ec89 | ||
|
|
d0dc8c1e4c | ||
|
|
5ec2e28802 | ||
|
|
391020fd1b | ||
|
|
e46874149d | ||
|
|
7f49f6a45c | ||
|
|
901b0ac146 | ||
|
|
28bc4089d0 | ||
|
|
2bca612a92 | ||
|
|
66d72d9870 | ||
|
|
11624cd83e | ||
|
|
55b7182136 | ||
|
|
55dc6fbc1c | ||
|
|
c446ffb814 | ||
|
|
689ced2ac0 | ||
|
|
51c533536f | ||
|
|
2431631b46 | ||
|
|
e189f5f887 | ||
|
|
5a736d338b | ||
|
|
95059f2bfd | ||
|
|
1bb67f63e3 | ||
|
|
b12d254427 | ||
|
|
af909f66a7 | ||
|
|
e05f41630b | ||
|
|
ba8f8c3403 | ||
|
|
84e2bdcf76 | ||
|
|
a211c16b73 | ||
|
|
f325c29b48 | ||
|
|
d5c451c4a8 | ||
|
|
8d0cbeab38 | ||
|
|
636fb95e24 | ||
|
|
2f1ad15645 | ||
|
|
b1ed79f239 | ||
|
|
aea61bf034 | ||
|
|
2254262cf0 | ||
|
|
872e4a0513 | ||
|
|
0e1ea54c32 | ||
|
|
ff69413729 | ||
|
|
a8c2b75b9b | ||
|
|
c8ff773b96 | ||
|
|
fa78dc79f3 | ||
|
|
1ef31d27c7 | ||
|
|
f634d15768 | ||
|
|
9bc9aa123f | ||
|
|
92b08f1f07 | ||
|
|
a81011333f | ||
|
|
a2e0706d55 | ||
|
|
85ccfb4bbc | ||
|
|
2ec28a5993 | ||
|
|
8ff8a3eab9 | ||
|
|
f5573deb60 | ||
|
|
16dcbc1e67 | ||
|
|
19782655e6 | ||
|
|
c53f788cc8 | ||
|
|
440ccf19d1 | ||
|
|
fc7d9c235c | ||
|
|
0f5ae5cac8 | ||
|
|
6903dbcc0d | ||
|
|
a806c68713 | ||
|
|
393cd46a82 | ||
|
|
0576046d02 | ||
|
|
c0794a83b4 | ||
|
|
dcd636f7be | ||
|
|
83e7d89f7e | ||
|
|
02763811b3 | ||
|
|
8b9952e770 | ||
|
|
43e55eb9a6 | ||
|
|
120e578a67 | ||
|
|
411b8e48a3 | ||
|
|
d38b5ed2f5 | ||
|
|
04abfdd5a6 | ||
|
|
1662f76f03 | ||
|
|
283e5d3a5c | ||
|
|
bef5be827d | ||
|
|
a8b78dc1f5 | ||
|
|
19888b95cc | ||
|
|
3e6a55a295 | ||
|
|
bbe58dd550 | ||
|
|
a422063c7d | ||
|
|
518db97962 | ||
|
|
fdf5799857 | ||
|
|
99dc161483 | ||
|
|
f16dc7afc8 | ||
|
|
32cd0cc984 | ||
|
|
169d75d2d1 | ||
|
|
6d234daa88 | ||
|
|
f8f64e853d | ||
|
|
823b873e50 | ||
|
|
5c97280359 | ||
|
|
7e62c3fa29 | ||
|
|
c18b6cbd68 | ||
|
|
29b3950e32 | ||
|
|
17bc11bbd4 | ||
|
|
3e937266b2 | ||
|
|
a02f22aab7 | ||
|
|
b31616e5bf | ||
|
|
b1057e8cd1 | ||
|
|
7543e27eae | ||
|
|
8a43bead74 | ||
|
|
2867cd2043 | ||
|
|
88ca6fc12e | ||
|
|
e04d3c45a4 | ||
|
|
db586e0c27 | ||
|
|
4aaea422bc | ||
|
|
7fd882a088 | ||
|
|
b0396cd646 | ||
|
|
d5117a62b8 | ||
|
|
b13328140f | ||
|
|
3be0b0925c | ||
|
|
7c47b9d75c | ||
|
|
09a8b4b379 | ||
|
|
ea36ebd0df | ||
|
|
549f7a53b1 | ||
|
|
739a612824 | ||
|
|
953a2fd9b2 | ||
|
|
2fa9645dfc | ||
|
|
3bd6450333 | ||
|
|
fee258edbe | ||
|
|
e294dfa760 | ||
|
|
669013f7e6 | ||
|
|
dde482082e | ||
|
|
868e9aa058 | ||
|
|
a815e2e30b | ||
|
|
89b76530da | ||
|
|
e909c2bbce | ||
|
|
ab1e1e9114 | ||
|
|
13b0fdadb1 | ||
|
|
90580a860b | ||
|
|
6d7fdb14f0 | ||
|
|
a2cb7b9ca4 | ||
|
|
91aeb25523 | ||
|
|
bb86ee7cc4 | ||
|
|
887a59066b | ||
|
|
e060135304 | ||
|
|
6bf2c64aa2 | ||
|
|
1aba495a1c | ||
|
|
482e26ae26 | ||
|
|
c50105b8c1 | ||
|
|
530a378aa1 | ||
|
|
04935f139d | ||
|
|
5228462363 | ||
|
|
9dc831f1ef | ||
|
|
6844d7c752 | ||
|
|
cda3d23508 | ||
|
|
e4ee165e29 | ||
|
|
e0255c0dc4 | ||
|
|
6ce3ca1ce0 | ||
|
|
c3cd613f42 | ||
|
|
f2078b25ad | ||
|
|
f9ec3c66ff | ||
|
|
4760dc9bcb | ||
|
|
808f362921 | ||
|
|
43cafcc761 | ||
|
|
b00c22b69b | ||
|
|
73248fd227 | ||
|
|
7205ffb5c0 | ||
|
|
ff77f14f2f | ||
|
|
a0cba6564f | ||
|
|
35b4f0a863 | ||
|
|
0fba1a777e | ||
|
|
d47ea20aa8 | ||
|
|
be6dcb5d0a | ||
|
|
bddf8cfde4 | ||
|
|
9369150db7 | ||
|
|
0fd7634339 | ||
|
|
969a91c432 | ||
|
|
4d08fcf1a7 | ||
|
|
8048b7addc | ||
|
|
4499ee178f | ||
|
|
b17f741050 | ||
|
|
4a45c35c4e | ||
|
|
f4c94ab121 | ||
|
|
64bb1ca2bb | ||
|
|
b7386a0e88 | ||
|
|
a7ff2cc5ea | ||
|
|
dcacdd23c8 | ||
|
|
8e46b07268 | ||
|
|
2f4c441074 | ||
|
|
61f85bcb14 | ||
|
|
699ff644ad | ||
|
|
0877e5b578 | ||
|
|
46114bb24d | ||
|
|
6208ee3809 | ||
|
|
17e341d245 | ||
|
|
f22c7afc59 | ||
|
|
d7aa24fd2d | ||
|
|
255c5ae94f | ||
|
|
ab2ff4a520 | ||
|
|
1a53a4bc53 | ||
|
|
4423f4c930 | ||
|
|
9c512bb645 | ||
|
|
bd0959b5a4 | ||
|
|
fe401203bd | ||
|
|
c86032d4dc | ||
|
|
e864679942 | ||
|
|
cadef5924f | ||
|
|
1a25b0bda7 | ||
|
|
f748139606 | ||
|
|
a5aff7d0c9 | ||
|
|
2afe28785c | ||
|
|
aca719ac74 | ||
|
|
8871f8d0f4 | ||
|
|
29b377d4c5 | ||
|
|
4915a4efbb | ||
|
|
245142cc07 | ||
|
|
5ac0f371c7 | ||
|
|
cf6d51bee8 | ||
|
|
d68ce0f345 | ||
|
|
4e21c14ff6 | ||
|
|
753e1e4616 | ||
|
|
9a1f051068 | ||
|
|
bcffb6cf55 | ||
|
|
0e09dca952 | ||
|
|
3bd3686acf | ||
|
|
4493304fa7 | ||
|
|
6decffb00c | ||
|
|
54e941724f | ||
|
|
e155e7d9ce | ||
|
|
6433ce70a1 | ||
|
|
1e086a4ac8 | ||
|
|
1c3e669761 | ||
|
|
af125fbe4f | ||
|
|
43249bd4be | ||
|
|
f54aa4f21e | ||
|
|
6822415ee2 | ||
|
|
6d0e1b0e07 | ||
|
|
238303d819 | ||
|
|
998f39868f | ||
|
|
20ac91703d | ||
|
|
33bb89729c | ||
|
|
e06e64823f | ||
|
|
cd485b0fdf | ||
|
|
1cf0de568d | ||
|
|
662316e687 | ||
|
|
14383a4c4a | ||
|
|
1dc795722a | ||
|
|
08274ffab7 | ||
|
|
5ea11d1222 | ||
|
|
35b6c2baad | ||
|
|
a92f22a4a4 | ||
|
|
2fc3f381ac | ||
|
|
2a2a21a736 | ||
|
|
5a739ddc47 | ||
|
|
4ef2493e95 | ||
|
|
c98776923a | ||
|
|
bb4f9eecbe | ||
|
|
d4e91d5d9b | ||
|
|
558e3f8042 | ||
|
|
9f9b9dfd82 | ||
|
|
a8d81a68d6 | ||
|
|
abe6ab4775 | ||
|
|
9a155cf5a5 | ||
|
|
ae9e64cedf | ||
|
|
e6d62f6e05 | ||
|
|
09567da292 | ||
|
|
a1ce5df74f | ||
|
|
dede5fabeb | ||
|
|
4a4c18b8b3 | ||
|
|
06026c1c27 | ||
|
|
e2b9162a30 | ||
|
|
eec4d9b5ad | ||
|
|
376091010f | ||
|
|
ac967db4e8 | ||
|
|
af8cbf000f | ||
|
|
034032c7c2 | ||
|
|
05e11844e5 | ||
|
|
4ba91cf4e3 | ||
|
|
9a52b90f22 | ||
|
|
8ea8700eef | ||
|
|
1f128e84fb | ||
|
|
1514b0f4e5 | ||
|
|
dc066d4c9b | ||
|
|
3d6b606792 | ||
|
|
c80837a9e6 | ||
|
|
a732b2bca1 | ||
|
|
0009f7f051 | ||
|
|
7b04c7e7df | ||
|
|
b5cc26fe76 | ||
|
|
b3cb78a598 | ||
|
|
60b38a3a52 | ||
|
|
c0a896ff5e | ||
|
|
63bbde2368 | ||
|
|
91b710b07d | ||
|
|
34fee2a790 | ||
|
|
6c709551ce | ||
|
|
aa4f8b2901 | ||
|
|
3003f85a3e | ||
|
|
33573edafa | ||
|
|
95c53c7e0b | ||
|
|
a94a28bb7e | ||
|
|
7b56fdebac | ||
|
|
0905018d3b | ||
|
|
9d230b1f4c | ||
|
|
9f4064e03b | ||
|
|
461e86423a | ||
|
|
f70413a031 | ||
|
|
26b7a3aca0 | ||
|
|
75721b7e82 | ||
|
|
fa3e7a574f | ||
|
|
d4fa33dddd | ||
|
|
a0cbed80f3 | ||
|
|
128d1f7aa8 | ||
|
|
09a841f3be | ||
|
|
074bf009d8 | ||
|
|
268b96effa | ||
|
|
5a3c2b19c9 | ||
|
|
b120394b49 | ||
|
|
46c67e7f2f | ||
|
|
790660e612 | ||
|
|
2bcfa0c126 | ||
|
|
e02029ecc6 | ||
|
|
09e143dc1f | ||
|
|
53c1d3775c | ||
|
|
62ad32cf2e | ||
|
|
150e238b02 | ||
|
|
ab1d47b36f | ||
|
|
dcd658f12e | ||
|
|
34399b8b47 | ||
|
|
092c1c8c4c | ||
|
|
b265a55b81 | ||
|
|
717ae54868 | ||
|
|
ade11568f9 | ||
|
|
98541beee3 | ||
|
|
ec12b78ddf | ||
|
|
08d2adddf5 | ||
|
|
a417389934 | ||
|
|
aa6f7481a0 | ||
|
|
ff2935e70c | ||
|
|
cd21519de3 | ||
|
|
a4de63ca92 | ||
|
|
4baf5eab16 | ||
|
|
7361af85b5 | ||
|
|
8ce644af28 | ||
|
|
78040330b6 | ||
|
|
3f88a7619f | ||
|
|
056ec81a71 | ||
|
|
bc40651bc2 | ||
|
|
442b510b23 | ||
|
|
4db112e28e | ||
|
|
4fdad3b8af | ||
|
|
9c02c66ed3 | ||
|
|
d82bf2b921 | ||
|
|
3ee35b83c2 | ||
|
|
500b141341 | ||
|
|
f9cca2422a | ||
|
|
76a8006003 | ||
|
|
7ac70e1f23 | ||
|
|
a0a1246efb | ||
|
|
8705882e6e | ||
|
|
2105cfd433 | ||
|
|
16f9e7bd40 | ||
|
|
f3a753bda6 | ||
|
|
1700aedbed | ||
|
|
48b1042347 | ||
|
|
a454aad124 | ||
|
|
c8afde6f87 | ||
|
|
726576363c | ||
|
|
d2ffe29343 | ||
|
|
ce81de1409 | ||
|
|
89bbf6cd67 | ||
|
|
17c102ebe1 | ||
|
|
d6812cf75e | ||
|
|
04f7f99fc3 | ||
|
|
46a4208b3d | ||
|
|
f0f58dade8 | ||
|
|
b282e45a02 | ||
|
|
0a876e1518 | ||
|
|
1d3d713c1c | ||
|
|
da9fe27db1 | ||
|
|
f91db3ee8e | ||
|
|
c7351c0922 | ||
|
|
99247d0c59 | ||
|
|
9b13db1c48 | ||
|
|
ed79621c76 | ||
|
|
afdde44061 | ||
|
|
c462d2f15e | ||
|
|
c304361c9b | ||
|
|
bae2af09a0 | ||
|
|
12ca4caa4a | ||
|
|
a0e0b82067 | ||
|
|
9fb65e10bd | ||
|
|
f02314dfd8 | ||
|
|
af46c192bf | ||
|
|
77a8a2b9ac | ||
|
|
a0e390c6c8 | ||
|
|
09b6888526 | ||
|
|
fd7d3f9286 | ||
|
|
59a2057fa0 | ||
|
|
be6619d9c0 | ||
|
|
bb7457f43c | ||
|
|
14f701f7fc | ||
|
|
058f7277b5 | ||
|
|
5d18996362 | ||
|
|
ad3f61a215 | ||
|
|
1eab488754 | ||
|
|
471c3c4d06 | ||
|
|
ca1022675c | ||
|
|
c3920116f2 | ||
|
|
26e0fd624a | ||
|
|
4c69c56797 | ||
|
|
df03805579 | ||
|
|
b38ce967f3 | ||
|
|
dbe73cdcbe | ||
|
|
2f0ebdeade | ||
|
|
98e3e7ff9b | ||
|
|
226aad357d | ||
|
|
7c5f1e814b | ||
|
|
49a236345f | ||
|
|
840cea680c | ||
|
|
83365840af | ||
|
|
5c46e66694 | ||
|
|
b44e46f8be | ||
|
|
bca05dc89f | ||
|
|
6ee6285670 | ||
|
|
dcfe9bc64f | ||
|
|
8fd619da71 | ||
|
|
1620691cbe | ||
|
|
49bd859136 | ||
|
|
93a11ade04 | ||
|
|
343982a2f9 | ||
|
|
3da9107354 | ||
|
|
f5169bdbbb | ||
|
|
d32f583fda | ||
|
|
bab00731a8 | ||
|
|
8cd539e125 | ||
|
|
3b8a0d4773 | ||
|
|
b60098ec68 | ||
|
|
321611f865 | ||
|
|
de02fddf89 | ||
|
|
2e058c9abc | ||
|
|
a7b48b9650 | ||
|
|
844bef5070 | ||
|
|
6210b7727f | ||
|
|
01015bc0d5 | ||
|
|
2b910eb5aa | ||
|
|
9672d35d8c | ||
|
|
14e14c6c92 | ||
|
|
1c07880c01 | ||
|
|
39fe80a196 | ||
|
|
7c28a40c3e | ||
|
|
029d155a07 | ||
|
|
97e329906e | ||
|
|
c92bc60cec | ||
|
|
551eea05ed | ||
|
|
6593dff9f5 | ||
|
|
90c82e4394 | ||
|
|
924c8db712 | ||
|
|
6c60be9e8d | ||
|
|
be5187718c | ||
|
|
14183b8fb5 | ||
|
|
f34e6d8977 | ||
|
|
58ee2a49fa | ||
|
|
68c6d7a099 | ||
|
|
6c37a38980 | ||
|
|
5277e79fa2 | ||
|
|
1035c453ea | ||
|
|
afe2ba3690 | ||
|
|
01776e767d | ||
|
|
87079e8071 | ||
|
|
f83b7c2d52 | ||
|
|
45e0fc6802 | ||
|
|
cbcf389f50 | ||
|
|
fe7fba4789 | ||
|
|
3bd2288ea9 | ||
|
|
f8f69767b7 | ||
|
|
ee5fd8a0bd | ||
|
|
032cbca651 | ||
|
|
be3e0ca9a1 | ||
|
|
a5f843ba9b | ||
|
|
4781a8cb6b | ||
|
|
a38c8cc75c | ||
|
|
51c0e5a988 | ||
|
|
d2ed3a9abb | ||
|
|
1b1550fb31 | ||
|
|
04ec35d9cc | ||
|
|
e3095ce6b2 | ||
|
|
70b8f3240f | ||
|
|
673cf8d35e | ||
|
|
fed61c082c | ||
|
|
d406e2aae2 | ||
|
|
3153129e2e | ||
|
|
c618bfc607 | ||
|
|
497ebca54f | ||
|
|
64ee42fc3d | ||
|
|
f6d024cb3f | ||
|
|
e6f9f284bf | ||
|
|
7ddf51722c | ||
|
|
59dafb610d | ||
|
|
2d91aed183 | ||
|
|
3dd64e7916 | ||
|
|
048a636315 | ||
|
|
1c750dac41 | ||
|
|
5e53f36f34 | ||
|
|
8f95b8a824 | ||
|
|
5456ee7f65 | ||
|
|
277da43631 | ||
|
|
70719c67d3 | ||
|
|
43fca182e3 | ||
|
|
80ce2def46 | ||
|
|
a1f9d40d08 | ||
|
|
bdcee4fc30 | ||
|
|
bb2ec5d8dc | ||
|
|
56d1c08317 | ||
|
|
2d69b419ff | ||
|
|
fef3155e6a | ||
|
|
1a2f722cdb | ||
|
|
8fc48f2d43 | ||
|
|
2d17e1c677 | ||
|
|
a829256bc4 | ||
|
|
b6d34bffcc | ||
|
|
8e5c1135c3 | ||
|
|
89a825cd03 | ||
|
|
ce8349662d | ||
|
|
02575f46a6 | ||
|
|
441cdeff3f | ||
|
|
85a6dd6031 | ||
|
|
b4dad81767 | ||
|
|
6d0b88e242 | ||
|
|
dbeee4707b | ||
|
|
ae8623e3af | ||
|
|
41da5af721 | ||
|
|
93d4a16017 | ||
|
|
6ef0116f09 | ||
|
|
76b5c68646 | ||
|
|
b6b4827680 | ||
|
|
a310cb2fbb | ||
|
|
67069beddc | ||
|
|
331fe92b9e | ||
|
|
f0d68a1a25 | ||
|
|
66309a3fea | ||
|
|
04185b05ab | ||
|
|
2047801b85 | ||
|
|
43992dc463 | ||
|
|
fac5d81790 | ||
|
|
b56633e1d6 | ||
|
|
1732ffed7a | ||
|
|
7d0c1bb737 | ||
|
|
c444e40c01 | ||
|
|
46cb45d94b | ||
|
|
4a5d1076ed | ||
|
|
4e6072fb29 | ||
|
|
f492f808f4 | ||
|
|
547ef772ab | ||
|
|
27cd26ec1e | ||
|
|
2216c3dd32 | ||
|
|
9e251a1abc | ||
|
|
45b42cbc1c | ||
|
|
c11ebd12d5 | ||
|
|
465d89129c | ||
|
|
0336082920 | ||
|
|
24da5d82db | ||
|
|
64809dd277 | ||
|
|
6ca3442ba3 | ||
|
|
27baf46eb5 | ||
|
|
d2dcb93866 | ||
|
|
d826515ba8 | ||
|
|
b221c68e4b | ||
|
|
fd81a4bdc4 | ||
|
|
b7fb78245a | ||
|
|
571a9642a5 | ||
|
|
9e2424ee76 | ||
|
|
6d2661a8f7 | ||
|
|
0f8d2d4e58 | ||
|
|
63107f5b2f | ||
|
|
a31331bfd9 | ||
|
|
07d33a1183 | ||
|
|
0dbb024c99 | ||
|
|
ba954b8cfe | ||
|
|
3fa809ae79 | ||
|
|
1a9c1ecfb1 | ||
|
|
c6b2652c01 | ||
|
|
5a9ea29614 | ||
|
|
6cc3294395 | ||
|
|
5f229d81e9 | ||
|
|
cb70192f36 | ||
|
|
2227de5f65 | ||
|
|
3dfafb710c | ||
|
|
9f5d44fa32 | ||
|
|
cd1e5d4171 | ||
|
|
beec49847f | ||
|
|
e4503f743e | ||
|
|
635c5e532b | ||
|
|
384cb215be | ||
|
|
9e64ce7da7 | ||
|
|
661c20e452 | ||
|
|
4c27fa5c37 | ||
|
|
6cf2e9945a | ||
|
|
b21a5c3ce9 | ||
|
|
5057a4bd4c | ||
|
|
3a0db39fa0 | ||
|
|
1d8d2c6e55 | ||
|
|
dc88ccdc0b | ||
|
|
b512780e37 | ||
|
|
91dda86a74 | ||
|
|
4171854e2f | ||
|
|
24a650d7ec | ||
|
|
cb042e32bc | ||
|
|
5e94187d03 | ||
|
|
cadd958339 | ||
|
|
b06c52553d | ||
|
|
b41c5f3497 | ||
|
|
930e1fdbdc | ||
|
|
f15fd93f90 | ||
|
|
6ad14f4ca0 | ||
|
|
9d55a254dc | ||
|
|
f9aecf5d4c | ||
|
|
c57b2d25b2 | ||
|
|
3cc756f302 | ||
|
|
3e7dffb676 | ||
|
|
d7ecaa8b23 | ||
|
|
512f3a7643 | ||
|
|
c1eb796cbd | ||
|
|
dd35cad62a | ||
|
|
5f972e00fe | ||
|
|
cc0cd0b292 | ||
|
|
c92bb6176a | ||
|
|
fffb95299e | ||
|
|
40cdb70b2f | ||
|
|
feae454481 | ||
|
|
71c2cc79e5 | ||
|
|
7ac4b47702 | ||
|
|
d24cf0b85b | ||
|
|
0e2c539d93 | ||
|
|
4f24cc7377 | ||
|
|
9bf83a57bd | ||
|
|
668f56807a | ||
|
|
8d479aa1c7 | ||
|
|
296117124c | ||
|
|
0d21c6f863 | ||
|
|
b787865fbb | ||
|
|
210c91398d | ||
|
|
7a377e72e7 | ||
|
|
c2abbe2c23 | ||
|
|
5f6f87a7cd | ||
|
|
e4eff6a32b | ||
|
|
c1e44c0f54 | ||
|
|
5cf2bf6b29 | ||
|
|
56d1614ea6 | ||
|
|
c3e365ef47 | ||
|
|
4bf0c9e36a | ||
|
|
509844fd7e | ||
|
|
fb111e6d95 | ||
|
|
e177462c90 | ||
|
|
82f19e6278 | ||
|
|
edf6ad9eda | ||
|
|
a86b260f73 | ||
|
|
21f464a557 | ||
|
|
423274b923 | ||
|
|
6c4054c20b | ||
|
|
69099a2732 | ||
|
|
4bd6cf5652 | ||
|
|
d99a51e5b7 | ||
|
|
843d631111 | ||
|
|
2e4e56f7cc | ||
|
|
bd0f63980b | ||
|
|
4eead1c688 | ||
|
|
d70c42b495 | ||
|
|
660079bd2a | ||
|
|
7c600b0380 | ||
|
|
e982698de1 | ||
|
|
4b7967b938 | ||
|
|
e3c7200b6f | ||
|
|
4656856dfb | ||
|
|
019dcefeca | ||
|
|
f7309b926b | ||
|
|
217c324a98 | ||
|
|
a0cfa769bd | ||
|
|
7df62589ac | ||
|
|
93259e4e92 | ||
|
|
f560a3c98f | ||
|
|
add9890754 | ||
|
|
503b2225f0 | ||
|
|
e3a6b0012e | ||
|
|
304085606f | ||
|
|
5d4110375a | ||
|
|
5902528bae | ||
|
|
1e8dcaffc9 | ||
|
|
4b7947d98c | ||
|
|
c034fab4da | ||
|
|
4cfd7b65fb | ||
|
|
5967360991 | ||
|
|
deede8e2dd | ||
|
|
f85c6d76de | ||
|
|
131baa9f45 | ||
|
|
629c915f36 | ||
|
|
c994f26dbd | ||
|
|
886a1a5381 | ||
|
|
d4c81d8e0e | ||
|
|
a4588af0f8 | ||
|
|
1709dbd376 | ||
|
|
9937fea2e7 | ||
|
|
d6fc85f460 | ||
|
|
db25f2024e | ||
|
|
395cf86607 | ||
|
|
4fb9989b4f | ||
|
|
40a8e50471 | ||
|
|
66e1e5b1b6 | ||
|
|
ecd161d678 | ||
|
|
e9f32ef94e | ||
|
|
2cf4381e19 | ||
|
|
0844fb8d8a | ||
|
|
764d6e3407 | ||
|
|
b2ab906483 | ||
|
|
6943960f99 | ||
|
|
858a6270d5 | ||
|
|
8a60bb4619 | ||
|
|
03d3cbdbf8 | ||
|
|
89aa882c95 | ||
|
|
0fba1bb868 | ||
|
|
fad381586c | ||
|
|
a0e1a8e0a2 | ||
|
|
a486c90686 | ||
|
|
53e353abf2 | ||
|
|
dd45d0a8b2 | ||
|
|
577da0eb9e | ||
|
|
eee037f7c2 | ||
|
|
23a20ba6a5 | ||
|
|
299b9e9014 | ||
|
|
21d081e175 | ||
|
|
8e475810a7 | ||
|
|
eb86ffefbf | ||
|
|
f1afb0ddfe | ||
|
|
561372e203 | ||
|
|
66f48847c9 | ||
|
|
62e3083f23 | ||
|
|
c331e585b8 | ||
|
|
05de59d4ad | ||
|
|
2de1285121 | ||
|
|
647a9b2740 | ||
|
|
e81949bb09 | ||
|
|
42878c40fc | ||
|
|
9aadcb0bd4 | ||
|
|
82306682c6 | ||
|
|
05f9f0a393 | ||
|
|
03f692f24f | ||
|
|
014a1f0158 | ||
|
|
746ea5a369 | ||
|
|
d868ebe4ba | ||
|
|
b49e09939a | ||
|
|
91db66b32d | ||
|
|
f0faa7f9b0 | ||
|
|
ef11b3eb2b | ||
|
|
3ab92ba9d9 | ||
|
|
949cce094e | ||
|
|
09abba3dd0 | ||
|
|
84105c3b05 | ||
|
|
a70db805b7 | ||
|
|
750e0a8d11 | ||
|
|
8970d30c93 | ||
|
|
75285fd452 | ||
|
|
76c8bbf7b8 | ||
|
|
eb3e43feec | ||
|
|
08bea83c03 | ||
|
|
8892568652 | ||
|
|
ce10a44e72 | ||
|
|
0f5bc00586 | ||
|
|
50ec3b300b | ||
|
|
2c5b6cf8dc | ||
|
|
f2ec84fb13 | ||
|
|
51d791d824 | ||
|
|
db08e2cea0 | ||
|
|
619f8f752b | ||
|
|
e8958b1fb8 | ||
|
|
07b67963f1 | ||
|
|
b0a491eaa8 | ||
|
|
be3bfa3806 | ||
|
|
47c14d3ca1 | ||
|
|
6a8c583220 | ||
|
|
468e976a88 | ||
|
|
25a63dc413 | ||
|
|
61e019e176 | ||
|
|
894b3706e7 | ||
|
|
e59237e680 | ||
|
|
b05c1c391c | ||
|
|
c09bab466a | ||
|
|
46cc360e4e | ||
|
|
d6ff8dc9b6 | ||
|
|
d0d72c7fd2 | ||
|
|
f0798f7833 | ||
|
|
3ce79dd6e1 | ||
|
|
ef7225b4f6 | ||
|
|
4f4d0e416e | ||
|
|
8fde0f01b8 | ||
|
|
757489beb7 | ||
|
|
906cbbe45d | ||
|
|
dfb75840b8 | ||
|
|
75804d7ce5 | ||
|
|
62f0266f46 | ||
|
|
7773ef0ff4 | ||
|
|
0600817ef7 | ||
|
|
2f5990962c | ||
|
|
214fa81ec6 | ||
|
|
81ae0fa252 | ||
|
|
fefc78a849 | ||
|
|
98fd311891 | ||
|
|
0d415fb3c9 | ||
|
|
ffe058d48f | ||
|
|
8d0cdf5c9a | ||
|
|
aa63c23839 | ||
|
|
57214fd659 | ||
|
|
5a2b17a1da | ||
|
|
0bb5f38ba5 | ||
|
|
6f21b3dc34 | ||
|
|
ae3067200b | ||
|
|
e13d7beac4 | ||
|
|
4562e1cc1c | ||
|
|
568cf2a9e4 | ||
|
|
67dd9c2930 | ||
|
|
e9c91a3ef3 | ||
|
|
4cde513523 | ||
|
|
c2ad28a000 | ||
|
|
f7ad5bbaad | ||
|
|
2a8c4bfbae | ||
|
|
c0f7b8879d | ||
|
|
3a347d7a56 | ||
|
|
c735503f7e | ||
|
|
b0f4929d41 | ||
|
|
10a1569c9a | ||
|
|
301e5383c7 | ||
|
|
66d0b4d0d5 | ||
|
|
94212766cc | ||
|
|
5b436d8fc3 | ||
|
|
cd2d1ff02a | ||
|
|
4ab4224277 | ||
|
|
b5b2e34da5 | ||
|
|
34d28e7ba9 | ||
|
|
ada578e7e3 | ||
|
|
f826c09abc | ||
|
|
3bd7133ba3 | ||
|
|
ce38350e00 | ||
|
|
45923f408f | ||
|
|
94e92bb4bf | ||
|
|
3fadedcc54 | ||
|
|
e095cb8113 | ||
|
|
1fcf59ff94 | ||
|
|
5cfb63da50 | ||
|
|
38646fe0e1 | ||
|
|
259f425050 | ||
|
|
e418a6b3d4 | ||
|
|
340d437ab2 | ||
|
|
34f576f540 | ||
|
|
64a97d42ff | ||
|
|
beb51040c2 | ||
|
|
8fc9d87b1b | ||
|
|
ab1dec813b | ||
|
|
4a71fb0831 | ||
|
|
5a8efc10d8 | ||
|
|
1aa9ce8fe5 | ||
|
|
32dfa4e868 | ||
|
|
b507ac1f98 | ||
|
|
601706b7b5 | ||
|
|
ef952a41b3 | ||
|
|
e7f6cd2cfa | ||
|
|
8e626a0142 | ||
|
|
9845272522 | ||
|
|
d4af870bb6 | ||
|
|
7b77e05f3a | ||
|
|
a284e1f9d8 | ||
|
|
89fbb86c7b | ||
|
|
8e4dea2334 | ||
|
|
8340d152e1 | ||
|
|
ec11ebbd54 | ||
|
|
f825e27f1a | ||
|
|
e7143a265a | ||
|
|
c087d1e18b | ||
|
|
51d9c37f6b | ||
|
|
057da80f2f | ||
|
|
edf804ea67 | ||
|
|
6f586ae11a | ||
|
|
22c89b6c66 | ||
|
|
cfae618c60 | ||
|
|
7766db40f5 | ||
|
|
9c72963d7c | ||
|
|
64fe15b6f5 | ||
|
|
18349efccc | ||
|
|
73766caa81 | ||
|
|
1c5630ef5a | ||
|
|
03d95ec089 | ||
|
|
09d84b5b68 | ||
|
|
d92ceed737 | ||
|
|
9d16666484 | ||
|
|
4ff533769a | ||
|
|
e3ce0496f5 | ||
|
|
8ef422a79b | ||
|
|
4a6e6ba1b2 | ||
|
|
bb4dcbe89e | ||
|
|
8a8c757327 | ||
|
|
8c75ace6ec | ||
|
|
8b3535bd0f | ||
|
|
28b2db93dc | ||
|
|
439d41b194 | ||
|
|
08a8f195e7 | ||
|
|
eb5dfcc9df | ||
|
|
a29c84b522 | ||
|
|
ab3b126ff6 | ||
|
|
fe960d7c28 | ||
|
|
07b628b667 | ||
|
|
fcb3674ce4 | ||
|
|
ad487ec9f7 | ||
|
|
7cfe4c0f01 | ||
|
|
77ffc385ab | ||
|
|
6a17da9b08 | ||
|
|
fca405741a | ||
|
|
715847bf74 | ||
|
|
78146d6417 | ||
|
|
59779f2a0e | ||
|
|
b1e191ce21 | ||
|
|
01289048a9 | ||
|
|
dc90f103d4 | ||
|
|
7181cf9012 | ||
|
|
d304821977 | ||
|
|
2f026b66a2 | ||
|
|
55f3198c9c | ||
|
|
48db3a189f | ||
|
|
08820fd655 | ||
|
|
a3d39b223d | ||
|
|
5c5fc0a62f | ||
|
|
66991a0778 | ||
|
|
26b92c8564 | ||
|
|
f965d9dc9e | ||
|
|
538845cbf5 | ||
|
|
684b572aa8 | ||
|
|
869126259b | ||
|
|
814dfcd4ac | ||
|
|
a61c72b3b2 | ||
|
|
48be6ad5c4 | ||
|
|
a07b5ba4dd | ||
|
|
412f177c56 | ||
|
|
fbc2bb02b4 | ||
|
|
861bd15c72 | ||
|
|
b8fcfc7698 | ||
|
|
494ce9b872 | ||
|
|
a984cd2b27 | ||
|
|
215d615fc3 | ||
|
|
7a7bfd9de7 | ||
|
|
d0956eb39d | ||
|
|
4d7acdd44d | ||
|
|
5b1ef760a0 | ||
|
|
4859e6e11a | ||
|
|
c2990964f0 | ||
|
|
d4bb6c17d1 | ||
|
|
fca1a7506e | ||
|
|
27bc5fa4b0 | ||
|
|
ad6cb63e07 | ||
|
|
adec67d5fa | ||
|
|
85b7c90637 | ||
|
|
e9ae51cfbc | ||
|
|
979c05b24d | ||
|
|
3dac1a8d4a | ||
|
|
d326e7a75c | ||
|
|
4c08d7c480 | ||
|
|
e5653945d3 | ||
|
|
ffaab27e77 | ||
|
|
9ba72a06b3 | ||
|
|
a604236d89 | ||
|
|
5024fe3e2d | ||
|
|
44cb68a356 | ||
|
|
157966eb11 | ||
|
|
b7ca2b41cc | ||
|
|
8451ee20c9 | ||
|
|
d4acf41192 | ||
|
|
24d256e253 | ||
|
|
cb39d9435d | ||
|
|
0a55d6d511 | ||
|
|
0305983360 | ||
|
|
11c703cb4b | ||
|
|
657ec75c3d | ||
|
|
a79b268438 | ||
|
|
5c12b56e87 | ||
|
|
11b03ca4d2 | ||
|
|
91e3c5c34e | ||
|
|
1c821640ce | ||
|
|
7ed80bf443 | ||
|
|
1c32c5fd2a | ||
|
|
ba547c2257 | ||
|
|
dae0107dd0 | ||
|
|
d5763ba476 | ||
|
|
95311ad07e | ||
|
|
8a8689c191 | ||
|
|
dd2c4c37ff | ||
|
|
0afdb3ed4d | ||
|
|
9a04b49585 | ||
|
|
dcad9ce26a | ||
|
|
3b6d7e3066 | ||
|
|
3d8de8cf0a | ||
|
|
19ec8488e0 | ||
|
|
0e8e0b48b3 | ||
|
|
cc0d53e695 | ||
|
|
cce2b08e6b | ||
|
|
ef4a0e5af5 | ||
|
|
a68e2999f1 | ||
|
|
fc5b688716 | ||
|
|
6b327f9f4c | ||
|
|
d59c1bb6bf | ||
|
|
6a4050cc93 | ||
|
|
5abcb8c978 | ||
|
|
aa7f6111a6 | ||
|
|
b1f82257e8 | ||
|
|
bc0f4b4fa5 | ||
|
|
e6a59ad36f | ||
|
|
e375224dfe | ||
|
|
f55ef7e728 | ||
|
|
bf1ec44186 | ||
|
|
e47c08ed72 | ||
|
|
e1a209a3da | ||
|
|
76703dee84 | ||
|
|
df45c13f62 | ||
|
|
3acc5b0508 | ||
|
|
455720ae93 | ||
|
|
8073be87da | ||
|
|
8d3bf59b7b | ||
|
|
d5c56c0f5d | ||
|
|
981631752a | ||
|
|
f3c0e212bf | ||
|
|
7092458945 | ||
|
|
56772e4807 | ||
|
|
3e7ab8e113 | ||
|
|
53fca8a248 | ||
|
|
1c712ce93e | ||
|
|
dc53573975 | ||
|
|
1ad1b74512 | ||
|
|
0e91810ed6 | ||
|
|
4471f580d7 | ||
|
|
063654373d | ||
|
|
ee929752e3 | ||
|
|
88ebfe6edb | ||
|
|
e1fdac3278 | ||
|
|
d65740311b | ||
|
|
55868ad02d | ||
|
|
014b629928 | ||
|
|
4bffa49add | ||
|
|
fe37b03757 | ||
|
|
4b2bd871b7 | ||
|
|
2108173e74 | ||
|
|
08900b730b | ||
|
|
9dd545f420 | ||
|
|
fda5231a71 | ||
|
|
b03545f899 | ||
|
|
e327b8cb9a | ||
|
|
64c81ed174 | ||
|
|
87eaa6d8e5 | ||
|
|
874cff1a87 | ||
|
|
3bb0efd2cb | ||
|
|
a99ebd42ec | ||
|
|
0cfe2ecd7b | ||
|
|
e5141dd91b | ||
|
|
14f1292743 | ||
|
|
c96f1dbbe2 | ||
|
|
8fcf16ee63 | ||
|
|
9936670f44 | ||
|
|
4fc8416c3c | ||
|
|
6c178d4485 | ||
|
|
8bd8af7d16 | ||
|
|
b4f8f4df7b | ||
|
|
98e2b2a60b | ||
|
|
eb69f6c346 | ||
|
|
2cb3ccbf14 | ||
|
|
6ac3fc4e07 | ||
|
|
fb1e3cba8b | ||
|
|
94d6461568 | ||
|
|
09f1e4bdfb | ||
|
|
8dceb8e3a7 | ||
|
|
d942818bd9 | ||
|
|
1acef2e242 | ||
|
|
e2814f5d80 | ||
|
|
542d9130b5 | ||
|
|
159d6469fd | ||
|
|
53445ba6bd | ||
|
|
1810edae93 | ||
|
|
7f9ab491f2 | ||
|
|
77190cca92 | ||
|
|
babe14410c | ||
|
|
d2e3e3003a | ||
|
|
56d981c8ef | ||
|
|
250d758d74 | ||
|
|
e32f9e0354 | ||
|
|
0325efeb35 | ||
|
|
9ab33f1e13 | ||
|
|
66c0ac591c | ||
|
|
6241967112 | ||
|
|
250d947667 | ||
|
|
6a49e3124e | ||
|
|
4cd0b745cb | ||
|
|
16f584608f | ||
|
|
88d0bf94d8 | ||
|
|
241a0829dc | ||
|
|
66a0b4790e | ||
|
|
46ab7ca786 | ||
|
|
3efe144fa0 | ||
|
|
744960d36d | ||
|
|
727b49c8ab | ||
|
|
0aa01740d1 | ||
|
|
1c75e71eb3 | ||
|
|
fbc57fa8e3 | ||
|
|
60fcb5f4f2 | ||
|
|
eb1e9edd33 | ||
|
|
6b6c2ccfa3 | ||
|
|
8a4ee0506c | ||
|
|
ee2ba21246 | ||
|
|
8e6ebd4f7b | ||
|
|
76af8fa754 | ||
|
|
601ebee969 | ||
|
|
becd5f1446 | ||
|
|
ab363e3132 | ||
|
|
7c655c8d61 | ||
|
|
7386fa57c8 | ||
|
|
3f2b7d756c | ||
|
|
cba602bf64 | ||
|
|
78c9f752af | ||
|
|
d13a6180be | ||
|
|
d479ed00e4 | ||
|
|
cf4588f16f | ||
|
|
67b6d41d57 | ||
|
|
601f1eb624 | ||
|
|
301b41eaa4 | ||
|
|
ed0d7890ab | ||
|
|
f50ae07560 | ||
|
|
8e53491867 | ||
|
|
d43542dd7a | ||
|
|
3c3c0ed342 | ||
|
|
8d9c47acdf | ||
|
|
9d69792e08 | ||
|
|
5b4aa71878 | ||
|
|
240db7b602 | ||
|
|
aff476d0d4 | ||
|
|
d5ff82bbe4 | ||
|
|
c8dbcf8a2a | ||
|
|
d893eb67b8 | ||
|
|
5dad444026 | ||
|
|
217a684e5f | ||
|
|
1ef558d7e6 | ||
|
|
7b6ddeb859 | ||
|
|
b12dc89bb1 | ||
|
|
a387868540 | ||
|
|
59caf141d1 | ||
|
|
1ac35dd047 | ||
|
|
458f2e748d | ||
|
|
b62dee4c90 | ||
|
|
6ea7ef43e0 | ||
|
|
3838472a8e | ||
|
|
064464a553 | ||
|
|
9bf366b7d4 | ||
|
|
4668f36ddd | ||
|
|
a68308b164 | ||
|
|
f7e3d0dbf6 | ||
|
|
bd3bc503ed | ||
|
|
e2eb36ded6 | ||
|
|
4ac3cec66e | ||
|
|
823729d2c1 | ||
|
|
34b38f06e0 | ||
|
|
0fef599341 | ||
|
|
124e08efde | ||
|
|
66338a5757 | ||
|
|
ebee3e208c | ||
|
|
f8cf68ab53 | ||
|
|
28c85cf3ae | ||
|
|
cf4e2b2953 | ||
|
|
f3d3ec5744 | ||
|
|
29829eb011 | ||
|
|
129e6bddde | ||
|
|
8260817cf7 | ||
|
|
47d15f3bf4 | ||
|
|
96d439bcee | ||
|
|
47fab97210 | ||
|
|
5dec3ff18e | ||
|
|
bd3e5156c4 | ||
|
|
fccc1da666 | ||
|
|
55995b0494 | ||
|
|
eb17598254 | ||
|
|
0d512dffc3 | ||
|
|
988028577b | ||
|
|
6cf3ebb7db | ||
|
|
c571ca40d7 | ||
|
|
3a17225546 | ||
|
|
5e541ff53b | ||
|
|
9b19e40a74 | ||
|
|
71a30cd9a5 | ||
|
|
766a7fb1b4 | ||
|
|
40a7446e3e | ||
|
|
fc96cd3710 | ||
|
|
40c625158f | ||
|
|
7dad842f35 | ||
|
|
909f67fb3a | ||
|
|
ef27a1ce6c | ||
|
|
75471ba10f | ||
|
|
e7d20efb1b | ||
|
|
a8d527f1cd | ||
|
|
e5f3296c6b | ||
|
|
9d584fc720 | ||
|
|
92e0c502f7 | ||
|
|
b5d4acf10a | ||
|
|
47fbdda409 | ||
|
|
1bb6dfc9a0 | ||
|
|
549866c090 | ||
|
|
7b69dc574b | ||
|
|
5e47b767ea | ||
|
|
5376a734d4 | ||
|
|
3f1a4b6559 | ||
|
|
11a7a08b9d | ||
|
|
d16bbfb224 | ||
|
|
48959d5606 | ||
|
|
94e548b07a | ||
|
|
4be48b8d8b | ||
|
|
9cd715bbbf | ||
|
|
04d66ba7f4 | ||
|
|
7efcb3c75f | ||
|
|
359bfb76f6 | ||
|
|
0e1c628066 | ||
|
|
65bc146afa | ||
|
|
7ef641e256 | ||
|
|
9630d2ef2c | ||
|
|
6e9d5a03c2 | ||
|
|
839c154869 | ||
|
|
6995d54a3c | ||
|
|
d31df715fb | ||
|
|
26fa091aa2 | ||
|
|
cfbeb1655d | ||
|
|
39c194c5c3 | ||
|
|
9dfb471c0b | ||
|
|
f51a7225c8 | ||
|
|
1d903655af | ||
|
|
9abb061e71 | ||
|
|
6e48c36519 | ||
|
|
d450fc61c4 | ||
|
|
a899ce1c22 | ||
|
|
1a737be2b4 | ||
|
|
fae9c23637 | ||
|
|
1159dd59ed | ||
|
|
0ce7358f0f | ||
|
|
41749f5eda | ||
|
|
1567b7b383 | ||
|
|
e70bd0054c | ||
|
|
b450b6a435 | ||
|
|
0403738981 | ||
|
|
0d7062ffdf | ||
|
|
8f59b2d3e0 | ||
|
|
1b290f573a | ||
|
|
b77169f1d8 | ||
|
|
00d8783e45 | ||
|
|
cf5beafcfd | ||
|
|
cdaf5f3fc0 | ||
|
|
bdf50a824e | ||
|
|
f23c8e7597 | ||
|
|
52657b6215 | ||
|
|
28cd2759d7 | ||
|
|
12f33d2cd4 | ||
|
|
11cdc36bcc | ||
|
|
22d45a8d1e | ||
|
|
7d9d1e0cdb | ||
|
|
98b53801e0 | ||
|
|
bff1e215cc | ||
|
|
6efef3922b | ||
|
|
caec565de5 | ||
|
|
16a2bfa95b | ||
|
|
60da235efb | ||
|
|
71e0e55b0b | ||
|
|
b28ff509b1 | ||
|
|
8467ecb1d7 | ||
|
|
1f47f4ff96 | ||
|
|
4fef29e61c | ||
|
|
56c3d5dbcb | ||
|
|
ceed0f7a1b | ||
|
|
906d91d4d1 | ||
|
|
e539a9e7bd | ||
|
|
1be98d7b7f | ||
|
|
66832c41e9 | ||
|
|
8e4c5db766 | ||
|
|
1dc3253d4a | ||
|
|
feebe7d4c6 | ||
|
|
9a8071e014 | ||
|
|
9ce817bb6e | ||
|
|
fe2a937cf2 | ||
|
|
1cf90dd14d | ||
|
|
6823f0aa52 | ||
|
|
f2efa8c753 | ||
|
|
e5cfb8a0cd | ||
|
|
4a3149d1ba | ||
|
|
dafe0a5547 | ||
|
|
fe5f1e4d67 | ||
|
|
859195d07a | ||
|
|
a782c9944c | ||
|
|
39055c919c | ||
|
|
325cbfcdb3 | ||
|
|
69e7a7594a | ||
|
|
c489f734db | ||
|
|
60a54e9aac | ||
|
|
280baf7c82 | ||
|
|
59a9f6bf02 | ||
|
|
2aff3a1a05 | ||
|
|
25988ddefa | ||
|
|
c99962106d | ||
|
|
52c1f79f2e | ||
|
|
e67ff5c122 | ||
|
|
37b7b2f1a8 | ||
|
|
fd5764e166 | ||
|
|
c49eec71f0 | ||
|
|
812d904c98 | ||
|
|
a4fdf3fbbb | ||
|
|
9090bfd1c3 | ||
|
|
b58bf75f21 | ||
|
|
189a15fe37 | ||
|
|
c7d9a5ac91 | ||
|
|
8aa4af372d | ||
|
|
d5e90d678a | ||
|
|
0061ac8584 | ||
|
|
f648809856 | ||
|
|
687114b407 | ||
|
|
40f805c94a | ||
|
|
c80f4feb62 | ||
|
|
2d06e86b5b | ||
|
|
400441d56b | ||
|
|
7d92e9026e | ||
|
|
42416aad22 | ||
|
|
9d51318c53 | ||
|
|
cdb1bc9be6 | ||
|
|
52183f8bf8 | ||
|
|
c2714262b3 | ||
|
|
a58f386831 | ||
|
|
656ec585b2 | ||
|
|
9497c6c0f7 | ||
|
|
4dd05dc4e8 | ||
|
|
ccbc532c1a | ||
|
|
48d2b3afa8 | ||
|
|
f273815d8f | ||
|
|
8797049144 | ||
|
|
09009d4b32 | ||
|
|
5cc6c6c1e9 | ||
|
|
d2e22d8c2f | ||
|
|
2862baeee1 | ||
|
|
47b2959486 | ||
|
|
c61853ff0b | ||
|
|
0f36916fb4 | ||
|
|
b9664f6980 | ||
|
|
0e76cec28f | ||
|
|
b772a5f564 | ||
|
|
4372e1fcda | ||
|
|
4ae503bef7 | ||
|
|
51e40add66 | ||
|
|
8123a62302 | ||
|
|
991db80646 | ||
|
|
b1876ac14f | ||
|
|
e8e61c83d5 | ||
|
|
20ae69ab7b | ||
|
|
5877e28d72 | ||
|
|
9ca7cc565b | ||
|
|
0956dcadd3 | ||
|
|
304c393f38 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -19,10 +19,11 @@
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
|
||||||
## Ignore RedMatrix site specific files and folders
|
## Ignore site specific files and folders
|
||||||
.htconfig.php
|
.htconfig.php
|
||||||
favicon.*
|
favicon.*
|
||||||
addon/
|
addon/
|
||||||
|
widget/
|
||||||
custom/
|
custom/
|
||||||
/store/
|
/store/
|
||||||
# site apps
|
# site apps
|
||||||
|
|||||||
@@ -2,10 +2,19 @@
|
|||||||
|
|
||||||
Run hubzilla-setup.sh for an unattended installation of hubzilla.
|
Run hubzilla-setup.sh for an unattended installation of hubzilla.
|
||||||
|
|
||||||
The script is known to work with Debian 8.3 stable (Jessie)
|
The script is known to work without adjustments with
|
||||||
|
|
||||||
+ Home-PC (Debian-8.3.0-amd64)
|
+ Hardware
|
||||||
+ DigitalOcean droplet (Debian 8.3 x64 / 512 MB Memory / 20 GB Disk / NYC3)
|
- Mini-PC with Debian-9.2-amd64, or
|
||||||
|
- Rapberry 3 with Raspbian, Debian-9.3
|
||||||
|
+ DynDNS
|
||||||
|
- selfHOST.de
|
||||||
|
- freedns.afraid.org
|
||||||
|
|
||||||
|
## Disclaimers
|
||||||
|
|
||||||
|
- This script does work with Debian 9 only.
|
||||||
|
- This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation).
|
||||||
|
|
||||||
# Step-by-Step Overwiew
|
# Step-by-Step Overwiew
|
||||||
|
|
||||||
@@ -14,25 +23,28 @@ The script is known to work with Debian 8.3 stable (Jessie)
|
|||||||
Hardware
|
Hardware
|
||||||
|
|
||||||
+ Internet connection and router at home
|
+ Internet connection and router at home
|
||||||
+ Mini-pc connected to your router
|
+ Mini-pc connected to your router (a Raspberry 3 will do for very small Hubs)
|
||||||
+ USB drive for backups
|
+ USB drive for backups
|
||||||
|
|
||||||
Software
|
Software
|
||||||
|
|
||||||
+ Fresh installation of Debian on your mini-pc
|
+ Fresh installation of Debian 9 (Stretch)
|
||||||
+ Router with open ports 80 and 443 for your Debian
|
+ Router with open ports 80 and 443 for your Hub
|
||||||
|
|
||||||
## The basic steps (quick overview)
|
## The basic steps (quick overview)
|
||||||
|
|
||||||
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
||||||
+ Log on to your new debian (server)
|
+ Log on to your fresh Debian
|
||||||
- apt-get install git
|
- apt-get install git
|
||||||
- mkdir -p /var/www
|
- mkdir -p /var/www
|
||||||
- cd /var/www
|
- cd /var/www
|
||||||
- git clone https://github.com/redmatrix/hubzilla.git html
|
- git clone https://github.com/redmatrix/hubzilla.git html
|
||||||
- cp .homeinstall/hubzilla-config.txt.template .homeinstall/hubzilla-config.txt
|
- cd /html/.homeinstall
|
||||||
- nano .homeinstall/hubzilla-config.txt
|
- cp hubzilla-config.txt.template hubzilla-config.txt
|
||||||
- Enter your values there: db pass, domain, values for dyn DNS
|
- nano hubzilla-config.txt
|
||||||
|
- Read the comments carefully
|
||||||
|
- Enter your values: db pass, domain, values for dyn DNS
|
||||||
|
- Make sure your external drive (for backups) is mounted
|
||||||
- hubzilla-setup.sh as root
|
- hubzilla-setup.sh as root
|
||||||
- ... wait, wait, wait until the script is finised
|
- ... wait, wait, wait until the script is finised
|
||||||
- reboot
|
- reboot
|
||||||
@@ -46,23 +58,44 @@ Software
|
|||||||
|
|
||||||
### Recommended: USB Drive for Backups
|
### Recommended: USB Drive for Backups
|
||||||
|
|
||||||
The installation will create a daily backup.
|
The installation will create a daily backup written to an external drive.
|
||||||
|
|
||||||
If the backup process does not find an external device than the backup goes to
|
The USB drive must be compatible with the filesystems
|
||||||
the internal disk.
|
|
||||||
|
|
||||||
The USB drive must be compatible with an encrpyted filesystem LUKS + ext4.
|
- ext4 (if you do not want to encrypt the USB)
|
||||||
|
- LUKS + ext4 (if you want to encrypt the USB)
|
||||||
|
|
||||||
|
The backup includes
|
||||||
|
|
||||||
|
- Hubzilla DB
|
||||||
|
- Hubzilla installation /var/www/html
|
||||||
|
- Certificates for letsencrypt
|
||||||
|
|
||||||
## Preparations Software
|
## Preparations Software
|
||||||
|
|
||||||
### Install Debian Linux on the Mini-PC
|
### Install Debian Linux on the Mini-PC
|
||||||
|
|
||||||
Download the stable Debian at https://www.debian.org/
|
Download the stable Debian at https://www.debian.org/
|
||||||
|
(Debian 8 is no longer supported.)
|
||||||
|
|
||||||
Create bootable USB drive with Debian on it. You could use the programm
|
Create bootable USB drive with Debian on it.You could use
|
||||||
unetbootin, https://en.wikipedia.org/wiki/UNetbootin
|
|
||||||
|
|
||||||
Switch of your mini pc, plug in your USB drive and start the mini pc from the
|
- unetbootin, https://en.wikipedia.org/wiki/UNetbootin
|
||||||
|
- or simply the linux command "dd"
|
||||||
|
|
||||||
|
Example for command dd...
|
||||||
|
|
||||||
|
su -
|
||||||
|
dd if=2017-11-29-raspbian-stretch.img of=/dev/mmcblk0
|
||||||
|
|
||||||
|
Do not forget to unmount the SD card before and check if unmounted like in this example...
|
||||||
|
|
||||||
|
su -
|
||||||
|
umount /dev/mmcblk0*
|
||||||
|
df -h
|
||||||
|
|
||||||
|
|
||||||
|
Switch off your mini pc, plug in your USB drive and start the mini pc from the
|
||||||
stick. Install Debian. Follow the instructions of the installation.
|
stick. Install Debian. Follow the instructions of the installation.
|
||||||
|
|
||||||
### Configure your Router
|
### Configure your Router
|
||||||
@@ -79,28 +112,20 @@ You can use subdomains as well
|
|||||||
|
|
||||||
my.cooldomain.org
|
my.cooldomain.org
|
||||||
|
|
||||||
There are two way to get a domain
|
There are two ways to get a domain...
|
||||||
|
|
||||||
- buy a domain (recommended) or
|
### Method 1: Buy a Domain
|
||||||
- register a free subdomain
|
|
||||||
|
|
||||||
### Method 1: Get yourself an own Domain (recommended)
|
...for example buy at selfHOST.de
|
||||||
|
|
||||||
...for example at selfHOST.de
|
The cost are around 10,- € once and 1,50 € per month (2017).
|
||||||
|
|
||||||
### Method 2 Register a (free) Subdomain
|
The cost are around 10,- € once and 1,50 € per month (2017).
|
||||||
|
|
||||||
Register a free subdomain for example at
|
...for example register at freedns.afraid.org
|
||||||
|
|
||||||
- freeDNS
|
Follow the instructions in .homeinstall/hubzilla-config.txt.
|
||||||
- selfHOST
|
|
||||||
|
|
||||||
WATCH THIS: A free subdomain is not the prefered way to get a domain name. Why?
|
|
||||||
|
|
||||||
Let's encrpyt issues a limited number of certificates each
|
|
||||||
day. Possibly other users of this domain will try to issue a certificate
|
|
||||||
at the same day as you do. So make sure you choose a domain with as less subdomains as
|
|
||||||
possible.
|
|
||||||
|
|
||||||
## Install Hubzilla on your Debian
|
## Install Hubzilla on your Debian
|
||||||
|
|
||||||
@@ -135,10 +160,12 @@ Copy the template file
|
|||||||
|
|
||||||
cp hubzilla-config.txt.template hubzilla-config.txt
|
cp hubzilla-config.txt.template hubzilla-config.txt
|
||||||
|
|
||||||
Change the file "hubzilla-config.txt". Read the instructions there and enter your values.
|
Modify the file "hubzilla-config.txt". Read the instructions there carefully and enter your values.
|
||||||
|
|
||||||
nano hubzilla-config.txt
|
nano hubzilla-config.txt
|
||||||
|
|
||||||
|
Make sure your external drive (for backups) is plugged in and can be mounted as configured in "hubzilla-config.txt". Otherwise the daily backups will not work.
|
||||||
|
|
||||||
Run the script
|
Run the script
|
||||||
|
|
||||||
./hubzilla-setup.sh
|
./hubzilla-setup.sh
|
||||||
@@ -146,7 +173,7 @@ Run the script
|
|||||||
Wait... The script should not finish with an error message.
|
Wait... The script should not finish with an error message.
|
||||||
|
|
||||||
In a webbrowser open your domain.
|
In a webbrowser open your domain.
|
||||||
Expected: A test page of hubzilla is shown. All checks there shoulg be
|
Expected: A test page of hubzilla is shown. All checks there should be
|
||||||
successfull. Go on...
|
successfull. Go on...
|
||||||
Expected: A page for the Hubzilla server configuration shows up.
|
Expected: A page for the Hubzilla server configuration shows up.
|
||||||
|
|
||||||
@@ -162,3 +189,28 @@ Leave db type "MySQL" untouched.
|
|||||||
|
|
||||||
Follow the instructions in the next pages.
|
Follow the instructions in the next pages.
|
||||||
|
|
||||||
|
After the daily script was executed at 05:30 (am)
|
||||||
|
|
||||||
|
- look at var/www/html/hubzilla-daily.log
|
||||||
|
- check your backup on the external drive
|
||||||
|
- optionally view the daily log under yourdomain.org/admin/logs/
|
||||||
|
- set the logfile to var/www/html/hubzilla-daily.log
|
||||||
|
|
||||||
|
## Note for the Rasperry
|
||||||
|
|
||||||
|
The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
|
||||||
|
|
||||||
|
It is recommended to deinstall these programms to avoid endless updates. Use...
|
||||||
|
|
||||||
|
sudo apt-get purge wolfram-engine sonic-pi
|
||||||
|
sudo apt-get autoremove
|
||||||
|
|
||||||
|
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
|
||||||
|
|
||||||
|
sudo raspi-config
|
||||||
|
|
||||||
|
to boot the Rapsi to the client console.
|
||||||
|
|
||||||
|
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -70,15 +70,17 @@ selfhost_pass=
|
|||||||
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
|
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#freedns_key=
|
freedns_key=
|
||||||
|
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
### OPTIONAL - Backup to external device ######
|
### OPTIONAL - Backup to external device ######
|
||||||
#
|
#
|
||||||
# The script can use an external device for the daily backup.
|
# The script can use an external device for the daily backup.
|
||||||
# The file system of the device (USB stick for example) must be compatible
|
# The file system of the device (USB stick for example) must be compatible with
|
||||||
# with encrypted LUKS + ext4
|
#
|
||||||
|
# - encrypted LUKS + ext4, or
|
||||||
|
# - ext4
|
||||||
#
|
#
|
||||||
# You should test to mount the device befor you run the script
|
# You should test to mount the device befor you run the script
|
||||||
# (hubzilla-setup.sh).
|
# (hubzilla-setup.sh).
|
||||||
@@ -113,27 +115,21 @@ selfhost_pass=
|
|||||||
# lsof /media/hubzilla_backup
|
# lsof /media/hubzilla_backup
|
||||||
#
|
#
|
||||||
# If you leave the following parameters
|
# If you leave the following parameters
|
||||||
|
#
|
||||||
# - "backup_device_name" and
|
# - "backup_device_name" and
|
||||||
# - "backup_device_pass"
|
# - "backup_device_pass"
|
||||||
|
#
|
||||||
# empty the script will create daily backups on the internal disk (which could
|
# empty the script will create daily backups on the internal disk (which could
|
||||||
# save you as well).
|
# save you as well).
|
||||||
#
|
#
|
||||||
# Example: backup_device_name=/dev/sdc1
|
# Example: backup_device_name=/dev/sdc1
|
||||||
#
|
#
|
||||||
|
# Leave "backup_device_pass=" empty if the external device is not encrypted.
|
||||||
|
#
|
||||||
backup_device_name=
|
backup_device_name=
|
||||||
backup_device_pass=
|
backup_device_pass=
|
||||||
|
|
||||||
|
|
||||||
###############################################
|
|
||||||
### OPTIONAL - Owncloud - deprecated ##########
|
|
||||||
#
|
|
||||||
# To install owncloud: owncloud=y
|
|
||||||
# Leave empty if you don't want to install owncloud
|
|
||||||
#
|
|
||||||
#owncloud=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
### OPTIONAL - do not mess with things below ##
|
### OPTIONAL - do not mess with things below ##
|
||||||
# (...if you are not certain)
|
# (...if you are not certain)
|
||||||
@@ -160,18 +156,3 @@ mysqlpass=$db_pass
|
|||||||
# Example: phpmyadminpass="aber hallo has blanks in it"
|
# Example: phpmyadminpass="aber hallo has blanks in it"
|
||||||
phpmyadminpass=$db_pass
|
phpmyadminpass=$db_pass
|
||||||
|
|
||||||
# TODO Prepare hubzilla for programmers
|
|
||||||
# - install eclipse and plugins
|
|
||||||
# - install xdebug to debug the php with eclipse
|
|
||||||
# - weaken permissions on /var/www/html
|
|
||||||
# - manual steps after this script
|
|
||||||
# * in eclipse: install plugins for php git hub
|
|
||||||
# * in eclipse: configure firefox (chrome,...) as browser to run with the php debuger
|
|
||||||
# * in eclipse: switch php debugger from zend to xdebug
|
|
||||||
# * in eclipse: add local hubzilla github repository
|
|
||||||
#
|
|
||||||
# Which user will use eclipse?
|
|
||||||
# Leave this empty if you do not want to prepare hubzilla for debugging
|
|
||||||
#
|
|
||||||
#developer_name=
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,11 @@ function check_sanity {
|
|||||||
fi
|
fi
|
||||||
if [ ! -f /etc/debian_version ]
|
if [ ! -f /etc/debian_version ]
|
||||||
then
|
then
|
||||||
die "Ubuntu is not supported"
|
die "Debian is supported only"
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Linux 9' /etc/issue
|
||||||
|
then
|
||||||
|
die "Linux 9 (stretch) is supported only"x
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,11 +257,11 @@ function install_sendmail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install_php {
|
function install_php {
|
||||||
# openssl and mbstring are included in libapache2-mod-php5
|
# openssl and mbstring are included in libapache2-mod-php
|
||||||
# to_to: php5-suhosin
|
|
||||||
print_info "installing php..."
|
print_info "installing php..."
|
||||||
nocheck_install "libapache2-mod-php5 php5 php-pear php5-xcache php5-curl php5-mcrypt php5-gd"
|
nocheck_install "libapache2-mod-php php php-pear php-curl php-mcrypt php-gd"
|
||||||
php5enmod mcrypt
|
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/7.0/apache2/php.ini
|
||||||
|
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/7.0/apache2/php.ini
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_mysql {
|
function install_mysql {
|
||||||
@@ -277,18 +281,17 @@ function install_mysql {
|
|||||||
# want to be prompted for it then this can be arranged by preseeding the
|
# want to be prompted for it then this can be arranged by preseeding the
|
||||||
# DebConf database with the required information.
|
# DebConf database with the required information.
|
||||||
#
|
#
|
||||||
# echo mysql-server-5.5 mysql-server/root_password password xyzzy | debconf-set-selections
|
# echo mysql-server mysql-server/root_password password xyzzy | debconf-set-selections
|
||||||
# echo mysql-server-5.5 mysql-server/root_password_again password xyzzy | debconf-set-selections
|
# echo mysql-server mysql-server/root_password_again password xyzzy | debconf-set-selections
|
||||||
#
|
#
|
||||||
print_info "installing mysql..."
|
print_info "installing mysql..."
|
||||||
if [ -z "$mysqlpass" ]
|
if [ -z "$mysqlpass" ]
|
||||||
then
|
then
|
||||||
die "mysqlpass not set in $configfile"
|
die "mysqlpass not set in $configfile"
|
||||||
fi
|
fi
|
||||||
echo mysql-server-5.5 mysql-server/root_password password $mysqlpass | debconf-set-selections
|
echo mysql-server mysql-server/root_password password $mysqlpass | debconf-set-selections
|
||||||
echo mysql-server-5.5 mysql-server/root_password_again password $mysqlpass | debconf-set-selections
|
echo mysql-server mysql-server/root_password_again password $mysqlpass | debconf-set-selections
|
||||||
nocheck_install "php5-mysql mysql-server mysql-client"
|
nocheck_install "php-mysql mysql-server mysql-client"
|
||||||
php5enmod mcrypt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_phpmyadmin {
|
function install_phpmyadmin {
|
||||||
@@ -327,6 +330,7 @@ function install_phpmyadmin {
|
|||||||
echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
|
echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
|
||||||
fi
|
fi
|
||||||
service apache2 restart
|
service apache2 restart
|
||||||
|
/etc/init.d/mysql start
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_hubzilla_db {
|
function create_hubzilla_db {
|
||||||
@@ -455,11 +459,6 @@ function configure_cron_selfhost {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_git {
|
|
||||||
print_info "installing git..."
|
|
||||||
nocheck_install "git"
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_letsencrypt {
|
function install_letsencrypt {
|
||||||
print_info "installing let's encrypt ..."
|
print_info "installing let's encrypt ..."
|
||||||
# check if user gave domain
|
# check if user gave domain
|
||||||
@@ -511,6 +510,8 @@ END
|
|||||||
then
|
then
|
||||||
die "Failed to load $url_http"
|
die "Failed to load $url_http"
|
||||||
fi
|
fi
|
||||||
|
# accept terms of service of letsencrypt
|
||||||
|
./dehydrated --register --accept-terms
|
||||||
# run script dehydrated
|
# run script dehydrated
|
||||||
#
|
#
|
||||||
./dehydrated --cron --config $le_dir/config.sh
|
./dehydrated --cron --config $le_dir/config.sh
|
||||||
@@ -564,17 +565,13 @@ function check_https {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install_hubzilla {
|
function install_hubzilla {
|
||||||
print_info "installing hubzilla..."
|
print_info "installing hubzilla addons..."
|
||||||
# rm -R /var/www/html/ # for "stand alone" usage
|
cd /var/www/html/
|
||||||
cd /var/www/
|
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
|
||||||
# git clone https://github.com/redmatrix/hubzilla html # for "stand alone" usage
|
|
||||||
cd html/
|
|
||||||
git clone https://github.com/redmatrix/hubzilla-addons addon
|
|
||||||
mkdir -p "store/[data]/smarty3"
|
mkdir -p "store/[data]/smarty3"
|
||||||
chmod -R 777 store
|
chmod -R 777 store
|
||||||
touch .htconfig.php
|
touch .htconfig.php
|
||||||
chmod ou+w .htconfig.php
|
chmod ou+w .htconfig.php
|
||||||
install_hubzilla_plugins
|
|
||||||
cd /var/www/
|
cd /var/www/
|
||||||
chown -R www-data:www-data html
|
chown -R www-data:www-data html
|
||||||
chown root:www-data /var/www/html/
|
chown root:www-data /var/www/html/
|
||||||
@@ -589,73 +586,6 @@ function install_hubzilla {
|
|||||||
print_info "installed hubzilla"
|
print_info "installed hubzilla"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_hubzilla_plugins {
|
|
||||||
print_info "installing hubzilla plugins..."
|
|
||||||
cd /var/www/html
|
|
||||||
plugin_install=.homeinstall/plugin_install.txt
|
|
||||||
theme_install=.homeinstall/theme_install.txt
|
|
||||||
# overwrite script to update the plugin and themes
|
|
||||||
rm -f $plugins_update
|
|
||||||
echo "cd /var/www/html" >> $plugins_update
|
|
||||||
###################
|
|
||||||
# write plugin file
|
|
||||||
if [ ! -f "$plugin_install" ]
|
|
||||||
then
|
|
||||||
echo "# To install a plugin" >> $plugin_install
|
|
||||||
echo "# 1. add the plugin in a new line and run" >> $plugin_install
|
|
||||||
echo "# 2. run" >> $plugin_install
|
|
||||||
echo "# cd /var/www/html/.homeinstall" >> $plugin_install
|
|
||||||
echo "# ./hubzilla-setup.sh" >> $plugin_install
|
|
||||||
echo "https://gitlab.com/zot/ownmapp.git ownMapp" >> $plugin_install
|
|
||||||
echo "https://gitlab.com/zot/hubzilla-chess.git chess" >> $plugin_install
|
|
||||||
fi
|
|
||||||
# install plugins
|
|
||||||
while read -r line; do
|
|
||||||
[[ "$line" =~ ^#.*$ ]] && continue
|
|
||||||
p_url=$(echo $line | awk -F' ' '{print $1}')
|
|
||||||
p_name=$(echo $line | awk -F' ' '{print $2}')
|
|
||||||
# basic check of format
|
|
||||||
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
|
|
||||||
then
|
|
||||||
# install addon
|
|
||||||
util/add_addon_repo $line
|
|
||||||
util/update_addon_repo $p_name # not sure if this line is neccessary
|
|
||||||
echo "util/update_addon_repo $p_name" >> $plugins_update
|
|
||||||
else
|
|
||||||
print_info "skipping installation of a plugin from file $plugin_install - something wrong with format in line: $line"
|
|
||||||
fi
|
|
||||||
done < "$plugin_install"
|
|
||||||
###################
|
|
||||||
# write theme file
|
|
||||||
if [ ! -f "$theme_install" ]
|
|
||||||
then
|
|
||||||
echo "# To install a theme" >> $theme_install
|
|
||||||
echo "# 1. add the theme in a new line and run" >> $theme_install
|
|
||||||
echo "# 2. run" >> $theme_install
|
|
||||||
echo "# cd /var/www/html/.homeinstall" >> $theme_install
|
|
||||||
echo "# ./hubzilla-setup.sh" >> $theme_install
|
|
||||||
echo "https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes" >> $theme_install
|
|
||||||
|
|
||||||
fi
|
|
||||||
# install plugins
|
|
||||||
while read -r line; do
|
|
||||||
[[ "$line" =~ ^#.*$ ]] && continue
|
|
||||||
p_url=$(echo $line | awk -F' ' '{print $1}')
|
|
||||||
p_name=$(echo $line | awk -F' ' '{print $2}')
|
|
||||||
# basic check of format
|
|
||||||
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
|
|
||||||
then
|
|
||||||
# install addon
|
|
||||||
util/add_theme_repo $line
|
|
||||||
util/update_theme_repo $p_name # not sure if this line is neccessary
|
|
||||||
echo "util/update_theme_repo $p_name" >> $plugins_update
|
|
||||||
else
|
|
||||||
print_info "skipping installation of a theme from file $theme_install - something wrong with format in line: $line"
|
|
||||||
fi
|
|
||||||
done < "$theme_install"
|
|
||||||
print_info "installed hubzilla plugins and themes"
|
|
||||||
}
|
|
||||||
|
|
||||||
function rewrite_to_https {
|
function rewrite_to_https {
|
||||||
print_info "configuring apache to redirect http to httpS ..."
|
print_info "configuring apache to redirect http to httpS ..."
|
||||||
htaccessfile=/var/www/html/.htaccess
|
htaccessfile=/var/www/html/.htaccess
|
||||||
@@ -675,25 +605,19 @@ function rewrite_to_https {
|
|||||||
function install_rsnapshot {
|
function install_rsnapshot {
|
||||||
print_info "installing rsnapshot..."
|
print_info "installing rsnapshot..."
|
||||||
nocheck_install "rsnapshot"
|
nocheck_install "rsnapshot"
|
||||||
# internal disk
|
# internal disk
|
||||||
cp -f /etc/rsnapshot.conf $snapshotconfig
|
cp -f /etc/rsnapshot.conf $snapshotconfig
|
||||||
sed -i "/hourly/s/retain/#retain/" $snapshotconfig
|
|
||||||
sed -i "/monthly/s/#retain/retain/" $snapshotconfig
|
|
||||||
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig
|
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig
|
||||||
sed -i "s/^backup/#backup/" $snapshotconfig
|
sed -i "s/^backup/#backup/" $snapshotconfig
|
||||||
if [ -z "`grep 'letsencrypt' $snapshotconfig`" ]
|
echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig
|
||||||
then
|
echo "backup /var/www/html/ localhost/" >> $snapshotconfig
|
||||||
echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig
|
echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig
|
||||||
echo "backup /var/www/html/ localhost/" >> $snapshotconfig
|
|
||||||
echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig
|
|
||||||
fi
|
|
||||||
# external disk
|
# external disk
|
||||||
if [ -n "$backup_device_name" ] && [ -n "$backup_device_pass" ]
|
if [ -n "$backup_device_name" ]
|
||||||
then
|
then
|
||||||
cp -f /etc/rsnapshot.conf $snapshotconfig_external_device
|
cp -f /etc/rsnapshot.conf $snapshotconfig_external_device
|
||||||
sed -i "s#snapshot_root.*#snapshot_root $backup_mount_point#" $snapshotconfig_external_device
|
sed -i "s#snapshot_root.*#snapshot_root $backup_mount_point#" $snapshotconfig_external_device
|
||||||
sed -i "/hourly/s/retain/#retain/" $snapshotconfig_external_device
|
sed -i "/alpha/s/6/30/" $snapshotconfig_external_device
|
||||||
sed -i "/monthly/s/#retain/retain/" $snapshotconfig_external_device
|
|
||||||
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig_external_device
|
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig_external_device
|
||||||
sed -i "s/^backup/#backup/" $snapshotconfig_external_device
|
sed -i "s/^backup/#backup/" $snapshotconfig_external_device
|
||||||
if [ -z "`grep 'letsencrypt' $snapshotconfig_external_device`" ]
|
if [ -z "`grep 'letsencrypt' $snapshotconfig_external_device`" ]
|
||||||
@@ -717,7 +641,7 @@ function configure_cron_daily {
|
|||||||
# every 10 min for poller.php
|
# every 10 min for poller.php
|
||||||
if [ -z "`grep 'poller.php' /etc/crontab`" ]
|
if [ -z "`grep 'poller.php' /etc/crontab`" ]
|
||||||
then
|
then
|
||||||
echo "*/10 * * * * www-data cd /var/www/html; php include/poller.php >> /dev/null 2>&1" >> /etc/crontab
|
echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab
|
||||||
fi
|
fi
|
||||||
# Run external script daily at 05:30
|
# Run external script daily at 05:30
|
||||||
# - stop apache and mysql-server
|
# - stop apache and mysql-server
|
||||||
@@ -767,9 +691,7 @@ echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$hub
|
|||||||
echo " then" >> /var/www/$hubzilladaily
|
echo " then" >> /var/www/$hubzilladaily
|
||||||
echo " device_mounted=1" >> /var/www/$hubzilladaily
|
echo " device_mounted=1" >> /var/www/$hubzilladaily
|
||||||
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily
|
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily
|
||||||
echo " rsnapshot -c $snapshotconfig_external_device daily" >> /var/www/$hubzilladaily
|
echo " rsnapshot -c $snapshotconfig_external_device alpha" >> /var/www/$hubzilladaily
|
||||||
echo " rsnapshot -c $snapshotconfig_external_device weekly" >> /var/www/$hubzilladaily
|
|
||||||
echo " rsnapshot -c $snapshotconfig_external_device monthly" >> /var/www/$hubzilladaily
|
|
||||||
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily
|
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily
|
||||||
echo " df -h" >> /var/www/$hubzilladaily
|
echo " df -h" >> /var/www/$hubzilladaily
|
||||||
echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
||||||
@@ -788,28 +710,22 @@ echo " fi" >> /var/www/$hubzilladaily
|
|||||||
echo "fi" >> /var/www/$hubzilladaily
|
echo "fi" >> /var/www/$hubzilladaily
|
||||||
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
|
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
|
||||||
echo "then" >> /var/www/$hubzilladaily
|
echo "then" >> /var/www/$hubzilladaily
|
||||||
echo " echo \"device could not be mounted $backup_device_name. Using internal disk for backup...\"" >> /var/www/$hubzilladaily
|
echo " echo \"device could not be mounted $backup_device_name. No backup written.\"" >> /var/www/$hubzilladaily
|
||||||
echo " rsnapshot -c $snapshotconfig daily" >> /var/www/$hubzilladaily
|
|
||||||
echo " rsnapshot -c $snapshotconfig weekly" >> /var/www/$hubzilladaily
|
|
||||||
echo " rsnapshot -c $snapshotconfig monthly" >> /var/www/$hubzilladaily
|
|
||||||
echo "fi" >> /var/www/$hubzilladaily
|
echo "fi" >> /var/www/$hubzilladaily
|
||||||
echo "#" >> /var/www/$hubzilladaily
|
echo "#" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
||||||
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
|
echo "du -h /var/lib/mysql/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
|
||||||
echo "#" >> /var/www/$hubzilladaily
|
echo "#" >> /var/www/$hubzilladaily
|
||||||
echo "# update" >> /var/www/$hubzilladaily
|
echo "# update" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
|
||||||
echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily
|
echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily
|
||||||
echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily
|
echo "(cd /var/www/html/ ; util/udall)" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - updating hubhilla addons...\"" >> /var/www/$hubzilladaily
|
|
||||||
echo "git -C /var/www/html/addon/ pull" >> /var/www/$hubzilladaily
|
|
||||||
echo "bash /var/www/html/$plugins_update" >> /var/www/$hubzilladaily
|
|
||||||
echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily
|
echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily
|
||||||
echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily
|
echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily
|
||||||
echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily
|
echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily
|
||||||
echo "apt-get -q -y update && apt-get -q -y dist-upgrade # update linux and upgrade" >> /var/www/$hubzilladaily
|
echo "apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove # update linux and upgrade" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - Backup hubzilla and update linux finished. Rebooting...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - Backup hubzilla and update linux finished. Rebooting...\"" >> /var/www/$hubzilladaily
|
||||||
echo "#" >> /var/www/$hubzilladaily
|
echo "#" >> /var/www/$hubzilladaily
|
||||||
echo "reboot" >> /var/www/$hubzilladaily
|
echo "reboot" >> /var/www/$hubzilladaily
|
||||||
@@ -894,7 +810,6 @@ install_run_selfhost
|
|||||||
ping_domain
|
ping_domain
|
||||||
configure_cron_freedns
|
configure_cron_freedns
|
||||||
configure_cron_selfhost
|
configure_cron_selfhost
|
||||||
install_git
|
|
||||||
install_letsencrypt
|
install_letsencrypt
|
||||||
configure_apache_for_https
|
configure_apache_for_https
|
||||||
check_https
|
check_https
|
||||||
|
|||||||
50
.travis.yml
50
.travis.yml
@@ -39,6 +39,7 @@ addons:
|
|||||||
php:
|
php:
|
||||||
- '7.0'
|
- '7.0'
|
||||||
- '7.1'
|
- '7.1'
|
||||||
|
- '7.2'
|
||||||
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
|
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
|
||||||
#- 'hhvm'
|
#- 'hhvm'
|
||||||
|
|
||||||
@@ -61,28 +62,34 @@ matrix:
|
|||||||
fast_finish: true
|
fast_finish: true
|
||||||
# Additional check combinations
|
# Additional check combinations
|
||||||
include:
|
include:
|
||||||
# PHP7.1, mariadb 10.1
|
# PHP7.2, mariadb 10.2
|
||||||
- php: '7.1'
|
- php: '7.2'
|
||||||
env: DB=mariadb MARIADB_VERSION=10.1 CODECOV=1
|
env: DB=mariadb MARIADB_VERSION=10.2 CODECOV=1
|
||||||
# use mariadb instead of MySQL
|
# use mariadb instead of MySQL
|
||||||
addons:
|
addons:
|
||||||
mariadb: '10.1'
|
mariadb: '10.2'
|
||||||
# PHP7.1, PostgreSQL 9.6
|
# PHP7.2, PostgreSQL 9.6
|
||||||
- php: '7.1'
|
- php: '7.2'
|
||||||
env: DB=pgsql POSTGRESQL_VERSION=9.6
|
env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
|
||||||
# Use newer postgres than 9.2 default
|
# Use newer postgres than 9.2 default
|
||||||
addons:
|
addons:
|
||||||
postgresql: '9.6'
|
postgresql: '9.6'
|
||||||
services:
|
services:
|
||||||
- postgresql
|
- postgresql
|
||||||
# PHP7.1, old precise distribution with MySQL 5.5
|
# PostgreSQL 10 with Docker container
|
||||||
- php: '7.1'
|
- php: '7.2'
|
||||||
|
env: DB=pgsql POSTGRESQL_VERSION=10 PHPUNITFILE=phpunit-pgsql.xml
|
||||||
|
sudo: required
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
# PHP7.2, old precise distribution with MySQL 5.5
|
||||||
|
- php: '7.2'
|
||||||
env: DB=mysql MYSQL_VERSION=5.5
|
env: DB=mysql MYSQL_VERSION=5.5
|
||||||
dist: precise
|
dist: precise
|
||||||
services:
|
services:
|
||||||
- mysql
|
- mysql
|
||||||
# MySQL 5.7 with Docker container
|
# MySQL 5.7 with Docker container
|
||||||
- php: '7.1'
|
- php: '7.2'
|
||||||
env: DB=mysql MYSQL_VERSION=5.7
|
env: DB=mysql MYSQL_VERSION=5.7
|
||||||
sudo: required
|
sudo: required
|
||||||
services:
|
services:
|
||||||
@@ -108,6 +115,8 @@ before_install:
|
|||||||
- travis_retry composer self-update
|
- travis_retry composer self-update
|
||||||
# Start MySQL 5.7 Docker container, needs some time to come up
|
# Start MySQL 5.7 Docker container, needs some time to come up
|
||||||
- if [[ "$MYSQL_VERSION" == "5.7" ]]; then sudo service mysql stop; docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 && sleep 25 && docker ps; fi
|
- if [[ "$MYSQL_VERSION" == "5.7" ]]; then sudo service mysql stop; docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 && sleep 25 && docker ps; fi
|
||||||
|
# Start PostgreSQL 10 Docker container, needs some time to come up
|
||||||
|
- if [[ "$POSTGRESQL_VERSION" == "10" ]]; then sudo service postgresql stop; docker run -d -p 5432:5432 postgres:10-alpine && sleep 35 && docker ps; fi
|
||||||
|
|
||||||
# Install composer dev libs
|
# Install composer dev libs
|
||||||
install:
|
install:
|
||||||
@@ -125,15 +134,19 @@ before_script:
|
|||||||
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
|
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
|
||||||
|
|
||||||
# omitting "script:" will default to phpunit
|
# omitting "script:" will default to phpunit
|
||||||
script: ./vendor/bin/phpunit $PHPUCOV -c tests/phpunit-$DB.xml
|
script:
|
||||||
|
- ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
# Generate API documentation and deploy it to gh-pages
|
- cat tests/results/testdox.txt
|
||||||
|
# Generate API documentation and prepare for deployment
|
||||||
- ./tests/travis/gen_apidocs.sh
|
- ./tests/travis/gen_apidocs.sh
|
||||||
#after_failure:
|
after_failure:
|
||||||
|
- cat tests/results/testdox.txt
|
||||||
|
|
||||||
# Deploying release and API documentation to GitHub
|
# Deploying release and API documentation to GitHub
|
||||||
#before_deploy:
|
before_deploy:
|
||||||
|
- if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
|
||||||
deploy:
|
deploy:
|
||||||
- provider: pages
|
- provider: pages
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
@@ -152,6 +165,15 @@ deploy:
|
|||||||
repo: redmatrix/hubzilla
|
repo: redmatrix/hubzilla
|
||||||
tags: true
|
tags: true
|
||||||
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
|
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
|
||||||
|
# add code coverage and test results to release
|
||||||
|
- provider: releases
|
||||||
|
skip_cleanup: true
|
||||||
|
api_key: $GH_TOKEN
|
||||||
|
file: 'tests/hubzilla-testresults.zip'
|
||||||
|
on:
|
||||||
|
repo: redmatrix/hubzilla
|
||||||
|
tags: true
|
||||||
|
condition: '(-n "$GH_TOKEN") && ("$CODECOV" == "1")'
|
||||||
#after_deploy:
|
#after_deploy:
|
||||||
|
|
||||||
#after_script:
|
#after_script:
|
||||||
|
|||||||
403
CHANGELOG
403
CHANGELOG
@@ -1,3 +1,406 @@
|
|||||||
|
Hubzilla 3.4.1 (2018-06-08)
|
||||||
|
- Say bye, bye to GitHub and move sourcecode repositories to #^https://framagit.org/hubzilla
|
||||||
|
- When removing a connection, don't remove items that are starred, filed or replied to
|
||||||
|
- Do not show archived forums in forum widget
|
||||||
|
- Fix potential XSS vulnerabilities
|
||||||
|
- Translation updates
|
||||||
|
- Fix postresql issue with oauth2
|
||||||
|
- Improve abconfig queries
|
||||||
|
- Fix postgresql issue if register mode was set to yes - with approval
|
||||||
|
|
||||||
|
Addons
|
||||||
|
- Diaspora: fix likes of non-contacts not allowed to like allthough diaspora_public_comments is set
|
||||||
|
- Pubcrawl: fix wrong hubloc url
|
||||||
|
- Pubcrawl: fix issues with attachments
|
||||||
|
- Pubcrawl: fetch required item metadata in asfetch_item()
|
||||||
|
- Cavatar: use cavatar for all default profile photos if enabled
|
||||||
|
- Pubcrawl: fix peertube video display
|
||||||
|
- Pubcrawl: fix incoming activitypub comments not getting propagated downstream
|
||||||
|
- Statistics: fix .well-known/nodeinfo
|
||||||
|
- Pubsubhubbub: fix postgresql related issues
|
||||||
|
- Pubcrawl: send the original LD-signature signed activity when distributing comments downstream if we have it
|
||||||
|
- Cavatar: improve the image creation process
|
||||||
|
|
||||||
|
|
||||||
|
Hubzilla 3.4 (2018-05-04)
|
||||||
|
- Provide warnings about profile photo and cover photo permissions
|
||||||
|
- Don't duplicate addressbook entries on repeated channel imports
|
||||||
|
- Where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered
|
||||||
|
- Rename boxy schema to Focus-Boxy
|
||||||
|
- Rename BS-Default schema to Focus-Light
|
||||||
|
- Mark simple_* schemas unmaintained and deprecated - they will be removed in next release if nobody steps up to maintain them.
|
||||||
|
- Implement trending tags for mod pubstream
|
||||||
|
- Relax restrictions to the design tools menu to allow those with write_pages permission
|
||||||
|
- Add alt pager to mod moderate
|
||||||
|
- Show existing cover photo when changing it
|
||||||
|
- Update to bootstrap lib to version 4.1
|
||||||
|
- Provide a higher accuracy method for active channels information
|
||||||
|
- Provide visible star status for starred posts
|
||||||
|
- Move the thread author menu to the wall item photo
|
||||||
|
- Accept system_language through either get or post
|
||||||
|
- Remove recipient name from stored notifications but keep them in emails
|
||||||
|
- Fix issue of being forced to log back in after leaving a delegated channel
|
||||||
|
- Implement last commented expiration setting in mod admin
|
||||||
|
- Create catcloud widget and provide a type option which can include 'cards' or 'articles'
|
||||||
|
- Modified notifications widget to add the public stream when the current user is allowed to see it only
|
||||||
|
- Don't provide a connect button for transient identities
|
||||||
|
- Merge techlevels and features
|
||||||
|
- Implement auto-save posts and comments in browser using localStorage
|
||||||
|
- Display directory server in siteinfo.json
|
||||||
|
- Bring back the dnt policy document
|
||||||
|
- Implement OAuth2/OpenIDConnect server
|
||||||
|
- Add basic structure for additional features documentation
|
||||||
|
- Community tag refactor
|
||||||
|
- Obscurify chats
|
||||||
|
- Provide a way to share wiki pages
|
||||||
|
- Update folder timestamp on uploaded files
|
||||||
|
- Code optimisations and de-duplication on updating parent commented timestamp
|
||||||
|
- Turn newmember widget into a feature
|
||||||
|
- Make list mode work in cards and articles
|
||||||
|
- Make alt pager work for articles and cards
|
||||||
|
- Initial support for alternative sort orders on the cloud pages
|
||||||
|
- Add Ochannel module for testing OStatus bad behaviour
|
||||||
|
- Add the social - federation permission role
|
||||||
|
- Update justified gallery lib from 3.6.3 to 3.6.5
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
- Fix regression with forum widget unseen count
|
||||||
|
- Fix issue with imagemagick exif info
|
||||||
|
- Aonymous comments in StdLimits shouldn't be allowed
|
||||||
|
- Fix wiki pages not syncing
|
||||||
|
- Show "Unseen public activity" channel setting when site only public streams are activated
|
||||||
|
- Fix channel import failing to provide channel_password value
|
||||||
|
- Fix permalinks to children of articles and cards
|
||||||
|
- Fix missing year on profile birthday input
|
||||||
|
- Fix missing login/out buttons for medium screensize
|
||||||
|
- Preserve existing categories when updating an app from an embed source
|
||||||
|
- Fix app sellpage not being stored
|
||||||
|
- Fix tagadelic being overly protective of permissions
|
||||||
|
- Fix comments not displayed in single card/article view
|
||||||
|
- Fix anonymous comments bump thread
|
||||||
|
- Fix pending registrations visible in admin accounts
|
||||||
|
|
||||||
|
Addons
|
||||||
|
Pubcrawl: fix issues with "private" messages
|
||||||
|
Pubcrawl: fix issues with postgresql
|
||||||
|
Fuzzloc: new addon to blur your browser location
|
||||||
|
Pubcrawl: implement follow by webfinger
|
||||||
|
Cart: new addon which provides online shop functionalities (experimental)
|
||||||
|
Pubcrawl: implement two-way summary functionality
|
||||||
|
Wordpress: upgrade incutio xmlrpc library to use hubzilla curl wrapper
|
||||||
|
Hzfiles: various fixes
|
||||||
|
Diaspora: support full_name attribute in profile messages
|
||||||
|
Frphotos: deprecate plugin (keep it for reference)
|
||||||
|
Webmention: require html5 parser
|
||||||
|
GNU-Social: provide alternative xchan_url
|
||||||
|
Diaspora: fix wrong callback function
|
||||||
|
Diaspora: fix conversion of forum mentions to markdown by providing a !{forum@host} link syntax
|
||||||
|
Diaspora: fix item title not transferred
|
||||||
|
|
||||||
|
|
||||||
|
Hubzilla 3.2 (2018-03-09)
|
||||||
|
- Improve rendering of Readme files in plugin settings
|
||||||
|
- Add pdl file for mod moderate
|
||||||
|
- Update redbasic theme screenshot
|
||||||
|
- Restrict mail messages to max_import_size
|
||||||
|
- Add pdl file for mod thing
|
||||||
|
- Add federation property to webfinger
|
||||||
|
- Provide new member widget which sits beneath the notifications for the first 60 days after an account creation
|
||||||
|
- Rename Addon/Feature settings to Addon Settings
|
||||||
|
- Move privacy groups to the newly created Access Control and Permissions tab
|
||||||
|
- Move oauth_client management and guest access tokens to features rather than auto-enabling at various feature levels
|
||||||
|
- Change undo_post_tagging() to emit quoted tags rather than using underscore replacement if they contain spaces
|
||||||
|
- Require directory servers to be using some modern form of encryption
|
||||||
|
- Change icon set from font-awesome to fork-awesome
|
||||||
|
- Provide opt-out link and text with notification emails
|
||||||
|
- Alter image selection widget to accept/submit on choose (github issue #979)
|
||||||
|
- If hide_in_statistics is set, only include the total channels count and no other statistical info in siteinfo.json
|
||||||
|
- Mark connections where we do not have post_comments permissions with an no entry sign
|
||||||
|
- Click your own profile photo to change it if loged in
|
||||||
|
- Remove street address info from the default basic profile fields
|
||||||
|
- Handle error logging in on cloud page (post method not implemented)
|
||||||
|
- Cloud 'view-as-tiles' toggle wasn't available for guests and they are the most likely to prefer that view
|
||||||
|
- Provide DB compatibility for poll and voting implementations across several platforms
|
||||||
|
- Remove the unused ZotDriver and ProtoDriver classes
|
||||||
|
- Move dreport from zot to lib
|
||||||
|
- Move Zotlabs\Zot\Verify to Zotlabs\Lib\Verify as part of the zot6 re-org
|
||||||
|
- Add event resource_id to iconfig so Diaspora can search on it without looking inside JSON objects
|
||||||
|
- Trim non-existent/deprecated plugins from siteinfo plugin list
|
||||||
|
- Add 'Validate' button to new_channel page
|
||||||
|
- Do not show summary if it is equal to body
|
||||||
|
- Update code tag styling so bbcode [code] blocks and wiki markdown inline code render nicely
|
||||||
|
- Crypto improvements (use pkcs1_oaep_padding instead of the older pkcs1_padding)
|
||||||
|
- Refactor OAuth2Server a bit
|
||||||
|
- Refactor of the DB update system
|
||||||
|
- Extend the oauth2 storage driver so that we can use our own channel table
|
||||||
|
- Provide option to block the public stream unless authenticated
|
||||||
|
- Refactor shares and urn shares into activities
|
||||||
|
- Show likes and dislikes in notices if always_show_in_notices is set
|
||||||
|
- Add hidden config to disallow anonymous comments (github issue #972)
|
||||||
|
- Add flexibility to prefix/suffix string translations for jquery.timeago
|
||||||
|
- Make post titles searchable (github issue #975)
|
||||||
|
- Implement zot6 delivery
|
||||||
|
- Remove mobile_detect library
|
||||||
|
- Separate the parsing of author information from the parsing of item/activity information in feedutils
|
||||||
|
- Provide summaries in feeds under very limited cases
|
||||||
|
- Redirect to the email_validation page if login was attempted after account creation but prior to successful verification
|
||||||
|
- Iprove workflow for form based email validation when auto_channel_create is in effect
|
||||||
|
- Provide a default video image if nothing else is available
|
||||||
|
- Surface the ability to change the landing page after channel creation
|
||||||
|
- Create the 'go' module to present several possible things to do after channel creation
|
||||||
|
- Add unit test for dba_pdo driver class
|
||||||
|
- Add unit test for \DBA factory
|
||||||
|
- Usability improvements to registration/verification workflow
|
||||||
|
- Don't do any bbcode translation within code blocks (except baseurl, observer, and linefeeds)
|
||||||
|
- Improve browser language detection
|
||||||
|
- Remove unused prototype importer template and obsolete reflection cms importer
|
||||||
|
- Update to bootstrap 4 stable
|
||||||
|
- Implement caching of notifications in browser session storage
|
||||||
|
- Code cleanup and simplification in mod_like
|
||||||
|
- Implement new cropper library
|
||||||
|
- Better notifications for edit post/comments which may have been originally posted long ago
|
||||||
|
- Ensure filter words are not empty in include/items.php
|
||||||
|
- Change query in mod search to be compatible with postgres
|
||||||
|
- Provide channel list function in the zot api
|
||||||
|
- Remove deprecated 'qcomment' feature
|
||||||
|
- Simplify webserver logic flow
|
||||||
|
- Simplify interactions with the get_features hook
|
||||||
|
- Provide a local pubstream option (content from this site only)
|
||||||
|
- Simplify dir_tagadelic dramatically
|
||||||
|
- Surface the article feature
|
||||||
|
- Add summary bbcode tag
|
||||||
|
- Move markdown-in-posts/comments feature to plugin
|
||||||
|
- Support tables in markdown posts/comments
|
||||||
|
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
- Fix javascript error if there are no notifications
|
||||||
|
- Fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers
|
||||||
|
- Fix unable to reset profile fields to defaults in admin/profs by emptying the textarea
|
||||||
|
⁻ Fix issues with accordions related to bootstrap upgrade
|
||||||
|
- Fix empty dob is set to the date of the first profile save
|
||||||
|
- Fix several email validation issues
|
||||||
|
- Fix issue if logged in locally and mod_display returns nothing owned by your uid; retry with known public uids rather than issue 'permission denied'
|
||||||
|
- Fix public stream app permission check to match the recent fixes to the Module
|
||||||
|
- Fix issues with delivery of edited posts to forums
|
||||||
|
- Fix autoname test
|
||||||
|
- Fix issue where self and pending connections were visible in connections when not loged in
|
||||||
|
- Fix bad query in mod defperms
|
||||||
|
- Fix issue where gnusocial likes were not recognised as like activity
|
||||||
|
- Fix manual queue invocation
|
||||||
|
- Fix unable to delete accounts using tickboxes on admin/accounts
|
||||||
|
- Fix a PHP7.2 warning when a channel has no cards
|
||||||
|
- Fix unable to delete permission groups with space in name (github issue #920)
|
||||||
|
|
||||||
|
Addons
|
||||||
|
Statistic: fix reporting of incorrect register policy in nodeinfo
|
||||||
|
Diaspora: diaspora_init_relay: calls diaspora_import_author with too many arguments
|
||||||
|
Pubcrawl: provide a system 'allowed' for to match the system setting for other protocols
|
||||||
|
Diaspora: fix issue with sending diaspora profile change messages over diaspora_v2
|
||||||
|
Diaspora: provide limited but hopefully adequate support for new Diaspora html5 audio/video
|
||||||
|
Pubcrawl: send zot context with follow requests
|
||||||
|
Pubcrawl: add video to the set of message types we process
|
||||||
|
Pubcrawl: support for activitypub media
|
||||||
|
Openclipatar: remove extra details for each image
|
||||||
|
Diaspora: initial work on event participation
|
||||||
|
Statistic: remove the friendica protocol from nodeinfo until it is fully implemented
|
||||||
|
Statistic: re-arrange the order of the .host-meta/nodeinfo links
|
||||||
|
Pubcrawl: add share verb to activitystreams translator
|
||||||
|
Pubcrawl: post public posts to syschannel
|
||||||
|
Statistics: fix legacy statistics.json interface
|
||||||
|
Gnusocial: improve error checking when processing a salmon message
|
||||||
|
Dirstats: fix sql syntax error
|
||||||
|
Pubcrawl: possibly reduce constraint violations for xchan_store_lowlevel (duplicate entry)
|
||||||
|
Diaspora: ensure we process Friendica-over-Diaspora yearless birthdays correctly
|
||||||
|
Chess: added simple history browsing controls to spectator view
|
||||||
|
Diaspora: support post/comment edits
|
||||||
|
Diaspora: don't redirect fetch requests for non-Diaspora wall-to-wall and forum posts unless they can be redirected to a Diaspora protocol site
|
||||||
|
Chess: added support for publicly visible games
|
||||||
|
Phpmailer: add quickstart notes
|
||||||
|
Chess: choose random color if no color is chosen
|
||||||
|
New Plugin: mdpost - markdown in posts/comments, migrated from core to addon
|
||||||
|
Diaspora: provide a configuration option to import the diaspora firehose, otherwise only import content matching subscribed tags
|
||||||
|
NSFW: load images only after click on the button
|
||||||
|
Twitter: provide configurable tweet length until such time as 280 becomes universal
|
||||||
|
|
||||||
|
|
||||||
|
Hubzilla 3.0 (2018-01-09)
|
||||||
|
- Updated homeinstall script
|
||||||
|
- Sort cloud directory by 1. is_dir and 2. name
|
||||||
|
- Document that imagick calls/execs ffmpeg for mp4 video thumbnails
|
||||||
|
- Use pipe_stream() instead of file_{get, put}_contents() in attach_store()
|
||||||
|
- Make homeinstall script ready for Debian 9
|
||||||
|
- Add url and headings to bbco_autocomplete()
|
||||||
|
- Remove additional linebreaks after headings
|
||||||
|
- html2bbcode: use headings bbcode for headings
|
||||||
|
- Don't zidify all permalinks, only zot permalinks
|
||||||
|
- Make remote homelink link to the home host and not to the home channel
|
||||||
|
- Auto promote beginner (techlevel 0) accounts to level 1 after they show signs of active participation.
|
||||||
|
- Go back to including the photo thumbnail data in the export file.
|
||||||
|
- Improvements to file import/export
|
||||||
|
- Default value for xlink_rating_text
|
||||||
|
- Implement IMoveTarget and recursive file/directory move/rename - github issue #680
|
||||||
|
- Synchronise an attach_move operation to clones
|
||||||
|
- Provide a themed page with an error notification on errors instead of an obtuse XML error structure in mod cloud
|
||||||
|
- Disallow backslashes in wiki and wiki-page names
|
||||||
|
- We only require one update module. The rest are superfluous.
|
||||||
|
- Render installable elements as buttons instead of links
|
||||||
|
- Implement chunked uploads for photos page
|
||||||
|
- Remove warning for large files on cloud upload
|
||||||
|
- Add a filter for notification to show new posts only
|
||||||
|
- Implement chunked uploads for cloud
|
||||||
|
- Use httpsig auth for getfile
|
||||||
|
- Load the profile images in the custom acl selector only if we actually need them
|
||||||
|
- Rework liveUpdate() and notificationsUpdate() (aka ping) to first do the liveUpdate and when this is done only do the ping once.
|
||||||
|
- Don't include invisible "update activities" in category widget
|
||||||
|
- Default profile assign
|
||||||
|
- Provide system config option for minimum registration age.
|
||||||
|
- Remove deprecated $a argument from advanced_profile()
|
||||||
|
- Change to bbcode calling parameters
|
||||||
|
- Extra checking of server headers in upload functions
|
||||||
|
- Provide a handler for chunked uploads in mod file_upload
|
||||||
|
- Optional divider between item header and body
|
||||||
|
- Allow toggle to SMBC scaling mode.
|
||||||
|
- Add thumbnail hook
|
||||||
|
- Implement SVG thumbnails and expose security setting
|
||||||
|
- Implement video thumbnail generator
|
||||||
|
- Implement pdf thumbnails
|
||||||
|
- Implement thumbnail generator for epubs
|
||||||
|
- Make browser history buttons work with ajax calls in mod display and hq
|
||||||
|
- Implement tile view for mod cloud (read only)
|
||||||
|
- Add mp3 audio thumbnail generator
|
||||||
|
- Set display_path for photo_upload from the DAV File interface
|
||||||
|
- Provide a generalised interface for thumbnail generators to support various content types
|
||||||
|
- Add ID3Parser library.
|
||||||
|
- Text thumbnails in cloud tile mode
|
||||||
|
- Revisit media breakpoints - do not switch to mobile view to early.
|
||||||
|
- Add French to help pages language dropdown selector
|
||||||
|
- Inroduce the HQ module - an alternative landing page for hubzilla
|
||||||
|
- Strip author name from notify messages in notifications - github issue #911
|
||||||
|
- Remove column item.diaspora_meta
|
||||||
|
- Provide ability to pin apps to navbar from mod apps
|
||||||
|
- Add private forums to forum widget
|
||||||
|
- Move notifications style to widgets.css
|
||||||
|
- Sort out a few more large image upload issues
|
||||||
|
- Move notifications full-screen handling to notifications widget
|
||||||
|
- Move mailhost settings from plugin to core
|
||||||
|
- Sort combined private mail conversations by latest updated conversation instead of created parent
|
||||||
|
- Filter atokens on acl search
|
||||||
|
- Allow a site to block (public) the directory separately from other resources.
|
||||||
|
- Improve removed_channel final cleanup - github issue #386
|
||||||
|
- Cleanup of upload_to_comments(
|
||||||
|
- Dedicate the first click to slideup the cover again but make sure the nav buttons remain functional
|
||||||
|
- Set os_syspath in DAV file put operation so that photos will scale correctly.
|
||||||
|
- Unit tests for Zotlabs\Access classes
|
||||||
|
- Bring back tabindex to submit comments
|
||||||
|
- attach.php minor cleanup and doc
|
||||||
|
- Allow cloud filenames to include ampersands without messing up auth tokens (zid, owt, and zat, and the constant placeholder 'f=')
|
||||||
|
- Provide short localised summary for likes that will end up in displayed notifications
|
||||||
|
- Improving Doxygen documentation.
|
||||||
|
- Update item_normal() to not include ACTIVITY_OBJ_FILE obj_type
|
||||||
|
- Sort out issues with pubstream item interactions
|
||||||
|
- Don't perform zot_refresh on dead sites unless $force is set
|
||||||
|
- Do not send message_list responses to dead sites (this delivery method bypassed the notifier)
|
||||||
|
- Support for netselect query
|
||||||
|
- Add another delivery control parameter (queue threshold)
|
||||||
|
- Add some documentation about shareable widgets
|
||||||
|
- Allow plugin class widgets
|
||||||
|
- Some more work on unit tests
|
||||||
|
- Encrypt the owa token
|
||||||
|
- Bring back the markdown post feature
|
||||||
|
- We call Theme:url() statically, make it also static.
|
||||||
|
- Table structure for pseudo or proxy channels (pchan)
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
- Fix sync non-default profile photo changes to clones - github issue #113
|
||||||
|
- Fix prev/next buttons on connedit can show deleted connections - github issue #673
|
||||||
|
- Fix affinity widget settings
|
||||||
|
- Fix dupe bug in content hooks - github issue #943
|
||||||
|
- Fix directory keywords returned from dir_tagadelic() in standalone mode
|
||||||
|
- Fix argument warning when arguments are correct in util/dcp
|
||||||
|
- Fix issue with long filenames in mod cloud
|
||||||
|
- Fix misc. issues with new 'insert photo from photo album' github issue #475
|
||||||
|
- Fix regression in channel sources delivery
|
||||||
|
- Fix loading of theme-specific widgets
|
||||||
|
- Fix unable to add wiki pages with spaces
|
||||||
|
- Fix mod display and others that require a non-zero profile_uid for updates
|
||||||
|
- Fix various PHP 7.2 issues
|
||||||
|
- Fix typo in HTTPSig
|
||||||
|
- Fix pagetitle lost importing a pdl element from conversation
|
||||||
|
- Fix js warning - getelementbyid (id doesn't exist)
|
||||||
|
- Fix some pubstream on/off weirdness
|
||||||
|
- Fix default addressbook has no name - github issue #921
|
||||||
|
- Fix double html ids in caldav widget if more than one sharee
|
||||||
|
- Fix regression in cdav calendar widget
|
||||||
|
- Fix sync packet not generated when deleting a file using the web browser interface
|
||||||
|
- Fix album cover thumb generator
|
||||||
|
- Fix like-button for images - github issue #826
|
||||||
|
- Fix typo - github issue #910
|
||||||
|
- Fix issue with group_rmv()
|
||||||
|
- Fix php warnings on photo delete
|
||||||
|
- Fix some conflicts between private tags and forum tags
|
||||||
|
- Fix some schema issues
|
||||||
|
- Fix wiki pages not updating after creating new page
|
||||||
|
- Fix a PHP warning in Permissions::FilledPerms()
|
||||||
|
- Fix unicode characters in urls tripping up url regexes - github issue #901
|
||||||
|
- Fix second half of github issue #893
|
||||||
|
- Fix common connections on suggestion page showing wildly different results than remote profile, and is consistently off by one
|
||||||
|
- Fix cloud redirects with owt tokens
|
||||||
|
- Fix issues with diaspora xchans
|
||||||
|
- Fix memory overflow trying to delete a connection with a very high noise to signal ratio
|
||||||
|
- Fix sql error in page module
|
||||||
|
- Fix unstar
|
||||||
|
|
||||||
|
Plugins/Addon
|
||||||
|
Diaspora: fix 'view full size' photo link - core github issue #947
|
||||||
|
Diaspora: implement recent changes in diaspora account_migration spec
|
||||||
|
GNU-Social: fix uploading a photo to a post results in double post - github issue 75
|
||||||
|
GNU-Social: fix gnusoc plugin not respecting delayed delivery - github issue 74
|
||||||
|
Pubcrawl: fix PHP warning
|
||||||
|
Diaspora: remove garbage from magic envelope
|
||||||
|
Diaspora: fix permalinks for zot reshares
|
||||||
|
New addon: hzfiles - sync files across hubzilla servers
|
||||||
|
Fix various PHP 7.2 issues
|
||||||
|
Remove Firefox social plugin - it was deprecated and removed in firefox version 57
|
||||||
|
Diaspora: unset id and parent for local comments
|
||||||
|
Pubsubhubbub: set interactive flag to avoid delivery killing if block_public is enabled
|
||||||
|
Mailhost addon moved to core
|
||||||
|
Remove js_upload addon
|
||||||
|
|
||||||
|
|
||||||
|
Hubzilla 2.8.1 (2017-11-11)
|
||||||
|
- Rename channel app events to calendar and add nav_set_selected() to /cal
|
||||||
|
- Load notifications links to /display via ajax if we are already in /display
|
||||||
|
- Add location info to the navbar for remote visitors
|
||||||
|
- Bring back tabindex to submit comments
|
||||||
|
- Add spanish translations for context help
|
||||||
|
- Added mode to portfolio widget
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
- Fix os_syspath in DAV file put operation so that photos will scale correctly
|
||||||
|
- Fix unicode characters in urls tripping up url regexes - github issue #901
|
||||||
|
- Fix wiki pages not updating after creating new page
|
||||||
|
- Fix notifications covered by cover photo on medium size screens - github issue #906
|
||||||
|
- Fix unable to change permissions on wiki with space in name
|
||||||
|
- Fix only show nav app link if we have a selected app
|
||||||
|
- Fix unable to mark all messages read
|
||||||
|
- Fix imagedata not set correctly if large photo and imagick is not installed
|
||||||
|
- Fix issues with diaspora xchans
|
||||||
|
- Fix profile photo issue triggered by a previous bug
|
||||||
|
|
||||||
|
Plugins/Addon
|
||||||
|
N-S-F-W: improve the undocumented n-s-f-w author::word feature
|
||||||
|
Diaspora: update the import_diaspora tool for the version 2.0 account export files
|
||||||
|
Diaspora: fix comments are partly containing "diaspora_handle" instead of "author" - github issue #69
|
||||||
|
Pubcrawl: provide feature setting for downgrade_media option
|
||||||
|
Pubcrawl: fix issue where replies to replies did not find its parent
|
||||||
|
Diaspora: fix friendica likes on comments
|
||||||
|
Diaspora: fix private mail
|
||||||
|
Diaspora: fix third party deletes/retractions not propagating
|
||||||
|
Diaspora: likes not working - github issue #895 in core
|
||||||
|
Diaspora: fix comments from unknown persons not accepted if allow public comments is enabled - github issue #68
|
||||||
|
XMPP: fix php warning
|
||||||
|
|
||||||
Hubzilla 2.8 (2017-10-25)
|
Hubzilla 2.8 (2017-10-25)
|
||||||
- Redirect to be moderated items to /moderate
|
- Redirect to be moderated items to /moderate
|
||||||
- Update notifications if notifications area remains open
|
- Update notifications if notifications area remains open
|
||||||
|
|||||||
37
DEVELOPERS
Normal file
37
DEVELOPERS
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
Developer Certificate of Origin
|
||||||
|
Version 1.1
|
||||||
|
|
||||||
|
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||||
|
1 Letterman Drive
|
||||||
|
Suite D4700
|
||||||
|
San Francisco, CA, 94129
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
Developer's Certificate of Origin 1.1
|
||||||
|
|
||||||
|
By making a contribution to this project, I certify that:
|
||||||
|
|
||||||
|
(a) The contribution was created in whole or in part by me and I
|
||||||
|
have the right to submit it under the open source license
|
||||||
|
indicated in the file; or
|
||||||
|
|
||||||
|
(b) The contribution is based upon previous work that, to the best
|
||||||
|
of my knowledge, is covered under an appropriate open source
|
||||||
|
license and I have the right under that license to submit that
|
||||||
|
work with modifications, whether created in whole or in part
|
||||||
|
by me, under the same open source license (unless I am
|
||||||
|
permitted to submit under a different license), as indicated
|
||||||
|
in the file; or
|
||||||
|
|
||||||
|
(c) The contribution was provided directly to me by some other
|
||||||
|
person who certified (a), (b) or (c) and I have not modified
|
||||||
|
it.
|
||||||
|
|
||||||
|
(d) I understand and agree that this project and the contribution
|
||||||
|
are public and that a record of the contribution (including all
|
||||||
|
personal information I submit with it, including my sign-off) is
|
||||||
|
maintained indefinitely and may be redistributed consistent with
|
||||||
|
this project or the open source license(s) involved.
|
||||||
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2010-2017 the Hubzilla Community
|
Copyright (c) 2010-2018 the Hubzilla Community
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -3,18 +3,18 @@
|
|||||||
Hubzilla - Community Server
|
Hubzilla - Community Server
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
<p align="center" markdown="1">
|
|
||||||
<em><a href="https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
<p align="center" markdown="1">
|
||||||
|
<em><a href="install/INSTALL.txt">Installing Hubzilla</a></em>
|
||||||
|
</p>
|
||||||
|
|
||||||
**What is Hubzilla?**
|
**What is Hubzilla?**
|
||||||
|
|
||||||
Hubzilla is a general purpose communication server integrated with a web publishing system and a decentralised permission system. If this sounds like a bunch of technical mumbo-jumbo to you, just think of it as an independent platform for sharing stuff online.
|
Hubzilla is a general purpose communication server integrated with a web publishing system and a decentralised permission system. If this sounds like a bunch of technical mumbo-jumbo to you, just think of it as an independent platform for sharing stuff online (publicly or privately).
|
||||||
|
|
||||||
Hubzilla contains some social network bits, some cloud storage bits, some blog and forum bits, and some content management bits. These are all integrated within a common privacy framework - and it is all decentralised.
|
Hubzilla contains some social network bits, some cloud storage bits, some blog and forum bits, and some content management bits. These are all integrated within a common privacy framework - and it is all decentralised.
|
||||||
|
|
||||||
Everything you publish or share can be restricted to those channels and people you wish to share them with; and these permissions work completely invisibly - even with channels on different servers or other communications services.
|
Everything you publish or share can be restricted to those channels and people you wish to share them with; and these permissions work completely invisibly - **even with channels on different servers or other communications services**.
|
||||||
|
|
||||||
Migration and live backups of your connections, settings, and everything you publish are built-in, so you never need worry about server failure.
|
Migration and live backups of your connections, settings, and everything you publish are built-in, so you never need worry about server failure.
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,14 @@
|
|||||||
namespace Zotlabs\Access;
|
namespace Zotlabs\Access;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief AccessList class.
|
* @brief AccessList class which represents individual content ACLs.
|
||||||
*
|
*
|
||||||
* A class to hold an AccessList object with allowed and denied contacts and
|
* A class to hold an AccessList object with allowed and denied contacts and
|
||||||
* groups.
|
* groups.
|
||||||
|
*
|
||||||
|
* After evaluating @ref ::Zotlabs::Access::PermissionLimits "PermissionLimits"
|
||||||
|
* and @ref ::Zotlabs::Lib::Permcat "Permcat"s individual content ACLs are evaluated.
|
||||||
|
* These answer the question "Can Joe view *this* album/photo?".
|
||||||
*/
|
*/
|
||||||
class AccessList {
|
class AccessList {
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +107,7 @@ class AccessList {
|
|||||||
* @brief Return an array consisting of the current access list components
|
* @brief Return an array consisting of the current access list components
|
||||||
* where the elements are directly storable.
|
* where the elements are directly storable.
|
||||||
*
|
*
|
||||||
* @return Associative array with:
|
* @return array An associative array with:
|
||||||
* * \e string \b allow_cid => string of allowed cids
|
* * \e string \b allow_cid => string of allowed cids
|
||||||
* * \e string \b allow_gid => string of allowed gids
|
* * \e string \b allow_gid => string of allowed gids
|
||||||
* * \e string \b deny_cid => string of denied cids
|
* * \e string \b deny_cid => string of denied cids
|
||||||
|
|||||||
@@ -2,35 +2,90 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Access;
|
namespace Zotlabs\Access;
|
||||||
|
|
||||||
use \Zotlabs\Lib as ZLib;
|
use Zotlabs\Lib\PConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Permission limits.
|
||||||
|
*
|
||||||
|
* Permission limits are a very high level permission setting. They are hard
|
||||||
|
* limits by design.
|
||||||
|
* "Who can view my photos (at all)?"
|
||||||
|
* "Who can post photos in my albums (at all)?"
|
||||||
|
*
|
||||||
|
* For viewing permissions we generally set these to 'anybody' and for write
|
||||||
|
* permissions we generally set them to 'those I allow', though many people
|
||||||
|
* restrict the viewing permissions further for things like 'Can view my connections'.
|
||||||
|
*
|
||||||
|
* People get confused enough by permissions that we wanted a place to set their
|
||||||
|
* privacy expectations once and be done with it.
|
||||||
|
*
|
||||||
|
* Connection related permissions like "Can Joe view my photos?" are handled by
|
||||||
|
* @ref ::Zotlabs::Lib::Permcat "Permcat" and inherit from the channel's Permission
|
||||||
|
* limits.
|
||||||
|
*
|
||||||
|
* @see Permissions
|
||||||
|
*/
|
||||||
class PermissionLimits {
|
class PermissionLimits {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get standard permission limits.
|
||||||
|
*
|
||||||
|
* Viewing permissions and post_comments permission are set to 'anybody',
|
||||||
|
* other permissions are set to 'those I allow'.
|
||||||
|
*
|
||||||
|
* The list of permissions comes from Permissions::Perms().
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
static public function Std_Limits() {
|
static public function Std_Limits() {
|
||||||
|
$limits = [];
|
||||||
$perms = Permissions::Perms();
|
$perms = Permissions::Perms();
|
||||||
$limits = array();
|
|
||||||
foreach($perms as $k => $v) {
|
foreach($perms as $k => $v) {
|
||||||
if(strstr($k,'view') || $k === 'post_comments')
|
if(strstr($k, 'view'))
|
||||||
$limits[$k] = PERMS_PUBLIC;
|
$limits[$k] = PERMS_PUBLIC;
|
||||||
else
|
else
|
||||||
$limits[$k] = PERMS_SPECIFIC;
|
$limits[$k] = PERMS_SPECIFIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $limits;
|
return $limits;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function Set($channel_id,$perm,$perm_limit) {
|
/**
|
||||||
ZLib\PConfig::Set($channel_id,'perm_limits',$perm,$perm_limit);
|
* @brief Sets a permission limit for a channel.
|
||||||
|
*
|
||||||
|
* @param int $channel_id
|
||||||
|
* @param string $perm
|
||||||
|
* @param int $perm_limit one of PERMS_* constants
|
||||||
|
*/
|
||||||
|
static public function Set($channel_id, $perm, $perm_limit) {
|
||||||
|
PConfig::Set($channel_id, 'perm_limits', $perm, $perm_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function Get($channel_id,$perm = '') {
|
/**
|
||||||
|
* @brief Get a channel's permission limits.
|
||||||
|
*
|
||||||
|
* Return a channel's permission limits from PConfig. If $perm is set just
|
||||||
|
* return this permission limit, if not set, return an array with all
|
||||||
|
* permission limits.
|
||||||
|
*
|
||||||
|
* @param int $channel_id
|
||||||
|
* @param string $perm (optional)
|
||||||
|
* @return
|
||||||
|
* * \b false if no perm_limits set for this channel
|
||||||
|
* * \b int if $perm is set, return one of PERMS_* constants for this permission, default 0
|
||||||
|
* * \b array with all permission limits, if $perm is not set
|
||||||
|
*/
|
||||||
|
static public function Get($channel_id, $perm = '') {
|
||||||
if($perm) {
|
if($perm) {
|
||||||
return Zlib\PConfig::Get($channel_id,'perm_limits',$perm);
|
return intval(PConfig::Get($channel_id, 'perm_limits', $perm));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Zlib\PConfig::Load($channel_id);
|
PConfig::Load($channel_id);
|
||||||
if(array_key_exists($channel_id,\App::$config) && array_key_exists('perm_limits',\App::$config[$channel_id]))
|
if(array_key_exists($channel_id, \App::$config)
|
||||||
return \App::$config[$channel_id]['perm_limits'];
|
&& array_key_exists('perm_limits', \App::$config[$channel_id]))
|
||||||
return false;
|
return \App::$config[$channel_id]['perm_limits'];
|
||||||
}
|
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace Zotlabs\Access;
|
namespace Zotlabs\Access;
|
||||||
|
|
||||||
use Zotlabs\Lib as Zlib;
|
/**
|
||||||
|
* @brief PermissionRoles class.
|
||||||
|
*
|
||||||
|
* @see Permissions
|
||||||
|
*/
|
||||||
class PermissionRoles {
|
class PermissionRoles {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief PermissionRoles version.
|
||||||
|
*
|
||||||
|
* This must match the version in Permissions.php before permission updates can run.
|
||||||
|
*
|
||||||
|
* @return number
|
||||||
|
*/
|
||||||
static public function version() {
|
static public function version() {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@@ -23,24 +32,43 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = false;
|
$ret['default_collection'] = false;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = true;
|
$ret['online'] = true;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'chat', 'post_like', 'republish' ];
|
'post_mail', 'chat', 'post_like', 'republish'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'social_federation':
|
||||||
|
$ret['perms_auto'] = false;
|
||||||
|
$ret['default_collection'] = false;
|
||||||
|
$ret['directory_publish'] = true;
|
||||||
|
$ret['online'] = true;
|
||||||
|
$ret['perms_connect'] = [
|
||||||
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
|
'post_mail', 'chat', 'post_like', 'republish'
|
||||||
|
];
|
||||||
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
$ret['limits']['post_comments'] = PERMS_AUTHED;
|
||||||
|
$ret['limits']['post_mail'] = PERMS_AUTHED;
|
||||||
|
$ret['limits']['post_like'] = PERMS_AUTHED;
|
||||||
|
$ret['limits']['chat'] = PERMS_AUTHED;
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'social_restricted':
|
case 'social_restricted':
|
||||||
$ret['perms_auto'] = false;
|
$ret['perms_auto'] = false;
|
||||||
$ret['default_collection'] = true;
|
$ret['default_collection'] = true;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = true;
|
$ret['online'] = true;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'chat', 'post_like' ];
|
'post_mail', 'chat', 'post_like'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -50,10 +78,11 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = true;
|
$ret['default_collection'] = true;
|
||||||
$ret['directory_publish'] = false;
|
$ret['directory_publish'] = false;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'post_like' ];
|
'post_mail', 'post_like'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
|
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
|
||||||
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
|
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
|
||||||
@@ -65,12 +94,13 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = false;
|
$ret['default_collection'] = false;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
|
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
|
||||||
'post_mail', 'post_like' , 'republish', 'chat' ];
|
'post_mail', 'post_like' , 'republish', 'chat'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'forum_restricted':
|
case 'forum_restricted':
|
||||||
@@ -78,11 +108,10 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = true;
|
$ret['default_collection'] = true;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
|
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
|
||||||
'post_mail', 'post_like' , 'chat' ];
|
'post_mail', 'post_like' , 'chat' ];
|
||||||
|
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -92,12 +121,11 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = true;
|
$ret['default_collection'] = true;
|
||||||
$ret['directory_publish'] = false;
|
$ret['directory_publish'] = false;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
|
$ret['perms_connect'] = [
|
||||||
$ret['perms_connect'] = [
|
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'post_like' , 'chat' ];
|
'post_mail', 'post_like' , 'chat'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
$ret['limits']['view_profile'] = PERMS_SPECIFIC;
|
$ret['limits']['view_profile'] = PERMS_SPECIFIC;
|
||||||
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
|
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
|
||||||
@@ -112,12 +140,11 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = false;
|
$ret['default_collection'] = false;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
|
$ret['perms_connect'] = [
|
||||||
$ret['perms_connect'] = [
|
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'post_like' , 'republish' ];
|
'post_mail', 'post_like' , 'republish'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -127,11 +154,11 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = true;
|
$ret['default_collection'] = true;
|
||||||
$ret['directory_publish'] = false;
|
$ret['directory_publish'] = false;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
$ret['perms_connect'] = [
|
$ret['perms_connect'] = [
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
|
||||||
'post_mail', 'post_like' , 'republish' ];
|
'post_mail', 'post_like' , 'republish'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -141,11 +168,10 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = false;
|
$ret['default_collection'] = false;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
|
$ret['perms_connect'] = [
|
||||||
$ret['perms_connect'] = [
|
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'post_like' , 'republish' ];
|
'view_pages', 'view_wiki', 'post_like' , 'republish'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -155,13 +181,13 @@ class PermissionRoles {
|
|||||||
$ret['default_collection'] = false;
|
$ret['default_collection'] = false;
|
||||||
$ret['directory_publish'] = true;
|
$ret['directory_publish'] = true;
|
||||||
$ret['online'] = false;
|
$ret['online'] = false;
|
||||||
|
$ret['perms_connect'] = [
|
||||||
$ret['perms_connect'] = [
|
|
||||||
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
|
||||||
'view_pages', 'view_wiki', 'write_storage', 'write_pages', 'post_wall', 'post_comments', 'tag_deliver',
|
'view_pages', 'view_wiki', 'write_storage', 'write_pages', 'post_wall', 'post_comments', 'tag_deliver',
|
||||||
'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki' ];
|
'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki'
|
||||||
|
];
|
||||||
$ret['limits'] = PermissionLimits::Std_Limits();
|
$ret['limits'] = PermissionLimits::Std_Limits();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'custom':
|
case 'custom':
|
||||||
@@ -170,11 +196,15 @@ class PermissionRoles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$x = get_config('system','role_perms');
|
$x = get_config('system','role_perms');
|
||||||
// let system settings over-ride any or all
|
// let system settings over-ride any or all
|
||||||
if($x && is_array($x) && array_key_exists($role,$x))
|
if($x && is_array($x) && array_key_exists($role,$x))
|
||||||
$ret = array_merge($ret,$x[$role]);
|
$ret = array_merge($ret,$x[$role]);
|
||||||
|
|
||||||
call_hooks('get_role_perms',$ret);
|
/**
|
||||||
|
* @hooks get_role_perms
|
||||||
|
* * \e array
|
||||||
|
*/
|
||||||
|
call_hooks('get_role_perms', $ret);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -187,10 +217,10 @@ class PermissionRoles {
|
|||||||
// \Zotlabs\Access\PermissionLimits::Set($uid,$perm,1);
|
// \Zotlabs\Access\PermissionLimits::Set($uid,$perm,1);
|
||||||
|
|
||||||
if($perm === 'view_wiki')
|
if($perm === 'view_wiki')
|
||||||
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_PUBLIC);
|
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_PUBLIC);
|
||||||
|
|
||||||
if($perm === 'write_wiki')
|
if($perm === 'write_wiki')
|
||||||
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_SPECIFIC);
|
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_SPECIFIC);
|
||||||
|
|
||||||
|
|
||||||
// set autoperms here if applicable
|
// set autoperms here if applicable
|
||||||
@@ -213,8 +243,6 @@ class PermissionRoles {
|
|||||||
if($c) {
|
if($c) {
|
||||||
set_abconfig($uid,$c['channel_hash'],'autoperms',$perm,$value);
|
set_abconfig($uid,$c['channel_hash'],'autoperms',$perm,$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now set something for all existing connections.
|
// now set something for all existing connections.
|
||||||
@@ -242,38 +270,45 @@ class PermissionRoles {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Array with translated role names and grouping.
|
||||||
|
*
|
||||||
|
* Return an associative array with grouped role names that can be used
|
||||||
|
* to create select groups like in \e field_select_grouped.tpl.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
static public function roles() {
|
static public function roles() {
|
||||||
$roles = [
|
$roles = [
|
||||||
t('Social Networking') => [
|
t('Social Networking') => [
|
||||||
'social' => t('Social - Mostly Public'),
|
'social_federation' => t('Social - Federation'),
|
||||||
'social_restricted' => t('Social - Restricted'),
|
'social' => t('Social - Mostly Public'),
|
||||||
|
'social_restricted' => t('Social - Restricted'),
|
||||||
'social_private' => t('Social - Private')
|
'social_private' => t('Social - Private')
|
||||||
],
|
],
|
||||||
|
|
||||||
t('Community Forum') => [
|
t('Community Forum') => [
|
||||||
'forum' => t('Forum - Mostly Public'),
|
'forum' => t('Forum - Mostly Public'),
|
||||||
'forum_restricted' => t('Forum - Restricted'),
|
'forum_restricted' => t('Forum - Restricted'),
|
||||||
'forum_private' => t('Forum - Private')
|
'forum_private' => t('Forum - Private')
|
||||||
],
|
],
|
||||||
|
|
||||||
t('Feed Republish') => [
|
t('Feed Republish') => [
|
||||||
'feed' => t('Feed - Mostly Public'),
|
'feed' => t('Feed - Mostly Public'),
|
||||||
'feed_restricted' => t('Feed - Restricted')
|
'feed_restricted' => t('Feed - Restricted')
|
||||||
],
|
],
|
||||||
|
|
||||||
t('Special Purpose') => [
|
t('Special Purpose') => [
|
||||||
'soapbox' => t('Special - Celebrity/Soapbox'),
|
'soapbox' => t('Special - Celebrity/Soapbox'),
|
||||||
'repository' => t('Special - Group Repository')
|
'repository' => t('Special - Group Repository')
|
||||||
],
|
],
|
||||||
|
|
||||||
t('Other') => [
|
t('Other') => [
|
||||||
'custom' => t('Custom/Expert Mode')
|
'custom' => t('Custom/Expert Mode')
|
||||||
]
|
]
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return $roles;
|
return $roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,19 +33,22 @@ use Zotlabs\Lib as Zlib;
|
|||||||
*/
|
*/
|
||||||
class Permissions {
|
class Permissions {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Permissions version.
|
||||||
|
*
|
||||||
|
* This must match the version in PermissionRoles.php before permission updates can run.
|
||||||
|
*
|
||||||
|
* @return number
|
||||||
|
*/
|
||||||
static public function version() {
|
static public function version() {
|
||||||
// This must match the version in PermissionRoles.php before permission updates can run.
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return an array with Permissions.
|
* @brief Return an array with Permissions.
|
||||||
*
|
*
|
||||||
* @hooks permissions_list
|
* @param string $filter (optional) only passed to hook permissions_list
|
||||||
* * \e array \b permissions
|
* @return array Associative array with permissions and short description.
|
||||||
* * \e string \b filter
|
|
||||||
* @param string $filter (optional) only passed to hook permission_list
|
|
||||||
* @return Associative array with permissions and short description.
|
|
||||||
*/
|
*/
|
||||||
static public function Perms($filter = '') {
|
static public function Perms($filter = '') {
|
||||||
|
|
||||||
@@ -74,6 +77,11 @@ class Permissions {
|
|||||||
'permissions' => $perms,
|
'permissions' => $perms,
|
||||||
'filter' => $filter
|
'filter' => $filter
|
||||||
];
|
];
|
||||||
|
/**
|
||||||
|
* @hooks permissions_list
|
||||||
|
* * \e array \b permissions
|
||||||
|
* * \e string \b filter
|
||||||
|
*/
|
||||||
call_hooks('permissions_list', $x);
|
call_hooks('permissions_list', $x);
|
||||||
|
|
||||||
return($x['permissions']);
|
return($x['permissions']);
|
||||||
@@ -84,9 +92,7 @@ class Permissions {
|
|||||||
*
|
*
|
||||||
* e.g. you must be authenticated.
|
* e.g. you must be authenticated.
|
||||||
*
|
*
|
||||||
* @hooks write_perms
|
* @return array Associative array with permissions and short description.
|
||||||
* * \e array \b permissions
|
|
||||||
* @return Associative array with permissions and short description.
|
|
||||||
*/
|
*/
|
||||||
static public function BlockedAnonPerms() {
|
static public function BlockedAnonPerms() {
|
||||||
|
|
||||||
@@ -99,6 +105,10 @@ class Permissions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$x = ['permissions' => $res];
|
$x = ['permissions' => $res];
|
||||||
|
/**
|
||||||
|
* @hooks write_perms
|
||||||
|
* * \e array \b permissions
|
||||||
|
*/
|
||||||
call_hooks('write_perms', $x);
|
call_hooks('write_perms', $x);
|
||||||
|
|
||||||
return($x['permissions']);
|
return($x['permissions']);
|
||||||
@@ -117,6 +127,7 @@ class Permissions {
|
|||||||
static public function FilledPerms($arr) {
|
static public function FilledPerms($arr) {
|
||||||
if(is_null($arr)) {
|
if(is_null($arr)) {
|
||||||
btlogger('FilledPerms: null');
|
btlogger('FilledPerms: null');
|
||||||
|
$arr = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$everything = self::Perms();
|
$everything = self::Perms();
|
||||||
@@ -138,7 +149,7 @@ class Permissions {
|
|||||||
* to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
|
* to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
|
||||||
*
|
*
|
||||||
* @param array $arr associative perms array 'view_stream' => 1
|
* @param array $arr associative perms array 'view_stream' => 1
|
||||||
* @return Indexed array with elements that look like
|
* @return array Indexed array with elements that look like
|
||||||
* * \e string \b name the perm name (e.g. view_stream)
|
* * \e string \b name the perm name (e.g. view_stream)
|
||||||
* * \e int \b value the value of the perm (e.g. 1)
|
* * \e int \b value the value of the perm (e.g. 1)
|
||||||
*/
|
*/
|
||||||
@@ -197,11 +208,10 @@ class Permissions {
|
|||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
* @param int $channel_id A channel id
|
* @param int $channel_id A channel id
|
||||||
* @return associative array
|
* @return array Associative array with
|
||||||
* * \e array \b perms Permission array
|
* * \e array \b perms Permission array
|
||||||
* * \e int \b automatic 0 or 1
|
* * \e int \b automatic 0 or 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function connect_perms($channel_id) {
|
static public function connect_perms($channel_id) {
|
||||||
|
|
||||||
$my_perms = [];
|
$my_perms = [];
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class Cron {
|
|||||||
// channels and sites that quietly vanished and prevent the directory from accumulating stale
|
// channels and sites that quietly vanished and prevent the directory from accumulating stale
|
||||||
// or dead entries.
|
// or dead entries.
|
||||||
|
|
||||||
$r = q("select channel_id from channel where channel_dirdate < %s - INTERVAL %s",
|
$r = q("select channel_id from channel where channel_dirdate < %s - INTERVAL %s and channel_removed = 0",
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
db_quoteinterval('30 DAY')
|
db_quoteinterval('30 DAY')
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -21,6 +21,21 @@ class Cron_weekly {
|
|||||||
|
|
||||||
mark_orphan_hubsxchans();
|
mark_orphan_hubsxchans();
|
||||||
|
|
||||||
|
// Find channels that were removed in the last three weeks, but
|
||||||
|
// haven't been finally cleaned up. These should be older than 10
|
||||||
|
// days to ensure that "purgeall" messages have gone out or bounced
|
||||||
|
// or timed out.
|
||||||
|
|
||||||
|
$r = q("select channel_id from channel where channel_removed = 1 and
|
||||||
|
channel_deleted > %s - INTERVAL %s and channel_deleted < %s - INTERVAL %s",
|
||||||
|
db_utcnow(), db_quoteinterval('21 DAY'),
|
||||||
|
db_utcnow(), db_quoteinterval('10 DAY')
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
foreach($r as $rv) {
|
||||||
|
channel_remove_final($rv['channel_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get rid of really old poco records
|
// get rid of really old poco records
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class Deliver {
|
|||||||
q("delete from dreport where dreport_queue = '%s'",
|
q("delete from dreport where dreport_queue = '%s'",
|
||||||
dbesc($argv[$x])
|
dbesc($argv[$x])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ class Expire {
|
|||||||
|
|
||||||
logger('expire: start', LOGGER_DEBUG);
|
logger('expire: start', LOGGER_DEBUG);
|
||||||
|
|
||||||
$site_expire = get_config('system', 'default_expire_days');
|
$site_expire = intval(get_config('system', 'default_expire_days'));
|
||||||
|
$commented_days = intval(get_config('system','active_expire_days'));
|
||||||
|
|
||||||
logger('site_expire: ' . $site_expire);
|
logger('site_expire: ' . $site_expire);
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ class Expire {
|
|||||||
|
|
||||||
// if the site or service class expiration is non-zero and less than person expiration, use that
|
// if the site or service class expiration is non-zero and less than person expiration, use that
|
||||||
logger('Expire: ' . $rr['channel_address'] . ' interval: ' . $expire_days, LOGGER_DEBUG);
|
logger('Expire: ' . $rr['channel_address'] . ' interval: ' . $expire_days, LOGGER_DEBUG);
|
||||||
item_expire($rr['channel_id'], $expire_days);
|
item_expire($rr['channel_id'], $expire_days, $commented_days);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ class Expire {
|
|||||||
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
|
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
|
||||||
|
|
||||||
if ($expire_days)
|
if ($expire_days)
|
||||||
item_expire($x['channel_id'], $expire_days);
|
item_expire($x['channel_id'], $expire_days, $commented_days);
|
||||||
|
|
||||||
logger('Expire: sys: done', LOGGER_DEBUG);
|
logger('Expire: sys: done', LOGGER_DEBUG);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ class Notifier {
|
|||||||
|
|
||||||
$item_id = $argv[2];
|
$item_id = $argv[2];
|
||||||
|
|
||||||
$extra = (($argc > 3) ? $argv[3] : null);
|
|
||||||
|
|
||||||
if(! $item_id)
|
if(! $item_id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -315,7 +313,7 @@ class Notifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($target_item['id'] == $target_item['parent']) {
|
if($target_item['mid'] === $target_item['parent_mid']) {
|
||||||
$parent_item = $target_item;
|
$parent_item = $target_item;
|
||||||
$top_level_post = true;
|
$top_level_post = true;
|
||||||
}
|
}
|
||||||
@@ -426,8 +424,10 @@ class Notifier {
|
|||||||
logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG);
|
logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG);
|
||||||
|
|
||||||
stringify_array_elms($recipients);
|
stringify_array_elms($recipients);
|
||||||
if(! $recipients)
|
if(! $recipients) {
|
||||||
|
logger('no recipients');
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// logger('notifier: recipients: ' . print_r($recipients,true), LOGGER_NORMAL, LOG_DEBUG);
|
// logger('notifier: recipients: ' . print_r($recipients,true), LOGGER_NORMAL, LOG_DEBUG);
|
||||||
|
|
||||||
@@ -618,8 +618,8 @@ class Notifier {
|
|||||||
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
||||||
}
|
}
|
||||||
if($packet_type === 'keychange') {
|
if($packet_type === 'keychange') {
|
||||||
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
|
||||||
$pmsg = get_pconfig($channel['channel_id'],'system','keychange');
|
$pmsg = get_pconfig($channel['channel_id'],'system','keychange');
|
||||||
|
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
||||||
}
|
}
|
||||||
elseif($packet_type === 'request') {
|
elseif($packet_type === 'request') {
|
||||||
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
|
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
|
||||||
@@ -640,7 +640,21 @@ class Notifier {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
|
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
|
||||||
$packet = zot_build_packet($channel,'notify',$env,(($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
|
|
||||||
|
// currently zot6 delivery is only performed on normal items and not sync items or mail or anything else
|
||||||
|
// Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing
|
||||||
|
// with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report
|
||||||
|
// to trigger dequeue'ing
|
||||||
|
|
||||||
|
$z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false);
|
||||||
|
if($z6) {
|
||||||
|
$packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
queue_insert(
|
queue_insert(
|
||||||
[
|
[
|
||||||
'hash' => $hash,
|
'hash' => $hash,
|
||||||
|
|||||||
@@ -12,10 +12,11 @@ class Queue {
|
|||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
|
|
||||||
if(argc() > 1)
|
|
||||||
$queue_id = argv(1);
|
if($argc > 1)
|
||||||
|
$queue_id = $argv[1];
|
||||||
else
|
else
|
||||||
$queue_id = 0;
|
$queue_id = EMPTY_STR;
|
||||||
|
|
||||||
logger('queue: start');
|
logger('queue: start');
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ class Ratenotif {
|
|||||||
'msg' => json_encode($encoded_item)
|
'msg' => json_encode($encoded_item)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
|
||||||
|
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
|
||||||
|
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
|
||||||
|
update_queue_item($hash);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$deliver[] = $hash;
|
$deliver[] = $hash;
|
||||||
|
|
||||||
if(count($deliver) >= $deliveries_per_process) {
|
if(count($deliver) >= $deliveries_per_process) {
|
||||||
|
|||||||
78
Zotlabs/Daemon/Thumbnail.php
Normal file
78
Zotlabs/Daemon/Thumbnail.php
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?php /** @file */
|
||||||
|
|
||||||
|
namespace Zotlabs\Daemon;
|
||||||
|
|
||||||
|
|
||||||
|
class Thumbnail {
|
||||||
|
|
||||||
|
static public function run($argc,$argv) {
|
||||||
|
|
||||||
|
if(! $argc == 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
$c = q("select * from attach where hash = '%s' ",
|
||||||
|
dbesc($argv[1])
|
||||||
|
);
|
||||||
|
|
||||||
|
if(! $c)
|
||||||
|
return;
|
||||||
|
|
||||||
|
$attach = $c[0];
|
||||||
|
|
||||||
|
$preview_style = intval(get_config('system','thumbnail_security',0));
|
||||||
|
$preview_width = intval(get_config('system','thumbnail_width',300));
|
||||||
|
$preview_height = intval(get_config('system','thumbnail_height',300));
|
||||||
|
|
||||||
|
$p = [
|
||||||
|
'attach' => $attach,
|
||||||
|
'preview_style' => $preview_style,
|
||||||
|
'preview_width' => $preview_width,
|
||||||
|
'preview_height' => $preview_height,
|
||||||
|
'thumbnail' => null
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @hooks thumbnail
|
||||||
|
* * \e array \b attach
|
||||||
|
* * \e int \b preview_style
|
||||||
|
* * \e int \b preview_width
|
||||||
|
* * \e int \b preview_height
|
||||||
|
* * \e string \b thumbnail
|
||||||
|
*/
|
||||||
|
|
||||||
|
call_hooks('thumbnail',$p);
|
||||||
|
if($p['thumbnail']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$default_controller = null;
|
||||||
|
|
||||||
|
$files = glob('Zotlabs/Thumbs/*.php');
|
||||||
|
if($files) {
|
||||||
|
foreach($files as $f) {
|
||||||
|
$clsname = '\\Zotlabs\\Thumbs\\' . ucfirst(basename($f,'.php'));
|
||||||
|
if(class_exists($clsname)) {
|
||||||
|
$x = new $clsname();
|
||||||
|
if(method_exists($x,'Match')) {
|
||||||
|
$matched = $x->Match($attach['filetype']);
|
||||||
|
if($matched) {
|
||||||
|
$x->Thumb($attach,$preview_style,$preview_width,$preview_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(method_exists($x,'MatchDefault')) {
|
||||||
|
$default_matched = $x->MatchDefault(substr($attach['filetype'],0,strpos($attach['filetype'],'/')));
|
||||||
|
if($default_matched) {
|
||||||
|
$default_controller = $x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(($default_controller)
|
||||||
|
&& ((! file_exists(dbunescbin($attach['content']) . '.thumb'))
|
||||||
|
|| (filectime(dbunescbin($attach['content']) . 'thumb') < (time() - 60)))) {
|
||||||
|
$default_controller->Thumb($attach,$preview_style,$preview_width,$preview_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Extend;
|
namespace Zotlabs\Extend;
|
||||||
|
|
||||||
|
use App;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Hook class.
|
||||||
|
*
|
||||||
|
*/
|
||||||
class Hook {
|
class Hook {
|
||||||
|
|
||||||
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
|
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
|
||||||
@@ -64,11 +69,14 @@ class Hook {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
// unregister all hooks with this file component.
|
/**
|
||||||
// Useful for addon upgrades where you want to clean out old interfaces.
|
* @brief Unregister all hooks with this file component.
|
||||||
|
*
|
||||||
|
* Useful for addon upgrades where you want to clean out old interfaces.
|
||||||
|
*
|
||||||
|
* @param string $file
|
||||||
|
*/
|
||||||
static public function unregister_by_file($file) {
|
static public function unregister_by_file($file) {
|
||||||
|
|
||||||
$r = q("DELETE FROM hook WHERE file = '%s' ",
|
$r = q("DELETE FROM hook WHERE file = '%s' ",
|
||||||
dbesc($file)
|
dbesc($file)
|
||||||
);
|
);
|
||||||
@@ -76,7 +84,6 @@ class Hook {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Inserts a hook into a page request.
|
* @brief Inserts a hook into a page request.
|
||||||
*
|
*
|
||||||
@@ -98,7 +105,6 @@ class Hook {
|
|||||||
* @param int $priority
|
* @param int $priority
|
||||||
* currently not implemented in this function, would require the hook array to be resorted
|
* currently not implemented in this function, would require the hook array to be resorted
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function insert($hook, $fn, $version = 0, $priority = 0) {
|
static public function insert($hook, $fn, $version = 0, $priority = 0) {
|
||||||
if(is_array($fn)) {
|
if(is_array($fn)) {
|
||||||
$fn = serialize($fn);
|
$fn = serialize($fn);
|
||||||
|
|||||||
34
Zotlabs/Identity/OAuth2Server.php
Normal file
34
Zotlabs/Identity/OAuth2Server.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Identity;
|
||||||
|
|
||||||
|
class OAuth2Server extends \OAuth2\Server {
|
||||||
|
|
||||||
|
public function __construct(OAuth2Storage $storage, $config = []) {
|
||||||
|
|
||||||
|
if(! is_array($config)) {
|
||||||
|
$config = [
|
||||||
|
'use_openid_connect' => true,
|
||||||
|
'issuer' => \Zotlabs\Lib\System::get_site_name()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::__construct($storage, $config);
|
||||||
|
|
||||||
|
// Add the "Client Credentials" grant type (it is the simplest of the grant types)
|
||||||
|
$this->addGrantType(new \OAuth2\GrantType\ClientCredentials($storage));
|
||||||
|
|
||||||
|
// Add the "Authorization Code" grant type (this is where the oauth magic happens)
|
||||||
|
$this->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage));
|
||||||
|
|
||||||
|
$keyStorage = new \OAuth2\Storage\Memory( [
|
||||||
|
'keys' => [
|
||||||
|
'public_key' => get_config('system', 'pubkey'),
|
||||||
|
'private_key' => get_config('system', 'prvkey')
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->addStorage($keyStorage, 'public_key');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
81
Zotlabs/Identity/OAuth2Storage.php
Normal file
81
Zotlabs/Identity/OAuth2Storage.php
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Identity;
|
||||||
|
|
||||||
|
|
||||||
|
class OAuth2Storage extends \OAuth2\Storage\Pdo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function checkUserCredentials($username, $password)
|
||||||
|
{
|
||||||
|
if ($user = $this->getUser($username)) {
|
||||||
|
return $this->checkPassword($user, $password);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $username
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
public function getUserDetails($username)
|
||||||
|
{
|
||||||
|
return $this->getUser($username);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param array $user
|
||||||
|
* @param string $password
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function checkPassword($user, $password)
|
||||||
|
{
|
||||||
|
|
||||||
|
$x = account_verify_password($user,$password);
|
||||||
|
return((array_key_exists('channel',$x) && ! empty($x['channel'])) ? true : false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $username
|
||||||
|
* @return array|bool
|
||||||
|
*/
|
||||||
|
public function getUser($username)
|
||||||
|
{
|
||||||
|
|
||||||
|
$x = channelx_by_nick($username);
|
||||||
|
if(! $x) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return( [
|
||||||
|
'username' => $x['channel_address'],
|
||||||
|
'user_id' => $x['channel_id'],
|
||||||
|
'firstName' => $x['channel_name'],
|
||||||
|
'lastName' => '',
|
||||||
|
'password' => 'NotARealPassword'
|
||||||
|
] );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* plaintext passwords are bad! Override this for your application
|
||||||
|
*
|
||||||
|
* @param string $username
|
||||||
|
* @param string $password
|
||||||
|
* @param string $firstName
|
||||||
|
* @param string $lastName
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function setUser($username, $password, $firstName = null, $lastName = null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief ActivityStreams class.
|
||||||
|
*
|
||||||
|
* Parses an ActivityStream JSON string.
|
||||||
|
*/
|
||||||
class ActivityStreams {
|
class ActivityStreams {
|
||||||
|
|
||||||
public $data;
|
public $data;
|
||||||
@@ -19,9 +24,16 @@ class ActivityStreams {
|
|||||||
public $recips = null;
|
public $recips = null;
|
||||||
public $raw_recips = null;
|
public $raw_recips = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Constructor for ActivityStreams.
|
||||||
|
*
|
||||||
|
* Takes a JSON string as parameter, decodes it and sets up this object.
|
||||||
|
*
|
||||||
|
* @param string $string
|
||||||
|
*/
|
||||||
function __construct($string) {
|
function __construct($string) {
|
||||||
|
|
||||||
$this->data = json_decode($string,true);
|
$this->data = json_decode($string, true);
|
||||||
if($this->data) {
|
if($this->data) {
|
||||||
$this->valid = true;
|
$this->valid = true;
|
||||||
}
|
}
|
||||||
@@ -50,6 +62,11 @@ class ActivityStreams {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return if instantiated ActivityStream is valid.
|
||||||
|
*
|
||||||
|
* @return boolean Return true if the JSON string could be decoded.
|
||||||
|
*/
|
||||||
function is_valid() {
|
function is_valid() {
|
||||||
return $this->valid;
|
return $this->valid;
|
||||||
}
|
}
|
||||||
@@ -58,18 +75,26 @@ class ActivityStreams {
|
|||||||
$this->saved_recips = $arr;
|
$this->saved_recips = $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function collect_recips($base = '',$namespace = '') {
|
/**
|
||||||
|
* @brief Collects all recipients.
|
||||||
|
*
|
||||||
|
* @param string $base
|
||||||
|
* @param string $namespace (optional) default empty
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function collect_recips($base = '', $namespace = '') {
|
||||||
$x = [];
|
$x = [];
|
||||||
$fields = [ 'to','cc','bto','bcc','audience'];
|
$fields = [ 'to', 'cc', 'bto', 'bcc', 'audience'];
|
||||||
foreach($fields as $f) {
|
foreach($fields as $f) {
|
||||||
$y = $this->get_compound_property($f,$base,$namespace);
|
$y = $this->get_compound_property($f, $base, $namespace);
|
||||||
if($y) {
|
if($y) {
|
||||||
$x = array_merge($x,$y);
|
$x = array_merge($x, $y);
|
||||||
if(! is_array($this->raw_recips))
|
if(! is_array($this->raw_recips))
|
||||||
$this->raw_recips = [];
|
$this->raw_recips = [];
|
||||||
|
|
||||||
$this->raw_recips[$f] = $x;
|
$this->raw_recips[$f] = $x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// not yet ready for prime time
|
// not yet ready for prime time
|
||||||
// $x = $this->expand($x,$base,$namespace);
|
// $x = $this->expand($x,$base,$namespace);
|
||||||
return $x;
|
return $x;
|
||||||
@@ -96,23 +121,30 @@ class ActivityStreams {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme de-duplicate
|
/// @fixme de-duplicate
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_namespace($base,$namespace) {
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param array $base
|
||||||
|
* @param string $namespace if not set return empty string
|
||||||
|
* @return string|NULL
|
||||||
|
*/
|
||||||
|
function get_namespace($base, $namespace) {
|
||||||
|
|
||||||
if(! $namespace)
|
if(! $namespace)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$key = null;
|
$key = null;
|
||||||
|
|
||||||
|
|
||||||
foreach( [ $this->data, $base ] as $b ) {
|
foreach( [ $this->data, $base ] as $b ) {
|
||||||
if(! $b)
|
if(! $b)
|
||||||
continue;
|
continue;
|
||||||
if(array_key_exists('@context',$b)) {
|
|
||||||
|
if(array_key_exists('@context', $b)) {
|
||||||
if(is_array($b['@context'])) {
|
if(is_array($b['@context'])) {
|
||||||
foreach($b['@context'] as $ns) {
|
foreach($b['@context'] as $ns) {
|
||||||
if(is_array($ns)) {
|
if(is_array($ns)) {
|
||||||
@@ -135,19 +167,35 @@ class ActivityStreams {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $key;
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
function get_property_obj($property,$base = '',$namespace = '' ) {
|
* @brief
|
||||||
$prefix = $this->get_namespace($base,$namespace);
|
*
|
||||||
|
* @param string $property
|
||||||
|
* @param array $base (optional)
|
||||||
|
* @param string $namespace (optional) default empty
|
||||||
|
* @return NULL|mixed
|
||||||
|
*/
|
||||||
|
function get_property_obj($property, $base = '', $namespace = '') {
|
||||||
|
$prefix = $this->get_namespace($base, $namespace);
|
||||||
if($prefix === null)
|
if($prefix === null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
$base = (($base) ? $base : $this->data);
|
$base = (($base) ? $base : $this->data);
|
||||||
$propname = (($prefix) ? $prefix . ':' : '') . $property;
|
$propname = (($prefix) ? $prefix . ':' : '') . $property;
|
||||||
return ((array_key_exists($propname,$base)) ? $base[$propname] : null);
|
|
||||||
|
return ((array_key_exists($propname, $base)) ? $base[$propname] : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Fetches a property from an URL.
|
||||||
|
*
|
||||||
|
* @param string $url
|
||||||
|
* @return NULL|mixed
|
||||||
|
*/
|
||||||
function fetch_property($url) {
|
function fetch_property($url) {
|
||||||
$redirects = 0;
|
$redirects = 0;
|
||||||
if(! check_siteallowed($url)) {
|
if(! check_siteallowed($url)) {
|
||||||
@@ -155,44 +203,70 @@ class ActivityStreams {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = z_fetch_url($url,true,$redirects,
|
$x = z_fetch_url($url, true, $redirects,
|
||||||
['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json' ]]);
|
['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json' ]]);
|
||||||
if($x['success'])
|
if($x['success'])
|
||||||
return json_decode($x['body'],true);
|
return json_decode($x['body'], true);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_compound_property($property,$base = '',$namespace = '') {
|
/**
|
||||||
$x = $this->get_property_obj($property,$base,$namespace);
|
* @brief
|
||||||
|
*
|
||||||
|
* @param string $property
|
||||||
|
* @param array $base
|
||||||
|
* @param string $namespace (optional) default empty
|
||||||
|
* @return NULL|mixed
|
||||||
|
*/
|
||||||
|
function get_compound_property($property, $base = '', $namespace = '') {
|
||||||
|
$x = $this->get_property_obj($property, $base, $namespace);
|
||||||
if($this->is_url($x)) {
|
if($this->is_url($x)) {
|
||||||
$x = $this->fetch_property($x);
|
$x = $this->fetch_property($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if string starts with http.
|
||||||
|
*
|
||||||
|
* @param string $url
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
function is_url($url) {
|
function is_url($url) {
|
||||||
if(($url) && (! is_array($url)) && (strpos($url,'http') === 0)) {
|
if(($url) && (! is_array($url)) && (strpos($url, 'http') === 0)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_primary_type($base = '',$namespace = '') {
|
/**
|
||||||
|
* @brief Gets the type property.
|
||||||
|
*
|
||||||
|
* @param array $base
|
||||||
|
* @param string $namespace (optional) default empty
|
||||||
|
* @return NULL|mixed
|
||||||
|
*/
|
||||||
|
function get_primary_type($base = '', $namespace = '') {
|
||||||
if(! $base)
|
if(! $base)
|
||||||
$base = $this->data;
|
$base = $this->data;
|
||||||
$x = $this->get_property_obj('type',$base,$namespace);
|
|
||||||
|
$x = $this->get_property_obj('type', $base, $namespace);
|
||||||
if(is_array($x)) {
|
if(is_array($x)) {
|
||||||
foreach($x as $y) {
|
foreach($x as $y) {
|
||||||
if(strpos($y,':') === false) {
|
if(strpos($y, ':') === false) {
|
||||||
return $y;
|
return $y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
function debug() {
|
function debug() {
|
||||||
$x = var_export($this,true);
|
$x = var_export($this, true);
|
||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ class Apps {
|
|||||||
|
|
||||||
|
|
||||||
static public function parse_app_description($f,$translate = true) {
|
static public function parse_app_description($f,$translate = true) {
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
$baseurl = z_root();
|
$baseurl = z_root();
|
||||||
@@ -194,6 +195,10 @@ class Apps {
|
|||||||
if(! is_public_profile())
|
if(! is_public_profile())
|
||||||
unset($ret);
|
unset($ret);
|
||||||
break;
|
break;
|
||||||
|
case 'public_stream':
|
||||||
|
if(! can_view_public_stream())
|
||||||
|
unset($ret);
|
||||||
|
break;
|
||||||
case 'observer':
|
case 'observer':
|
||||||
if(! $observer)
|
if(! $observer)
|
||||||
unset($ret);
|
unset($ret);
|
||||||
@@ -221,6 +226,7 @@ class Apps {
|
|||||||
static public function translate_system_apps(&$arr) {
|
static public function translate_system_apps(&$arr) {
|
||||||
$apps = array(
|
$apps = array(
|
||||||
'Apps' => t('Apps'),
|
'Apps' => t('Apps'),
|
||||||
|
'Articles' => t('Articles'),
|
||||||
'Cards' => t('Cards'),
|
'Cards' => t('Cards'),
|
||||||
'Admin' => t('Site Admin'),
|
'Admin' => t('Site Admin'),
|
||||||
'Report Bug' => t('Report Bug'),
|
'Report Bug' => t('Report Bug'),
|
||||||
@@ -345,6 +351,10 @@ class Apps {
|
|||||||
if(! is_public_profile())
|
if(! is_public_profile())
|
||||||
return '';
|
return '';
|
||||||
break;
|
break;
|
||||||
|
case 'public_stream':
|
||||||
|
if(! can_view_public_stream())
|
||||||
|
return '';
|
||||||
|
break;
|
||||||
case 'observer':
|
case 'observer':
|
||||||
$observer = \App::get_observer();
|
$observer = \App::get_observer();
|
||||||
if(! $observer)
|
if(! $observer)
|
||||||
@@ -352,7 +362,7 @@ class Apps {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if($config)
|
if($config)
|
||||||
$unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
|
$unset = ((get_config('system', $require[0]) === $require[1]) ? false : true);
|
||||||
else
|
else
|
||||||
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
|
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
|
||||||
if($unset)
|
if($unset)
|
||||||
@@ -401,11 +411,15 @@ class Apps {
|
|||||||
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
|
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
|
||||||
'$deleted' => $papp['deleted'],
|
'$deleted' => $papp['deleted'],
|
||||||
'$feature' => (($papp['embed']) ? false : true),
|
'$feature' => (($papp['embed']) ? false : true),
|
||||||
|
'$pin' => (($papp['embed']) ? false : true),
|
||||||
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
|
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
|
||||||
|
'$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
|
||||||
'$navapps' => (($mode == 'nav') ? true : false),
|
'$navapps' => (($mode == 'nav') ? true : false),
|
||||||
'$order' => (($mode == 'nav-order') ? true : false),
|
'$order' => (($mode == 'nav-order') ? true : false),
|
||||||
'$add' => t('Add to app-tray'),
|
'$add' => t('Add to app-tray'),
|
||||||
'$remove' => t('Remove from app-tray')
|
'$remove' => t('Remove from app-tray'),
|
||||||
|
'$add_nav' => t('Pin to navbar'),
|
||||||
|
'$remove_nav' => t('Unpin from navbar')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -498,25 +512,27 @@ class Apps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function app_feature($uid,$app) {
|
static public function app_feature($uid,$app,$term) {
|
||||||
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
|
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
|
||||||
dbesc($app['guid']),
|
dbesc($app['guid']),
|
||||||
intval($uid)
|
intval($uid)
|
||||||
);
|
);
|
||||||
|
|
||||||
$x = q("select * from term where otype = %d and oid = %d and term = 'nav_featured_app' limit 1",
|
$x = q("select * from term where otype = %d and oid = %d and term = '%s' limit 1",
|
||||||
intval(TERM_OBJ_APP),
|
intval(TERM_OBJ_APP),
|
||||||
intval($r[0]['id'])
|
intval($r[0]['id']),
|
||||||
|
dbesc($term)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($x) {
|
if($x) {
|
||||||
q("delete from term where otype = %d and oid = %d and term = 'nav_featured_app'",
|
q("delete from term where otype = %d and oid = %d and term = '%s'",
|
||||||
intval(TERM_OBJ_APP),
|
intval(TERM_OBJ_APP),
|
||||||
intval($x[0]['oid'])
|
intval($x[0]['oid']),
|
||||||
|
dbesc($term)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
store_item_tag($uid,$r[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,'nav_featured_app',escape_tags(z_root() . '/apps/?f=&cat=nav_featured_app'));
|
store_item_tag($uid, $r[0]['id'], TERM_OBJ_APP, TERM_CATEGORY, $term, escape_tags(z_root() . '/apps/?f=&cat=' . $term));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,16 +547,27 @@ class Apps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static public function app_list($uid, $deleted = false, $cat = '') {
|
static public function app_list($uid, $deleted = false, $cats = []) {
|
||||||
if($deleted)
|
if($deleted)
|
||||||
$sql_extra = "";
|
$sql_extra = "";
|
||||||
else
|
else
|
||||||
$sql_extra = " and app_deleted = 0 ";
|
$sql_extra = " and app_deleted = 0 ";
|
||||||
|
|
||||||
if($cat) {
|
if($cats) {
|
||||||
$r = q("select oid from term where otype = %d and term = '%s'",
|
|
||||||
intval(TERM_OBJ_APP),
|
$cat_sql_extra = " and ( ";
|
||||||
dbesc($cat)
|
|
||||||
|
foreach($cats as $cat) {
|
||||||
|
if(strpos($cat_sql_extra, 'term'))
|
||||||
|
$cat_sql_extra .= "or ";
|
||||||
|
|
||||||
|
$cat_sql_extra .= "term = '" . dbesc($cat) . "' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$cat_sql_extra .= ") ";
|
||||||
|
|
||||||
|
$r = q("select oid from term where otype = %d $cat_sql_extra",
|
||||||
|
intval(TERM_OBJ_APP)
|
||||||
);
|
);
|
||||||
if(! $r)
|
if(! $r)
|
||||||
return $r;
|
return $r;
|
||||||
@@ -616,7 +643,7 @@ class Apps {
|
|||||||
|
|
||||||
static function moveup($uid,$guid) {
|
static function moveup($uid,$guid) {
|
||||||
$syslist = array();
|
$syslist = array();
|
||||||
$list = self::app_list($uid, false, 'nav_featured_app');
|
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
|
||||||
if($list) {
|
if($list) {
|
||||||
foreach($list as $li) {
|
foreach($list as $li) {
|
||||||
$syslist[] = self::app_encode($li);
|
$syslist[] = self::app_encode($li);
|
||||||
@@ -657,7 +684,7 @@ class Apps {
|
|||||||
|
|
||||||
static function movedown($uid,$guid) {
|
static function movedown($uid,$guid) {
|
||||||
$syslist = array();
|
$syslist = array();
|
||||||
$list = self::app_list($uid, false, 'nav_featured_app');
|
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
|
||||||
if($list) {
|
if($list) {
|
||||||
foreach($list as $li) {
|
foreach($list as $li) {
|
||||||
$syslist[] = self::app_encode($li);
|
$syslist[] = self::app_encode($li);
|
||||||
@@ -758,6 +785,7 @@ class Apps {
|
|||||||
dbesc($darray['app_plugin']),
|
dbesc($darray['app_plugin']),
|
||||||
intval($darray['app_deleted'])
|
intval($darray['app_deleted'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
$ret['success'] = true;
|
$ret['success'] = true;
|
||||||
$ret['app_id'] = $darray['app_id'];
|
$ret['app_id'] = $darray['app_id'];
|
||||||
@@ -844,6 +872,12 @@ class Apps {
|
|||||||
dbesc($darray['app_id']),
|
dbesc($darray['app_id']),
|
||||||
intval($darray['app_channel'])
|
intval($darray['app_channel'])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// if updating an embed app, don't mess with any existing categories.
|
||||||
|
|
||||||
|
if(array_key_exists('embed',$arr) && intval($arr['embed']))
|
||||||
|
return $ret;
|
||||||
|
|
||||||
if($x) {
|
if($x) {
|
||||||
q("delete from term where otype = %d and oid = %d",
|
q("delete from term where otype = %d and oid = %d",
|
||||||
intval(TERM_OBJ_APP),
|
intval(TERM_OBJ_APP),
|
||||||
|
|||||||
@@ -2,22 +2,18 @@
|
|||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Chat related functions.
|
* @brief A class with chatroom related static methods.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Chatroom {
|
class Chatroom {
|
||||||
/**
|
/**
|
||||||
* @brief Creates a chatroom.
|
* @brief Creates a chatroom.
|
||||||
*
|
*
|
||||||
* @param array $channel
|
* @param array $channel
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
* @return An associative array containing:
|
* @return array An associative array containing:
|
||||||
* - success: A boolean
|
* * \e boolean \b success - A boolean success status
|
||||||
* - message: (optional) A string
|
* * \e string \b message - (optional) A string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function create($channel, $arr) {
|
static public function create($channel, $arr) {
|
||||||
|
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
@@ -150,8 +146,8 @@ class Chatroom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(intval($x[0]['cr_expire'])) {
|
if(intval($x[0]['cr_expire'])) {
|
||||||
$r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
|
$r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
db_quoteinterval( intval($x[0]['cr_expire']) . ' MINUTE' ),
|
db_quoteinterval( intval($x[0]['cr_expire']) . ' MINUTE' ),
|
||||||
intval($x[0]['cr_id'])
|
intval($x[0]['cr_id'])
|
||||||
);
|
);
|
||||||
@@ -225,10 +221,16 @@ class Chatroom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a chat message via API.
|
* @brief Create a chat message via API.
|
||||||
|
*
|
||||||
* It is the caller's responsibility to enter the room.
|
* It is the caller's responsibility to enter the room.
|
||||||
*/
|
*
|
||||||
|
* @param int $uid
|
||||||
|
* @param int $room_id
|
||||||
|
* @param string $xchan
|
||||||
|
* @param string $text
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
static public function message($uid, $room_id, $xchan, $text) {
|
static public function message($uid, $room_id, $xchan, $text) {
|
||||||
|
|
||||||
$ret = array('success' => false);
|
$ret = array('success' => false);
|
||||||
@@ -245,12 +247,18 @@ class Chatroom {
|
|||||||
if(! $r)
|
if(! $r)
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
||||||
$arr = array(
|
$arr = [
|
||||||
'chat_room' => $room_id,
|
'chat_room' => $room_id,
|
||||||
'chat_xchan' => $xchan,
|
'chat_xchan' => $xchan,
|
||||||
'chat_text' => $text
|
'chat_text' => $text
|
||||||
);
|
];
|
||||||
|
/**
|
||||||
|
* @hooks chat_message
|
||||||
|
* Called to create a chat message.
|
||||||
|
* * \e int \b chat_room
|
||||||
|
* * \e string \b chat_xchan
|
||||||
|
* * \e string \b chat_text
|
||||||
|
*/
|
||||||
call_hooks('chat_message', $arr);
|
call_hooks('chat_message', $arr);
|
||||||
|
|
||||||
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
|
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
|
||||||
@@ -258,7 +266,7 @@ class Chatroom {
|
|||||||
intval($room_id),
|
intval($room_id),
|
||||||
dbesc($xchan),
|
dbesc($xchan),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc($arr['chat_text'])
|
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
|
||||||
);
|
);
|
||||||
|
|
||||||
$ret['success'] = true;
|
$ret['success'] = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php /** @file */
|
<?php
|
||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
@@ -14,7 +14,6 @@ class Config {
|
|||||||
* @param string $family
|
* @param string $family
|
||||||
* The category of the configuration value
|
* The category of the configuration value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Load($family) {
|
static public function Load($family) {
|
||||||
if(! array_key_exists($family, \App::$config))
|
if(! array_key_exists($family, \App::$config))
|
||||||
\App::$config[$family] = array();
|
\App::$config[$family] = array();
|
||||||
@@ -30,7 +29,7 @@ class Config {
|
|||||||
}
|
}
|
||||||
\App::$config[$family]['config_loaded'] = true;
|
\App::$config[$family]['config_loaded'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,8 +46,7 @@ class Config {
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
* Return the set value, or false if the database update failed
|
* Return the set value, or false if the database update failed
|
||||||
*/
|
*/
|
||||||
|
static public function Set($family, $key, $value) {
|
||||||
static public function Set($family,$key,$value) {
|
|
||||||
// manage array value
|
// manage array value
|
||||||
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
|
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
|
||||||
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
|
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
|
||||||
@@ -76,8 +74,8 @@ class Config {
|
|||||||
\App::$config[$family][$key] = $value;
|
\App::$config[$family][$key] = $value;
|
||||||
$ret = $value;
|
$ret = $value;
|
||||||
}
|
}
|
||||||
return $ret;
|
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,25 +86,25 @@ class Config {
|
|||||||
* $key from a cached storage in App::$config[$family]. If a key is found in the
|
* $key from a cached storage in App::$config[$family]. If a key is found in the
|
||||||
* DB but does not exist in local config cache, pull it into the cache so we
|
* DB but does not exist in local config cache, pull it into the cache so we
|
||||||
* do not have to hit the DB again for this item.
|
* do not have to hit the DB again for this item.
|
||||||
*
|
*
|
||||||
* Returns false if not set.
|
* Returns false if not set.
|
||||||
*
|
*
|
||||||
* @param string $family
|
* @param string $family
|
||||||
* The category of the configuration value
|
* The category of the configuration value
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* The configuration key to query
|
* The configuration key to query
|
||||||
|
* @param string $default (optional) default false
|
||||||
* @return mixed Return value or false on error or if not set
|
* @return mixed Return value or false on error or if not set
|
||||||
*/
|
*/
|
||||||
|
static public function Get($family, $key, $default = false) {
|
||||||
static public function Get($family,$key,$default = false) {
|
|
||||||
if((! array_key_exists($family, \App::$config)) || (! array_key_exists('config_loaded', \App::$config[$family])))
|
if((! array_key_exists($family, \App::$config)) || (! array_key_exists('config_loaded', \App::$config[$family])))
|
||||||
self::Load($family);
|
self::Load($family);
|
||||||
|
|
||||||
if(array_key_exists('config_loaded', \App::$config[$family])) {
|
if(array_key_exists('config_loaded', \App::$config[$family])) {
|
||||||
if(! array_key_exists($key, \App::$config[$family])) {
|
if(! array_key_exists($key, \App::$config[$family])) {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key]))
|
return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key]))
|
||||||
? unserialize(\App::$config[$family][$key])
|
? unserialize(\App::$config[$family][$key])
|
||||||
: \App::$config[$family][$key]
|
: \App::$config[$family][$key]
|
||||||
);
|
);
|
||||||
@@ -127,25 +125,26 @@ class Config {
|
|||||||
* The configuration key to delete
|
* The configuration key to delete
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
static public function Delete($family, $key) {
|
||||||
static public function Delete($family,$key) {
|
|
||||||
|
|
||||||
$ret = false;
|
$ret = false;
|
||||||
|
|
||||||
if(array_key_exists($family, \App::$config) && array_key_exists($key, \App::$config[$family]))
|
if(array_key_exists($family, \App::$config) && array_key_exists($key, \App::$config[$family]))
|
||||||
unset(\App::$config[$family][$key]);
|
unset(\App::$config[$family][$key]);
|
||||||
$ret = q("DELETE FROM config WHERE cat = '%s' AND k = '%s'",
|
|
||||||
|
$ret = q("DELETE FROM config WHERE cat = '%s' AND k = '%s'",
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key)
|
dbesc($key)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns a value directly from the database configuration storage.
|
* @brief Returns a record directly from the database configuration storage.
|
||||||
*
|
*
|
||||||
* This function queries directly the database and bypasses the chached storage
|
* This function queries directly the database and bypasses the cached storage
|
||||||
* from get_config($family, $key).
|
* from get_config($family, $key).
|
||||||
*
|
*
|
||||||
* @param string $family
|
* @param string $family
|
||||||
@@ -154,12 +153,12 @@ class Config {
|
|||||||
* The configuration key to query
|
* The configuration key to query
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static private function get_from_storage($family,$key) {
|
static private function get_from_storage($family,$key) {
|
||||||
$ret = q("SELECT * FROM config WHERE cat = '%s' AND k = '%s' LIMIT 1",
|
$ret = q("SELECT * FROM config WHERE cat = '%s' AND k = '%s' LIMIT 1",
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key)
|
dbesc($key)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,22 +10,12 @@ class DB_Upgrade {
|
|||||||
|
|
||||||
function __construct($db_revision) {
|
function __construct($db_revision) {
|
||||||
|
|
||||||
$platform_name = System::get_platform_name();
|
$this->config_name = 'db_version';
|
||||||
|
$this->func_prefix = '_';
|
||||||
|
|
||||||
$update_file = 'install/' . $platform_name . '/update.php';
|
$build = get_config('system', 'db_version', 0);
|
||||||
if(! file_exists($update_file)) {
|
|
||||||
$update_file = 'install/update.php';
|
|
||||||
$this->config_name = 'db_version';
|
|
||||||
$this->func_prefix = 'update_r';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->config_name = $platform_name . '_db_version';
|
|
||||||
$this->func_prefix = $platform_name . '_update_';
|
|
||||||
}
|
|
||||||
|
|
||||||
$build = get_config('system', $this->config_name, 0);
|
|
||||||
if(! intval($build))
|
if(! intval($build))
|
||||||
$build = set_config('system', $this->config_name, $db_revision);
|
$build = set_config('system', 'db_version', $db_revision);
|
||||||
|
|
||||||
if($build == $db_revision) {
|
if($build == $db_revision) {
|
||||||
// Nothing to be done.
|
// Nothing to be done.
|
||||||
@@ -40,82 +30,78 @@ class DB_Upgrade {
|
|||||||
|
|
||||||
$current = intval($db_revision);
|
$current = intval($db_revision);
|
||||||
|
|
||||||
if(($stored < $current) && file_exists($update_file)) {
|
if($stored < $current) {
|
||||||
|
|
||||||
Config::Load('database');
|
// The last update we performed was $stored.
|
||||||
|
// Start at $stored + 1 and continue until we have completed $current
|
||||||
|
|
||||||
// We're reporting a different version than what is currently installed.
|
for($x = $stored + 1; $x <= $current; $x ++) {
|
||||||
// Run any existing update scripts to bring the database up to current.
|
$s = '_' . $x;
|
||||||
|
$cls = '\\Zotlabs\Update\\' . $s ;
|
||||||
require_once($update_file);
|
if(! class_exists($cls)) {
|
||||||
|
return;
|
||||||
// make sure that boot.php and update.php are the same release, we might be
|
}
|
||||||
// updating from git right this very second and the correct version of the update.php
|
|
||||||
// file may not be here yet. This can happen on a very busy site.
|
// There could be a lot of processes running or about to run.
|
||||||
|
// We want exactly one process to run the update command.
|
||||||
if($db_revision == UPDATE_VERSION) {
|
// So store the fact that we're taking responsibility
|
||||||
for($x = $stored; $x < $current; $x ++) {
|
// after first checking to see if somebody else already has.
|
||||||
$func = $this->func_prefix . $x;
|
|
||||||
if(function_exists($func)) {
|
// If the update fails or times-out completely you may need to
|
||||||
// There could be a lot of processes running or about to run.
|
// delete the config entry to try again.
|
||||||
// We want exactly one process to run the update command.
|
|
||||||
// So store the fact that we're taking responsibility
|
Config::Load('database');
|
||||||
// after first checking to see if somebody else already has.
|
|
||||||
|
if(get_config('database', $s))
|
||||||
// If the update fails or times-out completely you may need to
|
break;
|
||||||
// delete the config entry to try again.
|
set_config('database',$s, '1');
|
||||||
|
|
||||||
if(get_config('database', $func))
|
|
||||||
break;
|
$c = new $cls();
|
||||||
set_config('database',$func, '1');
|
$retval = $c->run();
|
||||||
// call the specific update
|
|
||||||
|
if($retval != UPDATE_SUCCESS) {
|
||||||
$retval = $func();
|
|
||||||
if($retval) {
|
// Prevent sending hundreds of thousands of emails by creating
|
||||||
|
// a lockfile.
|
||||||
// Prevent sending hundreds of thousands of emails by creating
|
|
||||||
// a lockfile.
|
$lockfile = 'store/[data]/mailsent';
|
||||||
|
|
||||||
$lockfile = 'store/[data]/mailsent';
|
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
|
||||||
|
return;
|
||||||
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
|
@unlink($lockfile);
|
||||||
return;
|
//send the administrator an e-mail
|
||||||
@unlink($lockfile);
|
file_put_contents($lockfile, $x);
|
||||||
//send the administrator an e-mail
|
|
||||||
file_put_contents($lockfile, $x);
|
$r = q("select account_language from account where account_email = '%s' limit 1",
|
||||||
|
dbesc(\App::$config['system']['admin_email'])
|
||||||
$r = q("select account_language from account where account_email = '%s' limit 1",
|
);
|
||||||
dbesc(\App::$config['system']['admin_email'])
|
push_lang(($r) ? $r[0]['account_language'] : 'en');
|
||||||
);
|
z_mail(
|
||||||
push_lang(($r) ? $r[0]['account_language'] : 'en');
|
[
|
||||||
|
'toEmail' => \App::$config['system']['admin_email'],
|
||||||
z_mail(
|
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
|
||||||
[
|
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
|
||||||
'toEmail' => \App::$config['system']['admin_email'],
|
[
|
||||||
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
|
'$sitename' => \App::$config['system']['sitename'],
|
||||||
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
|
'$siteurl' => z_root(),
|
||||||
[
|
'$update' => $x,
|
||||||
'$sitename' => \App::$config['system']['sitename'],
|
'$error' => sprintf( t('Update %s failed. See error logs.'), $x)
|
||||||
'$siteurl' => z_root(),
|
]
|
||||||
'$update' => $x,
|
)
|
||||||
'$error' => sprintf( t('Update %s failed. See error logs.'), $x)
|
]
|
||||||
]
|
);
|
||||||
)
|
|
||||||
]
|
//try the logger
|
||||||
);
|
logger('CRITICAL: Update Failed: ' . $x);
|
||||||
|
pop_lang();
|
||||||
//try the logger
|
}
|
||||||
logger('CRITICAL: Update Failed: ' . $x);
|
else {
|
||||||
pop_lang();
|
set_config('database',$s, 'success');
|
||||||
}
|
|
||||||
else {
|
|
||||||
set_config('database',$func, 'success');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
set_config('system', $this->config_name, $db_revision);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
set_config('system', 'db_version', $db_revision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Zotlabs\Zot;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
class DReport {
|
class DReport {
|
||||||
|
|
||||||
@@ -63,7 +63,9 @@ class Enotify {
|
|||||||
$thanks = t('Thank You,');
|
$thanks = t('Thank You,');
|
||||||
$sitename = get_config('system','sitename');
|
$sitename = get_config('system','sitename');
|
||||||
$site_admin = sprintf( t('%s Administrator'), $sitename);
|
$site_admin = sprintf( t('%s Administrator'), $sitename);
|
||||||
|
$opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname());
|
||||||
|
$opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings');
|
||||||
|
$hopt_out2 = sprintf( t('To stop receiving these messages, please adjust your %s.'), '<a href="' . z_root() . '/settings' . '">' . t('Notification Settings') . '</a>');
|
||||||
$sender_name = $product;
|
$sender_name = $product;
|
||||||
$hostname = \App::get_hostname();
|
$hostname = \App::get_hostname();
|
||||||
if(strpos($hostname,':'))
|
if(strpos($hostname,':'))
|
||||||
@@ -112,6 +114,11 @@ class Enotify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
|
||||||
|
$vnotify = get_pconfig($recip['channel_id'],'system','vnotify');
|
||||||
|
|
||||||
|
$salutation = $recip['channel_name'];
|
||||||
|
|
||||||
// e.g. "your post", "David's photo", etc.
|
// e.g. "your post", "David's photo", etc.
|
||||||
$possess_desc = t('%s <!item_type!>');
|
$possess_desc = t('%s <!item_type!>');
|
||||||
|
|
||||||
@@ -119,7 +126,7 @@ class Enotify {
|
|||||||
logger('notification: mail');
|
logger('notification: mail');
|
||||||
$subject = sprintf( t('[$Projectname:Notify] New mail received at %s'),$sitename);
|
$subject = sprintf( t('[$Projectname:Notify] New mail received at %s'),$sitename);
|
||||||
|
|
||||||
$preamble = sprintf( t('%1$s, %2$s sent you a new private message at %3$s.'),$recip['channel_name'], $sender['xchan_name'],$sitename);
|
$preamble = sprintf( t('%1$s sent you a new private message at %2$s.'), $sender['xchan_name'],$sitename);
|
||||||
$epreamble = sprintf( t('%1$s sent you %2$s.'),'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a private message') . '[/zrl]');
|
$epreamble = sprintf( t('%1$s sent you %2$s.'),'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a private message') . '[/zrl]');
|
||||||
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
|
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
|
||||||
$tsitelink = sprintf( $sitelink, $siteurl . '/mail/' . $params['item']['id'] );
|
$tsitelink = sprintf( $sitelink, $siteurl . '/mail/' . $params['item']['id'] );
|
||||||
@@ -128,18 +135,28 @@ class Enotify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($params['type'] == NOTIFY_COMMENT) {
|
if ($params['type'] == NOTIFY_COMMENT) {
|
||||||
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
|
//logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
|
||||||
|
|
||||||
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
|
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
|
||||||
|
|
||||||
$itemlink = $params['link'];
|
$itemlink = $params['link'];
|
||||||
|
|
||||||
// ignore like/unlike activity on posts - they probably require a separate notification preference
|
$action = t('commented on');
|
||||||
|
|
||||||
|
if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
|
||||||
|
|
||||||
|
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
|
||||||
|
logger('notification: not a visible activity. Ignoring.');
|
||||||
|
pop_lang();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(activity_match($params['verb'], ACTIVITY_LIKE))
|
||||||
|
$action = t('liked');
|
||||||
|
|
||||||
|
if(activity_match($params['verb'], ACTIVITY_DISLIKE))
|
||||||
|
$action = t('disliked');
|
||||||
|
|
||||||
if (array_key_exists('item',$params) && (! visible_activity($params['item']))) {
|
|
||||||
logger('notification: not a visible activity. Ignoring.');
|
|
||||||
pop_lang();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_mid = $params['parent_mid'];
|
$parent_mid = $params['parent_mid'];
|
||||||
@@ -181,26 +198,26 @@ class Enotify {
|
|||||||
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
|
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
|
||||||
|
|
||||||
// "a post"
|
// "a post"
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]a %4$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
// "George Bull's post"
|
// "George Bull's post"
|
||||||
if($p)
|
if($p)
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$p[0]['author']['xchan_name'],
|
$p[0]['author']['xchan_name'],
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
// "your post"
|
// "your post"
|
||||||
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
||||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]your %4$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
|
$action,
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
|
|
||||||
@@ -213,7 +230,7 @@ class Enotify {
|
|||||||
$subject = sprintf( t('[$Projectname:Notify] Moderated Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] Moderated Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
||||||
else
|
else
|
||||||
$subject = sprintf( t('[$Projectname:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
||||||
$preamble = sprintf( t('%1$s, %2$s commented on an item/conversation you have been following.'), $recip['channel_name'], $sender['xchan_name']);
|
$preamble = sprintf( t('%1$s commented on an item/conversation you have been following.'), $sender['xchan_name']);
|
||||||
$epreamble = $dest_str;
|
$epreamble = $dest_str;
|
||||||
|
|
||||||
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
||||||
@@ -231,12 +248,12 @@ class Enotify {
|
|||||||
|
|
||||||
$itemlink = $params['link'];
|
$itemlink = $params['link'];
|
||||||
|
|
||||||
// ignore like/unlike activity on posts - they probably require a separate notification preference
|
|
||||||
|
|
||||||
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
|
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
|
||||||
logger('notification: not a like activity. Ignoring.');
|
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
|
||||||
pop_lang();
|
logger('notification: not a visible activity. Ignoring.');
|
||||||
return;
|
pop_lang();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$parent_mid = $params['parent_mid'];
|
$parent_mid = $params['parent_mid'];
|
||||||
@@ -279,8 +296,7 @@ class Enotify {
|
|||||||
|
|
||||||
// "your post"
|
// "your post"
|
||||||
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
|
||||||
$dest_str = sprintf(t('%1$s, %2$s liked [zrl=%3$s]your %4$s[/zrl]'),
|
$dest_str = sprintf(t('%1$s liked [zrl=%2$s]your %3$s[/zrl]'),
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
$itemlink,
|
$itemlink,
|
||||||
$item_post_type);
|
$item_post_type);
|
||||||
@@ -295,7 +311,7 @@ class Enotify {
|
|||||||
// differents subjects for messages on the same thread.
|
// differents subjects for messages on the same thread.
|
||||||
|
|
||||||
$subject = sprintf( t('[$Projectname:Notify] Like received to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] Like received to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
|
||||||
$preamble = sprintf( t('%1$s, %2$s liked an item/conversation you created.'), $recip['channel_name'], $sender['xchan_name']);
|
$preamble = sprintf( t('%1$s liked an item/conversation you created.'), $sender['xchan_name']);
|
||||||
$epreamble = $dest_str;
|
$epreamble = $dest_str;
|
||||||
|
|
||||||
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
||||||
@@ -308,10 +324,9 @@ class Enotify {
|
|||||||
if($params['type'] == NOTIFY_WALL) {
|
if($params['type'] == NOTIFY_WALL) {
|
||||||
$subject = sprintf( t('[$Projectname:Notify] %s posted to your profile wall') , $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] %s posted to your profile wall') , $sender['xchan_name']);
|
||||||
|
|
||||||
$preamble = sprintf( t('%1$s, %2$s posted to your profile wall at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $sender['xchan_name'], $sitename);
|
||||||
|
|
||||||
$epreamble = sprintf( t('%1$s, %2$s posted to [zrl=%3$s]your wall[/zrl]') ,
|
$epreamble = sprintf( t('%1$s posted to [zrl=%2$s]your wall[/zrl]') ,
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
$params['link']);
|
$params['link']);
|
||||||
|
|
||||||
@@ -335,9 +350,8 @@ class Enotify {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$subject = sprintf( t('[$Projectname:Notify] %s tagged you') , $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] %s tagged you') , $sender['xchan_name']);
|
||||||
$preamble = sprintf( t('%1$s, %2$s tagged you at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('%1$s tagged you at %2$s') , $sender['xchan_name'], $sitename);
|
||||||
$epreamble = sprintf( t('%1$s, %2$s [zrl=%3$s]tagged you[/zrl].') ,
|
$epreamble = sprintf( t('%1$s [zrl=%2$s]tagged you[/zrl].') ,
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
$params['link']);
|
$params['link']);
|
||||||
|
|
||||||
@@ -349,9 +363,8 @@ class Enotify {
|
|||||||
|
|
||||||
if ($params['type'] == NOTIFY_POKE) {
|
if ($params['type'] == NOTIFY_POKE) {
|
||||||
$subject = sprintf( t('[$Projectname:Notify] %1$s poked you') , $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] %1$s poked you') , $sender['xchan_name']);
|
||||||
$preamble = sprintf( t('%1$s, %2$s poked you at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('%1$s poked you at %2$s') , $sender['xchan_name'], $sitename);
|
||||||
$epreamble = sprintf( t('%1$s, %2$s [zrl=%2$s]poked you[/zrl].') ,
|
$epreamble = sprintf( t('%1$s [zrl=%2$s]poked you[/zrl].') ,
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
$params['link']);
|
$params['link']);
|
||||||
|
|
||||||
@@ -367,9 +380,8 @@ class Enotify {
|
|||||||
|
|
||||||
if ($params['type'] == NOTIFY_TAGSHARE) {
|
if ($params['type'] == NOTIFY_TAGSHARE) {
|
||||||
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
|
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
|
||||||
$preamble = sprintf( t('%1$s, %2$s tagged your post at %3$s') , $recip['channel_name'],$sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('%1$s tagged your post at %2$s'),$sender['xchan_name'], $sitename);
|
||||||
$epreamble = sprintf( t('%1$s, %2$s tagged [zrl=%3$s]your post[/zrl]') ,
|
$epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') ,
|
||||||
$recip['channel_name'],
|
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||||
$itemlink);
|
$itemlink);
|
||||||
|
|
||||||
@@ -381,9 +393,8 @@ class Enotify {
|
|||||||
|
|
||||||
if ($params['type'] == NOTIFY_INTRO) {
|
if ($params['type'] == NOTIFY_INTRO) {
|
||||||
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
|
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
|
||||||
$preamble = sprintf( t('%1$s, you\'ve received an new connection request from \'%2$s\' at %3$s'), $recip['channel_name'], $sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
|
||||||
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a new connection request[/zrl] from %3$s.'),
|
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a new connection request[/zrl] from %2$s.'),
|
||||||
$recip['channel_name'],
|
|
||||||
$siteurl . '/connections/ifpending',
|
$siteurl . '/connections/ifpending',
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
|
||||||
$body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']);
|
$body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']);
|
||||||
@@ -396,9 +407,8 @@ class Enotify {
|
|||||||
|
|
||||||
if ($params['type'] == NOTIFY_SUGGEST) {
|
if ($params['type'] == NOTIFY_SUGGEST) {
|
||||||
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
|
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
|
||||||
$preamble = sprintf( t('%1$s, you\'ve received a friend suggestion from \'%2$s\' at %3$s'), $recip['channel_name'], $sender['xchan_name'], $sitename);
|
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
|
||||||
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a friend suggestion[/zrl] for %3$s from %4$s.'),
|
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'),
|
||||||
$recip['channel_name'],
|
|
||||||
$itemlink,
|
$itemlink,
|
||||||
'[zrl=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/zrl]',
|
'[zrl=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/zrl]',
|
||||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
|
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
|
||||||
@@ -496,8 +506,6 @@ class Enotify {
|
|||||||
// Another option would be to not add them to the DB, and change how emails are handled
|
// Another option would be to not add them to the DB, and change how emails are handled
|
||||||
// (probably would be better that way)
|
// (probably would be better that way)
|
||||||
|
|
||||||
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
|
|
||||||
|
|
||||||
if (!$always_show_in_notices) {
|
if (!$always_show_in_notices) {
|
||||||
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
|
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
|
||||||
$seen = 1;
|
$seen = 1;
|
||||||
@@ -600,6 +608,9 @@ class Enotify {
|
|||||||
$datarray['titemlink'] = $itemlink;
|
$datarray['titemlink'] = $itemlink;
|
||||||
$datarray['thanks'] = $thanks;
|
$datarray['thanks'] = $thanks;
|
||||||
$datarray['site_admin'] = $site_admin;
|
$datarray['site_admin'] = $site_admin;
|
||||||
|
$datarray['opt_out1'] = $opt_out1;
|
||||||
|
$datarray['opt_out2'] = $opt_out2;
|
||||||
|
$datarray['hopt_out2'] = $hopt_out2;
|
||||||
$datarray['title'] = stripslashes($title);
|
$datarray['title'] = stripslashes($title);
|
||||||
$datarray['htmlversion'] = $htmlversion;
|
$datarray['htmlversion'] = $htmlversion;
|
||||||
$datarray['textversion'] = $textversion;
|
$datarray['textversion'] = $textversion;
|
||||||
@@ -646,7 +657,7 @@ class Enotify {
|
|||||||
'$banner' => $datarray['banner'],
|
'$banner' => $datarray['banner'],
|
||||||
'$notify_icon' => \Zotlabs\Lib\System::get_notify_icon(),
|
'$notify_icon' => \Zotlabs\Lib\System::get_notify_icon(),
|
||||||
'$product' => $datarray['product'],
|
'$product' => $datarray['product'],
|
||||||
'$preamble' => $datarray['preamble'],
|
'$preamble' => $salutation . '<br><br>' . $datarray['preamble'],
|
||||||
'$sitename' => $datarray['sitename'],
|
'$sitename' => $datarray['sitename'],
|
||||||
'$siteurl' => $datarray['siteurl'],
|
'$siteurl' => $datarray['siteurl'],
|
||||||
'$source_name' => $datarray['source_name'],
|
'$source_name' => $datarray['source_name'],
|
||||||
@@ -657,6 +668,8 @@ class Enotify {
|
|||||||
'$hitemlink' => $datarray['hitemlink'],
|
'$hitemlink' => $datarray['hitemlink'],
|
||||||
'$thanks' => $datarray['thanks'],
|
'$thanks' => $datarray['thanks'],
|
||||||
'$site_admin' => $datarray['site_admin'],
|
'$site_admin' => $datarray['site_admin'],
|
||||||
|
'$opt_out1' => $datarray['opt_out1'],
|
||||||
|
'$opt_out2' => $datarray['hopt_out2'],
|
||||||
'$title' => $datarray['title'],
|
'$title' => $datarray['title'],
|
||||||
'$htmlversion' => $datarray['htmlversion'],
|
'$htmlversion' => $datarray['htmlversion'],
|
||||||
));
|
));
|
||||||
@@ -666,7 +679,7 @@ class Enotify {
|
|||||||
$email_text_body = replace_macros($tpl, array(
|
$email_text_body = replace_macros($tpl, array(
|
||||||
'$banner' => $datarray['banner'],
|
'$banner' => $datarray['banner'],
|
||||||
'$product' => $datarray['product'],
|
'$product' => $datarray['product'],
|
||||||
'$preamble' => $datarray['preamble'],
|
'$preamble' => $salutation . "\n\n" . $datarray['preamble'],
|
||||||
'$sitename' => $datarray['sitename'],
|
'$sitename' => $datarray['sitename'],
|
||||||
'$siteurl' => $datarray['siteurl'],
|
'$siteurl' => $datarray['siteurl'],
|
||||||
'$source_name' => $datarray['source_name'],
|
'$source_name' => $datarray['source_name'],
|
||||||
@@ -677,6 +690,8 @@ class Enotify {
|
|||||||
'$titemlink' => $datarray['titemlink'],
|
'$titemlink' => $datarray['titemlink'],
|
||||||
'$thanks' => $datarray['thanks'],
|
'$thanks' => $datarray['thanks'],
|
||||||
'$site_admin' => $datarray['site_admin'],
|
'$site_admin' => $datarray['site_admin'],
|
||||||
|
'$opt_out1' => $datarray['opt_out1'],
|
||||||
|
'$opt_out2' => $datarray['opt_out2'],
|
||||||
'$title' => $datarray['title'],
|
'$title' => $datarray['title'],
|
||||||
'$textversion' => $datarray['textversion'],
|
'$textversion' => $datarray['textversion'],
|
||||||
));
|
));
|
||||||
@@ -732,8 +747,8 @@ class Enotify {
|
|||||||
|
|
||||||
// generate a mime boundary
|
// generate a mime boundary
|
||||||
$mimeBoundary = rand(0, 9) . "-"
|
$mimeBoundary = rand(0, 9) . "-"
|
||||||
.rand(10000000000, 9999999999) . "-"
|
.rand(100000000, 999999999) . "-"
|
||||||
.rand(10000000000, 9999999999) . "=:"
|
.rand(100000000, 999999999) . "=:"
|
||||||
.rand(10000, 99999);
|
.rand(10000, 99999);
|
||||||
|
|
||||||
// generate a multipart/alternative message header
|
// generate a multipart/alternative message header
|
||||||
@@ -778,10 +793,14 @@ class Enotify {
|
|||||||
|
|
||||||
// Call localize_item to get a one line status for activities.
|
// Call localize_item to get a one line status for activities.
|
||||||
// This should set $item['localized'] to indicate we have a brief summary.
|
// This should set $item['localized'] to indicate we have a brief summary.
|
||||||
|
// and perhaps $item['shortlocalized'] for an even briefer summary
|
||||||
|
|
||||||
localize_item($item);
|
localize_item($item);
|
||||||
|
|
||||||
if($item['localize']) {
|
if($item['shortlocalize']) {
|
||||||
|
$itemem_text = $item['shortlocalize'];
|
||||||
|
}
|
||||||
|
elseif($item['localize']) {
|
||||||
$itemem_text = $item['localize'];
|
$itemem_text = $item['localize'];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -790,6 +809,20 @@ class Enotify {
|
|||||||
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
|
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$edit = false;
|
||||||
|
|
||||||
|
if($item['edited'] > $item['created']) {
|
||||||
|
if($item['item_thread_top']) {
|
||||||
|
$itemem_text = sprintf( t('edited a post dated %s'), relative_date($item['created']));
|
||||||
|
$edit = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$itemem_text = sprintf( t('edited a comment dated %s'), relative_date($item['created']));
|
||||||
|
$edit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// convert this logic into a json array just like the system notifications
|
// convert this logic into a json array just like the system notifications
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@@ -797,8 +830,11 @@ class Enotify {
|
|||||||
'name' => $item['author']['xchan_name'],
|
'name' => $item['author']['xchan_name'],
|
||||||
'url' => $item['author']['xchan_url'],
|
'url' => $item['author']['xchan_url'],
|
||||||
'photo' => $item['author']['xchan_photo_s'],
|
'photo' => $item['author']['xchan_photo_s'],
|
||||||
'when' => relative_date($item['created']),
|
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
|
||||||
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
|
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
|
||||||
|
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
|
||||||
|
'notify_id' => 'undefined',
|
||||||
|
'thread_top' => (($item['item_thread_top']) ? true : false),
|
||||||
'message' => strip_tags(bbcode($itemem_text))
|
'message' => strip_tags(bbcode($itemem_text))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
122
Zotlabs/Lib/Img_filesize.php
Normal file
122
Zotlabs/Lib/Img_filesize.php
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
class Img_filesize {
|
||||||
|
|
||||||
|
private $url;
|
||||||
|
|
||||||
|
function __construct($url) {
|
||||||
|
$this->url = $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSize() {
|
||||||
|
$size = null;
|
||||||
|
|
||||||
|
if(stripos($this->url,z_root() . '/photo') !== false) {
|
||||||
|
$size = self::getLocalFileSize($this->url);
|
||||||
|
}
|
||||||
|
if(! $size) {
|
||||||
|
$size = getRemoteFileSize($this->url);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static function getLocalFileSize($url) {
|
||||||
|
|
||||||
|
$fname = basename($url);
|
||||||
|
$resolution = 0;
|
||||||
|
|
||||||
|
if(strpos($fname,'.') !== false)
|
||||||
|
$fname = substr($fname,0,strpos($fname,'.'));
|
||||||
|
|
||||||
|
if(substr($fname,-2,1) == '-') {
|
||||||
|
$resolution = intval(substr($fname,-1,1));
|
||||||
|
$fname = substr($fname,0,-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$r = q("SELECT filesize FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
|
||||||
|
dbesc($fname),
|
||||||
|
intval($resolution)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
return $r[0]['filesize'];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try to determine the size of a remote file by making an HTTP request for
|
||||||
|
* a byte range, or look for the content-length header in the response.
|
||||||
|
* The function aborts the transfer as soon as the size is found, or if no
|
||||||
|
* length headers are returned, it aborts the transfer.
|
||||||
|
*
|
||||||
|
* @return int|null null if size could not be determined, or length of content
|
||||||
|
*/
|
||||||
|
function getRemoteFileSize($url)
|
||||||
|
{
|
||||||
|
$ch = curl_init($url);
|
||||||
|
|
||||||
|
$headers = array(
|
||||||
|
'Range: bytes=0-1',
|
||||||
|
'Connection: close',
|
||||||
|
);
|
||||||
|
|
||||||
|
$in_headers = true;
|
||||||
|
$size = null;
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2450.0 Iron/46.0.2450.0');
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_VERBOSE, 0); // set to 1 to debug
|
||||||
|
curl_setopt($ch, CURLOPT_STDERR, fopen('php://output', 'r'));
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $line) use (&$in_headers, &$size) {
|
||||||
|
$length = strlen($line);
|
||||||
|
|
||||||
|
if (trim($line) == '') {
|
||||||
|
$in_headers = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
list($header, $content) = explode(':', $line, 2);
|
||||||
|
$header = strtolower(trim($header));
|
||||||
|
|
||||||
|
if ($header == 'content-range') {
|
||||||
|
// found a content-range header
|
||||||
|
list($rng, $s) = explode('/', $content, 2);
|
||||||
|
$size = (int)$s;
|
||||||
|
return 0; // aborts transfer
|
||||||
|
} else if ($header == 'content-length' && 206 != curl_getinfo($curl, CURLINFO_HTTP_CODE)) {
|
||||||
|
// found content-length header and this is not a 206 Partial Content response (range response)
|
||||||
|
$size = (int)$content;
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
// continue
|
||||||
|
return $length;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($curl, $data) use ($in_headers) {
|
||||||
|
if (!$in_headers) {
|
||||||
|
// shouldn't be here unless we couldn't determine file size
|
||||||
|
// abort transfer
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// write function is also called when reading headers
|
||||||
|
return strlen($data);
|
||||||
|
});
|
||||||
|
|
||||||
|
curl_exec($ch);
|
||||||
|
curl_getinfo($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
return $size;
|
||||||
|
}
|
||||||
@@ -3,51 +3,66 @@
|
|||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MarkdownSoap
|
* @brief MarkdownSoap class.
|
||||||
|
*
|
||||||
* Purify Markdown for storage
|
* Purify Markdown for storage
|
||||||
|
* @code{.php}
|
||||||
* $x = new MarkdownSoap($string_to_be_cleansed);
|
* $x = new MarkdownSoap($string_to_be_cleansed);
|
||||||
* $text = $x->clean();
|
* $text = $x->clean();
|
||||||
*
|
* @endcode
|
||||||
* What this does:
|
* What this does:
|
||||||
* 1. extracts code blocks and privately escapes them from processing
|
* 1. extracts code blocks and privately escapes them from processing
|
||||||
* 2. Run html purifier on the content
|
* 2. Run html purifier on the content
|
||||||
* 3. put back the code blocks
|
* 3. put back the code blocks
|
||||||
* 4. run htmlspecialchars on the entire content for safe storage
|
* 4. run htmlspecialchars on the entire content for safe storage
|
||||||
*
|
*
|
||||||
* At render time:
|
* At render time:
|
||||||
|
* @code{.php}
|
||||||
* $markdown = \Zotlabs\Lib\MarkdownSoap::unescape($text);
|
* $markdown = \Zotlabs\Lib\MarkdownSoap::unescape($text);
|
||||||
* $html = \Michelf\MarkdownExtra::DefaultTransform($markdown);
|
* $html = \Michelf\MarkdownExtra::DefaultTransform($markdown);
|
||||||
|
* @endcode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MarkdownSoap {
|
class MarkdownSoap {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $str;
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
private $token;
|
private $token;
|
||||||
|
|
||||||
private $str;
|
|
||||||
|
|
||||||
function __construct($s) {
|
function __construct($s) {
|
||||||
$this->str = $s;
|
$this->str = $s;
|
||||||
$this->token = random_string(20);
|
$this->token = random_string(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function clean() {
|
function clean() {
|
||||||
|
|
||||||
$x = $this->extract_code($this->str);
|
$x = $this->extract_code($this->str);
|
||||||
|
|
||||||
$x = $this->purify($x);
|
$x = $this->purify($x);
|
||||||
|
|
||||||
$x = $this->putback_code($x);
|
$x = $this->putback_code($x);
|
||||||
|
|
||||||
$x = $this->escape($x);
|
$x = $this->escape($x);
|
||||||
|
|
||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Extracts code blocks and privately escapes them from processing.
|
||||||
|
*
|
||||||
|
* @see encode_code()
|
||||||
|
* @see putback_code()
|
||||||
|
*
|
||||||
|
* @param string $s
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function extract_code($s) {
|
function extract_code($s) {
|
||||||
|
|
||||||
$text = preg_replace_callback('{
|
$text = preg_replace_callback('{
|
||||||
(?:\n\n|\A\n?)
|
(?:\n\n|\A\n?)
|
||||||
( # $1 = the code block -- one or more lines, starting with a space/tab
|
( # $1 = the code block -- one or more lines, starting with a space/tab
|
||||||
@@ -62,7 +77,7 @@ class MarkdownSoap {
|
|||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function encode_code($matches) {
|
function encode_code($matches) {
|
||||||
return $this->token . ';' . base64_encode($matches[0]) . ';' ;
|
return $this->token . ';' . base64_encode($matches[0]) . ';' ;
|
||||||
}
|
}
|
||||||
@@ -71,8 +86,17 @@ class MarkdownSoap {
|
|||||||
return base64_decode($matches[1]);
|
return base64_decode($matches[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Put back the code blocks.
|
||||||
|
*
|
||||||
|
* @see extract_code()
|
||||||
|
* @see decode_code()
|
||||||
|
*
|
||||||
|
* @param string $s
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function putback_code($s) {
|
function putback_code($s) {
|
||||||
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm',[ $this, 'decode_code' ], $s);
|
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm', [ $this, 'decode_code' ], $s);
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,20 +108,25 @@ class MarkdownSoap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function protect_autolinks($s) {
|
function protect_autolinks($s) {
|
||||||
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/','[$1$2]($1$2)',$s);
|
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/', '[$1$2]($1$2)', $s);
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
function unprotect_autolinks($s) {
|
function unprotect_autolinks($s) {
|
||||||
return $s;
|
return $s;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function escape($s) {
|
function escape($s) {
|
||||||
return htmlspecialchars($s,ENT_QUOTES,'UTF-8',false);
|
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Converts special HTML entities back to characters.
|
||||||
|
*
|
||||||
|
* @param string $s
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
static public function unescape($s) {
|
static public function unescape($s) {
|
||||||
return htmlspecialchars_decode($s,ENT_QUOTES);
|
return htmlspecialchars_decode($s, ENT_QUOTES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,16 +171,23 @@ class NativeWiki {
|
|||||||
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
|
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
|
||||||
dbesc($resource_id)
|
dbesc($resource_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
$q = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'",
|
$q = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'",
|
||||||
dbesc($r[0]['resource_type'])
|
dbesc($r[0]['resource_id'])
|
||||||
);
|
);
|
||||||
if($q) {
|
if($q) {
|
||||||
$r = array_merge($r,$q);
|
$r = array_merge($r,$q);
|
||||||
}
|
}
|
||||||
xchan_query($r);
|
xchan_query($r);
|
||||||
$sync_item = fetch_post_tags($r);
|
$sync_item = fetch_post_tags($r);
|
||||||
build_sync_packet($uid,array('wiki' => array(encode_item($sync_item[0],true))));
|
if($sync_item) {
|
||||||
|
$pkt = [];
|
||||||
|
foreach($sync_item as $w) {
|
||||||
|
$pkt[] = encode_item($w,true);
|
||||||
|
}
|
||||||
|
build_sync_packet($uid,array('wiki' => $pkt));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ class NativeWikiPage {
|
|||||||
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
|
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// backslashes won't work well in the javascript functions
|
||||||
|
$name = str_replace('\\','',$name);
|
||||||
|
|
||||||
// create an empty activity
|
// create an empty activity
|
||||||
|
|
||||||
$arr = [];
|
$arr = [];
|
||||||
@@ -351,6 +354,7 @@ class NativeWikiPage {
|
|||||||
// fetch the most recently saved revision.
|
// fetch the most recently saved revision.
|
||||||
|
|
||||||
$item = self::load_page($arr);
|
$item = self::load_page($arr);
|
||||||
|
|
||||||
if(! $item) {
|
if(! $item) {
|
||||||
return array('message' => t('Page not found'), 'success' => false);
|
return array('message' => t('Page not found'), 'success' => false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
<?php /** @file */
|
<?php
|
||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Class for handling channel specific configurations.
|
||||||
|
*
|
||||||
|
* <b>PConfig</b> is used for channel specific configurations and takes a
|
||||||
|
* <i>channel_id</i> as identifier. It stores for example which features are
|
||||||
|
* enabled per channel. The storage is of size MEDIUMTEXT.
|
||||||
|
*
|
||||||
|
* @code{.php}$var = Zotlabs\Lib\PConfig::Get('uid', 'category', 'key');
|
||||||
|
* // with default value for non existent key
|
||||||
|
* $var = Zotlabs\Lib\PConfig::Get('uid', 'category', 'unsetkey', 'defaultvalue');@endcode
|
||||||
|
*
|
||||||
|
* The old (deprecated?) way to access a PConfig value is:
|
||||||
|
* @code{.php}$var = get_pconfig(local_channel(), 'category', 'key');@endcode
|
||||||
|
*/
|
||||||
class PConfig {
|
class PConfig {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,9 +26,8 @@ class PConfig {
|
|||||||
*
|
*
|
||||||
* @param string $uid
|
* @param string $uid
|
||||||
* The channel_id
|
* The channel_id
|
||||||
* @return void|false Nothing or false if $uid is false
|
* @return void|false Nothing or false if $uid is null or false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Load($uid) {
|
static public function Load($uid) {
|
||||||
if(is_null($uid) || $uid === false)
|
if(is_null($uid) || $uid === false)
|
||||||
return false;
|
return false;
|
||||||
@@ -64,11 +76,11 @@ class PConfig {
|
|||||||
* The category of the configuration value
|
* The category of the configuration value
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* The configuration key to query
|
* The configuration key to query
|
||||||
* @param boolean $instore (deprecated, without function)
|
* @param mixed $default (optional, default false)
|
||||||
|
* Default value to return if key does not exist
|
||||||
* @return mixed Stored value or false if it does not exist
|
* @return mixed Stored value or false if it does not exist
|
||||||
*/
|
*/
|
||||||
|
static public function Get($uid, $family, $key, $default = false) {
|
||||||
static public function Get($uid,$family,$key,$default = false) {
|
|
||||||
|
|
||||||
if(is_null($uid) || $uid === false)
|
if(is_null($uid) || $uid === false)
|
||||||
return $default;
|
return $default;
|
||||||
@@ -79,11 +91,10 @@ class PConfig {
|
|||||||
if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family])))
|
if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family])))
|
||||||
return $default;
|
return $default;
|
||||||
|
|
||||||
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
|
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
|
||||||
? unserialize(\App::$config[$uid][$family][$key])
|
? unserialize(\App::$config[$uid][$family][$key])
|
||||||
: \App::$config[$uid][$family][$key]
|
: \App::$config[$uid][$family][$key]
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,12 +113,11 @@ class PConfig {
|
|||||||
* The value to store
|
* The value to store
|
||||||
* @return mixed Stored $value or false
|
* @return mixed Stored $value or false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Set($uid, $family, $key, $value) {
|
static public function Set($uid, $family, $key, $value) {
|
||||||
|
|
||||||
// this catches subtle errors where this function has been called
|
// this catches subtle errors where this function has been called
|
||||||
// with local_channel() when not logged in (which returns false)
|
// with local_channel() when not logged in (which returns false)
|
||||||
// and throws an error in array_key_exists below.
|
// and throws an error in array_key_exists below.
|
||||||
// we provide a function backtrace in the logs so that we can find
|
// we provide a function backtrace in the logs so that we can find
|
||||||
// and fix the calling function.
|
// and fix the calling function.
|
||||||
|
|
||||||
@@ -132,7 +142,6 @@ class PConfig {
|
|||||||
dbesc($key),
|
dbesc($key),
|
||||||
dbesc($dbvalue)
|
dbesc($dbvalue)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@@ -142,7 +151,6 @@ class PConfig {
|
|||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key)
|
dbesc($key)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep a separate copy for all variables which were
|
// keep a separate copy for all variables which were
|
||||||
@@ -178,7 +186,6 @@ class PConfig {
|
|||||||
* The configuration key to delete
|
* The configuration key to delete
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Delete($uid, $family, $key) {
|
static public function Delete($uid, $family, $key) {
|
||||||
|
|
||||||
if(is_null($uid) || $uid === false)
|
if(is_null($uid) || $uid === false)
|
||||||
@@ -186,12 +193,12 @@ class PConfig {
|
|||||||
|
|
||||||
$ret = false;
|
$ret = false;
|
||||||
|
|
||||||
if(array_key_exists($uid,\App::$config)
|
if(array_key_exists($uid,\App::$config)
|
||||||
&& is_array(\App::$config['uid'])
|
&& is_array(\App::$config['uid'])
|
||||||
&& array_key_exists($family,\App::$config['uid'])
|
&& array_key_exists($family,\App::$config['uid'])
|
||||||
&& array_key_exists($key, \App::$config[$uid][$family]))
|
&& array_key_exists($key, \App::$config[$uid][$family]))
|
||||||
unset(\App::$config[$uid][$family][$key]);
|
unset(\App::$config[$uid][$family][$key]);
|
||||||
|
|
||||||
$ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'",
|
$ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'",
|
||||||
intval($uid),
|
intval($uid),
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
@@ -202,4 +209,3 @@ class PConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,12 +2,36 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
use \Zotlabs\Access as Zaccess;
|
use Zotlabs\Access\PermissionRoles;
|
||||||
|
use Zotlabs\Access\Permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Permission Categories. Permission rules for various classes of connections.
|
||||||
|
*
|
||||||
|
* Connection permissions answer the question "Can Joe view my photos?"
|
||||||
|
*
|
||||||
|
* Some permissions may be inherited from the channel's "privacy settings"
|
||||||
|
* (@ref ::Zotlabs::Access::PermissionLimits "PermissionLimits") "Who can view my
|
||||||
|
* photos (at all)?" which have higher priority than individual connection settings.
|
||||||
|
* We evaluate permission limits first, and then fall through to connection
|
||||||
|
* permissions if the permission limits didn't already make a definitive decision.
|
||||||
|
*
|
||||||
|
* After PermissionLimits and connection permissions are evaluated, individual
|
||||||
|
* content ACLs are evaluated (@ref ::Zotlabs::Access::AccessList "AccessList").
|
||||||
|
* These answer the question "Can Joe view *this* album/photo?".
|
||||||
|
*/
|
||||||
class Permcat {
|
class Permcat {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
private $permcats = [];
|
private $permcats = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Permcat constructor.
|
||||||
|
*
|
||||||
|
* @param int $channel_id
|
||||||
|
*/
|
||||||
public function __construct($channel_id) {
|
public function __construct($channel_id) {
|
||||||
|
|
||||||
$perms = [];
|
$perms = [];
|
||||||
@@ -16,16 +40,16 @@ class Permcat {
|
|||||||
|
|
||||||
$role = get_pconfig($channel_id,'system','permissions_role');
|
$role = get_pconfig($channel_id,'system','permissions_role');
|
||||||
if($role) {
|
if($role) {
|
||||||
$x = Zaccess\PermissionRoles::role_perms($role);
|
$x = PermissionRoles::role_perms($role);
|
||||||
if($x['perms_connect']) {
|
if($x['perms_connect']) {
|
||||||
$perms = Zaccess\Permissions::FilledPerms($x['perms_connect']);
|
$perms = Permissions::FilledPerms($x['perms_connect']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no role perms it may be a custom role, see if there any autoperms
|
// if no role perms it may be a custom role, see if there any autoperms
|
||||||
|
|
||||||
if(! $perms) {
|
if(! $perms) {
|
||||||
$perms = Zaccess\Permissions::FilledAutoPerms($channel_id);
|
$perms = Permissions::FilledAutoPerms($channel_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no autoperms it may be a custom role with manual perms
|
// if no autoperms it may be a custom role with manual perms
|
||||||
@@ -50,13 +74,13 @@ class Permcat {
|
|||||||
// nothing was found - create a filled permission array where all permissions are 0
|
// nothing was found - create a filled permission array where all permissions are 0
|
||||||
|
|
||||||
if(! $perms) {
|
if(! $perms) {
|
||||||
$perms = Zaccess\Permissions::FilledPerms([]);
|
$perms = Permissions::FilledPerms([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->permcats[] = [
|
$this->permcats[] = [
|
||||||
'name' => 'default',
|
'name' => 'default',
|
||||||
'localname' => t('default','permcat'),
|
'localname' => t('default','permcat'),
|
||||||
'perms' => Zaccess\Permissions::Operms($perms),
|
'perms' => Permissions::Operms($perms),
|
||||||
'system' => 1
|
'system' => 1
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -67,26 +91,39 @@ class Permcat {
|
|||||||
$this->permcats[] = [
|
$this->permcats[] = [
|
||||||
'name' => $p[$x][0],
|
'name' => $p[$x][0],
|
||||||
'localname' => $p[$x][1],
|
'localname' => $p[$x][1],
|
||||||
'perms' => Zaccess\Permissions::Operms(Zaccess\Permissions::FilledPerms($p[$x][2])),
|
'perms' => Permissions::Operms(Permissions::FilledPerms($p[$x][2])),
|
||||||
'system' => intval($p[$x][3])
|
'system' => intval($p[$x][3])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return array with permcats.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function listing() {
|
public function listing() {
|
||||||
return $this->permcats;
|
return $this->permcats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @return array
|
||||||
|
* * \e array with permcats
|
||||||
|
* * \e bool \b error if $name not found in permcats true
|
||||||
|
*/
|
||||||
public function fetch($name) {
|
public function fetch($name) {
|
||||||
if($name && $this->permcats) {
|
if($name && $this->permcats) {
|
||||||
foreach($this->permcats as $permcat) {
|
foreach($this->permcats as $permcat) {
|
||||||
if(strcasecmp($permcat['name'],$name) === 0) {
|
if(strcasecmp($permcat['name'], $name) === 0) {
|
||||||
return $permcat;
|
return $permcat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['error' => true];
|
return ['error' => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,29 +155,32 @@ class Permcat {
|
|||||||
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
|
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call_hooks('permcats',$permcats);
|
/**
|
||||||
|
* @hooks permcats
|
||||||
|
* * \e array
|
||||||
|
*/
|
||||||
|
call_hooks('permcats', $permcats);
|
||||||
|
|
||||||
return $permcats;
|
return $permcats;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function find_permcat($arr,$name) {
|
static public function find_permcat($arr, $name) {
|
||||||
if((! $arr) || (! $name))
|
if((! $arr) || (! $name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
foreach($arr as $p)
|
foreach($arr as $p)
|
||||||
if($p['name'] == $name)
|
if($p['name'] == $name)
|
||||||
return $p['value'];
|
return $p['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function update($channel_id, $name,$permarr) {
|
static public function update($channel_id, $name, $permarr) {
|
||||||
PConfig::Set($channel_id,'permcat',$name,$permarr);
|
PConfig::Set($channel_id, 'permcat', $name, $permarr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function delete($channel_id,$name) {
|
static public function delete($channel_id, $name) {
|
||||||
PConfig::Delete($channel_id,'permcat',$name);
|
PConfig::Delete($channel_id, 'permcat', $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php /** @file */
|
|
||||||
|
|
||||||
namespace Zotlabs\Lib;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Abstraction class for dealing with alternate networks (which of course do not exist, hence the abstraction)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
abstract class ProtoDriver {
|
|
||||||
abstract protected function discover($channel,$location);
|
|
||||||
abstract protected function deliver($item,$channel,$recipients);
|
|
||||||
abstract protected function collect($channel,$connection);
|
|
||||||
abstract protected function change_permissions($permissions,$channel,$recipient);
|
|
||||||
abstract protected function acknowledge_permissions($permissions,$channel,$recipient);
|
|
||||||
abstract protected function deliver_private($item,$channel,$recipients);
|
|
||||||
abstract protected function collect_private($channel,$connection);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,11 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
// account configuration storage is built on top of the under-utilised xconfig
|
/**
|
||||||
|
* @brief Account configuration storage is built on top of the under-utilised xconfig.
|
||||||
|
*
|
||||||
|
* @see XConfig
|
||||||
|
*/
|
||||||
class SConfig {
|
class SConfig {
|
||||||
|
|
||||||
static public function Load($server_id) {
|
static public function Load($server_id) {
|
||||||
|
|||||||
143
Zotlabs/Lib/Share.php
Normal file
143
Zotlabs/Lib/Share.php
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
|
||||||
|
class Share {
|
||||||
|
|
||||||
|
private $item = null;
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct($post_id) {
|
||||||
|
|
||||||
|
if(! $post_id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(! (local_channel() || remote_channel()))
|
||||||
|
return;
|
||||||
|
|
||||||
|
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
|
||||||
|
intval($post_id)
|
||||||
|
);
|
||||||
|
if(! $r)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
|
||||||
|
return;
|
||||||
|
|
||||||
|
$sql_extra = item_permissions_sql($r[0]['uid']);
|
||||||
|
|
||||||
|
$r = q("select * from item where id = %d $sql_extra",
|
||||||
|
intval($post_id)
|
||||||
|
);
|
||||||
|
if(! $r)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if($r[0]['mimetype'] !== 'text/bbcode')
|
||||||
|
return;
|
||||||
|
|
||||||
|
/** @FIXME eventually we want to post remotely via rpost on your home site */
|
||||||
|
// When that works remove this next bit:
|
||||||
|
|
||||||
|
if(! local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
xchan_query($r);
|
||||||
|
|
||||||
|
$this->item = $r[0];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function obj() {
|
||||||
|
$obj = [];
|
||||||
|
|
||||||
|
if(! $this->item)
|
||||||
|
return $obj;
|
||||||
|
|
||||||
|
$obj['type'] = $this->item['obj_type'];
|
||||||
|
$obj['id'] = $this->item['mid'];
|
||||||
|
$obj['content'] = $this->item['body'];
|
||||||
|
$obj['content_type'] = $this->item['mimetype'];
|
||||||
|
$obj['title'] = $this->item['title'];
|
||||||
|
$obj['created'] = $this->item['created'];
|
||||||
|
$obj['edited'] = $this->item['edited'];
|
||||||
|
$obj['author'] = [
|
||||||
|
'name' => $this->item['author']['xchan_name'],
|
||||||
|
'address' => $this->item['author']['xchan_addr'],
|
||||||
|
'network' => $this->item['author']['xchan_network'],
|
||||||
|
'link' => [
|
||||||
|
[
|
||||||
|
'rel' => 'alternate',
|
||||||
|
'type' => 'text/html',
|
||||||
|
'href' => $this->item['author']['xchan_url']
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'rel' => 'photo',
|
||||||
|
'type' => $this->item['author']['xchan_photo_mimetype'],
|
||||||
|
'href' => $this->item['author']['xchan_photo_m']
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$obj['owner'] = [
|
||||||
|
'name' => $this->item['owner']['xchan_name'],
|
||||||
|
'address' => $this->item['owner']['xchan_addr'],
|
||||||
|
'network' => $this->item['owner']['xchan_network'],
|
||||||
|
'link' => [
|
||||||
|
[
|
||||||
|
'rel' => 'alternate',
|
||||||
|
'type' => 'text/html',
|
||||||
|
'href' => $this->item['owner']['xchan_url']
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'rel' => 'photo',
|
||||||
|
'type' => $this->item['owner']['xchan_photo_mimetype'],
|
||||||
|
'href' => $this->item['owner']['xchan_photo_m']
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$obj['link'] = [
|
||||||
|
'rel' => 'alternate',
|
||||||
|
'type' => 'text/html',
|
||||||
|
'href' => $this->item['plink']
|
||||||
|
];
|
||||||
|
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function bbcode() {
|
||||||
|
$bb = EMPTY_STR;
|
||||||
|
|
||||||
|
if(! $this->item)
|
||||||
|
return $bb;
|
||||||
|
|
||||||
|
$is_photo = (($this->item['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
|
||||||
|
if($is_photo) {
|
||||||
|
$object = json_decode($this->item['obj'],true);
|
||||||
|
$photo_bb = $object['body'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($this->item['body'], "[/share]") !== false) {
|
||||||
|
$pos = strpos($this->item['body'], "[share");
|
||||||
|
$bb = substr($this->item['body'], $pos);
|
||||||
|
} else {
|
||||||
|
$bb = "[share author='".urlencode($this->item['author']['xchan_name']).
|
||||||
|
"' profile='" . $this->item['author']['xchan_url'] .
|
||||||
|
"' avatar='" . $this->item['author']['xchan_photo_s'] .
|
||||||
|
"' link='" . $this->item['plink'] .
|
||||||
|
"' auth='" . (($this->item['author']['network'] === 'zot') ? 'true' : 'false') .
|
||||||
|
"' posted='" . $this->item['created'] .
|
||||||
|
"' message_id='" . $this->item['mid'] .
|
||||||
|
"']";
|
||||||
|
if($this->item['title'])
|
||||||
|
$bb .= '[b]'.$this->item['title'].'[/b]'."\r\n";
|
||||||
|
$bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']);
|
||||||
|
$bb .= "[/share]";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $bb;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -54,7 +54,7 @@ class System {
|
|||||||
static public function get_project_srclink() {
|
static public function get_project_srclink() {
|
||||||
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_srclink'])
|
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_srclink'])
|
||||||
return \App::$config['system']['project_srclink'];
|
return \App::$config['system']['project_srclink'];
|
||||||
return 'https://github.com/redmatrix/hubzilla';
|
return 'https://framagit.org/hubzilla/core.git';
|
||||||
}
|
}
|
||||||
|
|
||||||
static public function get_server_role() {
|
static public function get_server_role() {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class ThreadItem {
|
|||||||
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
|
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
|
||||||
|
|
||||||
// Prepare the children
|
// Prepare the children
|
||||||
if(count($data['children'])) {
|
if($data['children']) {
|
||||||
foreach($data['children'] as $item) {
|
foreach($data['children'] as $item) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -105,7 +105,17 @@ class ThreadItem {
|
|||||||
|
|
||||||
$mode = $conv->get_mode();
|
$mode = $conv->get_mode();
|
||||||
|
|
||||||
$edlink = (($item['item_type'] == ITEM_TYPE_CARD) ? 'card_edit' : 'editpost');
|
switch($item['item_type']) {
|
||||||
|
case ITEM_TYPE_CARD:
|
||||||
|
$edlink = 'card_edit';
|
||||||
|
break;
|
||||||
|
case ITEM_TYPE_ARTICLE:
|
||||||
|
$edlink = 'article_edit';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$edlink = 'editpost';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(local_channel() && $observer['xchan_hash'] === $item['author_xchan'])
|
if(local_channel() && $observer['xchan_hash'] === $item['author_xchan'])
|
||||||
$edpost = array(z_root() . '/' . $edlink . '/' . $item['id'], t('Edit'));
|
$edpost = array(z_root() . '/' . $edlink . '/' . $item['id'], t('Edit'));
|
||||||
@@ -186,7 +196,7 @@ class ThreadItem {
|
|||||||
|
|
||||||
$like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
|
$like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
|
||||||
$like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : '');
|
$like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : '');
|
||||||
if (count($like_list) > MAX_LIKERS) {
|
if (($like_list) && (count($like_list) > MAX_LIKERS)) {
|
||||||
$like_list_part = array_slice($like_list, 0, MAX_LIKERS);
|
$like_list_part = array_slice($like_list, 0, MAX_LIKERS);
|
||||||
array_push($like_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#likeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
|
array_push($like_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#likeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
|
||||||
} else {
|
} else {
|
||||||
@@ -198,7 +208,7 @@ class ThreadItem {
|
|||||||
$dislike_count = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid']] : '');
|
$dislike_count = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid']] : '');
|
||||||
$dislike_list = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid'] . '-l'] : '');
|
$dislike_list = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid'] . '-l'] : '');
|
||||||
$dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
|
$dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
|
||||||
if (count($dislike_list) > MAX_LIKERS) {
|
if (($dislike_list) && (count($dislike_list) > MAX_LIKERS)) {
|
||||||
$dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS);
|
$dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS);
|
||||||
array_push($dislike_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#dislikeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
|
array_push($dislike_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#dislikeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
|
||||||
} else {
|
} else {
|
||||||
@@ -228,9 +238,9 @@ class ThreadItem {
|
|||||||
'do' => t("Add Star"),
|
'do' => t("Add Star"),
|
||||||
'undo' => t("Remove Star"),
|
'undo' => t("Remove Star"),
|
||||||
'toggle' => t("Toggle Star Status"),
|
'toggle' => t("Toggle Star Status"),
|
||||||
'classdo' => (intval($item['item_starred']) ? "hidden" : ""),
|
'classdo' => ((intval($item['item_starred'])) ? "hidden" : ""),
|
||||||
'classundo' => (intval($item['item_starred']) ? "" : "hidden"),
|
'classundo' => ((intval($item['item_starred'])) ? "" : "hidden"),
|
||||||
'isstarred' => (intval($item['item_starred']) ? "starred fa-star" : "unstarred fa-star-o"),
|
'isstarred' => ((intval($item['item_starred'])) ? true : false),
|
||||||
'starred' => t('starred'),
|
'starred' => t('starred'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -303,7 +313,7 @@ class ThreadItem {
|
|||||||
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
|
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
|
||||||
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
|
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -360,6 +370,7 @@ class ThreadItem {
|
|||||||
'unverified' => $unverified,
|
'unverified' => $unverified,
|
||||||
'forged' => $forged,
|
'forged' => $forged,
|
||||||
'location' => $location,
|
'location' => $location,
|
||||||
|
'divider' => get_pconfig($conv->get_profile_owner(),'system','item_divider'),
|
||||||
'attend_label' => t('Attend'),
|
'attend_label' => t('Attend'),
|
||||||
'attend_title' => t('Attendance Options'),
|
'attend_title' => t('Attendance Options'),
|
||||||
'vote_label' => t('Vote'),
|
'vote_label' => t('Vote'),
|
||||||
@@ -719,12 +730,11 @@ class ThreadItem {
|
|||||||
|
|
||||||
$observer = $conv->get_observer();
|
$observer = $conv->get_observer();
|
||||||
|
|
||||||
$qc = ((local_channel()) ? get_pconfig(local_channel(),'system','qcomment') : null);
|
|
||||||
$qcomment = (($qc) ? explode("\n",$qc) : null);
|
|
||||||
|
|
||||||
$arr = array('comment_buttons' => '','id' => $this->get_id());
|
$arr = array('comment_buttons' => '','id' => $this->get_id());
|
||||||
call_hooks('comment_buttons',$arr);
|
call_hooks('comment_buttons',$arr);
|
||||||
$comment_buttons = $arr['comment_buttons'];
|
$comment_buttons = $arr['comment_buttons'];
|
||||||
|
|
||||||
|
$feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
|
||||||
|
|
||||||
$comment_box = replace_macros($template,array(
|
$comment_box = replace_macros($template,array(
|
||||||
'$return_path' => '',
|
'$return_path' => '',
|
||||||
@@ -733,7 +743,6 @@ class ThreadItem {
|
|||||||
'$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
|
'$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
|
||||||
'$id' => $this->get_id(),
|
'$id' => $this->get_id(),
|
||||||
'$parent' => $this->get_id(),
|
'$parent' => $this->get_id(),
|
||||||
'$qcomment' => $qcomment,
|
|
||||||
'$comment_buttons' => $comment_buttons,
|
'$comment_buttons' => $comment_buttons,
|
||||||
'$profile_uid' => $conv->get_profile_owner(),
|
'$profile_uid' => $conv->get_profile_owner(),
|
||||||
'$mylink' => $observer['xchan_url'],
|
'$mylink' => $observer['xchan_url'],
|
||||||
@@ -761,7 +770,8 @@ class ThreadItem {
|
|||||||
'$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
|
'$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
|
||||||
'$anonname' => [ 'anonname', t('Your full name (required)') ],
|
'$anonname' => [ 'anonname', t('Your full name (required)') ],
|
||||||
'$anonmail' => [ 'anonmail', t('Your email address (required)') ],
|
'$anonmail' => [ 'anonmail', t('Your email address (required)') ],
|
||||||
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ]
|
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ],
|
||||||
|
'$auto_save_draft' => $feature_auto_save_draft,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $comment_box;
|
return $comment_box;
|
||||||
|
|||||||
@@ -54,6 +54,14 @@ class ThreadStream {
|
|||||||
$this->profile_owner = local_channel();
|
$this->profile_owner = local_channel();
|
||||||
$this->writable = true;
|
$this->writable = true;
|
||||||
break;
|
break;
|
||||||
|
case 'pubstream':
|
||||||
|
$this->profile_owner = local_channel();
|
||||||
|
$this->writable = ((local_channel()) ? true : false);
|
||||||
|
break;
|
||||||
|
case 'hq':
|
||||||
|
$this->profile_owner = local_channel();
|
||||||
|
$this->writable = true;
|
||||||
|
break;
|
||||||
case 'channel':
|
case 'channel':
|
||||||
$this->profile_owner = \App::$profile['profile_uid'];
|
$this->profile_owner = \App::$profile['profile_uid'];
|
||||||
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
||||||
@@ -63,6 +71,11 @@ class ThreadStream {
|
|||||||
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
||||||
$this->reload = $_SESSION['return_url'];
|
$this->reload = $_SESSION['return_url'];
|
||||||
break;
|
break;
|
||||||
|
case 'articles':
|
||||||
|
$this->profile_owner = \App::$profile['profile_uid'];
|
||||||
|
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
||||||
|
$this->reload = $_SESSION['return_url'];
|
||||||
|
break;
|
||||||
case 'display':
|
case 'display':
|
||||||
// in this mode we set profile_owner after initialisation (from conversation()) and then
|
// in this mode we set profile_owner after initialisation (from conversation()) and then
|
||||||
// pull some trickery which allows us to re-invoke this function afterward
|
// pull some trickery which allows us to re-invoke this function afterward
|
||||||
@@ -179,6 +192,10 @@ class ThreadStream {
|
|||||||
$item->set_commentable(can_comment_on_post($ob_hash,$item->data));
|
$item->set_commentable(can_comment_on_post($ob_hash,$item->data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($this->mode === 'pubstream' && (! local_channel())) {
|
||||||
|
$item->set_commentable(false);
|
||||||
|
}
|
||||||
|
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
|
|
||||||
$item->set_conversation($this);
|
$item->set_conversation($this);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Zotlabs\Zot;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
|
||||||
class Verify {
|
class Verify {
|
||||||
@@ -26,12 +26,11 @@ class Verify {
|
|||||||
q("delete from verify where id = %d",
|
q("delete from verify where id = %d",
|
||||||
intval($r[0]['id'])
|
intval($r[0]['id'])
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_meta($type,$channel_id,$token) {
|
function get_meta($type,$channel_id,$token) {
|
||||||
$r = q("select id, meta from verify where vtype = '%s' and channel = %d and token = '%s' limit 1",
|
$r = q("select id, meta from verify where vtype = '%s' and channel = %d and token = '%s' limit 1",
|
||||||
dbesc($type),
|
dbesc($type),
|
||||||
@@ -42,12 +41,18 @@ class Verify {
|
|||||||
q("delete from verify where id = %d",
|
q("delete from verify where id = %d",
|
||||||
intval($r[0]['id'])
|
intval($r[0]['id'])
|
||||||
);
|
);
|
||||||
return $r[0]['meta'];
|
return $r[0]['meta'];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function purge($type,$interval) {
|
/**
|
||||||
|
* @brief Purge entries of a verify-type older than interval.
|
||||||
|
*
|
||||||
|
* @param string $type Verify type
|
||||||
|
* @param string $interval SQL compatible time interval
|
||||||
|
*/
|
||||||
|
function purge($type, $interval) {
|
||||||
q("delete from verify where vtype = '%s' and created < %s - INTERVAL %s",
|
q("delete from verify where vtype = '%s' and created < %s - INTERVAL %s",
|
||||||
dbesc($type),
|
dbesc($type),
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
@@ -2,7 +2,26 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Lib;
|
namespace Zotlabs\Lib;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Class for handling observer's config.
|
||||||
|
*
|
||||||
|
* <b>XConfig</b> is comparable to <i>PConfig</i>, except that it uses <i>xchan</i>
|
||||||
|
* (an observer hash) as an identifier.
|
||||||
|
*
|
||||||
|
* <b>XConfig</b> is used for observer specific configurations and takes a
|
||||||
|
* <i>xchan</i> as identifier.
|
||||||
|
* The storage is of size MEDIUMTEXT.
|
||||||
|
*
|
||||||
|
* @code{.php}$var = Zotlabs\Lib\XConfig::Get('xchan', 'category', 'key');
|
||||||
|
* // with default value for non existent key
|
||||||
|
* $var = Zotlabs\Lib\XConfig::Get('xchan', 'category', 'unsetkey', 'defaultvalue');@endcode
|
||||||
|
*
|
||||||
|
* The old (deprecated?) way to access a XConfig value is:
|
||||||
|
* @code{.php}$observer = App::get_observer_hash();
|
||||||
|
* if ($observer) {
|
||||||
|
* $var = get_xconfig($observer, 'category', 'key');
|
||||||
|
* }@endcode
|
||||||
|
*/
|
||||||
class XConfig {
|
class XConfig {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +34,6 @@ class XConfig {
|
|||||||
* The observer's hash
|
* The observer's hash
|
||||||
* @return void|false Returns false if xchan is not set
|
* @return void|false Returns false if xchan is not set
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Load($xchan) {
|
static public function Load($xchan) {
|
||||||
|
|
||||||
if(! $xchan)
|
if(! $xchan)
|
||||||
@@ -56,9 +74,9 @@ class XConfig {
|
|||||||
* The category of the configuration value
|
* The category of the configuration value
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* The configuration key to query
|
* The configuration key to query
|
||||||
|
* @param boolean $default (optional) default false
|
||||||
* @return mixed Stored $value or false if it does not exist
|
* @return mixed Stored $value or false if it does not exist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Get($xchan, $family, $key, $default = false) {
|
static public function Get($xchan, $family, $key, $default = false) {
|
||||||
|
|
||||||
if(! $xchan)
|
if(! $xchan)
|
||||||
@@ -70,7 +88,7 @@ class XConfig {
|
|||||||
if((! array_key_exists($family, \App::$config[$xchan])) || (! array_key_exists($key, \App::$config[$xchan][$family])))
|
if((! array_key_exists($family, \App::$config[$xchan])) || (! array_key_exists($key, \App::$config[$xchan][$family])))
|
||||||
return $default;
|
return $default;
|
||||||
|
|
||||||
return ((! is_array(\App::$config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$xchan][$family][$key]))
|
return ((! is_array(\App::$config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$xchan][$family][$key]))
|
||||||
? unserialize(\App::$config[$xchan][$family][$key])
|
? unserialize(\App::$config[$xchan][$family][$key])
|
||||||
: \App::$config[$xchan][$family][$key]
|
: \App::$config[$xchan][$family][$key]
|
||||||
);
|
);
|
||||||
@@ -82,7 +100,6 @@ class XConfig {
|
|||||||
* Stores a config value ($value) in the category ($family) under the key ($key)
|
* Stores a config value ($value) in the category ($family) under the key ($key)
|
||||||
* for the observer's $xchan hash.
|
* for the observer's $xchan hash.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @param string $xchan
|
* @param string $xchan
|
||||||
* The observer's hash
|
* The observer's hash
|
||||||
* @param string $family
|
* @param string $family
|
||||||
@@ -93,7 +110,6 @@ class XConfig {
|
|||||||
* The value to store
|
* The value to store
|
||||||
* @return mixed Stored $value or false
|
* @return mixed Stored $value or false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Set($xchan, $family, $key, $value) {
|
static public function Set($xchan, $family, $key, $value) {
|
||||||
|
|
||||||
// manage array value
|
// manage array value
|
||||||
@@ -106,7 +122,7 @@ class XConfig {
|
|||||||
if(! array_key_exists($family, \App::$config[$xchan]))
|
if(! array_key_exists($family, \App::$config[$xchan]))
|
||||||
\App::$config[$xchan][$family] = array();
|
\App::$config[$xchan][$family] = array();
|
||||||
|
|
||||||
$ret = q("INSERT INTO xconfig ( xchan, cat, k, v ) VALUES ( '%s', '%s', '%s', '%s' ) ",
|
$ret = q("INSERT INTO xconfig ( xchan, cat, k, v ) VALUES ( '%s', '%s', '%s', '%s' )",
|
||||||
dbesc($xchan),
|
dbesc($xchan),
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
dbesc($key),
|
dbesc($key),
|
||||||
@@ -126,6 +142,7 @@ class XConfig {
|
|||||||
|
|
||||||
if($ret)
|
if($ret)
|
||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,11 +160,11 @@ class XConfig {
|
|||||||
* The configuration key to delete
|
* The configuration key to delete
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static public function Delete($xchan, $family, $key) {
|
static public function Delete($xchan, $family, $key) {
|
||||||
|
|
||||||
if(x(\App::$config[$xchan][$family], $key))
|
if(x(\App::$config[$xchan][$family], $key))
|
||||||
unset(\App::$config[$xchan][$family][$key]);
|
unset(\App::$config[$xchan][$family][$key]);
|
||||||
|
|
||||||
$ret = q("DELETE FROM xconfig WHERE xchan = '%s' AND cat = '%s' AND k = '%s'",
|
$ret = q("DELETE FROM xconfig WHERE xchan = '%s' AND cat = '%s' AND k = '%s'",
|
||||||
dbesc($xchan),
|
dbesc($xchan),
|
||||||
dbesc($family),
|
dbesc($family),
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php /** @file */
|
|
||||||
|
|
||||||
namespace Zotlabs\Lib;
|
|
||||||
|
|
||||||
|
|
||||||
class ZotDriver extends ProtoDriver {
|
|
||||||
|
|
||||||
protected function discover($channel,$location) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function deliver($item,$channel,$recipients) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function collect($channel,$connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function change_permissions($permissions,$channel,$recipient) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function acknowledge_permissions($permissions,$channel,$recipient) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function deliver_private($item,$channel,$recipients) {
|
|
||||||
|
|
||||||
}
|
|
||||||
protected function collect_private($channel,$connection) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,36 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Zotlabs\Module;
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
/*
|
require_once 'include/acl_selectors.php';
|
||||||
* ACL selector json backend
|
require_once 'include/group.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief ACL selector json backend.
|
||||||
|
*
|
||||||
* This module provides JSON lists of connections and local/remote channels
|
* This module provides JSON lists of connections and local/remote channels
|
||||||
* (xchans) to populate various tools such as the ACL (AccessControlList) popup
|
* (xchans) to populate various tools such as the ACL (AccessControlList) popup
|
||||||
* and various auto-complete functions (such as email recipients, search, and
|
* and various auto-complete functions (such as email recipients, search, and
|
||||||
* mention targets.
|
* mention targets.
|
||||||
|
*
|
||||||
* There are two primary output structural formats. One for the ACL widget and
|
* There are two primary output structural formats. One for the ACL widget and
|
||||||
* the other for auto-completion.
|
* the other for auto-completion.
|
||||||
* Many of the behaviour variations are triggered on the use of single character keys
|
*
|
||||||
* however this functionality has grown in an ad-hoc manner and has gotten quite messy over time.
|
* Many of the behaviour variations are triggered on the use of single character
|
||||||
|
* keys however this functionality has grown in an ad-hoc manner and has gotten
|
||||||
|
* quite messy over time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("include/acl_selectors.php");
|
|
||||||
require_once("include/group.php");
|
|
||||||
|
|
||||||
|
|
||||||
class Acl extends \Zotlabs\Web\Controller {
|
class Acl extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
logger('mod_acl: ' . print_r($_REQUEST,true));
|
logger('mod_acl: ' . print_r($_REQUEST,true),LOGGER_DATA);
|
||||||
|
|
||||||
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
|
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
|
||||||
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
|
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
|
||||||
$search = (x($_REQUEST,'search') ? $_REQUEST['search'] : '');
|
$search = (x($_REQUEST,'search') ? $_REQUEST['search'] : '');
|
||||||
$type = (x($_REQUEST,'type') ? $_REQUEST['type'] : '');
|
$type = (x($_REQUEST,'type') ? $_REQUEST['type'] : '');
|
||||||
$noforums = (x($_REQUEST,'n') ? $_REQUEST['n'] : false);
|
$noforums = (x($_REQUEST,'n') ? $_REQUEST['n'] : false);
|
||||||
|
|
||||||
|
|
||||||
// $type =
|
// $type =
|
||||||
// '' => standard ACL request
|
// '' => standard ACL request
|
||||||
// 'g' => Groups only ACL request
|
// 'g' => Groups only ACL request
|
||||||
// 'f' => forums only ACL request
|
// 'f' => forums only ACL request
|
||||||
@@ -79,7 +82,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($search) {
|
if($search) {
|
||||||
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||||
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
|
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
|
||||||
|
|
||||||
// This horrible mess is needed because position also returns 0 if nothing is found.
|
// This horrible mess is needed because position also returns 0 if nothing is found.
|
||||||
// Would be MUCH easier if it instead returned a very large value
|
// Would be MUCH easier if it instead returned a very large value
|
||||||
@@ -89,10 +92,10 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
$order_extra2 = "CASE WHEN xchan_name LIKE "
|
$order_extra2 = "CASE WHEN xchan_name LIKE "
|
||||||
. protect_sprintf( "'%" . dbesc($search) . "%'" )
|
. protect_sprintf( "'%" . dbesc($search) . "%'" )
|
||||||
. " then POSITION('" . protect_sprintf(dbesc($search))
|
. " then POSITION('" . protect_sprintf(dbesc($search))
|
||||||
. "' IN xchan_name) else position('" . protect_sprintf(dbesc($search)) . "' IN xchan_addr) end, ";
|
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
|
||||||
|
|
||||||
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
|
||||||
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc(($col === 'xchan_addr') ? punify($search) : $search) . "%'" ) . " ";
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -176,11 +179,18 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
$extra_channels_sql = " OR (abook_channel IN ($extra_channels_sql)) and abook_hidden = 0 ";
|
$extra_channels_sql = " OR (abook_channel IN ($extra_channels_sql)) and abook_hidden = 0 ";
|
||||||
|
|
||||||
|
|
||||||
// Add atokens belonging to the local channel @TODO restrict by search
|
// Add atokens belonging to the local channel
|
||||||
|
|
||||||
|
if($search) {
|
||||||
|
$sql_extra_atoken = "AND ( atoken_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . ") ";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sql_extra_atoken = '';
|
||||||
|
}
|
||||||
|
|
||||||
$r2 = null;
|
$r2 = null;
|
||||||
|
|
||||||
$r1 = q("select * from atoken where atoken_uid = %d",
|
$r1 = q("select * from atoken where atoken_uid = %d $sql_extra_atoken",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -375,15 +385,13 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
'count' => $count,
|
'count' => $count,
|
||||||
'items' => $items,
|
'items' => $items,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo json_encode($o);
|
echo json_encode($o);
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function navbar_complete(&$a) {
|
function navbar_complete(&$a) {
|
||||||
|
|
||||||
// logger('navbar_complete');
|
// logger('navbar_complete');
|
||||||
@@ -427,7 +435,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
|
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
|
||||||
if($url) {
|
if($url) {
|
||||||
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
|
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
|
||||||
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode($search) : '');
|
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode(punify($search)) : '');
|
||||||
|
|
||||||
$x = z_fetch_url($query);
|
$x = z_fetch_url($query);
|
||||||
if($x['success']) {
|
if($x['success']) {
|
||||||
@@ -440,5 +448,5 @@ class Acl extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class Accounts {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
|
|
||||||
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
|
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
|
||||||
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
|
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
|
||||||
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
|
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
|
||||||
@@ -24,7 +25,7 @@ class Accounts {
|
|||||||
|
|
||||||
// change to switch structure?
|
// change to switch structure?
|
||||||
// account block/unblock button was submitted
|
// account block/unblock button was submitted
|
||||||
if (x($_POST, 'page_users_block')) {
|
if (x($_POST, 'page_accounts_block')) {
|
||||||
for ($i = 0; $i < count($users); $i++) {
|
for ($i = 0; $i < count($users); $i++) {
|
||||||
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
|
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
|
||||||
$op = ($blocked[$i]) ? '& ~' : '| ';
|
$op = ($blocked[$i]) ? '& ~' : '| ';
|
||||||
@@ -43,13 +44,13 @@ class Accounts {
|
|||||||
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
|
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
|
||||||
}
|
}
|
||||||
// registration approved button was submitted
|
// registration approved button was submitted
|
||||||
if (x($_POST, 'page_users_approve')) {
|
if (x($_POST, 'page_accounts_approve')) {
|
||||||
foreach ($pending as $hash) {
|
foreach ($pending as $hash) {
|
||||||
account_allow($hash);
|
account_allow($hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// registration deny button was submitted
|
// registration deny button was submitted
|
||||||
if (x($_POST, 'page_users_deny')) {
|
if (x($_POST, 'page_accounts_deny')) {
|
||||||
foreach ($pending as $hash) {
|
foreach ($pending as $hash) {
|
||||||
account_deny($hash);
|
account_deny($hash);
|
||||||
}
|
}
|
||||||
@@ -132,12 +133,13 @@ class Accounts {
|
|||||||
|
|
||||||
$base = z_root() . '/admin/accounts?f=';
|
$base = z_root() . '/admin/accounts?f=';
|
||||||
$odir = (($dir === 'asc') ? '0' : '1');
|
$odir = (($dir === 'asc') ? '0' : '1');
|
||||||
|
|
||||||
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
|
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
|
||||||
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
|
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
|
||||||
where true $serviceclass order by $key $dir limit %d offset %d ",
|
where true $serviceclass and account_flags != %d order by $key $dir limit %d offset %d ",
|
||||||
intval(ACCOUNT_BLOCKED),
|
intval(ACCOUNT_BLOCKED),
|
||||||
db_concat('ch.channel_address', ' '),
|
db_concat('ch.channel_address', ' '),
|
||||||
|
intval(ACCOUNT_BLOCKED | ACCOUNT_PENDING),
|
||||||
intval(\App::$pager['itemspage']),
|
intval(\App::$pager['itemspage']),
|
||||||
intval(\App::$pager['start'])
|
intval(\App::$pager['start'])
|
||||||
);
|
);
|
||||||
@@ -202,4 +204,4 @@ class Accounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,36 +7,38 @@ namespace Zotlabs\Module\Admin;
|
|||||||
class Dbsync {
|
class Dbsync {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
|
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
|
||||||
set_config('database', 'update_r' . intval(argv(3)), 'success');
|
// remove the old style config if it exists
|
||||||
if(intval(get_config('system','db_version')) <= intval(argv(3)))
|
del_config('database', 'update_r' . intval(argv(3)));
|
||||||
set_config('system','db_version',intval(argv(3)) + 1);
|
set_config('database', '_' . intval(argv(3)), 'success');
|
||||||
|
if(intval(get_config('system','db_version')) < intval(argv(3)))
|
||||||
|
set_config('system','db_version',intval(argv(3)));
|
||||||
info( t('Update has been marked successful') . EOL);
|
info( t('Update has been marked successful') . EOL);
|
||||||
goaway(z_root() . '/admin/dbsync');
|
goaway(z_root() . '/admin/dbsync');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argc() > 2 && intval(argv(2))) {
|
if(argc() > 2 && intval(argv(2))) {
|
||||||
require_once('install/update.php');
|
$x = intval(argv(2));
|
||||||
$func = 'update_r' . intval(argv(2));
|
$s = '_' . $x;
|
||||||
if(function_exists($func)) {
|
$cls = '\\Zotlabs\Update\\' . $s ;
|
||||||
$retval = $func();
|
if(class_exists($cls)) {
|
||||||
|
$c = new $cls();
|
||||||
|
$retval = $c->run();
|
||||||
if($retval === UPDATE_FAILED) {
|
if($retval === UPDATE_FAILED) {
|
||||||
$o .= sprintf( t('Executing %s failed. Check system logs.'), $func);
|
$o .= sprintf( t('Executing %s failed. Check system logs.'), $s);
|
||||||
}
|
}
|
||||||
elseif($retval === UPDATE_SUCCESS) {
|
elseif($retval === UPDATE_SUCCESS) {
|
||||||
$o .= sprintf( t('Update %s was successfully applied.'), $func);
|
$o .= sprintf( t('Update %s was successfully applied.'), $s);
|
||||||
set_config('database',$func, 'success');
|
set_config('database',$s, 'success');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func);
|
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$o .= sprintf( t('Update function %s could not be found.'), $func);
|
$o .= sprintf( t('Update function %s could not be found.'), $s);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
@@ -45,23 +47,25 @@ class Dbsync {
|
|||||||
$r = q("select * from config where cat = 'database' ");
|
$r = q("select * from config where cat = 'database' ");
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$upd = intval(substr($rr['k'],8));
|
$upd = intval(substr($rr['k'],-4));
|
||||||
if($rr['v'] === 'success')
|
if($rr['v'] === 'success')
|
||||||
continue;
|
continue;
|
||||||
$failed[] = $upd;
|
$failed[] = $upd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(! count($failed))
|
if(count($failed)) {
|
||||||
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
|
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
|
||||||
|
'$base' => z_root(),
|
||||||
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
|
'$banner' => t('Failed Updates'),
|
||||||
'$base' => z_root(),
|
'$desc' => '',
|
||||||
'$banner' => t('Failed Updates'),
|
'$mark' => t('Mark success (if update was manually applied)'),
|
||||||
'$desc' => '',
|
'$apply' => t('Attempt to execute this update step automatically'),
|
||||||
'$mark' => t('Mark success (if update was manually applied)'),
|
'$failed' => $failed
|
||||||
'$apply' => t('Attempt to execute this update step automatically'),
|
|
||||||
'$failed' => $failed
|
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
|
||||||
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,37 @@ class Profs {
|
|||||||
|
|
||||||
if(array_key_exists('basic',$_REQUEST)) {
|
if(array_key_exists('basic',$_REQUEST)) {
|
||||||
$arr = explode(',',$_REQUEST['basic']);
|
$arr = explode(',',$_REQUEST['basic']);
|
||||||
for($x = 0; $x < count($arr); $x ++)
|
array_walk($arr,'array_trim');
|
||||||
if(trim($arr[$x]))
|
$narr = [];
|
||||||
$arr[$x] = trim($arr[$x]);
|
if(count($arr)) {
|
||||||
set_config('system','profile_fields_basic',$arr);
|
foreach($arr as $a) {
|
||||||
|
if(strlen($a)) {
|
||||||
|
$narr[] = $a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(! $narr)
|
||||||
|
del_config('system','profile_fields_basic');
|
||||||
|
else
|
||||||
|
set_config('system','profile_fields_basic',$narr);
|
||||||
|
|
||||||
|
|
||||||
if(array_key_exists('advanced',$_REQUEST)) {
|
if(array_key_exists('advanced',$_REQUEST)) {
|
||||||
$arr = explode(',',$_REQUEST['advanced']);
|
$arr = explode(',',$_REQUEST['advanced']);
|
||||||
for($x = 0; $x < count($arr); $x ++)
|
array_walk($arr,'array_trim');
|
||||||
if(trim($arr[$x]))
|
$narr = [];
|
||||||
$arr[$x] = trim($arr[$x]);
|
if(count($arr)) {
|
||||||
set_config('system','profile_fields_advanced',$arr);
|
foreach($arr as $a) {
|
||||||
|
if(strlen($a)) {
|
||||||
|
$narr[] = $a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(! $narr)
|
||||||
|
del_config('system','profile_fields_advanced');
|
||||||
|
else
|
||||||
|
set_config('system','profile_fields_advanced',$narr);
|
||||||
|
|
||||||
}
|
}
|
||||||
goaway(z_root() . '/admin/profs');
|
goaway(z_root() . '/admin/profs');
|
||||||
}
|
}
|
||||||
@@ -98,6 +118,7 @@ class Profs {
|
|||||||
$basic = '';
|
$basic = '';
|
||||||
$barr = array();
|
$barr = array();
|
||||||
$fields = get_profile_fields_basic();
|
$fields = get_profile_fields_basic();
|
||||||
|
|
||||||
if(! $fields)
|
if(! $fields)
|
||||||
$fields = get_profile_fields_basic(1);
|
$fields = get_profile_fields_basic(1);
|
||||||
if($fields) {
|
if($fields) {
|
||||||
|
|||||||
@@ -52,24 +52,24 @@ class Security {
|
|||||||
function get() {
|
function get() {
|
||||||
|
|
||||||
$whitesites = get_config('system','whitelisted_sites');
|
$whitesites = get_config('system','whitelisted_sites');
|
||||||
$whitesites_str = ((is_array($whitesites)) ? implode($whitesites,"\n") : '');
|
$whitesites_str = ((is_array($whitesites)) ? implode("\n",$whitesites) : '');
|
||||||
|
|
||||||
$blacksites = get_config('system','blacklisted_sites');
|
$blacksites = get_config('system','blacklisted_sites');
|
||||||
$blacksites_str = ((is_array($blacksites)) ? implode($blacksites,"\n") : '');
|
$blacksites_str = ((is_array($blacksites)) ? implode("\n",$blacksites) : '');
|
||||||
|
|
||||||
|
|
||||||
$whitechannels = get_config('system','whitelisted_channels');
|
$whitechannels = get_config('system','whitelisted_channels');
|
||||||
$whitechannels_str = ((is_array($whitechannels)) ? implode($whitechannels,"\n") : '');
|
$whitechannels_str = ((is_array($whitechannels)) ? implode("\n",$whitechannels) : '');
|
||||||
|
|
||||||
$blackchannels = get_config('system','blacklisted_channels');
|
$blackchannels = get_config('system','blacklisted_channels');
|
||||||
$blackchannels_str = ((is_array($blackchannels)) ? implode($blackchannels,"\n") : '');
|
$blackchannels_str = ((is_array($blackchannels)) ? implode("\n",$blackchannels) : '');
|
||||||
|
|
||||||
|
|
||||||
$whiteembeds = get_config('system','embed_allow');
|
$whiteembeds = get_config('system','embed_allow');
|
||||||
$whiteembeds_str = ((is_array($whiteembeds)) ? implode($whiteembeds,"\n") : '');
|
$whiteembeds_str = ((is_array($whiteembeds)) ? implode("\n",$whiteembeds) : '');
|
||||||
|
|
||||||
$blackembeds = get_config('system','embed_deny');
|
$blackembeds = get_config('system','embed_deny');
|
||||||
$blackembeds_str = ((is_array($blackembeds)) ? implode($blackembeds,"\n") : '');
|
$blackembeds_str = ((is_array($blackembeds)) ? implode("\n",$blackembeds) : '');
|
||||||
|
|
||||||
$embed_coop = intval(get_config('system','embed_coop'));
|
$embed_coop = intval(get_config('system','embed_coop'));
|
||||||
|
|
||||||
|
|||||||
@@ -24,28 +24,39 @@ class Site {
|
|||||||
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
|
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
|
||||||
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
||||||
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
|
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
|
||||||
$theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
|
// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
|
||||||
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
|
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
|
||||||
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
|
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
|
||||||
|
|
||||||
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
|
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
|
||||||
|
$minimum_age = ((x($_POST,'minimum_age')) ? intval(trim($_POST['minimum_age'])) : 13);
|
||||||
$access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0);
|
$access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0);
|
||||||
$invite_only = ((x($_POST,'invite_only')) ? True : False);
|
$invite_only = ((x($_POST,'invite_only')) ? True : False);
|
||||||
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
|
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
|
||||||
|
|
||||||
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
|
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
|
||||||
|
$site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : '');
|
||||||
|
$site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : '');
|
||||||
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
|
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
|
||||||
|
$firstpage = ((x($_POST,'firstpage')) ? notags(trim($_POST['firstpage'])) : 'profiles');
|
||||||
|
$first_page = ((x($_POST,'first_page')) ? notags(trim($_POST['first_page'])) : 'profiles');
|
||||||
|
// check value after trim
|
||||||
|
if(! $first_page) {
|
||||||
|
$first_page = 'profiles';
|
||||||
|
}
|
||||||
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
|
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
|
||||||
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
|
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
|
||||||
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
|
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
|
||||||
$force_publish = ((x($_POST,'publish_all')) ? True : False);
|
$force_publish = ((x($_POST,'publish_all')) ? True : False);
|
||||||
$disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True);
|
$disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True);
|
||||||
|
$site_firehose = ((x($_POST,'site_firehose')) ? True : False);
|
||||||
|
$open_pubstream = ((x($_POST,'open_pubstream')) ? True : False);
|
||||||
$login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False);
|
$login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False);
|
||||||
$enable_context_help = ((x($_POST,'enable_context_help')) ? True : False);
|
$enable_context_help = ((x($_POST,'enable_context_help')) ? True : False);
|
||||||
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
|
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
|
||||||
$no_community_page = !((x($_POST,'no_community_page')) ? True : False);
|
$no_community_page = !((x($_POST,'no_community_page')) ? True : False);
|
||||||
$default_expire_days = ((array_key_exists('default_expire_days',$_POST)) ? intval($_POST['default_expire_days']) : 0);
|
$default_expire_days = ((array_key_exists('default_expire_days',$_POST)) ? intval($_POST['default_expire_days']) : 0);
|
||||||
|
$active_expire_days = ((array_key_exists('active_expire_days',$_POST)) ? intval($_POST['active_expire_days']) : 7);
|
||||||
|
|
||||||
$reply_address = ((array_key_exists('reply_address',$_POST) && trim($_POST['reply_address'])) ? trim($_POST['reply_address']) : 'noreply@' . \App::get_hostname());
|
$reply_address = ((array_key_exists('reply_address',$_POST) && trim($_POST['reply_address'])) ? trim($_POST['reply_address']) : 'noreply@' . \App::get_hostname());
|
||||||
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
|
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
|
||||||
@@ -61,8 +72,10 @@ class Site {
|
|||||||
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
|
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
|
||||||
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
|
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
|
||||||
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
|
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
|
||||||
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
|
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
|
||||||
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
|
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
|
||||||
|
$thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0);
|
||||||
|
$force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000);
|
||||||
|
|
||||||
$techlevel = null;
|
$techlevel = null;
|
||||||
if(array_key_exists('techlevel', $_POST))
|
if(array_key_exists('techlevel', $_POST))
|
||||||
@@ -74,17 +87,21 @@ class Site {
|
|||||||
set_config('system', 'poll_interval', $poll_interval);
|
set_config('system', 'poll_interval', $poll_interval);
|
||||||
set_config('system', 'maxloadavg', $maxloadavg);
|
set_config('system', 'maxloadavg', $maxloadavg);
|
||||||
set_config('system', 'frontpage', $frontpage);
|
set_config('system', 'frontpage', $frontpage);
|
||||||
|
set_config('system', 'sellpage', $site_sellpage);
|
||||||
|
set_config('system', 'workflow_channel_next', $first_page);
|
||||||
|
set_config('system', 'site_location', $site_location);
|
||||||
set_config('system', 'mirror_frontpage', $mirror_frontpage);
|
set_config('system', 'mirror_frontpage', $mirror_frontpage);
|
||||||
set_config('system', 'sitename', $sitename);
|
set_config('system', 'sitename', $sitename);
|
||||||
set_config('system', 'login_on_homepage', $login_on_homepage);
|
set_config('system', 'login_on_homepage', $login_on_homepage);
|
||||||
set_config('system', 'enable_context_help', $enable_context_help);
|
set_config('system', 'enable_context_help', $enable_context_help);
|
||||||
set_config('system', 'verify_email', $verify_email);
|
set_config('system', 'verify_email', $verify_email);
|
||||||
set_config('system', 'default_expire_days', $default_expire_days);
|
set_config('system', 'default_expire_days', $default_expire_days);
|
||||||
|
set_config('system', 'active_expire_days', $active_expire_days);
|
||||||
set_config('system', 'reply_address', $reply_address);
|
set_config('system', 'reply_address', $reply_address);
|
||||||
set_config('system', 'from_email', $from_email);
|
set_config('system', 'from_email', $from_email);
|
||||||
set_config('system', 'from_email_name' , $from_email_name);
|
set_config('system', 'from_email_name' , $from_email_name);
|
||||||
set_config('system', 'imagick_convert_path' , $imagick_path);
|
set_config('system', 'imagick_convert_path' , $imagick_path);
|
||||||
|
set_config('system', 'thumbnail_security' , $thumbnail_security);
|
||||||
|
|
||||||
set_config('system', 'techlevel_lock', $techlevel_lock);
|
set_config('system', 'techlevel_lock', $techlevel_lock);
|
||||||
|
|
||||||
@@ -112,15 +129,16 @@ class Site {
|
|||||||
set_config('system','siteinfo',$siteinfo);
|
set_config('system','siteinfo',$siteinfo);
|
||||||
set_config('system', 'language', $language);
|
set_config('system', 'language', $language);
|
||||||
set_config('system', 'theme', $theme);
|
set_config('system', 'theme', $theme);
|
||||||
if ( $theme_mobile === '---' ) {
|
// if ( $theme_mobile === '---' ) {
|
||||||
del_config('system', 'mobile_theme');
|
// del_config('system', 'mobile_theme');
|
||||||
} else {
|
// } else {
|
||||||
set_config('system', 'mobile_theme', $theme_mobile);
|
// set_config('system', 'mobile_theme', $theme_mobile);
|
||||||
}
|
// }
|
||||||
// set_config('system','site_channel', $site_channel);
|
// set_config('system','site_channel', $site_channel);
|
||||||
set_config('system','maximagesize', $maximagesize);
|
set_config('system','maximagesize', $maximagesize);
|
||||||
|
|
||||||
set_config('system','register_policy', $register_policy);
|
set_config('system','register_policy', $register_policy);
|
||||||
|
set_config('system','minimum_age', $minimum_age);
|
||||||
set_config('system','invitation_only', $invite_only);
|
set_config('system','invitation_only', $invite_only);
|
||||||
set_config('system','access_policy', $access_policy);
|
set_config('system','access_policy', $access_policy);
|
||||||
set_config('system','account_abandon_days', $abandon_days);
|
set_config('system','account_abandon_days', $abandon_days);
|
||||||
@@ -128,6 +146,9 @@ class Site {
|
|||||||
set_config('system','allowed_sites', $allowed_sites);
|
set_config('system','allowed_sites', $allowed_sites);
|
||||||
set_config('system','publish_all', $force_publish);
|
set_config('system','publish_all', $force_publish);
|
||||||
set_config('system','disable_discover_tab', $disable_discover_tab);
|
set_config('system','disable_discover_tab', $disable_discover_tab);
|
||||||
|
set_config('system','site_firehose', $site_firehose);
|
||||||
|
set_config('system','open_pubstream', $open_pubstream);
|
||||||
|
set_config('system','force_queue_threshold', $force_queue);
|
||||||
if ($global_directory == '') {
|
if ($global_directory == '') {
|
||||||
del_config('system', 'directory_submit_url');
|
del_config('system', 'directory_submit_url');
|
||||||
} else {
|
} else {
|
||||||
@@ -206,9 +227,10 @@ class Site {
|
|||||||
$realm = get_directory_realm();
|
$realm = get_directory_realm();
|
||||||
|
|
||||||
// directory server should not be set or settable unless we are a directory client
|
// directory server should not be set or settable unless we are a directory client
|
||||||
|
// avoid older redmatrix servers which don't have modern encryption
|
||||||
|
|
||||||
if($dirmode == DIRECTORY_MODE_NORMAL) {
|
if($dirmode == DIRECTORY_MODE_NORMAL) {
|
||||||
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0",
|
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0 and site_project != 'redmatrix'",
|
||||||
intval(DIRECTORY_MODE_SECONDARY),
|
intval(DIRECTORY_MODE_SECONDARY),
|
||||||
intval(DIRECTORY_MODE_PRIMARY),
|
intval(DIRECTORY_MODE_PRIMARY),
|
||||||
dbesc($realm)
|
dbesc($realm)
|
||||||
@@ -248,6 +270,7 @@ class Site {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$discover_tab = get_config('system','disable_discover_tab');
|
$discover_tab = get_config('system','disable_discover_tab');
|
||||||
|
|
||||||
// $disable public streams by default
|
// $disable public streams by default
|
||||||
if($discover_tab === false)
|
if($discover_tab === false)
|
||||||
$discover_tab = 1;
|
$discover_tab = 1;
|
||||||
@@ -284,17 +307,18 @@ class Site {
|
|||||||
|
|
||||||
'$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ],
|
'$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ],
|
||||||
|
|
||||||
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
|
'$banner' => array('banner', t("Banner/Logo"), $banner, t('Unfiltered HTML/CSS/JS is allowed')),
|
||||||
'$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")),
|
'$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")),
|
||||||
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
|
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
|
||||||
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
|
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
|
||||||
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
|
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
|
||||||
'$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
|
// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
|
||||||
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
|
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
|
||||||
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
|
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
|
||||||
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
|
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
|
||||||
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
|
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
|
||||||
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
|
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
|
||||||
|
'$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
|
||||||
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
|
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
|
||||||
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
|
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
|
||||||
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
|
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
|
||||||
@@ -304,6 +328,8 @@ class Site {
|
|||||||
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
|
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
|
||||||
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
|
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
|
||||||
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
|
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
|
||||||
|
'$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')),
|
||||||
|
'$open_pubstream' => array('open_pubstream', t('Allow anybody on the internet to access the Public streams'), get_config('system','open_pubstream',1), t('Disable to require authentication before viewing. Warning: this content is unmoderated.')),
|
||||||
'$login_on_homepage' => array('login_on_homepage', t("Login on Homepage"),((intval($homelogin) || $homelogin === false) ? 1 : '') , t("Present a login box to visitors on the home page if no other content has been configured.")),
|
'$login_on_homepage' => array('login_on_homepage', t("Login on Homepage"),((intval($homelogin) || $homelogin === false) ? 1 : '') , t("Present a login box to visitors on the home page if no other content has been configured.")),
|
||||||
'$enable_context_help' => array('enable_context_help', t("Enable context help"),((intval($enable_context_help) === 1 || $enable_context_help === false) ? 1 : 0) , t("Display contextual help for the current page when the help button is pressed.")),
|
'$enable_context_help' => array('enable_context_help', t("Enable context help"),((intval($enable_context_help) === 1 || $enable_context_help === false) ? 1 : 0) , t("Display contextual help for the current page when the help button is pressed.")),
|
||||||
|
|
||||||
@@ -318,10 +344,20 @@ class Site {
|
|||||||
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
|
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
|
||||||
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
|
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
|
||||||
'$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")),
|
'$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")),
|
||||||
|
'$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',3000), t("Always defer immediate delivery if queue contains more than this number of entries.")),
|
||||||
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
|
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
|
||||||
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
|
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
|
||||||
|
'$thumbnail_security' => array('thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.")),
|
||||||
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
|
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
|
||||||
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
|
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
|
||||||
|
'$active_expire_days' => array('active_expire_days', t('Do not expire any posts which have comments less than this many days ago'), intval(get_config('system','active_expire_days',7)), ''),
|
||||||
|
|
||||||
|
'$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
|
||||||
|
'$first_page' => array('first_page', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')),
|
||||||
|
|
||||||
|
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),
|
||||||
|
|
||||||
|
|
||||||
'$form_security_token' => get_form_security_token("admin_site"),
|
'$form_security_token' => get_form_security_token("admin_site"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ class Api extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
// get consumer/client from request token
|
// get consumer/client from request token
|
||||||
try {
|
try {
|
||||||
$request = OAuth1Request::from_request();
|
$request = \OAuth1Request::from_request();
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
catch(\Exception $e) {
|
||||||
echo "<pre>"; var_dump($e); killme();
|
logger('OAuth exception: ' . print_r($e,true));
|
||||||
|
// echo "<pre>"; var_dump($e);
|
||||||
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ class Api extends \Zotlabs\Web\Controller {
|
|||||||
if (is_null($app))
|
if (is_null($app))
|
||||||
return "Invalid request. Unknown token.";
|
return "Invalid request. Unknown token.";
|
||||||
|
|
||||||
$consumer = new OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
|
$consumer = new \OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
|
||||||
|
|
||||||
$verifier = md5($app['secret'] . local_channel());
|
$verifier = md5($app['secret'] . local_channel());
|
||||||
set_config('oauth', $verifier, local_channel());
|
set_config('oauth', $verifier, local_channel());
|
||||||
@@ -63,7 +65,7 @@ class Api extends \Zotlabs\Web\Controller {
|
|||||||
$glue = '?';
|
$glue = '?';
|
||||||
if(strstr($consumer->callback_url,$glue))
|
if(strstr($consumer->callback_url,$glue))
|
||||||
$glue = '?';
|
$glue = '?';
|
||||||
goaway($consumer->callback_url . $glue . "oauth_token=" . OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . OAuth1Util::urlencode_rfc3986($verifier));
|
goaway($consumer->callback_url . $glue . "oauth_token=" . \OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . \OAuth1Util::urlencode_rfc3986($verifier));
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ class Appman extends \Zotlabs\Web\Controller {
|
|||||||
'photo' => escape_tags($_REQUEST['photo']),
|
'photo' => escape_tags($_REQUEST['photo']),
|
||||||
'version' => escape_tags($_REQUEST['version']),
|
'version' => escape_tags($_REQUEST['version']),
|
||||||
'price' => escape_tags($_REQUEST['price']),
|
'price' => escape_tags($_REQUEST['price']),
|
||||||
|
'page' => escape_tags($_REQUEST['page']),
|
||||||
'requires' => escape_tags($_REQUEST['requires']),
|
'requires' => escape_tags($_REQUEST['requires']),
|
||||||
'system' => intval($_REQUEST['system']),
|
'system' => intval($_REQUEST['system']),
|
||||||
'plugin' => escape_tags($_REQUEST['plugin']),
|
'plugin' => escape_tags($_REQUEST['plugin']),
|
||||||
@@ -64,7 +65,11 @@ class Appman extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($_POST['feature']) {
|
if($_POST['feature']) {
|
||||||
Zlib\Apps::app_feature(local_channel(),$papp);
|
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['feature']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_POST['pin']) {
|
||||||
|
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['pin']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_SESSION['return_url'])
|
if($_SESSION['return_url'])
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Apporder extends \Zotlabs\Web\Controller {
|
|||||||
nav_set_selected('Order Apps');
|
nav_set_selected('Order Apps');
|
||||||
|
|
||||||
$syslist = array();
|
$syslist = array();
|
||||||
$list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app');
|
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
|
||||||
if($list) {
|
if($list) {
|
||||||
foreach($list as $li) {
|
foreach($list as $li) {
|
||||||
$syslist[] = Zlib\Apps::app_encode($li);
|
$syslist[] = Zlib\Apps::app_encode($li);
|
||||||
@@ -31,14 +31,20 @@ class Apporder extends \Zotlabs\Web\Controller {
|
|||||||
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
|
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
|
||||||
|
|
||||||
foreach($syslist as $app) {
|
foreach($syslist as $app) {
|
||||||
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
if(strpos($app['categories'],'nav_pinned_app') !== false) {
|
||||||
|
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return replace_macros(get_markup_template('apporder.tpl'),
|
return replace_macros(get_markup_template('apporder.tpl'),
|
||||||
[
|
[
|
||||||
'$header' => t('Change Order of Navigation Apps'),
|
'$header' => [t('Change Order of Pinned Navbar Apps'), t('Change Order of App Tray Apps')],
|
||||||
'$desc' => t('Use arrows to move the corresponding app up or down in the display list'),
|
'$desc' => [t('Use arrows to move the corresponding app left (top) or right (bottom) in the navbar'), t('Use arrows to move the corresponding app up or down in the app tray')],
|
||||||
'$nav_apps' => $nav_apps
|
'$nav_apps' => $nav_apps,
|
||||||
|
'$navbar_apps' => $navbar_apps
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ class Apps extends \Zotlabs\Web\Controller {
|
|||||||
if(local_channel()) {
|
if(local_channel()) {
|
||||||
Zlib\Apps::import_system_apps();
|
Zlib\Apps::import_system_apps();
|
||||||
$syslist = array();
|
$syslist = array();
|
||||||
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $_GET['cat']);
|
$cat = ((array_key_exists('cat',$_GET) && $_GET['cat']) ? [ escape_tags($_GET['cat']) ] : '');
|
||||||
|
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $cat);
|
||||||
if($list) {
|
if($list) {
|
||||||
foreach($list as $x) {
|
foreach($list as $x) {
|
||||||
$syslist[] = Zlib\Apps::app_encode($x);
|
$syslist[] = Zlib\Apps::app_encode($x);
|
||||||
@@ -43,7 +44,7 @@ class Apps extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
return replace_macros(get_markup_template('myapps.tpl'), array(
|
return replace_macros(get_markup_template('myapps.tpl'), array(
|
||||||
'$sitename' => get_config('system','sitename'),
|
'$sitename' => get_config('system','sitename'),
|
||||||
'$cat' => ((array_key_exists('cat',$_GET) && $_GET['cat']) ? escape_tags($_GET['cat']) : ''),
|
'$cat' => $cat,
|
||||||
'$title' => t('Apps'),
|
'$title' => t('Apps'),
|
||||||
'$apps' => $apps,
|
'$apps' => $apps,
|
||||||
'$authed' => ((local_channel()) ? true : false),
|
'$authed' => ((local_channel()) ? true : false),
|
||||||
|
|||||||
138
Zotlabs/Module/Article_edit.php
Normal file
138
Zotlabs/Module/Article_edit.php
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?php
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
require_once('include/channel.php');
|
||||||
|
require_once('include/acl_selectors.php');
|
||||||
|
require_once('include/conversation.php');
|
||||||
|
|
||||||
|
class Article_edit extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
|
||||||
|
// Figure out which post we're editing
|
||||||
|
$post_id = ((argc() > 1) ? intval(argv(1)) : 0);
|
||||||
|
|
||||||
|
if(! $post_id) {
|
||||||
|
notice( t('Item not found') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$itm = q("SELECT * FROM item WHERE id = %d and item_type = %d LIMIT 1",
|
||||||
|
intval($post_id),
|
||||||
|
intval(ITEM_TYPE_ARTICLE)
|
||||||
|
);
|
||||||
|
if($itm) {
|
||||||
|
$item_id = q("select * from iconfig where cat = 'system' and k = 'ARTICLE' and iid = %d limit 1",
|
||||||
|
intval($itm[0]['id'])
|
||||||
|
);
|
||||||
|
if($item_id)
|
||||||
|
$card_title = $item_id[0]['v'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
notice( t('Item not found') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$owner = $itm[0]['uid'];
|
||||||
|
$uid = local_channel();
|
||||||
|
|
||||||
|
$observer = \App::get_observer();
|
||||||
|
|
||||||
|
$channel = channelx_by_n($owner);
|
||||||
|
if(! $channel) {
|
||||||
|
notice( t('Channel not found.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||||
|
|
||||||
|
if(! perm_is_allowed($owner,$ob_hash,'write_pages')) {
|
||||||
|
notice( t('Permission denied.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$is_owner = (($uid && $uid == $owner) ? true : false);
|
||||||
|
|
||||||
|
$o = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$category = '';
|
||||||
|
$catsenabled = ((feature_enabled($owner,'categories')) ? 'categories' : '');
|
||||||
|
|
||||||
|
if ($catsenabled){
|
||||||
|
$itm = fetch_post_tags($itm);
|
||||||
|
|
||||||
|
$cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
|
||||||
|
|
||||||
|
foreach ($cats as $cat) {
|
||||||
|
if (strlen($category))
|
||||||
|
$category .= ', ';
|
||||||
|
$category .= $cat['term'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($itm[0]['attach']) {
|
||||||
|
$j = json_decode($itm[0]['attach'],true);
|
||||||
|
if($j) {
|
||||||
|
foreach($j as $jj) {
|
||||||
|
$itm[0]['body'] .= "\n" . '[attachment]' . basename($jj['href']) . ',' . $jj['revision'] . '[/attachment]' . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$mimetype = $itm[0]['mimetype'];
|
||||||
|
|
||||||
|
$content = $itm[0]['body'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$rp = 'articles/' . $channel['channel_address'];
|
||||||
|
|
||||||
|
$x = array(
|
||||||
|
'nickname' => $channel['channel_address'],
|
||||||
|
'bbco_autocomplete'=> 'bbcode',
|
||||||
|
'return_path' => $rp,
|
||||||
|
'webpage' => ITEM_TYPE_ARTICLE,
|
||||||
|
'button' => t('Edit'),
|
||||||
|
'writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_pages'),
|
||||||
|
'weblink' => t('Insert web link'),
|
||||||
|
'hide_voting' => false,
|
||||||
|
'hide_future' => false,
|
||||||
|
'hide_location' => false,
|
||||||
|
'hide_expire' => false,
|
||||||
|
'showacl' => true,
|
||||||
|
'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')),
|
||||||
|
'permissions' => $itm[0],
|
||||||
|
'lockstate' => (($itm[0]['allow_cid'] || $itm[0]['allow_gid'] || $itm[0]['deny_cid'] || $itm[0]['deny_gid']) ? 'lock' : 'unlock'),
|
||||||
|
'ptyp' => $itm[0]['type'],
|
||||||
|
'mimeselect' => false,
|
||||||
|
'mimetype' => $itm[0]['mimetype'],
|
||||||
|
'body' => undo_post_tagging($content),
|
||||||
|
'post_id' => $post_id,
|
||||||
|
'visitor' => true,
|
||||||
|
'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
|
||||||
|
'placeholdertitle' => t('Title (optional)'),
|
||||||
|
'pagetitle' => $card_title,
|
||||||
|
'profile_uid' => (intval($channel['channel_id'])),
|
||||||
|
'catsenabled' => $catsenabled,
|
||||||
|
'category' => $category,
|
||||||
|
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
|
||||||
|
);
|
||||||
|
|
||||||
|
$editor = status_editor($a, $x);
|
||||||
|
|
||||||
|
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
|
||||||
|
'$title' => t('Edit Article'),
|
||||||
|
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||||
|
'$id' => $itm[0]['id'],
|
||||||
|
'$editor' => $editor
|
||||||
|
));
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
200
Zotlabs/Module/Articles.php
Normal file
200
Zotlabs/Module/Articles.php
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<?php
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
require_once('include/channel.php');
|
||||||
|
require_once('include/conversation.php');
|
||||||
|
require_once('include/acl_selectors.php');
|
||||||
|
|
||||||
|
|
||||||
|
class Articles extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
if(argc() > 1)
|
||||||
|
$which = argv(1);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
profile_load($which);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
|
if(observer_prohibited(true)) {
|
||||||
|
return login();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! \App::$profile) {
|
||||||
|
notice( t('Requested profile is not available.') . EOL );
|
||||||
|
\App::$error = 404;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! feature_enabled(\App::$profile_uid,'articles')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav_set_selected(t('Articles'));
|
||||||
|
|
||||||
|
head_add_link([
|
||||||
|
'rel' => 'alternate',
|
||||||
|
'type' => 'application/json+oembed',
|
||||||
|
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
|
||||||
|
'title' => 'oembed'
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
|
||||||
|
|
||||||
|
if($category) {
|
||||||
|
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$which = argv(1);
|
||||||
|
|
||||||
|
$selected_card = ((argc() > 2) ? argv(2) : '');
|
||||||
|
|
||||||
|
$_SESSION['return_url'] = \App::$query_string;
|
||||||
|
|
||||||
|
$uid = local_channel();
|
||||||
|
$owner = \App::$profile_uid;
|
||||||
|
$observer = \App::get_observer();
|
||||||
|
|
||||||
|
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||||
|
|
||||||
|
if(! perm_is_allowed($owner,$ob_hash,'view_pages')) {
|
||||||
|
notice( t('Permission denied.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$is_owner = ($uid && $uid == $owner);
|
||||||
|
|
||||||
|
$channel = channelx_by_n($owner);
|
||||||
|
|
||||||
|
if($channel) {
|
||||||
|
$channel_acl = array(
|
||||||
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
|
'deny_gid' => $channel['channel_deny_gid']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(perm_is_allowed($owner,$ob_hash,'write_pages')) {
|
||||||
|
|
||||||
|
$x = [
|
||||||
|
'webpage' => ITEM_TYPE_ARTICLE,
|
||||||
|
'is_owner' => true,
|
||||||
|
'content_label' => t('Add Article'),
|
||||||
|
'button' => t('Create'),
|
||||||
|
'nickname' => $channel['channel_address'],
|
||||||
|
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|
||||||
|
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||||
|
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
|
||||||
|
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
|
||||||
|
'permissions' => $channel_acl,
|
||||||
|
'showacl' => (($is_owner) ? true : false),
|
||||||
|
'visitor' => true,
|
||||||
|
'body' => '[summary][/summary]',
|
||||||
|
'hide_location' => false,
|
||||||
|
'hide_voting' => false,
|
||||||
|
'profile_uid' => intval($owner),
|
||||||
|
'mimetype' => 'text/bbcode',
|
||||||
|
'mimeselect' => false,
|
||||||
|
'layoutselect' => false,
|
||||||
|
'expanded' => false,
|
||||||
|
'novoting' => false,
|
||||||
|
'catsenabled' => feature_enabled($owner,'categories'),
|
||||||
|
'bbco_autocomplete' => 'bbcode',
|
||||||
|
'bbcode' => true
|
||||||
|
];
|
||||||
|
|
||||||
|
if($_REQUEST['title'])
|
||||||
|
$x['title'] = $_REQUEST['title'];
|
||||||
|
if($_REQUEST['body'])
|
||||||
|
$x['body'] = $_REQUEST['body'];
|
||||||
|
$editor = status_editor($a,$x);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$editor = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemspage = get_pconfig(local_channel(),'system','itemspage');
|
||||||
|
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
|
||||||
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||||
|
|
||||||
|
|
||||||
|
$sql_extra = item_permissions_sql($owner);
|
||||||
|
$sql_item = '';
|
||||||
|
|
||||||
|
if($selected_card) {
|
||||||
|
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.v = '%s' limit 1",
|
||||||
|
dbesc($selected_card)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$r = q("select * from item
|
||||||
|
where item.uid = %d and item_type = %d
|
||||||
|
$sql_extra $sql_item order by item.created desc $pager_sql",
|
||||||
|
intval($owner),
|
||||||
|
intval(ITEM_TYPE_ARTICLE)
|
||||||
|
);
|
||||||
|
|
||||||
|
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0
|
||||||
|
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
||||||
|
and item.item_blocked = 0 ";
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
|
||||||
|
$pager_total = count($r);
|
||||||
|
|
||||||
|
$parents_str = ids_to_querystr($r,'id');
|
||||||
|
|
||||||
|
$items = q("SELECT item.*, item.id AS item_id
|
||||||
|
FROM item
|
||||||
|
WHERE item.uid = %d $item_normal
|
||||||
|
AND item.parent IN ( %s )
|
||||||
|
$sql_extra $sql_extra2 ",
|
||||||
|
intval(\App::$profile['profile_uid']),
|
||||||
|
dbesc($parents_str)
|
||||||
|
);
|
||||||
|
if($items) {
|
||||||
|
xchan_query($items);
|
||||||
|
$items = fetch_post_tags($items, true);
|
||||||
|
$items = conv_sort($items,'updated');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$items = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$mode = 'articles';
|
||||||
|
|
||||||
|
if(get_pconfig(local_channel(),'system','articles_list_mode') && (! $selected_card))
|
||||||
|
$page_mode = 'pager_list';
|
||||||
|
else
|
||||||
|
$page_mode = 'traditional';
|
||||||
|
|
||||||
|
$content = conversation($items,$mode,false,$page_mode);
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template('cards.tpl'), [
|
||||||
|
'$title' => t('Articles'),
|
||||||
|
'$editor' => $editor,
|
||||||
|
'$content' => $content,
|
||||||
|
'$pager' => alt_pager($pager_total)
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,70 +2,95 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Module;
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
use Zotlabs\Identity\OAuth2Storage;
|
||||||
|
|
||||||
class Authorize extends \Zotlabs\Web\Controller {
|
class Authorize extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
|
if (!local_channel()) {
|
||||||
|
return login();
|
||||||
// workaround for HTTP-auth in CGI mode
|
} else {
|
||||||
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
|
// TODO: Fully implement the dynamic client registration protocol:
|
||||||
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
|
// OpenID Connect Dynamic Client Registration 1.0 Client Metadata
|
||||||
if(strlen($userpass)) {
|
// http://openid.net/specs/openid-connect-registration-1_0.html
|
||||||
list($name, $password) = explode(':', $userpass);
|
$app = array(
|
||||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
'name' => (x($_REQUEST, 'client_name') ? urldecode($_REQUEST['client_name']) : t('Unknown App')),
|
||||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
'icon' => (x($_REQUEST, 'logo_uri') ? urldecode($_REQUEST['logo_uri']) : z_root() . '/images/icons/plugin.png'),
|
||||||
}
|
'url' => (x($_REQUEST, 'client_uri') ? urldecode($_REQUEST['client_uri']) : ''),
|
||||||
}
|
);
|
||||||
|
$o .= replace_macros(get_markup_template('oauth_authorize.tpl'), array(
|
||||||
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
|
'$title' => t('Authorize'),
|
||||||
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
|
'$authorize' => sprintf( t('Do you authorize the app %s to access your channel data?'), '<a style="float: none;" href="' . $app['url'] . '">' . $app['name'] . '</a> '),
|
||||||
if(strlen($userpass)) {
|
'$app' => $app,
|
||||||
list($name, $password) = explode(':', $userpass);
|
'$yes' => t('Allow'),
|
||||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
'$no' => t('Deny'),
|
||||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
'$client_id' => (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : ''),
|
||||||
}
|
'$redirect_uri' => (x($_REQUEST, 'redirect_uri') ? $_REQUEST['redirect_uri'] : ''),
|
||||||
}
|
'$state' => (x($_REQUEST, 'state') ? $_REQUEST['state'] : ''),
|
||||||
|
));
|
||||||
|
return $o;
|
||||||
|
}
|
||||||
|
|
||||||
require_once('include/oauth2.php');
|
|
||||||
|
|
||||||
$request = \OAuth2\Request::createFromGlobals();
|
|
||||||
$response = new \OAuth2\Response();
|
|
||||||
|
|
||||||
// validate the authorize request
|
|
||||||
if (! $oauth2_server->validateAuthorizeRequest($request, $response)) {
|
|
||||||
$response->send();
|
|
||||||
killme();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// display an authorization form
|
function post() {
|
||||||
if (empty($_POST)) {
|
if (! local_channel()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return '
|
$storage = new OAuth2Storage(\DBA::$dba->db);
|
||||||
<form method="post">
|
$s = new \Zotlabs\Identity\OAuth2Server($storage);
|
||||||
<label>Do You Authorize TestClient?</label><br />
|
|
||||||
<input type="submit" name="authorized" value="yes">
|
|
||||||
<input type="submit" name="authorized" value="no">
|
|
||||||
</form>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// print the authorization code if the user has authorized your client
|
// TODO: The automatic client registration protocol below should adhere more
|
||||||
$is_authorized = ($_POST['authorized'] === 'yes');
|
// closely to "OAuth 2.0 Dynamic Client Registration Protocol" defined
|
||||||
$oauth2_server->handleAuthorizeRequest($request, $response, $is_authorized);
|
// at https://tools.ietf.org/html/rfc7591
|
||||||
if ($is_authorized) {
|
|
||||||
// this is only here so that you get to see your code in the cURL request. Otherwise,
|
|
||||||
// we'd redirect back to the client
|
|
||||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
|
||||||
echo("SUCCESS! Authorization Code: $code");
|
|
||||||
|
|
||||||
|
// If no client_id was provided, generate a new one.
|
||||||
|
if (x($_POST, 'client_id')) {
|
||||||
|
$client_id = $_POST['client_id'];
|
||||||
|
} else {
|
||||||
|
$client_id = $_POST['client_id'] = random_string(16);
|
||||||
|
}
|
||||||
|
// If no redirect_uri was provided, generate a fake one.
|
||||||
|
if (x($_POST, 'redirect_uri')) {
|
||||||
|
$redirect_uri = $_POST['redirect_uri'];
|
||||||
|
} else {
|
||||||
|
$redirect_uri = $_POST['redirect_uri'] = 'https://fake.example.com/oauth';
|
||||||
|
}
|
||||||
|
|
||||||
|
$request = \OAuth2\Request::createFromGlobals();
|
||||||
|
$response = new \OAuth2\Response();
|
||||||
|
|
||||||
|
// If the client is not registered, add to the database
|
||||||
|
if (!$client = $storage->getClientDetails($client_id)) {
|
||||||
|
$client_secret = random_string(16);
|
||||||
|
// Client apps are registered per channel
|
||||||
|
$user_id = local_channel();
|
||||||
|
$storage->setClientDetails($client_id, $client_secret, $redirect_uri, 'authorization_code', null, $user_id);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!$client = $storage->getClientDetails($client_id)) {
|
||||||
|
// There was an error registering the client.
|
||||||
|
$response->send();
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
$response->setParameter('client_secret', $client['client_secret']);
|
||||||
|
|
||||||
|
// validate the authorize request
|
||||||
|
if (!$s->validateAuthorizeRequest($request, $response)) {
|
||||||
|
$response->send();
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
|
// print the authorization code if the user has authorized your client
|
||||||
|
$is_authorized = ($_POST['authorize'] === 'allow');
|
||||||
|
$s->handleAuthorizeRequest($request, $response, $is_authorized, local_channel());
|
||||||
|
if ($is_authorized) {
|
||||||
|
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
|
||||||
|
logger('Authorization Code: ' . $code);
|
||||||
|
}
|
||||||
|
|
||||||
|
$response->send();
|
||||||
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
$response->send();
|
}
|
||||||
killme();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ class Cal extends \Zotlabs\Web\Controller {
|
|||||||
notice( t('Permissions denied.') . EOL);
|
notice( t('Permissions denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav_set_selected('Calendar');
|
||||||
|
|
||||||
$sql_extra = permissions_sql($channel['channel_id'],get_observer_hash(),'event');
|
$sql_extra = permissions_sql($channel['channel_id'],get_observer_hash(),'event');
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,22 @@ require_once('include/acl_selectors.php');
|
|||||||
class Cards extends \Zotlabs\Web\Controller {
|
class Cards extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
if(argc() > 1)
|
if(argc() > 1)
|
||||||
$which = argv(1);
|
$which = argv(1);
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
profile_load($which);
|
profile_load($which);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* @see \Zotlabs\Web\Controller::get()
|
||||||
|
*/
|
||||||
function get($update = 0, $load = false) {
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
if(observer_prohibited(true)) {
|
if(observer_prohibited(true)) {
|
||||||
return login();
|
return login();
|
||||||
}
|
}
|
||||||
@@ -31,13 +35,13 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! feature_enabled(\App::$profile_uid,'cards')) {
|
if(! feature_enabled(\App::$profile_uid, 'cards')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav_set_selected(t('Cards'));
|
nav_set_selected(t('Cards'));
|
||||||
|
|
||||||
head_add_link([
|
head_add_link([
|
||||||
'rel' => 'alternate',
|
'rel' => 'alternate',
|
||||||
'type' => 'application/json+oembed',
|
'type' => 'application/json+oembed',
|
||||||
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
|
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
|
||||||
@@ -46,48 +50,48 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
|
|
||||||
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
|
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
|
||||||
|
|
||||||
if($category) {
|
if($category) {
|
||||||
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
|
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$which = argv(1);
|
$which = argv(1);
|
||||||
|
|
||||||
$selected_card = ((argc() > 2) ? argv(2) : '');
|
$selected_card = ((argc() > 2) ? argv(2) : '');
|
||||||
|
|
||||||
$_SESSION['return_url'] = \App::$query_string;
|
$_SESSION['return_url'] = \App::$query_string;
|
||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
$owner = \App::$profile_uid;
|
$owner = \App::$profile_uid;
|
||||||
$observer = \App::get_observer();
|
$observer = \App::get_observer();
|
||||||
|
|
||||||
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||||
|
|
||||||
if(! perm_is_allowed($owner,$ob_hash,'view_pages')) {
|
if(! perm_is_allowed($owner, $ob_hash, 'view_pages')) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_owner = ($uid && $uid == $owner);
|
$is_owner = ($uid && $uid == $owner);
|
||||||
|
|
||||||
$channel = channelx_by_n($owner);
|
$channel = channelx_by_n($owner);
|
||||||
|
|
||||||
if($channel) {
|
if($channel) {
|
||||||
$channel_acl = array(
|
$channel_acl = [
|
||||||
'allow_cid' => $channel['channel_allow_cid'],
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
'allow_gid' => $channel['channel_allow_gid'],
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
'deny_cid' => $channel['channel_deny_cid'],
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
'deny_gid' => $channel['channel_deny_gid']
|
'deny_gid' => $channel['channel_deny_gid']
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
$channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(perm_is_allowed($owner,$ob_hash,'write_pages')) {
|
|
||||||
|
if(perm_is_allowed($owner, $ob_hash, 'write_pages')) {
|
||||||
|
|
||||||
$x = [
|
$x = [
|
||||||
'webpage' => ITEM_TYPE_CARD,
|
'webpage' => ITEM_TYPE_CARD,
|
||||||
@@ -95,9 +99,9 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
'content_label' => t('Add Card'),
|
'content_label' => t('Add Card'),
|
||||||
'button' => t('Create'),
|
'button' => t('Create'),
|
||||||
'nickname' => $channel['channel_address'],
|
'nickname' => $channel['channel_address'],
|
||||||
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|
||||||
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||||
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
|
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
|
||||||
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
|
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
|
||||||
'permissions' => $channel_acl,
|
'permissions' => $channel_acl,
|
||||||
'showacl' => (($is_owner) ? true : false),
|
'showacl' => (($is_owner) ? true : false),
|
||||||
@@ -110,7 +114,7 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
'layoutselect' => false,
|
'layoutselect' => false,
|
||||||
'expanded' => false,
|
'expanded' => false,
|
||||||
'novoting' => false,
|
'novoting' => false,
|
||||||
'catsenabled' => feature_enabled($owner,'categories'),
|
'catsenabled' => feature_enabled($owner, 'categories'),
|
||||||
'bbco_autocomplete' => 'bbcode',
|
'bbco_autocomplete' => 'bbcode',
|
||||||
'bbcode' => true
|
'bbcode' => true
|
||||||
];
|
];
|
||||||
@@ -119,28 +123,34 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
$x['title'] = $_REQUEST['title'];
|
$x['title'] = $_REQUEST['title'];
|
||||||
if($_REQUEST['body'])
|
if($_REQUEST['body'])
|
||||||
$x['body'] = $_REQUEST['body'];
|
$x['body'] = $_REQUEST['body'];
|
||||||
$editor = status_editor($a,$x);
|
|
||||||
|
|
||||||
|
$editor = status_editor($a, $x);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$editor = '';
|
$editor = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$itemspage = get_pconfig(local_channel(),'system','itemspage');
|
||||||
|
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
|
||||||
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||||
|
|
||||||
|
|
||||||
$sql_extra = item_permissions_sql($owner);
|
$sql_extra = item_permissions_sql($owner);
|
||||||
|
$sql_item = '';
|
||||||
|
|
||||||
if($selected_card) {
|
if($selected_card) {
|
||||||
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.v = '%s' limit 1",
|
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.v = '%s' limit 1",
|
||||||
dbesc($selected_card)
|
dbesc($selected_card)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
$sql_extra .= "and item.id = " . intval($r[0]['iid']) . " ";
|
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("select * from item
|
$r = q("select * from item
|
||||||
where item.uid = %d and item_type = %d
|
where uid = %d and item_type = %d
|
||||||
$sql_extra order by item.created desc",
|
$sql_extra $sql_item order by item.created desc $pager_sql",
|
||||||
intval($owner),
|
intval($owner),
|
||||||
intval(ITEM_TYPE_CARD)
|
intval(ITEM_TYPE_CARD)
|
||||||
);
|
);
|
||||||
@@ -149,9 +159,12 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
|
||||||
and item.item_blocked = 0 ";
|
and item.item_blocked = 0 ";
|
||||||
|
|
||||||
|
$items_result = [];
|
||||||
if($r) {
|
if($r) {
|
||||||
|
|
||||||
$parents_str = ids_to_querystr($r,'id');
|
$pager_total = count($r);
|
||||||
|
|
||||||
|
$parents_str = ids_to_querystr($r, 'id');
|
||||||
|
|
||||||
$items = q("SELECT item.*, item.id AS item_id
|
$items = q("SELECT item.*, item.id AS item_id
|
||||||
FROM item
|
FROM item
|
||||||
@@ -164,24 +177,27 @@ class Cards extends \Zotlabs\Web\Controller {
|
|||||||
if($items) {
|
if($items) {
|
||||||
xchan_query($items);
|
xchan_query($items);
|
||||||
$items = fetch_post_tags($items, true);
|
$items = fetch_post_tags($items, true);
|
||||||
$items = conv_sort($items,'updated');
|
$items_result = conv_sort($items, 'updated');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$items = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$mode = 'cards';
|
$mode = 'cards';
|
||||||
|
|
||||||
$content = conversation($items,$mode,false,'traditional');
|
if(get_pconfig(local_channel(),'system','articles_list_mode') && (! $selected_card))
|
||||||
|
$page_mode = 'pager_list';
|
||||||
|
else
|
||||||
|
$page_mode = 'traditional';
|
||||||
|
|
||||||
|
$content = conversation($items_result, $mode, false, $page_mode);
|
||||||
|
|
||||||
$o = replace_macros(get_markup_template('cards.tpl'), [
|
$o = replace_macros(get_markup_template('cards.tpl'), [
|
||||||
'$title' => t('Cards'),
|
'$title' => t('Cards'),
|
||||||
'$editor' => $editor,
|
'$editor' => $editor,
|
||||||
'$content' => $content,
|
'$content' => $content,
|
||||||
'$pager' => alt_pager($a,count($items))
|
'$pager' => alt_pager($pager_total)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Cdav extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
|
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
|
||||||
if($sigblock) {
|
if($sigblock) {
|
||||||
$keyId = $sigblock['keyId'];
|
$keyId = str_replace('acct:','',$sigblock['keyId']);
|
||||||
if($keyId) {
|
if($keyId) {
|
||||||
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
|
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
|
||||||
dbesc($keyId)
|
dbesc($keyId)
|
||||||
@@ -1250,7 +1250,7 @@ class Cdav extends \Zotlabs\Web\Controller {
|
|||||||
//create default addressbook
|
//create default addressbook
|
||||||
$carddavBackend = new \Sabre\CardDAV\Backend\PDO($pdo);
|
$carddavBackend = new \Sabre\CardDAV\Backend\PDO($pdo);
|
||||||
$properties = ['{DAV:}displayname' => t('Default Addressbook')];
|
$properties = ['{DAV:}displayname' => t('Default Addressbook')];
|
||||||
$carddavBackend->createAddressBook($uri, $default, $properties);
|
$carddavBackend->createAddressBook($uri, 'default', $properties);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
$_SESSION['loadtime'] = datetime_convert();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("SELECT distinct parent AS item_id, created from item
|
$r = q("SELECT parent AS item_id from item
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
WHERE uid = %d $item_normal_update
|
WHERE uid = %d $item_normal_update
|
||||||
AND item_wall = 1 $simple_update
|
AND item_wall = 1 $simple_update
|
||||||
@@ -239,7 +239,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($load || ($checkjs->disabled())) {
|
if($load || ($checkjs->disabled())) {
|
||||||
if($mid) {
|
if($mid) {
|
||||||
$r = q("SELECT distinct parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
||||||
AND item_wall = 1 $sql_extra limit 1",
|
AND item_wall = 1 $sql_extra limit 1",
|
||||||
dbesc($mid . '%'),
|
dbesc($mid . '%'),
|
||||||
intval(\App::$profile['profile_uid'])
|
intval(\App::$profile['profile_uid'])
|
||||||
@@ -249,13 +249,13 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$r = q("SELECT distinct id AS item_id, created FROM item
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
left join abook on item.author_xchan = abook.abook_xchan
|
left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
|
||||||
WHERE uid = %d $item_normal
|
WHERE true and item.uid = %d AND item.item_thread_top = 1 $item_normal
|
||||||
AND item_wall = 1 and item_thread_top = 1
|
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
AND (abook_blocked = 0 or abook.abook_flags is null)
|
AND item.item_wall = 1
|
||||||
$sql_extra $sql_extra2
|
$sql_extra $sql_extra2
|
||||||
ORDER BY created DESC $pager_sql ",
|
ORDER BY created DESC, id $pager_sql ",
|
||||||
intval(\App::$profile['profile_uid'])
|
intval(\App::$profile['profile_uid'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -312,8 +312,8 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
|
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
|
||||||
'$gid' => '0',
|
'$gid' => '0',
|
||||||
'$cid' => '0',
|
'$cid' => '0',
|
||||||
'$cmin' => '0',
|
'$cmin' => '(-1)',
|
||||||
'$cmax' => '0',
|
'$cmax' => '(-1)',
|
||||||
'$star' => '0',
|
'$star' => '0',
|
||||||
'$liked' => '0',
|
'$liked' => '0',
|
||||||
'$conv' => '0',
|
'$conv' => '0',
|
||||||
@@ -332,6 +332,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
|
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
|
||||||
'$mid' => $mid,
|
'$mid' => $mid,
|
||||||
'$verb' => '',
|
'$verb' => '',
|
||||||
|
'$net' => '',
|
||||||
'$dend' => $datequery,
|
'$dend' => $datequery,
|
||||||
'$dbegin' => $datequery2
|
'$dbegin' => $datequery2
|
||||||
));
|
));
|
||||||
@@ -379,7 +380,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((! $update) || ($checkjs->disabled())) {
|
if((! $update) || ($checkjs->disabled())) {
|
||||||
$o .= alt_pager($a,count($items));
|
$o .= alt_pager(count($items));
|
||||||
if ($mid && $items[0]['title'])
|
if ($mid && $items[0]['title'])
|
||||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Chanview extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
if($_REQUEST['address']) {
|
if($_REQUEST['address']) {
|
||||||
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
|
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
|
||||||
dbesc($_REQUEST['address'])
|
dbesc(punify($_REQUEST['address']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif(local_channel() && intval($_REQUEST['cid'])) {
|
elseif(local_channel() && intval($_REQUEST['cid'])) {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
|
|||||||
intval(\App::$data['chat']['room_id']),
|
intval(\App::$data['chat']['room_id']),
|
||||||
dbesc(get_observer_hash()),
|
dbesc(get_observer_hash()),
|
||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
dbesc($arr['chat_text'])
|
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
|
||||||
);
|
);
|
||||||
|
|
||||||
$ret['success'] = true;
|
$ret['success'] = true;
|
||||||
@@ -157,7 +157,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
|
|||||||
'name' => $rr['xchan_name'],
|
'name' => $rr['xchan_name'],
|
||||||
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
|
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
|
||||||
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
|
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
|
||||||
'text' => zidify_links(smilies(bbcode($rr['chat_text']))),
|
'text' => zidify_links(smilies(bbcode(base64url_decode(str_rot47($rr['chat_text']))))),
|
||||||
'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '')
|
'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,12 +57,18 @@ class Cloud extends \Zotlabs\Web\Controller {
|
|||||||
$auth->observer = $ob_hash;
|
$auth->observer = $ob_hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we arrived at this path with any query parameters in the url, build a clean url without
|
||||||
|
// them and redirect.
|
||||||
|
|
||||||
$_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
|
if(! array_key_exists('cloud_sort',$_SESSION)) {
|
||||||
$_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
|
$_SESSION['cloud_sort'] = 'name';
|
||||||
|
}
|
||||||
|
|
||||||
$_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
|
$_SESSION['cloud_sort'] = (($_REQUEST['sort']) ? trim(notags($_REQUEST['sort'])) : $_SESSION['cloud_sort']);
|
||||||
$_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
|
|
||||||
|
$x = clean_query_string();
|
||||||
|
if($x !== \App::$query_string)
|
||||||
|
goaway(z_root() . '/' . $x);
|
||||||
|
|
||||||
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
|
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
|
||||||
|
|
||||||
@@ -83,17 +89,45 @@ class Cloud extends \Zotlabs\Web\Controller {
|
|||||||
$server->addPlugin($browser);
|
$server->addPlugin($browser);
|
||||||
|
|
||||||
// Experimental QuotaPlugin
|
// Experimental QuotaPlugin
|
||||||
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
|
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
|
||||||
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
|
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
|
||||||
|
|
||||||
|
|
||||||
|
// over-ride the default XML output on thrown exceptions
|
||||||
|
|
||||||
|
$server->on('exception', [ $this, 'DAVException' ]);
|
||||||
|
|
||||||
// ob_start();
|
|
||||||
// All we need to do now, is to fire up the server
|
// All we need to do now, is to fire up the server
|
||||||
|
|
||||||
$server->exec();
|
$server->exec();
|
||||||
|
|
||||||
// ob_end_flush();
|
|
||||||
if($browser->build_page)
|
if($browser->build_page)
|
||||||
construct_page();
|
construct_page();
|
||||||
|
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function DAVException($err) {
|
||||||
|
|
||||||
|
if($err instanceof \Sabre\DAV\Exception\NotFound) {
|
||||||
|
notice( t('Not found') . EOL);
|
||||||
|
}
|
||||||
|
elseif($err instanceof \Sabre\DAV\Exception\Forbidden) {
|
||||||
|
notice( t('Permission denied') . EOL);
|
||||||
|
}
|
||||||
|
elseif($err instanceof \Sabre\DAV\Exception\NotImplemented) {
|
||||||
|
notice( t('Please refresh page') . EOL);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
notice( t('Unknown error') . EOL);
|
||||||
|
}
|
||||||
|
|
||||||
|
construct_page();
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
21
Zotlabs/Module/Cloud_tiles.php
Normal file
21
Zotlabs/Module/Cloud_tiles.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
class Cloud_tiles extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
if(intval($_SESSION['cloud_tiles']))
|
||||||
|
$_SESSION['cloud_tiles'] = 0;
|
||||||
|
else
|
||||||
|
$_SESSION['cloud_tiles'] = 1;
|
||||||
|
|
||||||
|
if(local_channel()) {
|
||||||
|
set_pconfig(local_channel(),'system','cloud_tiles',$_SESSION['cloud_tiles']);
|
||||||
|
}
|
||||||
|
|
||||||
|
goaway(z_root() . '/' . hex2bin(argv(1)));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
nav_set_selected('Connections');
|
nav_set_selected('Connections');
|
||||||
|
|
||||||
|
$active = false;
|
||||||
$blocked = false;
|
$blocked = false;
|
||||||
$hidden = false;
|
$hidden = false;
|
||||||
$ignored = false;
|
$ignored = false;
|
||||||
@@ -44,11 +45,16 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
if(! $_REQUEST['aj'])
|
if(! $_REQUEST['aj'])
|
||||||
$_SESSION['return_url'] = \App::$query_string;
|
$_SESSION['return_url'] = \App::$query_string;
|
||||||
|
|
||||||
$search_flags = '';
|
$search_flags = "";
|
||||||
$head = '';
|
$head = '';
|
||||||
|
|
||||||
if(argc() == 2) {
|
if(argc() == 2) {
|
||||||
switch(argv(1)) {
|
switch(argv(1)) {
|
||||||
|
case 'active':
|
||||||
|
$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 AND abook_not_here = 0 ";
|
||||||
|
$head = t('Active');
|
||||||
|
$active = true;
|
||||||
|
break;
|
||||||
case 'blocked':
|
case 'blocked':
|
||||||
$search_flags = " and abook_blocked = 1 ";
|
$search_flags = " and abook_blocked = 1 ";
|
||||||
$head = t('Blocked');
|
$head = t('Blocked');
|
||||||
@@ -101,8 +107,9 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
case 'all':
|
case 'all':
|
||||||
$head = t('All');
|
$head = t('All');
|
||||||
default:
|
default:
|
||||||
$search_flags = '';
|
$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 and abook_not_here = 0 ";
|
||||||
$all = true;
|
$active = true;
|
||||||
|
$head = t('Active');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -129,6 +136,13 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
),
|
),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'active' => array(
|
||||||
|
'label' => t('Active Connections'),
|
||||||
|
'url' => z_root() . '/connections/active',
|
||||||
|
'sel' => ($active) ? 'active' : '',
|
||||||
|
'title' => t('Show active connections'),
|
||||||
|
),
|
||||||
|
|
||||||
'pending' => array(
|
'pending' => array(
|
||||||
'label' => t('New Connections'),
|
'label' => t('New Connections'),
|
||||||
'url' => z_root() . '/connections/pending',
|
'url' => z_root() . '/connections/pending',
|
||||||
@@ -136,12 +150,6 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
'title' => t('Show pending (new) connections'),
|
'title' => t('Show pending (new) connections'),
|
||||||
),
|
),
|
||||||
|
|
||||||
'all' => array(
|
|
||||||
'label' => t('All Connections'),
|
|
||||||
'url' => z_root() . '/connections/all',
|
|
||||||
'sel' => ($all) ? 'active' : '',
|
|
||||||
'title' => t('Show all connections'),
|
|
||||||
),
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
array(
|
array(
|
||||||
@@ -187,6 +195,13 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
// 'title' => t('Only show one-way connections'),
|
// 'title' => t('Only show one-way connections'),
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
|
|
||||||
|
'all' => array(
|
||||||
|
'label' => t('All Connections'),
|
||||||
|
'url' => z_root() . '/connections',
|
||||||
|
'sel' => ($all) ? 'active' : '',
|
||||||
|
'title' => t('Show all connections'),
|
||||||
|
),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -232,12 +247,13 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
if($rr['xchan_url']) {
|
if($rr['xchan_url']) {
|
||||||
|
|
||||||
if(($rr['vcard']) && is_array($rr['vcard']['tels']) && $rr['vcard']['tels'][0]['nr'])
|
if(($rr['vcard']) && is_array($rr['vcard']['tels']) && $rr['vcard']['tels'][0]['nr'])
|
||||||
$phone = ((\App::$is_mobile || \App::$is_tablet) ? $rr['vcard']['tels'][0]['nr'] : '');
|
$phone = $rr['vcard']['tels'][0]['nr'];
|
||||||
else
|
else
|
||||||
$phone = '';
|
$phone = '';
|
||||||
|
|
||||||
$status_str = '';
|
$status_str = '';
|
||||||
$status = array(
|
$status = array(
|
||||||
|
((intval($rr['abook_active'])) ? t('Active') : ''),
|
||||||
((intval($rr['abook_pending'])) ? t('Pending approval') : ''),
|
((intval($rr['abook_pending'])) ? t('Pending approval') : ''),
|
||||||
((intval($rr['abook_archived'])) ? t('Archived') : ''),
|
((intval($rr['abook_archived'])) ? t('Archived') : ''),
|
||||||
((intval($rr['abook_hidden'])) ? t('Hidden') : ''),
|
((intval($rr['abook_hidden'])) ? t('Hidden') : ''),
|
||||||
@@ -245,6 +261,11 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
((intval($rr['abook_blocked'])) ? t('Blocked') : ''),
|
((intval($rr['abook_blocked'])) ? t('Blocked') : ''),
|
||||||
((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '')
|
((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$oneway = false;
|
||||||
|
if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) {
|
||||||
|
$oneway = true;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($status as $str) {
|
foreach($status as $str) {
|
||||||
if(!$str)
|
if(!$str)
|
||||||
@@ -283,7 +304,8 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
'ignore_hover' => t('Ignore connection'),
|
'ignore_hover' => t('Ignore connection'),
|
||||||
'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false),
|
'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false),
|
||||||
'recent_label' => t('Recent activity'),
|
'recent_label' => t('Recent activity'),
|
||||||
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id'])
|
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']),
|
||||||
|
'oneway' => $oneway
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,7 +326,7 @@ class Connections extends \Zotlabs\Web\Controller {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
|
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
|
||||||
$o .= replace_macros(get_markup_template('connections.tpl'),array(
|
$o .= replace_macros(get_markup_template('connections.tpl'),array(
|
||||||
'$header' => t('Connections') . (($head) ? ': ' . $head : ''),
|
'$header' => t('Connections') . (($head) ? ': ' . $head : ''),
|
||||||
'$tabs' => $tabs,
|
'$tabs' => $tabs,
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
$contact_id = \App::$poi['abook_id'];
|
$contact_id = \App::$poi['abook_id'];
|
||||||
$contact = \App::$poi;
|
$contact = \App::$poi;
|
||||||
|
|
||||||
$cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 order by xchan_name",
|
$cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and xchan_deleted = 0 order by xchan_name",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -826,27 +826,10 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$locstr = '';
|
$locstr = locations_by_netid($contact['xchan_hash']);
|
||||||
|
if(! $locstr)
|
||||||
|
$locstr = unpunify($contact['xchan_url']);
|
||||||
|
|
||||||
$locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s'
|
|
||||||
and hubloc_deleted = 0 and site_dead = 0",
|
|
||||||
dbesc($contact['xchan_hash'])
|
|
||||||
);
|
|
||||||
|
|
||||||
if($locs) {
|
|
||||||
foreach($locs as $l) {
|
|
||||||
if(!($l['location']))
|
|
||||||
continue;
|
|
||||||
if(strpos($locstr,$l['location']) !== false)
|
|
||||||
continue;
|
|
||||||
if(strlen($locstr))
|
|
||||||
$locstr .= ', ';
|
|
||||||
$locstr .= $l['location'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$locstr = $contact['xchan_url'];
|
|
||||||
|
|
||||||
$clone_warn = '';
|
$clone_warn = '';
|
||||||
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
|
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
|
||||||
if(! $clonable) {
|
if(! $clonable) {
|
||||||
@@ -866,11 +849,11 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
$o .= replace_macros($tpl, [
|
$o .= replace_macros($tpl, [
|
||||||
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
|
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
|
||||||
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no),
|
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no),
|
||||||
'$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ],
|
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
|
||||||
'$permcat_new' => t('Add permission role'),
|
'$permcat_new' => t('Add permission role'),
|
||||||
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
|
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
|
||||||
'$addr' => $contact['xchan_addr'],
|
'$addr' => unpunify($contact['xchan_addr']),
|
||||||
'$primeurl' => $contact['xchan_url'],
|
'$primeurl' => unpunify($contact['xchan_url']),
|
||||||
'$section' => $section,
|
'$section' => $section,
|
||||||
'$sections' => $sections,
|
'$sections' => $sections,
|
||||||
'$vcard' => $vcard,
|
'$vcard' => $vcard,
|
||||||
@@ -912,7 +895,6 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
'$permnote_self' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'),
|
'$permnote_self' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'),
|
||||||
'$lastupdtext' => t('Last update:'),
|
'$lastupdtext' => t('Last update:'),
|
||||||
'$last_update' => relative_date($contact['abook_connected']),
|
'$last_update' => relative_date($contact['abook_connected']),
|
||||||
'$is_mobile' => ((\App::$is_mobile || \App::$is_tablet) ? true : false),
|
|
||||||
'$profile_select' => contact_profile_assign($contact['abook_profile']),
|
'$profile_select' => contact_profile_assign($contact['abook_profile']),
|
||||||
'$multiprofs' => $multiprofs,
|
'$multiprofs' => $multiprofs,
|
||||||
'$contact_id' => $contact['abook_id'],
|
'$contact_id' => $contact['abook_id'],
|
||||||
|
|||||||
@@ -64,12 +64,12 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
|||||||
$image_id = substr($image_id,0,-2);
|
$image_id = substr($image_id,0,-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$srcX = $_POST['xstart'];
|
|
||||||
$srcY = $_POST['ystart'];
|
$srcX = intval($_POST['xstart']);
|
||||||
$srcW = $_POST['xfinal'] - $srcX;
|
$srcY = intval($_POST['ystart']);
|
||||||
$srcH = $_POST['yfinal'] - $srcY;
|
$srcW = intval($_POST['xfinal']) - $srcX;
|
||||||
|
$srcH = intval($_POST['yfinal']) - $srcY;
|
||||||
|
|
||||||
$r = q("select gender from profile where uid = %d and is_default = 1 limit 1",
|
$r = q("select gender from profile where uid = %d and is_default = 1 limit 1",
|
||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
@@ -207,7 +207,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$imagedata = (($os_storage) ? @file_get_contents($imagedata) : $imagedata);
|
$imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata));
|
||||||
$ph = photo_factory($imagedata, $filetype);
|
$ph = photo_factory($imagedata, $filetype);
|
||||||
|
|
||||||
if(! $ph->is_valid()) {
|
if(! $ph->is_valid()) {
|
||||||
@@ -355,14 +355,27 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'$user' => \App::$channel['channel_address'],
|
'$user' => \App::$channel['channel_address'],
|
||||||
|
'$info' => t('Your cover photo may be visible to anybody on the internet'),
|
||||||
|
'$existing' => get_cover_photo(local_channel(),'array',PHOTO_RES_COVER_850),
|
||||||
'$lbl_upfile' => t('Upload File:'),
|
'$lbl_upfile' => t('Upload File:'),
|
||||||
'$lbl_profiles' => t('Select a profile:'),
|
'$lbl_profiles' => t('Select a profile:'),
|
||||||
'$title' => t('Upload Cover Photo'),
|
'$title' => t('Change Cover Photo'),
|
||||||
'$submit' => t('Upload'),
|
'$submit' => t('Upload'),
|
||||||
'$profiles' => $profiles,
|
'$profiles' => $profiles,
|
||||||
|
'$embedPhotos' => t('Use a photo from your albums'),
|
||||||
|
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
|
||||||
|
'$embedPhotosModalCancel' => t('Cancel'),
|
||||||
|
'$embedPhotosModalOK' => t('OK'),
|
||||||
|
'$modalchooseimages' => t('Choose images to embed'),
|
||||||
|
'$modalchoosealbum' => t('Choose an album'),
|
||||||
|
'$modaldiffalbum' => t('Choose a different album'),
|
||||||
|
'$modalerrorlist' => t('Error getting album list'),
|
||||||
|
'$modalerrorlink' => t('Error getting photo link'),
|
||||||
|
'$modalerroralbum' => t('Error getting album'),
|
||||||
'$form_security_token' => get_form_security_token("cover_photo"),
|
'$form_security_token' => get_form_security_token("cover_photo"),
|
||||||
/// @FIXME - yuk
|
/// @FIXME - yuk
|
||||||
'$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . z_root() . '">' . t('skip this step') . '</a>' : '<a href="'. z_root() . '/photos/' . \App::$channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>')
|
'$select' => t('Select existing photo'),
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
call_hooks('cover_photo_content_end', $o);
|
call_hooks('cover_photo_content_end', $o);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class Dav extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
|
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
|
||||||
if($sigblock) {
|
if($sigblock) {
|
||||||
$keyId = $sigblock['keyId'];
|
$keyId = str_replace('acct:','',$sigblock['keyId']);
|
||||||
if($keyId) {
|
if($keyId) {
|
||||||
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
|
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
|
||||||
dbesc($keyId)
|
dbesc($keyId)
|
||||||
|
|||||||
267
Zotlabs/Module/Defperms.php
Normal file
267
Zotlabs/Module/Defperms.php
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
<?php
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
require_once('include/socgraph.php');
|
||||||
|
require_once('include/selectors.php');
|
||||||
|
require_once('include/group.php');
|
||||||
|
require_once('include/photos.php');
|
||||||
|
|
||||||
|
|
||||||
|
class Defperms extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
/* @brief Initialize the connection-editor
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
if(! local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$r = q("SELECT abook.*, xchan.*
|
||||||
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
|
WHERE abook_self = 1 and abook_channel = %d LIMIT 1",
|
||||||
|
intval(local_channel())
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
\App::$poi = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
if($channel)
|
||||||
|
head_set_icon($channel['xchan_photo_s']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* @brief Evaluate posted values and set changes
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function post() {
|
||||||
|
|
||||||
|
if(! local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$contact_id = intval(argv(1));
|
||||||
|
if(! $contact_id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
||||||
|
intval($contact_id),
|
||||||
|
intval(local_channel())
|
||||||
|
);
|
||||||
|
|
||||||
|
if(! $orig_record) {
|
||||||
|
notice( t('Could not access contact record.') . EOL);
|
||||||
|
goaway(z_root() . '/connections');
|
||||||
|
return; // NOTREACHED
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(intval($orig_record[0]['abook_self'])) {
|
||||||
|
$autoperms = intval($_POST['autoperms']);
|
||||||
|
$is_self = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$autoperms = null;
|
||||||
|
$is_self = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$all_perms = \Zotlabs\Access\Permissions::Perms();
|
||||||
|
|
||||||
|
if($all_perms) {
|
||||||
|
foreach($all_perms as $perm => $desc) {
|
||||||
|
|
||||||
|
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$perm);
|
||||||
|
$inherited = (($checkinherited & PERMS_SPECIFIC) ? false : true);
|
||||||
|
|
||||||
|
if(array_key_exists('perms_' . $perm, $_POST)) {
|
||||||
|
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,
|
||||||
|
intval($_POST['perms_' . $perm]));
|
||||||
|
if($autoperms) {
|
||||||
|
set_pconfig($channel['channel_id'],'autoperms',$perm,intval($_POST['perms_' . $perm]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,0);
|
||||||
|
if($autoperms) {
|
||||||
|
set_pconfig($channel['channel_id'],'autoperms',$perm,0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! is_null($autoperms))
|
||||||
|
set_pconfig($channel['channel_id'],'system','autoperms',$autoperms);
|
||||||
|
|
||||||
|
|
||||||
|
notice( t('Settings updated.') . EOL);
|
||||||
|
|
||||||
|
|
||||||
|
// Refresh the structure in memory with the new data
|
||||||
|
|
||||||
|
$r = q("SELECT abook.*, xchan.*
|
||||||
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
|
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
|
||||||
|
intval(local_channel()),
|
||||||
|
intval($contact_id)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
\App::$poi = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$this->defperms_clone($a);
|
||||||
|
|
||||||
|
goaway(z_root() . '/defperms');
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @brief Clone connection
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function defperms_clone(&$a) {
|
||||||
|
|
||||||
|
if(! \App::$poi)
|
||||||
|
return;
|
||||||
|
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
$r = q("SELECT abook.*, xchan.*
|
||||||
|
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||||
|
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
|
||||||
|
intval(local_channel()),
|
||||||
|
intval(\App::$poi['abook_id'])
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
\App::$poi = array_shift($r);
|
||||||
|
}
|
||||||
|
|
||||||
|
$clone = \App::$poi;
|
||||||
|
|
||||||
|
unset($clone['abook_id']);
|
||||||
|
unset($clone['abook_account']);
|
||||||
|
unset($clone['abook_channel']);
|
||||||
|
|
||||||
|
$abconfig = load_abconfig($channel['channel_id'],$clone['abook_xchan']);
|
||||||
|
if($abconfig)
|
||||||
|
$clone['abconfig'] = $abconfig;
|
||||||
|
|
||||||
|
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @brief Generate content of connection default permissions page
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
|
||||||
|
$sort_type = 0;
|
||||||
|
$o = '';
|
||||||
|
|
||||||
|
if(! local_channel()) {
|
||||||
|
notice( t('Permission denied.') . EOL);
|
||||||
|
return login();
|
||||||
|
}
|
||||||
|
|
||||||
|
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
$yes_no = array(t('No'),t('Yes'));
|
||||||
|
|
||||||
|
$connect_perms = \Zotlabs\Access\Permissions::connect_perms(local_channel());
|
||||||
|
|
||||||
|
$o .= "<script>function connectDefaultShare() {
|
||||||
|
\$('.abook-edit-me').each(function() {
|
||||||
|
if(! $(this).is(':disabled'))
|
||||||
|
$(this).prop('checked', false);
|
||||||
|
});\n\n";
|
||||||
|
foreach($connect_perms['perms'] as $p => $v) {
|
||||||
|
if($v) {
|
||||||
|
$o .= "\$('#me_id_perms_" . $p . "').prop('checked', true); \n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$o .= " }\n</script>\n";
|
||||||
|
|
||||||
|
if(\App::$poi) {
|
||||||
|
|
||||||
|
$sections = [];
|
||||||
|
|
||||||
|
$self = false;
|
||||||
|
|
||||||
|
$tpl = get_markup_template('defperms.tpl');
|
||||||
|
|
||||||
|
|
||||||
|
$perms = array();
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
$contact = \App::$poi;
|
||||||
|
|
||||||
|
$global_perms = \Zotlabs\Access\Permissions::Perms();
|
||||||
|
|
||||||
|
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
|
||||||
|
$hidden_perms = [];
|
||||||
|
|
||||||
|
foreach($global_perms as $k => $v) {
|
||||||
|
$thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k);
|
||||||
|
|
||||||
|
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k);
|
||||||
|
|
||||||
|
$inherited = (($checkinherited & PERMS_SPECIFIC) ? false : true);
|
||||||
|
|
||||||
|
$perms[] = [ 'perms_' . $k, $v, intval($thisperm), '', $yes_no, (($inherited) ? ' disabled="disabled" ' : '') ];
|
||||||
|
if($inherited) {
|
||||||
|
$hidden_perms[] = [ 'perms_' . $k, intval($thisperm) ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pcat = new \Zotlabs\Lib\Permcat(local_channel());
|
||||||
|
$pcatlist = $pcat->listing();
|
||||||
|
$permcats = [];
|
||||||
|
if($pcatlist) {
|
||||||
|
foreach($pcatlist as $pc) {
|
||||||
|
$permcats[$pc['name']] = $pc['localname'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$o .= replace_macros($tpl, [
|
||||||
|
'$header' => t('Connection Default Permissions'),
|
||||||
|
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no),
|
||||||
|
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
|
||||||
|
'$permcat_new' => t('Add permission role'),
|
||||||
|
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
|
||||||
|
'$section' => $section,
|
||||||
|
'$sections' => $sections,
|
||||||
|
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),
|
||||||
|
'$autoapprove' => t('Automatic approval settings'),
|
||||||
|
'$unapproved' => $unapproved,
|
||||||
|
'$inherited' => t('inherited'),
|
||||||
|
'$submit' => t('Submit'),
|
||||||
|
'$me' => t('My Settings'),
|
||||||
|
'$perms' => $perms,
|
||||||
|
'$hidden_perms' => $hidden_perms,
|
||||||
|
'$permlbl' => t('Individual Permissions'),
|
||||||
|
'$permnote_self' => t('Some individual permissions may have been preset or locked based on your channel type and privacy settings.'),
|
||||||
|
'$contact_id' => $contact['abook_id'],
|
||||||
|
'$name' => $contact['xchan_name'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$arr = array('contact' => $contact,'output' => $o);
|
||||||
|
|
||||||
|
call_hooks('contact_edit', $arr);
|
||||||
|
|
||||||
|
return $arr['output'];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
dbesc($_GET['ignore'])
|
dbesc($_GET['ignore'])
|
||||||
);
|
);
|
||||||
goaway(z_root() . '/directory?suggest=1');
|
goaway(z_root() . '/directory?f=&suggest=1');
|
||||||
}
|
}
|
||||||
|
|
||||||
$observer = get_observer_hash();
|
$observer = get_observer_hash();
|
||||||
@@ -64,6 +64,11 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(get_config('system','block_public_directory',false) && (! get_observer_hash())) {
|
||||||
|
notice( t('Public access denied.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$observer = get_observer_hash();
|
$observer = get_observer_hash();
|
||||||
|
|
||||||
$globaldir = get_directory_setting($observer, 'globaldir');
|
$globaldir = get_directory_setting($observer, 'globaldir');
|
||||||
@@ -96,13 +101,18 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
if($suggest) {
|
if($suggest) {
|
||||||
|
|
||||||
$r = suggestion_query(local_channel(),get_observer_hash());
|
$r = suggestion_query(local_channel(),get_observer_hash());
|
||||||
|
|
||||||
|
if(! $r) {
|
||||||
|
notice( t('No default suggestions were found.') . EOL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remember in which order the suggestions were
|
// Remember in which order the suggestions were
|
||||||
$addresses = array();
|
$addresses = array();
|
||||||
$common = array();
|
$common = array();
|
||||||
$index = 0;
|
$index = 0;
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$common[$rr['xchan_addr']] = $rr['total'];
|
$common[$rr['xchan_addr']] = ((intval($rr['total']) > 0) ? intval($rr['total']) - 1 : 0);
|
||||||
$addresses[$rr['xchan_addr']] = $index++;
|
$addresses[$rr['xchan_addr']] = $index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,9 +299,9 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
if(strlen($out))
|
if(strlen($out))
|
||||||
$out .= ', ';
|
$out .= ', ';
|
||||||
if($marr && in_arrayi($k,$marr))
|
if($marr && in_arrayi($k,$marr))
|
||||||
$out .= '<strong>' . $k . '</strong>';
|
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'"><strong>' . $k . '</strong></a>';
|
||||||
else
|
else
|
||||||
$out .= $k;
|
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'">' . $k . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +344,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '',
|
'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '',
|
||||||
'ignore_label' => t('Don\'t suggest'),
|
'ignore_label' => t('Don\'t suggest'),
|
||||||
'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''),
|
'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''),
|
||||||
'common_label' => t('Common connections:'),
|
'common_label' => t('Common connections (estimated):'),
|
||||||
'common_count' => intval($common[$rr['address']]),
|
'common_count' => intval($common[$rr['address']]),
|
||||||
'safe' => $safe_mode
|
'safe' => $safe_mode
|
||||||
);
|
);
|
||||||
@@ -385,7 +395,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$dirtitle = (($globaldir) ? t('Global Directory') : t('Local Directory'));
|
$dirtitle = (($globaldir) ? t('Global Directory') : t('Local Directory'));
|
||||||
|
|
||||||
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; divmore_height = " . intval($maxheight) . "; </script>";
|
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; divmore_height = " . intval($maxheight) . "; </script>";
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$search' => $search,
|
'$search' => $search,
|
||||||
'$desc' => t('Find'),
|
'$desc' => t('Find'),
|
||||||
@@ -394,7 +404,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
|||||||
'$entries' => $entries,
|
'$entries' => $entries,
|
||||||
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
|
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
|
||||||
'$submit' => t('Find'),
|
'$submit' => t('Find'),
|
||||||
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
|
'$next' => alt_pager($j['records'], t('next page'), t('previous page')),
|
||||||
'$sort' => t('Sort options'),
|
'$sort' => t('Sort options'),
|
||||||
'$normal' => t('Alphabetic'),
|
'$normal' => t('Alphabetic'),
|
||||||
'$reverse' => t('Reverse Alphabetic'),
|
'$reverse' => t('Reverse Alphabetic'),
|
||||||
|
|||||||
@@ -97,7 +97,10 @@ class Dirsearch extends \Zotlabs\Web\Controller {
|
|||||||
else
|
else
|
||||||
$sync = false;
|
$sync = false;
|
||||||
|
|
||||||
|
if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) {
|
||||||
|
$hub = \App::get_hostname();
|
||||||
|
}
|
||||||
|
|
||||||
if($hub)
|
if($hub)
|
||||||
$hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
$hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
||||||
else
|
else
|
||||||
@@ -313,7 +316,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$ret['results'] = $entries;
|
$ret['results'] = $entries;
|
||||||
if($kw) {
|
if($kw) {
|
||||||
$k = dir_tagadelic($kw);
|
$k = dir_tagadelic($kw, $hub);
|
||||||
if($k) {
|
if($k) {
|
||||||
$ret['keywords'] = array();
|
$ret['keywords'] = array();
|
||||||
foreach($k as $kv) {
|
foreach($k as $kv) {
|
||||||
|
|||||||
@@ -12,6 +12,15 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
function get($update = 0, $load = false) {
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
|
$module_format = 'html';
|
||||||
|
|
||||||
|
|
||||||
|
if(argc() > 1) {
|
||||||
|
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
|
||||||
|
if(! in_array($module_format,['atom','zot','json']))
|
||||||
|
$module_format = 'html';
|
||||||
|
}
|
||||||
|
|
||||||
$checkjs = new \Zotlabs\Web\CheckJS(1);
|
$checkjs = new \Zotlabs\Web\CheckJS(1);
|
||||||
|
|
||||||
if($load)
|
if($load)
|
||||||
@@ -22,8 +31,12 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argc() > 1 && argv(1) !== 'load')
|
if(argc() > 1) {
|
||||||
$item_hash = argv(1);
|
$item_hash = argv(1);
|
||||||
|
if($module_format !== 'html') {
|
||||||
|
$item_hash = substr($item_hash,0,strrpos($item_hash,'.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($_REQUEST['mid'])
|
if($_REQUEST['mid'])
|
||||||
$item_hash = $_REQUEST['mid'];
|
$item_hash = $_REQUEST['mid'];
|
||||||
@@ -44,28 +57,28 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$channel_acl = array(
|
$channel_acl = array(
|
||||||
'allow_cid' => $channel['channel_allow_cid'],
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
'allow_gid' => $channel['channel_allow_gid'],
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
'deny_cid' => $channel['channel_deny_cid'],
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
'deny_gid' => $channel['channel_deny_gid']
|
'deny_gid' => $channel['channel_deny_gid']
|
||||||
);
|
);
|
||||||
|
|
||||||
$x = array(
|
$x = array(
|
||||||
'is_owner' => true,
|
'is_owner' => true,
|
||||||
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
|
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
|
||||||
'default_location' => $channel['channel_location'],
|
'default_location' => $channel['channel_location'],
|
||||||
'nickname' => $channel['channel_address'],
|
'nickname' => $channel['channel_address'],
|
||||||
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||||
|
|
||||||
'acl' => populate_acl($channel_acl),
|
'acl' => populate_acl($channel_acl),
|
||||||
'permissions' => $channel_acl,
|
'permissions' => $channel_acl,
|
||||||
'bang' => '',
|
'bang' => '',
|
||||||
'visitor' => true,
|
'visitor' => true,
|
||||||
'profile_uid' => local_channel(),
|
'profile_uid' => local_channel(),
|
||||||
'return_path' => 'channel/' . $channel['channel_address'],
|
'return_path' => 'channel/' . $channel['channel_address'],
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'editor_autocomplete' => true,
|
'editor_autocomplete' => true,
|
||||||
'bbco_autocomplete' => 'bbcode',
|
'bbco_autocomplete' => 'bbcode',
|
||||||
'bbcode' => true,
|
'bbcode' => true,
|
||||||
'jotnets' => true
|
'jotnets' => true
|
||||||
);
|
);
|
||||||
|
|
||||||
$o = '<div id="jot-popup">';
|
$o = '<div id="jot-popup">';
|
||||||
@@ -89,7 +102,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
if($decoded)
|
if($decoded)
|
||||||
$item_hash = $decoded;
|
$item_hash = $decoded;
|
||||||
|
|
||||||
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
|
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where mid like '%s' limit 1",
|
||||||
dbesc($item_hash . '%')
|
dbesc($item_hash . '%')
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -97,6 +110,14 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$target_item = $r[0];
|
$target_item = $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||||
|
dbesc($target_item['author_xchan'])
|
||||||
|
);
|
||||||
|
if($x) {
|
||||||
|
// not yet ready for prime time
|
||||||
|
// \App::$poi = $x[0];
|
||||||
|
}
|
||||||
|
|
||||||
//if the item is to be moderated redirect to /moderate
|
//if the item is to be moderated redirect to /moderate
|
||||||
if($target_item['item_blocked'] == ITEM_MODERATED) {
|
if($target_item['item_blocked'] == ITEM_MODERATED) {
|
||||||
goaway(z_root() . '/moderate/' . $target_item['id']);
|
goaway(z_root() . '/moderate/' . $target_item['id']);
|
||||||
@@ -111,7 +132,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$y = q("select * from iconfig left join item on iconfig.iid = item.id
|
$y = q("select * from iconfig left join item on iconfig.iid = item.id
|
||||||
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item.id = %d limit 1",
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item.id = %d limit 1",
|
||||||
intval($target_item['uid']),
|
intval($target_item['uid']),
|
||||||
intval($target_item['id'])
|
intval($target_item['parent'])
|
||||||
);
|
);
|
||||||
if($x && $y) {
|
if($x && $y) {
|
||||||
goaway(z_root() . '/page/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
|
goaway(z_root() . '/page/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
|
||||||
@@ -121,6 +142,41 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($target_item['item_type'] == ITEM_TYPE_ARTICLE) {
|
||||||
|
$x = q("select * from channel where channel_id = %d limit 1",
|
||||||
|
intval($target_item['uid'])
|
||||||
|
);
|
||||||
|
$y = q("select * from iconfig left join item on iconfig.iid = item.id
|
||||||
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and item.id = %d limit 1",
|
||||||
|
intval($target_item['uid']),
|
||||||
|
intval($target_item['parent'])
|
||||||
|
);
|
||||||
|
if($x && $y) {
|
||||||
|
goaway(z_root() . '/articles/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
notice( t('Page not found.') . EOL);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($target_item['item_type'] == ITEM_TYPE_CARD) {
|
||||||
|
$x = q("select * from channel where channel_id = %d limit 1",
|
||||||
|
intval($target_item['uid'])
|
||||||
|
);
|
||||||
|
$y = q("select * from iconfig left join item on iconfig.iid = item.id
|
||||||
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'CARD' and item.id = %d limit 1",
|
||||||
|
intval($target_item['uid']),
|
||||||
|
intval($target_item['parent'])
|
||||||
|
);
|
||||||
|
if($x && $y) {
|
||||||
|
goaway(z_root() . '/cards/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
notice( t('Page not found.') . EOL);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
||||||
|
|
||||||
@@ -139,10 +195,11 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
||||||
|
|
||||||
//if the target item is not a post (eg a like) we want to address its thread parent
|
// if the target item is not a post (eg a like) we want to address its thread parent
|
||||||
|
|
||||||
$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
|
$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
|
||||||
|
|
||||||
//if we got a decoded hash we must encode it again before handing to javascript
|
// if we got a decoded hash we must encode it again before handing to javascript
|
||||||
if($decoded)
|
if($decoded)
|
||||||
$mid = 'b64.' . base64url_encode($mid);
|
$mid = 'b64.' . base64url_encode($mid);
|
||||||
|
|
||||||
@@ -152,32 +209,33 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
|
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
|
||||||
'$baseurl' => z_root(),
|
'$baseurl' => z_root(),
|
||||||
'$pgtype' => 'display',
|
'$pgtype' => 'display',
|
||||||
'$uid' => '0',
|
'$uid' => '0',
|
||||||
'$gid' => '0',
|
'$gid' => '0',
|
||||||
'$cid' => '0',
|
'$cid' => '0',
|
||||||
'$cmin' => '0',
|
'$cmin' => '(-1)',
|
||||||
'$cmax' => '99',
|
'$cmax' => '(-1)',
|
||||||
'$star' => '0',
|
'$star' => '0',
|
||||||
'$liked' => '0',
|
'$liked' => '0',
|
||||||
'$conv' => '0',
|
'$conv' => '0',
|
||||||
'$spam' => '0',
|
'$spam' => '0',
|
||||||
'$fh' => '0',
|
'$fh' => '0',
|
||||||
'$nouveau' => '0',
|
'$nouveau' => '0',
|
||||||
'$wall' => '0',
|
'$wall' => '0',
|
||||||
'$static' => $static,
|
'$static' => $static,
|
||||||
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
|
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
|
||||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||||
'$search' => '',
|
'$search' => '',
|
||||||
'$xchan' => '',
|
'$xchan' => '',
|
||||||
'$order' => '',
|
'$order' => '',
|
||||||
'$file' => '',
|
'$file' => '',
|
||||||
'$cats' => '',
|
'$cats' => '',
|
||||||
'$tags' => '',
|
'$tags' => '',
|
||||||
'$dend' => '',
|
'$dend' => '',
|
||||||
'$dbegin' => '',
|
'$dbegin' => '',
|
||||||
'$verb' => '',
|
'$verb' => '',
|
||||||
'$mid' => $mid
|
'$net' => '',
|
||||||
|
'$mid' => $mid
|
||||||
));
|
));
|
||||||
|
|
||||||
head_add_link([
|
head_add_link([
|
||||||
@@ -195,11 +253,12 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$sql_extra = public_permissions_sql($observer_hash);
|
$sql_extra = public_permissions_sql($observer_hash);
|
||||||
|
|
||||||
if(($update && $load) || ($checkjs->disabled())) {
|
if(($update && $load) || ($checkjs->disabled()) || ($module_format !== 'html')) {
|
||||||
|
|
||||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
|
||||||
|
|
||||||
if($load || ($checkjs->disabled())) {
|
if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
@@ -220,7 +279,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($r === null) {
|
if(! $r) {
|
||||||
|
|
||||||
// in case somebody turned off public access to sys channel content using permissions
|
// in case somebody turned off public access to sys channel content using permissions
|
||||||
// make that content unsearchable by ensuring the owner uid can't match
|
// make that content unsearchable by ensuring the owner uid can't match
|
||||||
@@ -246,7 +305,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
elseif($update && !$load) {
|
elseif($update && !$load) {
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
$sys = get_sys_channel();
|
$sys = get_sys_channel();
|
||||||
$sysid = $sys['channel_id'];
|
$sysid = $sys['channel_id'];
|
||||||
@@ -266,12 +325,11 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($r === null) {
|
if(! $r) {
|
||||||
// in case somebody turned off public access to sys channel content using permissions
|
// in case somebody turned off public access to sys channel content using permissions
|
||||||
// make that content unsearchable by ensuring the owner_xchan can't match
|
// make that content unsearchable by ensuring the owner_xchan can't match
|
||||||
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
||||||
$sysid = 0;
|
$sysid = 0;
|
||||||
|
|
||||||
$r = q("SELECT item.parent AS item_id from item
|
$r = q("SELECT item.parent AS item_id from item
|
||||||
WHERE parent_mid = '%s'
|
WHERE parent_mid = '%s'
|
||||||
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
|
||||||
@@ -301,7 +359,6 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
WHERE parent in ( %s ) $item_normal ",
|
WHERE parent in ( %s ) $item_normal ",
|
||||||
dbesc($parents_str)
|
dbesc($parents_str)
|
||||||
);
|
);
|
||||||
|
|
||||||
xchan_query($items);
|
xchan_query($items);
|
||||||
$items = fetch_post_tags($items,true);
|
$items = fetch_post_tags($items,true);
|
||||||
$items = conv_sort($items,'created');
|
$items = conv_sort($items,'created');
|
||||||
@@ -311,13 +368,62 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$items = array();
|
$items = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($checkjs->disabled()) {
|
|
||||||
$o .= conversation($items, 'display', $update, 'traditional');
|
switch($module_format) {
|
||||||
if ($items[0]['title'])
|
|
||||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
case 'html':
|
||||||
}
|
|
||||||
else {
|
if ($checkjs->disabled()) {
|
||||||
$o .= conversation($items, 'display', $update, 'client');
|
$o .= conversation($items, 'display', $update, 'traditional');
|
||||||
|
if ($items[0]['title'])
|
||||||
|
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$o .= conversation($items, 'display', $update, 'client');
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'atom':
|
||||||
|
|
||||||
|
$atom = replace_macros(get_markup_template('atom_feed.tpl'), array(
|
||||||
|
'$version' => xmlify(\Zotlabs\Lib\System::get_project_version()),
|
||||||
|
'$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()),
|
||||||
|
'$generator_uri' => 'https://hubzilla.org',
|
||||||
|
'$feed_id' => xmlify(\App::$cmd),
|
||||||
|
'$feed_title' => xmlify(t('Article')),
|
||||||
|
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)),
|
||||||
|
'$author' => '',
|
||||||
|
'$owner' => '',
|
||||||
|
'$profile_page' => xmlify(z_root() . '/display/' . $target_item['mid']),
|
||||||
|
));
|
||||||
|
|
||||||
|
$x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ];
|
||||||
|
call_hooks('atom_feed_top',$x);
|
||||||
|
|
||||||
|
$atom = $x['xml'];
|
||||||
|
|
||||||
|
// a much simpler interface
|
||||||
|
call_hooks('atom_feed', $atom);
|
||||||
|
|
||||||
|
|
||||||
|
if($items) {
|
||||||
|
$type = 'html';
|
||||||
|
foreach($items as $item) {
|
||||||
|
if($item['item_private'])
|
||||||
|
continue;
|
||||||
|
$atom .= atom_entry($item, $type, null, '', true, '', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
call_hooks('atom_feed_end', $atom);
|
||||||
|
|
||||||
|
$atom .= '</feed>' . "\r\n";
|
||||||
|
|
||||||
|
header('Content-type: application/atom+xml');
|
||||||
|
echo $atom;
|
||||||
|
killme();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($updateable) {
|
if($updateable) {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class Editpost extends \Zotlabs\Web\Controller {
|
|||||||
'editor_autocomplete'=> true,
|
'editor_autocomplete'=> true,
|
||||||
'bbco_autocomplete'=> 'bbcode',
|
'bbco_autocomplete'=> 'bbcode',
|
||||||
'return_path' => $_SESSION['return_url'],
|
'return_path' => $_SESSION['return_url'],
|
||||||
'button' => t('Edit'),
|
'button' => t('Submit'),
|
||||||
'hide_voting' => true,
|
'hide_voting' => true,
|
||||||
'hide_future' => true,
|
'hide_future' => true,
|
||||||
'hide_location' => true,
|
'hide_location' => true,
|
||||||
|
|||||||
46
Zotlabs/Module/Email_resend.php
Normal file
46
Zotlabs/Module/Email_resend.php
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
class Email_resend extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function post() {
|
||||||
|
|
||||||
|
if($_POST['token']) {
|
||||||
|
if(! account_approve(trim($_POST['token']))) {
|
||||||
|
notice(t('Token verification failed.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
|
||||||
|
if(argc() > 1) {
|
||||||
|
$result = false;
|
||||||
|
$email = hex2bin(argv(1));
|
||||||
|
|
||||||
|
if($email) {
|
||||||
|
$result = verify_email_address( [ 'resend' => true, 'email' => $email ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if($result) {
|
||||||
|
notice(t('Email verification resent'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
notice(t('Unable to resend email verification message.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
goaway(z_root() . '/email_validation/' . bin2hex($email));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// @todo - one can provide a form here to resend the mail
|
||||||
|
// after directing to here if a succesful login was attempted from an unverified address.
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
Zotlabs/Module/Email_validation.php
Normal file
48
Zotlabs/Module/Email_validation.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
class Email_validation extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function post() {
|
||||||
|
|
||||||
|
$success = false;
|
||||||
|
if($_POST['token']) {
|
||||||
|
// This will redirect internally on success unless the channel is auto_created
|
||||||
|
if(account_approve(trim(basename($_POST['token'])))) {
|
||||||
|
$success = true;
|
||||||
|
if(get_config('system','auto_channel_create')) {
|
||||||
|
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
|
||||||
|
}
|
||||||
|
if($next_page) {
|
||||||
|
goaway(z_root() . '/' . $next_page);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(! $success) {
|
||||||
|
notice( t('Token verification failed.') . EOL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
|
||||||
|
if(argc() > 1) {
|
||||||
|
$email = hex2bin(argv(1));
|
||||||
|
}
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template('email_validation.tpl'), [
|
||||||
|
'$title' => t('Email Verification Required'),
|
||||||
|
'$desc' => sprintf( t('A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message.'),$email),
|
||||||
|
'$resend' => t('Resend Email'),
|
||||||
|
'$email' => bin2hex($email),
|
||||||
|
'$submit' => t('Submit'),
|
||||||
|
'$token' => [ 'token', t('Validation token'),'','' ],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
} else {
|
} else {
|
||||||
json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false));
|
json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false));
|
||||||
}
|
}
|
||||||
json_return_and_die(array('status' => true, 'photolink' => $photolink));
|
json_return_and_die(array('status' => true, 'photolink' => $photolink, 'resource_id' => $resource_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
|
|||||||
return '';
|
return '';
|
||||||
|
|
||||||
if($args['album'])
|
if($args['album'])
|
||||||
$album = $args['album'];
|
$album = (($args['album'] === '/') ? '' : $args['album']);
|
||||||
if($args['title'])
|
if($args['title'])
|
||||||
$title = $args['title'];
|
$title = $args['title'];
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,15 @@ class Feed extends \Zotlabs\Web\Controller {
|
|||||||
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
|
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
|
||||||
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
|
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
|
||||||
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
|
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
|
||||||
$params['start'] = ((x($params,'start')) ? intval($params['start']) : 0);
|
$params['start'] = ((x($_REQUEST,'start')) ? intval($_REQUEST['start']) : 0);
|
||||||
$params['records'] = ((x($params,'records')) ? intval($params['records']) : 40);
|
$params['records'] = ((x($_REQUEST,'records')) ? intval($_REQUEST['records']) : 40);
|
||||||
$params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc');
|
$params['direction'] = ((x($_REQUEST,'direction')) ? dbesc($_REQUEST['direction']) : 'desc');
|
||||||
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
|
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
|
||||||
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 0);
|
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 0);
|
||||||
|
|
||||||
|
if(! in_array($params['direction'],['asc','desc'])) {
|
||||||
|
$params['direction'] = 'desc';
|
||||||
|
}
|
||||||
|
|
||||||
if(argc() > 1) {
|
if(argc() > 1) {
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
|
|
||||||
// logger('file upload: ' . print_r($_REQUEST,true));
|
logger('file upload: ' . print_r($_REQUEST,true));
|
||||||
|
logger('file upload: ' . print_r($_FILES,true));
|
||||||
|
|
||||||
$channel = (($_REQUEST['channick']) ? channelx_by_nick($_REQUEST['channick']) : null);
|
$channel = (($_REQUEST['channick']) ? channelx_by_nick($_REQUEST['channick']) : null);
|
||||||
|
|
||||||
@@ -30,8 +31,8 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']);
|
$_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']);
|
||||||
$_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']);
|
$_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']);
|
||||||
$_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
|
$_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
|
||||||
$_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
|
$_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
|
||||||
|
|
||||||
if($_REQUEST['filename']) {
|
if($_REQUEST['filename']) {
|
||||||
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
|
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
|
||||||
@@ -47,6 +48,51 @@ class File_upload extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
$matches = [];
|
||||||
|
$partial = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) {
|
||||||
|
$pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches);
|
||||||
|
if($pm) {
|
||||||
|
logger('Content-Range: ' . print_r($matches,true));
|
||||||
|
$partial = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($partial) {
|
||||||
|
$x = save_chunk($channel,$matches[1],$matches[2],$matches[3]);
|
||||||
|
|
||||||
|
if($x['partial']) {
|
||||||
|
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
|
||||||
|
json_return_and_die($result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
|
||||||
|
|
||||||
|
$_FILES['userfile'] = [
|
||||||
|
'name' => $x['name'],
|
||||||
|
'type' => $x['type'],
|
||||||
|
'tmp_name' => $x['tmp_name'],
|
||||||
|
'error' => $x['error'],
|
||||||
|
'size' => $x['size']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(! array_key_exists('userfile',$_FILES)) {
|
||||||
|
$_FILES['userfile'] = [
|
||||||
|
'name' => $_FILES['files']['name'],
|
||||||
|
'type' => $_FILES['files']['type'],
|
||||||
|
'tmp_name' => $_FILES['files']['tmp_name'],
|
||||||
|
'error' => $_FILES['files']['error'],
|
||||||
|
'size' => $_FILES['files']['size']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
|
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
|
||||||
if($r['success']) {
|
if($r['success']) {
|
||||||
$sync = attach_export_data($channel,$r['data']['hash']);
|
$sync = attach_export_data($channel,$r['data']['hash']);
|
||||||
|
|||||||
@@ -103,6 +103,11 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
attach_delete($owner, $f['hash']);
|
attach_delete($owner, $f['hash']);
|
||||||
|
|
||||||
|
$sync = attach_export_data($channel, $f['hash'], true);
|
||||||
|
if($sync) {
|
||||||
|
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
|
||||||
|
}
|
||||||
|
|
||||||
goaway(dirname($url));
|
goaway(dirname($url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,21 +14,26 @@ class Follow extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
$url = notags(trim($_REQUEST['url']));
|
$url = notags(trim(punify($_REQUEST['url'])));
|
||||||
$return_url = $_SESSION['return_url'];
|
$return_url = $_SESSION['return_url'];
|
||||||
$confirm = intval($_REQUEST['confirm']);
|
$confirm = intval($_REQUEST['confirm']);
|
||||||
|
$interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1);
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
$result = new_contact($uid,$url,$channel,true,$confirm);
|
$result = new_contact($uid,$url,$channel,$interactive,$confirm);
|
||||||
|
|
||||||
if($result['success'] == false) {
|
if($result['success'] == false) {
|
||||||
if($result['message'])
|
if($result['message'])
|
||||||
notice($result['message']);
|
notice($result['message']);
|
||||||
goaway($return_url);
|
if($interactive) {
|
||||||
|
goaway($return_url);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
json_return_and_die($result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info( t('Channel added.') . EOL);
|
info( t('Connection added.') . EOL);
|
||||||
|
|
||||||
$clone = array();
|
$clone = array();
|
||||||
foreach($result['abook'] as $k => $v) {
|
foreach($result['abook'] as $k => $v) {
|
||||||
@@ -53,7 +58,12 @@ class Follow extends \Zotlabs\Web\Controller {
|
|||||||
if(($can_view_stream) || ($result['abook']['xchan_network'] === 'rss'))
|
if(($can_view_stream) || ($result['abook']['xchan_network'] === 'rss'))
|
||||||
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$result['abook']['abook_id']));
|
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$result['abook']['abook_id']));
|
||||||
|
|
||||||
goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1');
|
if($interactive) {
|
||||||
|
goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
json_return_and_die([ 'success' => true ]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,17 +28,51 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
|
|
||||||
logger('post: ' . print_r($_POST,true),LOGGER_DEBUG,LOG_INFO);
|
$header_verified = false;
|
||||||
|
|
||||||
$hash = $_POST['hash'];
|
$hash = $_POST['hash'];
|
||||||
$time = $_POST['time'];
|
$time = $_POST['time'];
|
||||||
$sig = $_POST['signature'];
|
$sig = $_POST['signature'];
|
||||||
$resource = $_POST['resource'];
|
$resource = $_POST['resource'];
|
||||||
$revision = intval($_POST['revision']);
|
$revision = intval($_POST['revision']);
|
||||||
$resolution = (-1);
|
$resolution = (-1);
|
||||||
|
|
||||||
if(! $hash)
|
if(! $hash)
|
||||||
killme();
|
killme();
|
||||||
|
|
||||||
|
foreach([ 'REDIRECT_REMOTE_USER', 'HTTP_AUTHORIZATION' ] as $head) {
|
||||||
|
if(array_key_exists($head,$_SERVER) && substr(trim($_SERVER[$head]),0,9) === 'Signature') {
|
||||||
|
if($head !== 'HTTP_AUTHORIZATION') {
|
||||||
|
$_SERVER['HTTP_AUTHORIZATION'] = $_SERVER[$head];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
|
||||||
|
if($sigblock) {
|
||||||
|
$keyId = $sigblock['keyId'];
|
||||||
|
|
||||||
|
if($keyId) {
|
||||||
|
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
|
||||||
|
where hubloc_addr = '%s' limit 1",
|
||||||
|
dbesc(str_replace('acct:','',$keyId))
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
$hubloc = $r[0];
|
||||||
|
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
|
||||||
|
if($verified && $verified['header_signed'] && $verified['header_valid'] && $hash == $hubloc['hubloc_hash']) {
|
||||||
|
$header_verified = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
logger('post: ' . print_r($_POST,true),LOGGER_DEBUG,LOG_INFO);
|
||||||
|
if($header_verified) {
|
||||||
|
logger('HTTPSig verified');
|
||||||
|
}
|
||||||
|
|
||||||
$channel = channelx_by_hash($hash);
|
$channel = channelx_by_hash($hash);
|
||||||
|
|
||||||
@@ -59,16 +93,17 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
$d1 = datetime_convert('UTC','UTC',"now + $slop minutes");
|
$d1 = datetime_convert('UTC','UTC',"now + $slop minutes");
|
||||||
$d2 = datetime_convert('UTC','UTC',"now - $slop minutes");
|
$d2 = datetime_convert('UTC','UTC',"now - $slop minutes");
|
||||||
|
|
||||||
if(($time > $d1) || ($time < $d2)) {
|
if(! $header_verified) {
|
||||||
logger('time outside allowable range');
|
if(($time > $d1) || ($time < $d2)) {
|
||||||
killme();
|
logger('time outside allowable range');
|
||||||
}
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
if(! rsa_verify($hash . '.' . $time,base64url_decode($sig),$channel['channel_pubkey'])) {
|
if(! rsa_verify($hash . '.' . $time,base64url_decode($sig),$channel['channel_pubkey'])) {
|
||||||
logger('verify failed.');
|
logger('verify failed.');
|
||||||
killme();
|
killme();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($resolution > 0) {
|
if($resolution > 0) {
|
||||||
$r = q("select * from photo where resource_id = '%s' and uid = %d limit 1",
|
$r = q("select * from photo where resource_id = '%s' and uid = %d limit 1",
|
||||||
|
|||||||
67
Zotlabs/Module/Go.php
Normal file
67
Zotlabs/Module/Go.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
class Go extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
if(local_channel()) {
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
if($channel) {
|
||||||
|
profile_load($channel['channel_address'],0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
if(! local_channel()) {
|
||||||
|
notify( t('This page is available only to site members') . EOL);
|
||||||
|
}
|
||||||
|
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
|
||||||
|
$title = t('Welcome');
|
||||||
|
|
||||||
|
$m = t('What would you like to do?');
|
||||||
|
|
||||||
|
$m1 = t('Please bookmark this page if you would like to return to it in the future');
|
||||||
|
|
||||||
|
|
||||||
|
$options = [
|
||||||
|
'profile_photo' => t('Upload a profile photo'),
|
||||||
|
'cover_photo' => t('Upload a cover photo'),
|
||||||
|
'profiles' => t('Edit your default profile'),
|
||||||
|
'suggest' => t('View friend suggestions'),
|
||||||
|
'directory' => t('View the channel directory'),
|
||||||
|
'settings' => t('View/edit your channel settings'),
|
||||||
|
'help' => t('View the site or project documentation'),
|
||||||
|
'channel/' . $channel['channel_address'] => t('Visit your channel homepage'),
|
||||||
|
'connections' => t('View your connections and/or add somebody whose address you already know'),
|
||||||
|
'network' => t('View your personal stream (this may be empty until you add some connections)'),
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false);
|
||||||
|
$net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true);
|
||||||
|
|
||||||
|
if($site_firehose || $net_firehose) {
|
||||||
|
$options['pubstream'] = t('View the public stream. Warning: this content is not moderated');
|
||||||
|
}
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template('go.tpl'), [
|
||||||
|
'$title' => $title,
|
||||||
|
'$m' => $m,
|
||||||
|
'$m1' => $m1,
|
||||||
|
'$options' => $options
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
27
Zotlabs/Module/Hashtags.php
Normal file
27
Zotlabs/Module/Hashtags.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
|
||||||
|
class Hashtags extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
$result = [];
|
||||||
|
|
||||||
|
$t = escape_tags($_REQUEST['t']);
|
||||||
|
if(! $t)
|
||||||
|
json_return_and_die($result);
|
||||||
|
|
||||||
|
$r = q("select distinct(term) from term where term like '%s' and ttype = %d order by term",
|
||||||
|
dbesc($t . '%'),
|
||||||
|
intval(TERM_HASHTAG)
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
foreach($r as $rv) {
|
||||||
|
$result[] = [ 'text' => $rv['term'] ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
json_return_and_die($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
298
Zotlabs/Module/Hq.php
Normal file
298
Zotlabs/Module/Hq.php
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
<?php
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
require_once("include/bbcode.php");
|
||||||
|
require_once('include/security.php');
|
||||||
|
require_once('include/conversation.php');
|
||||||
|
require_once('include/acl_selectors.php');
|
||||||
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
|
class Hq extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
if(! local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
\App::$profile_uid = local_channel();
|
||||||
|
}
|
||||||
|
|
||||||
|
function post() {
|
||||||
|
|
||||||
|
if(!local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if($_REQUEST['notify_id']) {
|
||||||
|
q("update notify set seen = 1 where id = %d and uid = %d",
|
||||||
|
intval($_REQUEST['notify_id']),
|
||||||
|
intval(local_channel())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
killme();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
|
if(!local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if($load)
|
||||||
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
|
|
||||||
|
if(argc() > 1 && argv(1) !== 'load') {
|
||||||
|
$item_hash = argv(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_REQUEST['mid'])
|
||||||
|
$item_hash = $_REQUEST['mid'];
|
||||||
|
|
||||||
|
$item_normal = item_normal();
|
||||||
|
$item_normal_update = item_normal_update();
|
||||||
|
|
||||||
|
if(! $item_hash) {
|
||||||
|
$r = q("SELECT mid FROM item
|
||||||
|
WHERE uid = %d $item_normal
|
||||||
|
AND mid = parent_mid
|
||||||
|
ORDER BY created DESC LIMIT 1",
|
||||||
|
intval(local_channel())
|
||||||
|
);
|
||||||
|
|
||||||
|
if($r[0]['mid']) {
|
||||||
|
$item_hash = 'b64.' . base64url_encode($r[0]['mid']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($item_hash) {
|
||||||
|
|
||||||
|
if(strpos($item_hash,'b64.') === 0)
|
||||||
|
$decoded = @base64url_decode(substr($item_hash,4));
|
||||||
|
|
||||||
|
if($decoded)
|
||||||
|
$item_hash = $decoded;
|
||||||
|
|
||||||
|
$target_item = null;
|
||||||
|
|
||||||
|
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
|
||||||
|
dbesc($item_hash . '%')
|
||||||
|
);
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$target_item = $r[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
//if the item is to be moderated redirect to /moderate
|
||||||
|
if($target_item['item_blocked'] == ITEM_MODERATED) {
|
||||||
|
goaway(z_root() . '/moderate/' . $target_item['id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
||||||
|
|
||||||
|
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
|
||||||
|
|
||||||
|
if($update && $_SESSION['loadtime'])
|
||||||
|
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
|
||||||
|
|
||||||
|
if($static && $simple_update)
|
||||||
|
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
|
||||||
|
|
||||||
|
$sys = get_sys_channel();
|
||||||
|
$sql_extra = item_permissions_sql($sys['channel_id']);
|
||||||
|
|
||||||
|
$sys_item = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! $update) {
|
||||||
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
|
$channel_acl = [
|
||||||
|
'allow_cid' => $channel['channel_allow_cid'],
|
||||||
|
'allow_gid' => $channel['channel_allow_gid'],
|
||||||
|
'deny_cid' => $channel['channel_deny_cid'],
|
||||||
|
'deny_gid' => $channel['channel_deny_gid']
|
||||||
|
];
|
||||||
|
|
||||||
|
$x = [
|
||||||
|
'is_owner' => true,
|
||||||
|
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
|
||||||
|
'default_location' => $channel['channel_location'],
|
||||||
|
'nickname' => $channel['channel_address'],
|
||||||
|
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||||
|
|
||||||
|
'acl' => populate_acl($channel_acl),
|
||||||
|
'permissions' => $channel_acl,
|
||||||
|
'bang' => '',
|
||||||
|
'visitor' => true,
|
||||||
|
'profile_uid' => local_channel(),
|
||||||
|
'return_path' => 'hq',
|
||||||
|
'expanded' => true,
|
||||||
|
'editor_autocomplete' => true,
|
||||||
|
'bbco_autocomplete' => 'bbcode',
|
||||||
|
'bbcode' => true,
|
||||||
|
'jotnets' => true
|
||||||
|
];
|
||||||
|
|
||||||
|
$o = replace_macros(get_markup_template("hq.tpl"),
|
||||||
|
[
|
||||||
|
'$no_messages' => (($target_item) ? false : true),
|
||||||
|
'$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ],
|
||||||
|
'$editor' => status_editor($a,$x)
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(! $update && ! $load) {
|
||||||
|
|
||||||
|
nav_set_selected('HQ');
|
||||||
|
|
||||||
|
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
||||||
|
|
||||||
|
if($target_item) {
|
||||||
|
// if the target item is not a post (eg a like) we want to address its thread parent
|
||||||
|
$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
|
||||||
|
|
||||||
|
// if we got a decoded hash we must encode it again before handing to javascript
|
||||||
|
if($decoded)
|
||||||
|
$mid = 'b64.' . base64url_encode($mid);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$mid = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$o .= '<div id="live-hq"></div>' . "\r\n";
|
||||||
|
$o .= "<script> var profile_uid = " . local_channel()
|
||||||
|
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . ";</script>\r\n";
|
||||||
|
|
||||||
|
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
|
||||||
|
'$baseurl' => z_root(),
|
||||||
|
'$pgtype' => 'hq',
|
||||||
|
'$uid' => local_channel(),
|
||||||
|
'$gid' => '0',
|
||||||
|
'$cid' => '0',
|
||||||
|
'$cmin' => '0',
|
||||||
|
'$cmax' => '99',
|
||||||
|
'$star' => '0',
|
||||||
|
'$liked' => '0',
|
||||||
|
'$conv' => '0',
|
||||||
|
'$spam' => '0',
|
||||||
|
'$fh' => '0',
|
||||||
|
'$nouveau' => '0',
|
||||||
|
'$wall' => '0',
|
||||||
|
'$static' => $static,
|
||||||
|
'$page' => 1,
|
||||||
|
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||||
|
'$search' => '',
|
||||||
|
'$xchan' => '',
|
||||||
|
'$order' => '',
|
||||||
|
'$file' => '',
|
||||||
|
'$cats' => '',
|
||||||
|
'$tags' => '',
|
||||||
|
'$dend' => '',
|
||||||
|
'$dbegin' => '',
|
||||||
|
'$verb' => '',
|
||||||
|
'$net' => '',
|
||||||
|
'$mid' => $mid
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$updateable = false;
|
||||||
|
|
||||||
|
if($load && $target_item) {
|
||||||
|
$r = null;
|
||||||
|
|
||||||
|
$r = q("SELECT item.id AS item_id FROM item
|
||||||
|
WHERE uid = %d
|
||||||
|
AND mid = '%s'
|
||||||
|
$item_normal
|
||||||
|
LIMIT 1",
|
||||||
|
intval(local_channel()),
|
||||||
|
dbesc($target_item['parent_mid'])
|
||||||
|
);
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$updateable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$r) {
|
||||||
|
$sys_item = true;
|
||||||
|
|
||||||
|
$r = q("SELECT item.id AS item_id FROM item
|
||||||
|
LEFT JOIN abook ON item.author_xchan = abook.abook_xchan
|
||||||
|
WHERE mid = '%s' AND item.uid = %d $item_normal
|
||||||
|
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
|
$sql_extra LIMIT 1",
|
||||||
|
dbesc($target_item['parent_mid']),
|
||||||
|
intval($sys['channel_id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif($update && $target_item) {
|
||||||
|
$r = null;
|
||||||
|
|
||||||
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
|
WHERE uid = %d
|
||||||
|
AND parent_mid = '%s'
|
||||||
|
$item_normal_update
|
||||||
|
$simple_update
|
||||||
|
LIMIT 1",
|
||||||
|
intval(local_channel()),
|
||||||
|
dbesc($target_item['parent_mid'])
|
||||||
|
);
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$updateable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$r) {
|
||||||
|
$sys_item = true;
|
||||||
|
|
||||||
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
|
LEFT JOIN abook ON item.author_xchan = abook.abook_xchan
|
||||||
|
WHERE mid = '%s' AND item.uid = %d $item_normal_update $simple_update
|
||||||
|
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
|
$sql_extra LIMIT 1",
|
||||||
|
dbesc($target_item['parent_mid']),
|
||||||
|
intval($sys['channel_id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$r = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
$items = q("SELECT item.*, item.id AS item_id
|
||||||
|
FROM item
|
||||||
|
WHERE parent = '%s' $item_normal ",
|
||||||
|
dbesc($r[0]['item_id'])
|
||||||
|
);
|
||||||
|
|
||||||
|
xchan_query($items,true,(($sys_item) ? local_channel() : 0));
|
||||||
|
$items = fetch_post_tags($items,true);
|
||||||
|
$items = conv_sort($items,'created');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$items = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$o .= conversation($items, 'hq', $update, 'client');
|
||||||
|
|
||||||
|
if($updateable) {
|
||||||
|
$x = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d AND parent = %d ",
|
||||||
|
intval(local_channel()),
|
||||||
|
intval($r[0]['item_id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$o .= '<div id="content-complete"></div>';
|
||||||
|
|
||||||
|
return $o;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,6 +26,8 @@ class Impel extends \Zotlabs\Web\Controller {
|
|||||||
if(! $j)
|
if(! $j)
|
||||||
json_return_and_die($ret);
|
json_return_and_die($ret);
|
||||||
|
|
||||||
|
// logger('element: ' . print_r($j,true));
|
||||||
|
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
notice( t('Nothing to import.') . EOL);
|
notice( t('Nothing to import.') . EOL);
|
||||||
return;
|
return;
|
||||||
} else if(strpos($old_address, '@')) {
|
} else if(strpos($old_address, '@')) {
|
||||||
// if you copy the identity address from your profile page, make it work for convenience
|
// if you copy the identity address from your profile page, make it work for convenience - WARNING: this is a utf-8 variant and NOT an ASCII ampersand. Please do not edit.
|
||||||
$old_address = str_replace('@', '@', $old_address);
|
$old_address = str_replace('@', '@', $old_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,15 +114,16 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
|
// This is only an info message but it is alarming to folks who then report failure with this as the cause, when in fact we ignore this completely.
|
||||||
$v1 = substr($data['compatibility']['database'],-4);
|
// if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
|
||||||
$v2 = substr(DB_UPDATE_VERSION,-4);
|
// $v1 = substr($data['compatibility']['database'],-4);
|
||||||
if($v2 > $v1) {
|
// $v2 = substr(DB_UPDATE_VERSION,-4);
|
||||||
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
|
// if($v2 > $v1) {
|
||||||
notice($t);
|
// $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
|
||||||
}
|
// notice($t);
|
||||||
|
// }
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
if($moving)
|
if($moving)
|
||||||
$seize = 1;
|
$seize = 1;
|
||||||
@@ -362,11 +363,27 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
abook_store_lowlevel($abook);
|
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
|
||||||
|
dbesc($abook['abook_xchan']),
|
||||||
|
intval($channel['channel_id'])
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
foreach($abook as $k => $v) {
|
||||||
|
$r = q("UPDATE abook SET " . TQUOT . "%s" . TQUOT . " = '%s' WHERE abook_xchan = '%s' AND abook_channel = %d",
|
||||||
|
dbesc($k),
|
||||||
|
dbesc($v),
|
||||||
|
dbesc($abook['abook_xchan']),
|
||||||
|
intval($channel['channel_id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
abook_store_lowlevel($abook);
|
||||||
|
|
||||||
$friends ++;
|
$friends ++;
|
||||||
if(intval($abook['abook_feed']))
|
if(intval($abook['abook_feed']))
|
||||||
$feeds ++;
|
$feeds ++;
|
||||||
|
}
|
||||||
|
|
||||||
translate_abook_perms_inbound($channel,$abook_copy);
|
translate_abook_perms_inbound($channel,$abook_copy);
|
||||||
|
|
||||||
@@ -515,16 +532,19 @@ class Import extends \Zotlabs\Web\Controller {
|
|||||||
'$desc' => t('Use this form to import an existing channel from a different server/hub. You may retrieve the channel identity from the old server/hub via the network or provide an export file.'),
|
'$desc' => t('Use this form to import an existing channel from a different server/hub. You may retrieve the channel identity from the old server/hub via the network or provide an export file.'),
|
||||||
'$label_filename' => t('File to Upload'),
|
'$label_filename' => t('File to Upload'),
|
||||||
'$choice' => t('Or provide the old server/hub details'),
|
'$choice' => t('Or provide the old server/hub details'),
|
||||||
'$label_old_address' => t('Your old identity address (xyz@example.com)'),
|
|
||||||
'$label_old_email' => t('Your old login email address'),
|
'$old_address' => [ 'old_address', t('Your old identity address (xyz@example.com)'), '', ''],
|
||||||
'$label_old_pass' => t('Your old login password'),
|
'$email' => [ 'email', t('Your old login email address'), '', '' ],
|
||||||
|
'$password' => [ 'password', t('Your old login password'), '', '' ],
|
||||||
|
'$import_posts' => [ 'import_posts', t('Import a few months of posts if possible (limited by available memory'), false, '', [ t('No'), t('Yes') ]],
|
||||||
|
|
||||||
'$common' => t('For either option, please choose whether to make this hub your new primary address, or whether your old location should continue this role. You will be able to post from either location, but only one can be marked as the primary location for files, photos, and media.'),
|
'$common' => t('For either option, please choose whether to make this hub your new primary address, or whether your old location should continue this role. You will be able to post from either location, but only one can be marked as the primary location for files, photos, and media.'),
|
||||||
'$label_import_primary' => t('Make this hub my primary location'),
|
|
||||||
'$label_import_moving' => t('Move this channel (disable all previous locations)'),
|
'$make_primary' => [ 'make_primary', t('Make this hub my primary location'), false, '', [ t('No'), t('Yes') ] ],
|
||||||
'$label_import_posts' => t('Import a few months of posts if possible (limited by available memory'),
|
'$moving' => [ 'moving', t('Move this channel (disable all previous locations)'), false, '', [ t('No'), t('Yes') ] ],
|
||||||
|
|
||||||
'$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'),
|
'$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'),
|
||||||
'$email' => '',
|
|
||||||
'$pass' => '',
|
|
||||||
'$form_security_token' => get_form_security_token('channel_import'),
|
'$form_security_token' => get_form_security_token('channel_import'),
|
||||||
'$submit' => t('Submit')
|
'$submit' => t('Submit')
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$uid = local_channel();
|
$uid = local_channel();
|
||||||
$channel = null;
|
$channel = null;
|
||||||
$observer = null;
|
$observer = null;
|
||||||
|
$datarray = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,6 +60,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
|
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
|
||||||
require_once('include/channel.php');
|
require_once('include/channel.php');
|
||||||
|
|
||||||
$sys = get_sys_channel();
|
$sys = get_sys_channel();
|
||||||
if($sys && $profile_uid && ($sys['channel_id'] == $profile_uid) && is_site_admin()) {
|
if($sys && $profile_uid && ($sys['channel_id'] == $profile_uid) && is_site_admin()) {
|
||||||
$uid = intval($sys['channel_id']);
|
$uid = intval($sys['channel_id']);
|
||||||
@@ -155,7 +157,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
if(! x($_REQUEST,'type'))
|
if(! x($_REQUEST,'type'))
|
||||||
$_REQUEST['type'] = 'net-comment';
|
$_REQUEST['type'] = 'net-comment';
|
||||||
|
|
||||||
if($obj_type == ACTIVITY_OBJ_POST)
|
if($obj_type == ACTIVITY_OBJ_NOTE)
|
||||||
$obj_type = ACTIVITY_OBJ_COMMENT;
|
$obj_type = ACTIVITY_OBJ_COMMENT;
|
||||||
|
|
||||||
if($parent) {
|
if($parent) {
|
||||||
@@ -171,7 +173,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// if this isn't the real parent of the conversation, find it
|
// if this isn't the real parent of the conversation, find it
|
||||||
if($r !== false && count($r)) {
|
if($r) {
|
||||||
$parid = $r[0]['parent'];
|
$parid = $r[0]['parent'];
|
||||||
$parent_mid = $r[0]['mid'];
|
$parent_mid = $r[0]['mid'];
|
||||||
if($r[0]['id'] != $r[0]['parent']) {
|
if($r[0]['id'] != $r[0]['parent']) {
|
||||||
@@ -179,9 +181,16 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
intval($parid)
|
intval($parid)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if interacting with a pubstream item,
|
||||||
|
// create a copy of the parent in your stream
|
||||||
|
|
||||||
|
if($r[0]['uid'] === $sys['channel_id'] && local_channel()) {
|
||||||
|
$r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($r === false) || (! count($r))) {
|
if(! $r) {
|
||||||
notice( t('Unable to locate original post.') . EOL);
|
notice( t('Unable to locate original post.') . EOL);
|
||||||
if($api_source)
|
if($api_source)
|
||||||
return ( [ 'success' => false, 'message' => 'invalid post id' ] );
|
return ( [ 'success' => false, 'message' => 'invalid post id' ] );
|
||||||
@@ -189,15 +198,12 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
goaway(z_root() . "/" . $return_path );
|
goaway(z_root() . "/" . $return_path );
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
// can_comment_on_post() needs info from the following xchan_query
|
|
||||||
// This may be from the discover tab which means we need to correct the effective uid
|
|
||||||
|
|
||||||
xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
|
xchan_query($r,true);
|
||||||
|
|
||||||
$parent_item = $r[0];
|
$parent_item = $r[0];
|
||||||
$parent = $r[0]['id'];
|
$parent = $r[0]['id'];
|
||||||
|
|
||||||
// multi-level threading - preserve the info but re-parent to our single level threading
|
// multi-level threading - preserve the info but re-parent to our single level threading
|
||||||
|
|
||||||
$thr_parent = $parent_mid;
|
$thr_parent = $parent_mid;
|
||||||
@@ -462,6 +468,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$private = intval($acl->is_private() || $parent_item['item_private']);
|
$private = intval($acl->is_private() || $parent_item['item_private']);
|
||||||
$public_policy = $parent_item['public_policy'];
|
$public_policy = $parent_item['public_policy'];
|
||||||
$owner_hash = $parent_item['owner_xchan'];
|
$owner_hash = $parent_item['owner_xchan'];
|
||||||
|
$webpage = $parent_item['item_type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if((! $allow_empty) && (! strlen($body))) {
|
if((! $allow_empty) && (! strlen($body))) {
|
||||||
@@ -499,7 +506,12 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$body = z_input_filter($body,$mimetype,$execflag);
|
$body = z_input_filter($body,$mimetype,$execflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify ability to use html or php!!!
|
|
||||||
|
$arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
|
||||||
|
call_hooks('post_content',$arr);
|
||||||
|
$body = $arr['content'];
|
||||||
|
$mimetype = $arr['mimetype'];
|
||||||
|
|
||||||
|
|
||||||
$gacl = $acl->get();
|
$gacl = $acl->get();
|
||||||
$str_contact_allow = $gacl['allow_cid'];
|
$str_contact_allow = $gacl['allow_cid'];
|
||||||
@@ -511,48 +523,13 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
require_once('include/text.php');
|
require_once('include/text.php');
|
||||||
|
|
||||||
// Markdown doesn't work correctly. Do not re-enable unless you're willing to fix it and support it.
|
|
||||||
|
|
||||||
// Sample that will probably give you grief - you must preserve the linebreaks
|
|
||||||
// and provide the correct markdown interpretation and you cannot allow unfiltered HTML
|
|
||||||
|
|
||||||
// Markdown
|
|
||||||
// ========
|
|
||||||
//
|
|
||||||
// **bold** abcde
|
|
||||||
// fghijkl
|
|
||||||
// *italic*
|
|
||||||
// <img src="javascript:alert('hacked');" />
|
|
||||||
|
|
||||||
// if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
|
|
||||||
// require_once('include/markdown.php');
|
|
||||||
// $body = escape_tags(trim($body));
|
|
||||||
// $body = str_replace("\n",'<br />', $body);
|
|
||||||
// $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
|
|
||||||
// $body = markdown_to_bb($body,true);
|
|
||||||
// $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// BBCODE alert: the following functions assume bbcode input
|
// BBCODE alert: the following functions assume bbcode input
|
||||||
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
|
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
|
||||||
// we may need virtual or template classes to implement the possible alternatives
|
// we may need virtual or template classes to implement the possible alternatives
|
||||||
|
|
||||||
// Work around doubled linefeeds in Tinymce 3.5b2
|
|
||||||
// First figure out if it's a status post that would've been
|
|
||||||
// created using tinymce. Otherwise leave it alone.
|
|
||||||
|
|
||||||
$plaintext = true;
|
|
||||||
|
|
||||||
// $plaintext = ((feature_enabled($profile_uid,'richtext')) ? false : true);
|
|
||||||
// if((! $parent) && (! $api_source) && (! $plaintext)) {
|
|
||||||
// $body = fix_mce_lf($body);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// If we're sending a private top-level message with a single @-taggable channel as a recipient, @-tag it, if our pconfig is set.
|
// If we're sending a private top-level message with a single @-taggable channel as a recipient, @-tag it, if our pconfig is set.
|
||||||
|
|
||||||
|
|
||||||
if((! $parent) && (get_pconfig($profile_uid,'system','tagifonlyrecip')) && (substr_count($str_contact_allow,'<') == 1) && ($str_group_allow == '') && ($str_contact_deny == '') && ($str_group_deny == '')) {
|
if((! $parent) && (get_pconfig($profile_uid,'system','tagifonlyrecip')) && (substr_count($str_contact_allow,'<') == 1) && ($str_group_allow == '') && ($str_contact_deny == '') && ($str_group_deny == '')) {
|
||||||
$x = q("select abook_id, abconfig.v from abook left join abconfig on abook_xchan = abconfig.xchan and abook_channel = abconfig.chan and cat= 'their_perms' and abconfig.k = 'tag_deliver' and abconfig.v = 1 and abook_xchan = '%s' and abook_channel = %d limit 1",
|
$x = q("select abook_id, abconfig.v from abook left join abconfig on abook_xchan = abconfig.xchan and abook_channel = abconfig.chan and cat= 'their_perms' and abconfig.k = 'tag_deliver' and abconfig.v = 1 and abook_xchan = '%s' and abook_channel = %d limit 1",
|
||||||
dbesc(str_replace(array('<','>'),array('',''),$str_contact_allow)),
|
dbesc(str_replace(array('<','>'),array('',''),$str_contact_allow)),
|
||||||
@@ -566,7 +543,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
// Look for tags and linkify them
|
// Look for tags and linkify them
|
||||||
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
||||||
|
|
||||||
if($results) {
|
if($results) {
|
||||||
|
|
||||||
// Set permissions based on tag replacements
|
// Set permissions based on tag replacements
|
||||||
@@ -605,15 +582,6 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
* so we'll set the permissions regardless and realise that the media may not be
|
* so we'll set the permissions regardless and realise that the media may not be
|
||||||
* referenced in the post.
|
* referenced in the post.
|
||||||
*
|
*
|
||||||
* What is preventing us from being able to upload photos into comments is dealing with
|
|
||||||
* the photo and attachment permissions, since we don't always know who was in the
|
|
||||||
* distribution for the top level post.
|
|
||||||
*
|
|
||||||
* We might be able to provide this functionality with a lot of fiddling:
|
|
||||||
* - if the top level post is public (make the photo public)
|
|
||||||
* - if the top level post was written by us or a wall post that belongs to us (match the top level post)
|
|
||||||
* - if the top level post has privacy mentions, add those to the permissions.
|
|
||||||
* - otherwise disallow the photo *or* make the photo public. This is the part that gets messy.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(! $preview) {
|
if(! $preview) {
|
||||||
@@ -653,6 +621,21 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(preg_match_all('/(\[share=(.*?)\](.*?)\[\/share\])/',$body,$match)) {
|
||||||
|
// process share by id
|
||||||
|
|
||||||
|
$verb = ACTIVITY_SHARE;
|
||||||
|
$i = 0;
|
||||||
|
foreach($match[2] as $mtch) {
|
||||||
|
$reshare = new \Zotlabs\Lib\Share($mtch);
|
||||||
|
$datarray['obj'] = $reshare->obj();
|
||||||
|
$datarray['obj_type'] = $datarray['obj']['type'];
|
||||||
|
$body = str_replace($match[1][$i],$reshare->bbcode(),$body);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -666,6 +649,9 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
if($webpage == ITEM_TYPE_CARD) {
|
if($webpage == ITEM_TYPE_CARD) {
|
||||||
$catlink = z_root() . '/cards/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
|
$catlink = z_root() . '/cards/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
|
||||||
}
|
}
|
||||||
|
elseif($webpage == ITEM_TYPE_ARTICLE) {
|
||||||
|
$catlink = z_root() . '/articles/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat));
|
$catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat));
|
||||||
}
|
}
|
||||||
@@ -751,7 +737,6 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
if(!$thr_parent)
|
if(!$thr_parent)
|
||||||
$thr_parent = $mid;
|
$thr_parent = $mid;
|
||||||
|
|
||||||
$datarray = array();
|
|
||||||
|
|
||||||
$item_thread_top = ((! $parent) ? 1 : 0);
|
$item_thread_top = ((! $parent) ? 1 : 0);
|
||||||
|
|
||||||
@@ -770,8 +755,21 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($webpage == ITEM_TYPE_ARTICLE) {
|
||||||
|
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16));
|
||||||
|
}
|
||||||
|
if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_ARTICLE)) {
|
||||||
|
$r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.iid = %d limit 1",
|
||||||
|
intval($parent_item['id'])
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . $r[0]['v'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((! $plink) && ($item_thread_top)) {
|
if ((! $plink) && ($item_thread_top)) {
|
||||||
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
|
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
|
||||||
|
$plink = substr($plink,0,190);
|
||||||
}
|
}
|
||||||
|
|
||||||
$datarray['aid'] = $channel['channel_account_id'];
|
$datarray['aid'] = $channel['channel_account_id'];
|
||||||
@@ -833,6 +831,12 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$datarray['plink'] = $plink;
|
$datarray['plink'] = $plink;
|
||||||
$datarray['route'] = $route;
|
$datarray['route'] = $route;
|
||||||
|
|
||||||
|
|
||||||
|
// A specific ACL over-rides public_policy completely
|
||||||
|
|
||||||
|
if(! empty_acl($datarray))
|
||||||
|
$datarray['public_policy'] = '';
|
||||||
|
|
||||||
if($iconfig)
|
if($iconfig)
|
||||||
$datarray['iconfig'] = $iconfig;
|
$datarray['iconfig'] = $iconfig;
|
||||||
|
|
||||||
@@ -1156,7 +1160,29 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
$ret['message'] = t('Unable to obtain post information from database.');
|
$ret['message'] = t('Unable to obtain post information from database.');
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts
|
||||||
|
// and have uploaded something (like a profile photo), promote them to level 1.
|
||||||
|
|
||||||
|
$a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)",
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) {
|
||||||
|
$x = q("select count(abook_id) as total from abook where abook_channel = %d",
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
if($x && intval($x[0]['total']) > 2) {
|
||||||
|
$y = q("select count(id) as total from attach where uid = %d",
|
||||||
|
intval($channel_id)
|
||||||
|
);
|
||||||
|
if($y && intval($y[0]['total']) > 1) {
|
||||||
|
q("update account set account_level = 1 where account_id = %d limit 1",
|
||||||
|
intval($a[0]['account_id'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$iswebpage) {
|
if (!$iswebpage) {
|
||||||
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
|
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
|
||||||
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {
|
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {
|
||||||
|
|||||||
@@ -162,12 +162,12 @@ class Layouts extends \Zotlabs\Web\Controller {
|
|||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
'edited' => $rr['edited'],
|
'edited' => $rr['edited'],
|
||||||
'mimetype' => $rr['mimetype'],
|
'mimetype' => $rr['mimetype'],
|
||||||
'pagetitle' => $rr['sid'],
|
'pagetitle' => urldecode($rr['v']),
|
||||||
'mid' => $rr['mid']
|
'mid' => $rr['mid']
|
||||||
);
|
);
|
||||||
$pages[$rr['iid']][] = array(
|
$pages[$rr['iid']][] = array(
|
||||||
'url' => $rr['iid'],
|
'url' => $rr['iid'],
|
||||||
'title' => $rr['v'],
|
'title' => urldecode($rr['v']),
|
||||||
'descr' => $rr['title'],
|
'descr' => $rr['title'],
|
||||||
'mid' => $rr['mid'],
|
'mid' => $rr['mid'],
|
||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
|
|||||||
@@ -9,10 +9,45 @@ require_once('include/items.php');
|
|||||||
|
|
||||||
class Like extends \Zotlabs\Web\Controller {
|
class Like extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function get() {
|
|
||||||
|
|
||||||
$o = '';
|
private function reaction_to_activity($reaction) {
|
||||||
|
|
||||||
|
$acts = [
|
||||||
|
'like' => ACTIVITY_LIKE ,
|
||||||
|
'dislike' => ACTIVITY_DISLIKE ,
|
||||||
|
'agree' => ACTIVITY_AGREE ,
|
||||||
|
'disagree' => ACTIVITY_DISAGREE ,
|
||||||
|
'abstain' => ACTIVITY_ABSTAIN ,
|
||||||
|
'attendyes' => ACTIVITY_ATTEND ,
|
||||||
|
'attendno' => ACTIVITY_ATTENDNO ,
|
||||||
|
'attendmaybe' => ACTIVITY_ATTENDMAYBE
|
||||||
|
];
|
||||||
|
|
||||||
|
// unlike (etc.) reactions are an undo of positive reactions, rather than a negative action.
|
||||||
|
// The activity is the same in undo actions and will have the same activity mapping
|
||||||
|
|
||||||
|
if(substr($reaction,0,2) === 'un') {
|
||||||
|
$reaction = substr($reaction,2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists($reaction,$acts)) {
|
||||||
|
return $acts[$reaction];
|
||||||
|
}
|
||||||
|
|
||||||
|
return EMPTY_STR;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function get() {
|
||||||
|
|
||||||
|
$o = EMPTY_STR;
|
||||||
|
|
||||||
|
$sys_channel = get_sys_channel();
|
||||||
|
$sys_channel_id = (($sys_channel) ? $sys_channel['channel_id'] : 0);
|
||||||
|
|
||||||
$observer = \App::get_observer();
|
$observer = \App::get_observer();
|
||||||
$interactive = $_REQUEST['interactive'];
|
$interactive = $_REQUEST['interactive'];
|
||||||
if($interactive) {
|
if($interactive) {
|
||||||
@@ -32,48 +67,17 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
if(! $verb)
|
if(! $verb)
|
||||||
$verb = 'like';
|
$verb = 'like';
|
||||||
|
|
||||||
switch($verb) {
|
$activity = $this->reaction_to_activity($verb);
|
||||||
case 'like':
|
|
||||||
case 'unlike':
|
if(! $activity) {
|
||||||
$activity = ACTIVITY_LIKE;
|
return EMPTY_STR;
|
||||||
break;
|
|
||||||
case 'dislike':
|
|
||||||
case 'undislike':
|
|
||||||
$activity = ACTIVITY_DISLIKE;
|
|
||||||
break;
|
|
||||||
case 'agree':
|
|
||||||
case 'unagree':
|
|
||||||
$activity = ACTIVITY_AGREE;
|
|
||||||
break;
|
|
||||||
case 'disagree':
|
|
||||||
case 'undisagree':
|
|
||||||
$activity = ACTIVITY_DISAGREE;
|
|
||||||
break;
|
|
||||||
case 'abstain':
|
|
||||||
case 'unabstain':
|
|
||||||
$activity = ACTIVITY_ABSTAIN;
|
|
||||||
break;
|
|
||||||
case 'attendyes':
|
|
||||||
case 'unattendyes':
|
|
||||||
$activity = ACTIVITY_ATTEND;
|
|
||||||
break;
|
|
||||||
case 'attendno':
|
|
||||||
case 'unattendno':
|
|
||||||
$activity = ACTIVITY_ATTENDNO;
|
|
||||||
break;
|
|
||||||
case 'attendmaybe':
|
|
||||||
case 'unattendmaybe':
|
|
||||||
$activity = ACTIVITY_ATTENDMAYBE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$extended_like = false;
|
$extended_like = false;
|
||||||
$object = $target = null;
|
$object = $target = null;
|
||||||
$post_type = '';
|
$post_type = EMPTY_STR;
|
||||||
$objtype = '';
|
$objtype = EMPTY_STR;
|
||||||
|
|
||||||
if(argc() == 3) {
|
if(argc() == 3) {
|
||||||
|
|
||||||
@@ -253,20 +257,29 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
logger('like: verb ' . $verb . ' item ' . $item_id, LOGGER_DEBUG);
|
logger('like: verb ' . $verb . ' item ' . $item_id, LOGGER_DEBUG);
|
||||||
|
|
||||||
// get the item. Allow linked photos (which are normally hidden) to be liked
|
// get the item. Allow linked photos (which are normally hidden) to be liked
|
||||||
|
|
||||||
$r = q("SELECT * FROM item WHERE id = %d
|
$r = q("SELECT * FROM item WHERE id = %d
|
||||||
and (item_type = 0 or item_type = 6) and item_deleted = 0 and item_unpublished = 0
|
and item_type in (0,6,7) and item_deleted = 0 and item_unpublished = 0
|
||||||
and item_delayed = 0 and item_pending_remove = 0 and item_blocked = 0 LIMIT 1",
|
and item_delayed = 0 and item_pending_remove = 0 and item_blocked = 0 LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// if interacting with a pubstream item,
|
||||||
|
// create a copy of the parent in your stream. If not the conversation
|
||||||
|
// parent, copy that as well.
|
||||||
|
|
||||||
|
if($r) {
|
||||||
|
if($r[0]['uid'] === $sys_channel['channel_id'] && local_channel()) {
|
||||||
|
$r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(! $item_id || (! $r)) {
|
if(! $item_id || (! $r)) {
|
||||||
logger('like: no item ' . $item_id);
|
logger('like: no item ' . $item_id);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xchan_query($r,true);
|
||||||
xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
|
|
||||||
|
|
||||||
$item = $r[0];
|
$item = $r[0];
|
||||||
|
|
||||||
@@ -283,10 +296,11 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
notice( t('Permission denied') . EOL);
|
notice( t('Permission denied') . EOL);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||||
dbesc($item['owner_xchan'])
|
dbesc($item['owner_xchan'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r)
|
if($r)
|
||||||
$thread_owner = $r[0];
|
$thread_owner = $r[0];
|
||||||
else
|
else
|
||||||
@@ -405,6 +419,7 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$arr['item_origin'] = 1;
|
$arr['item_origin'] = 1;
|
||||||
$arr['item_notshown'] = 1;
|
$arr['item_notshown'] = 1;
|
||||||
|
$arr['item_type'] = $item['item_type'];
|
||||||
|
|
||||||
if(intval($item['item_wall']))
|
if(intval($item['item_wall']))
|
||||||
$arr['item_wall'] = 1;
|
$arr['item_wall'] = 1;
|
||||||
@@ -464,6 +479,8 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
$arr['mid'] = $mid;
|
$arr['mid'] = $mid;
|
||||||
$arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid);
|
$arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid);
|
||||||
$arr['uid'] = $owner_uid;
|
$arr['uid'] = $owner_uid;
|
||||||
|
|
||||||
|
|
||||||
$arr['item_flags'] = $item_flags;
|
$arr['item_flags'] = $item_flags;
|
||||||
$arr['item_wall'] = $item_wall;
|
$arr['item_wall'] = $item_wall;
|
||||||
$arr['parent_mid'] = (($extended_like) ? $mid : $item['mid']);
|
$arr['parent_mid'] = (($extended_like) ? $mid : $item['mid']);
|
||||||
|
|||||||
@@ -120,9 +120,9 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$siteinfo = self::parseurl_getsiteinfo($url);
|
$siteinfo = self::parseurl_getsiteinfo($url);
|
||||||
|
|
||||||
// If this is a Red site, use zrl rather than url so they get zids sent to them by default
|
// If the site uses this platform, use zrl rather than url so they get zids sent to them by default
|
||||||
|
|
||||||
if( x($siteinfo,'generator') && (strpos($siteinfo['generator'], \Zotlabs\Lib\System::get_platform_name() . ' ') === 0))
|
if(is_matrix_url($url))
|
||||||
$template = str_replace('url','zrl',$template);
|
$template = str_replace('url','zrl',$template);
|
||||||
|
|
||||||
if($siteinfo["title"] == "") {
|
if($siteinfo["title"] == "") {
|
||||||
|
|||||||
@@ -5,8 +5,13 @@ namespace Zotlabs\Module;
|
|||||||
class Logout extends \Zotlabs\Web\Controller {
|
class Logout extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
\App::$session->nuke();
|
if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
|
||||||
|
$_SESSION = $_SESSION['delegate_push'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
\App::$session->nuke();
|
||||||
|
}
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,18 @@ class Magic extends \Zotlabs\Web\Controller {
|
|||||||
logger('mod_magic: args: ' . print_r($_REQUEST,true),LOGGER_DATA);
|
logger('mod_magic: args: ' . print_r($_REQUEST,true),LOGGER_DATA);
|
||||||
|
|
||||||
$addr = ((x($_REQUEST,'addr')) ? $_REQUEST['addr'] : '');
|
$addr = ((x($_REQUEST,'addr')) ? $_REQUEST['addr'] : '');
|
||||||
|
$bdest = ((x($_REQUEST,'bdest')) ? $_REQUEST['bdest'] : '');
|
||||||
$dest = ((x($_REQUEST,'dest')) ? $_REQUEST['dest'] : '');
|
$dest = ((x($_REQUEST,'dest')) ? $_REQUEST['dest'] : '');
|
||||||
$test = ((x($_REQUEST,'test')) ? intval($_REQUEST['test']) : 0);
|
$test = ((x($_REQUEST,'test')) ? intval($_REQUEST['test']) : 0);
|
||||||
$rev = ((x($_REQUEST,'rev')) ? intval($_REQUEST['rev']) : 0);
|
$rev = ((x($_REQUEST,'rev')) ? intval($_REQUEST['rev']) : 0);
|
||||||
$owa = ((x($_REQUEST,'owa')) ? intval($_REQUEST['owa']) : 0);
|
$owa = ((x($_REQUEST,'owa')) ? intval($_REQUEST['owa']) : 0);
|
||||||
$delegate = ((x($_REQUEST,'delegate')) ? $_REQUEST['delegate'] : '');
|
$delegate = ((x($_REQUEST,'delegate')) ? $_REQUEST['delegate'] : '');
|
||||||
|
|
||||||
|
if($bdest)
|
||||||
|
$dest = hex2bin($bdest);
|
||||||
|
|
||||||
|
$dest = html_entity_decode($dest);
|
||||||
|
|
||||||
$parsed = parse_url($dest);
|
$parsed = parse_url($dest);
|
||||||
if(! $parsed) {
|
if(! $parsed) {
|
||||||
if($test) {
|
if($test) {
|
||||||
@@ -112,6 +118,8 @@ class Magic extends \Zotlabs\Web\Controller {
|
|||||||
if($r && intval($r[0]['channel_id'])) {
|
if($r && intval($r[0]['channel_id'])) {
|
||||||
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
|
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
|
||||||
if($allowed) {
|
if($allowed) {
|
||||||
|
$tmp = $_SESSION;
|
||||||
|
$_SESSION['delegate_push'] = $tmp;
|
||||||
$_SESSION['delegate_channel'] = $r[0]['channel_id'];
|
$_SESSION['delegate_channel'] = $r[0]['channel_id'];
|
||||||
$_SESSION['delegate'] = get_observer_hash();
|
$_SESSION['delegate'] = get_observer_hash();
|
||||||
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
|
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
|
||||||
@@ -146,10 +154,17 @@ class Magic extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($x['success']) {
|
if($x['success']) {
|
||||||
$j = json_decode($x['body'],true);
|
$j = json_decode($x['body'],true);
|
||||||
if($j['success'] && $j['token']) {
|
if($j['success']) {
|
||||||
$x = strpbrk($dest,'?&');
|
$token = '';
|
||||||
$args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : '');
|
if($j['encrypted_token']) {
|
||||||
|
openssl_private_decrypt(base64url_decode($j['encrypted_token']),$token,$channel['channel_prvkey']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$token = $j['token'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$x = strpbrk($dest,'?&');
|
||||||
|
$args = (($x) ? '&owt=' . $token : '?f=&owt=' . $token) . (($delegate) ? '&delegate=1' : '');
|
||||||
goaway($dest . $args);
|
goaway($dest . $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,7 +174,7 @@ class Magic extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$token = random_string();
|
$token = random_string();
|
||||||
|
|
||||||
\Zotlabs\Zot\Verify::create('auth',$channel['channel_id'],$token,$x[0]['hubloc_url']);
|
\Zotlabs\Lib\Verify::create('auth',$channel['channel_id'],$token,$x[0]['hubloc_url']);
|
||||||
|
|
||||||
$target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode(channel_reddress($channel))
|
$target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode(channel_reddress($channel))
|
||||||
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;
|
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||||||
$replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : '');
|
$replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : '');
|
||||||
$subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : '');
|
$subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : '');
|
||||||
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
|
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
|
||||||
$recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : '');
|
$recipient = ((x($_REQUEST,'messageto')) ? notags(trim(urldecode($_REQUEST['messageto']))) : '');
|
||||||
$rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : '');
|
$rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : '');
|
||||||
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
|
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
|
||||||
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE);
|
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE);
|
||||||
@@ -67,14 +67,14 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||||||
if(! $recipient) {
|
if(! $recipient) {
|
||||||
$channel = \App::get_channel();
|
$channel = \App::get_channel();
|
||||||
|
|
||||||
$j = \Zotlabs\Zot\Finger::run($rstr,$channel);
|
$j = \Zotlabs\Zot\Finger::run(punify($rstr),$channel);
|
||||||
|
|
||||||
if(! $j['success']) {
|
if(! $j['success']) {
|
||||||
notice( t('Unable to lookup recipient.') . EOL);
|
notice( t('Unable to lookup recipient.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('message_post: lookup: ' . $url . ' ' . print_r($j,true));
|
logger('message_post: lookup: ' . $rstr . ' ' . print_r($j,true));
|
||||||
|
|
||||||
if(! $j['guid']) {
|
if(! $j['guid']) {
|
||||||
notice( t('Unable to communicate with requested channel.'));
|
notice( t('Unable to communicate with requested channel.'));
|
||||||
@@ -124,7 +124,7 @@ class Mail extends \Zotlabs\Web\Controller {
|
|||||||
// We have a local_channel, let send_message use the session channel and save a lookup
|
// We have a local_channel, let send_message use the session channel and save a lookup
|
||||||
|
|
||||||
$ret = send_message(0, $recipient, $body, $subject, $replyto, $expires, $mimetype, $raw);
|
$ret = send_message(0, $recipient, $body, $subject, $replyto, $expires, $mimetype, $raw);
|
||||||
|
|
||||||
if($ret['success']) {
|
if($ret['success']) {
|
||||||
xchan_mail_query($ret['mail']);
|
xchan_mail_query($ret['mail']);
|
||||||
build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));
|
build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
|
|||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
$o .= alt_pager($a,count($r));
|
$o .= alt_pager(count($r));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,12 @@ class Moderate extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\App::set_pager_itemspage(60);
|
||||||
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||||
|
|
||||||
//show all items
|
//show all items
|
||||||
if(argc() == 1) {
|
if(argc() == 1) {
|
||||||
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
|
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
intval(ITEM_MODERATED)
|
intval(ITEM_MODERATED)
|
||||||
);
|
);
|
||||||
@@ -26,7 +29,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
|||||||
if(argc() == 2) {
|
if(argc() == 2) {
|
||||||
$post_id = intval(argv(1));
|
$post_id = intval(argv(1));
|
||||||
|
|
||||||
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
|
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
|
||||||
intval($post_id),
|
intval($post_id),
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
intval(ITEM_MODERATED)
|
intval(ITEM_MODERATED)
|
||||||
@@ -47,17 +50,26 @@ class Moderate extends \Zotlabs\Web\Controller {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
|
$item = $r[0];
|
||||||
|
|
||||||
if($action === 'approve') {
|
if($action === 'approve') {
|
||||||
q("update item set item_blocked = 0 where uid = %d and id = %d",
|
q("update item set item_blocked = 0 where uid = %d and id = %d",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
intval($post_id)
|
intval($post_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$item['item_blocked'] = 0;
|
||||||
|
|
||||||
|
item_update_parent_commented($item);
|
||||||
|
|
||||||
notice( t('Comment approved') . EOL);
|
notice( t('Comment approved') . EOL);
|
||||||
}
|
}
|
||||||
elseif($action === 'drop') {
|
elseif($action === 'drop') {
|
||||||
drop_item($post_id,false);
|
drop_item($post_id,false);
|
||||||
notice( t('Comment deleted') . EOL);
|
notice( t('Comment deleted') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// refetch the item after changes have been made
|
||||||
|
|
||||||
$r = q("select * from item where id = %d",
|
$r = q("select * from item where id = %d",
|
||||||
intval($post_id)
|
intval($post_id)
|
||||||
@@ -83,6 +95,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$o = conversation($items,'moderate',false,'traditional');
|
$o = conversation($items,'moderate',false,'traditional');
|
||||||
|
$o .= alt_pager(count($items));
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,12 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
return login(false);
|
return login(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($load)
|
$o = '';
|
||||||
|
|
||||||
|
if($load) {
|
||||||
$_SESSION['loadtime'] = datetime_convert();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
|
}
|
||||||
|
|
||||||
$arr = array('query' => \App::$query_string);
|
$arr = array('query' => \App::$query_string);
|
||||||
|
|
||||||
call_hooks('network_content_init', $arr);
|
call_hooks('network_content_init', $arr);
|
||||||
@@ -104,8 +107,9 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
|
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
|
||||||
}
|
}
|
||||||
|
|
||||||
$o = '';
|
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
|
||||||
|
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
|
||||||
|
|
||||||
|
|
||||||
// if no tabs are selected, defaults to comments
|
// if no tabs are selected, defaults to comments
|
||||||
|
|
||||||
@@ -115,15 +119,17 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
|
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
|
||||||
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
|
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
|
||||||
$spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
|
$spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
|
||||||
$cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
|
$cmin = ((array_key_exists('cmin',$_GET)) ? intval($_GET['cmin']) : $default_cmin);
|
||||||
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
|
$cmax = ((array_key_exists('cmax',$_GET)) ? intval($_GET['cmax']) : $default_cmax);
|
||||||
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
|
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
|
||||||
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
|
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
|
||||||
|
$net = ((x($_GET,'net')) ? $_GET['net'] : '');
|
||||||
|
|
||||||
$deftag = '';
|
$deftag = '';
|
||||||
|
|
||||||
if(x($_GET,'search') || x($_GET,'file'))
|
if(x($_GET,'search') || x($_GET,'file'))
|
||||||
$nouveau = true;
|
$nouveau = true;
|
||||||
|
|
||||||
if($cid) {
|
if($cid) {
|
||||||
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
||||||
intval($cid),
|
intval($cid),
|
||||||
@@ -138,7 +144,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
if($_GET['pf'] === '1')
|
if($_GET['pf'] === '1')
|
||||||
$deftag = '@' . t('forum') . '+' . intval($cid) . '+';
|
$deftag = '!' . t('forum') . '+' . intval($cid);
|
||||||
else
|
else
|
||||||
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
||||||
}
|
}
|
||||||
@@ -203,8 +209,10 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
: '');
|
: '');
|
||||||
|
|
||||||
$sql_nets = '';
|
$sql_nets = '';
|
||||||
|
|
||||||
|
$item_thread_top = ' AND item_thread_top = 1 ';
|
||||||
|
|
||||||
$sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE item_thread_top = 1 $sql_options ) ";
|
$sql_extra = '';
|
||||||
|
|
||||||
if($group) {
|
if($group) {
|
||||||
$contact_str = '';
|
$contact_str = '';
|
||||||
@@ -220,7 +228,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
$contact_str = ' 0 ';
|
$contact_str = ' 0 ';
|
||||||
info( t('Privacy group is empty'));
|
info( t('Privacy group is empty'));
|
||||||
}
|
}
|
||||||
|
$item_thread_top = '';
|
||||||
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) ";
|
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) ";
|
||||||
|
|
||||||
$x = group_rec_byhash(local_channel(), $group_hash);
|
$x = group_rec_byhash(local_channel(), $group_hash);
|
||||||
@@ -244,6 +252,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
intval(local_channel())
|
intval(local_channel())
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
|
$item_thread_top = '';
|
||||||
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) $item_normal ) ";
|
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) $item_normal ) ";
|
||||||
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
||||||
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
|
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
|
||||||
@@ -258,13 +267,14 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($xchan) {
|
elseif($xchan) {
|
||||||
$r = q("select * from xchan where xchan_hash = '%s'",
|
$r = q("select * from xchan where xchan_hash = '%s'",
|
||||||
dbesc($xchan)
|
dbesc($xchan)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
|
$item_thread_top = '';
|
||||||
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
|
||||||
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
|
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
||||||
|
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
|
||||||
));
|
));
|
||||||
$o = $tabs;
|
$o = $tabs;
|
||||||
$o .= $title;
|
$o .= $title;
|
||||||
@@ -306,8 +316,8 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
'$uid' => ((local_channel()) ? local_channel() : '0'),
|
'$uid' => ((local_channel()) ? local_channel() : '0'),
|
||||||
'$gid' => (($gid) ? $gid : '0'),
|
'$gid' => (($gid) ? $gid : '0'),
|
||||||
'$cid' => (($cid) ? $cid : '0'),
|
'$cid' => (($cid) ? $cid : '0'),
|
||||||
'$cmin' => (($cmin) ? $cmin : '0'),
|
'$cmin' => (($cmin) ? $cmin : '(-1)'),
|
||||||
'$cmax' => (($cmax) ? $cmax : '0'),
|
'$cmax' => (($cmax) ? $cmax : '(-1)'),
|
||||||
'$star' => (($star) ? $star : '0'),
|
'$star' => (($star) ? $star : '0'),
|
||||||
'$liked' => (($liked) ? $liked : '0'),
|
'$liked' => (($liked) ? $liked : '0'),
|
||||||
'$conv' => (($conv) ? $conv : '0'),
|
'$conv' => (($conv) ? $conv : '0'),
|
||||||
@@ -326,7 +336,8 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
'$tags' => urlencode($hashtags),
|
'$tags' => urlencode($hashtags),
|
||||||
'$dend' => $datequery,
|
'$dend' => $datequery,
|
||||||
'$mid' => '',
|
'$mid' => '',
|
||||||
'$verb' => $verb,
|
'$verb' => $verb,
|
||||||
|
'$net' => $net,
|
||||||
'$dbegin' => $datequery2
|
'$dbegin' => $datequery2
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -366,6 +377,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($conv) {
|
if($conv) {
|
||||||
|
$item_thread_top = '';
|
||||||
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
|
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
|
||||||
dbesc(protect_sprintf($channel['channel_hash']))
|
dbesc(protect_sprintf($channel['channel_hash']))
|
||||||
);
|
);
|
||||||
@@ -383,8 +395,9 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// cmin and cmax are both -1 when the affinity tool is disabled
|
||||||
if(($cmin != 0) || ($cmax != 99)) {
|
|
||||||
|
if(($cmin != (-1)) || ($cmax != (-1))) {
|
||||||
|
|
||||||
// Not everybody who shows up in the network stream will be in your address book.
|
// Not everybody who shows up in the network stream will be in your address book.
|
||||||
// By default those that aren't are assumed to have closeness = 99; but this isn't
|
// By default those that aren't are assumed to have closeness = 99; but this isn't
|
||||||
@@ -402,9 +415,11 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
if($cmax == 99)
|
if($cmax == 99)
|
||||||
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
|
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
|
||||||
|
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
|
||||||
|
|
||||||
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
|
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
|
||||||
$uids = " and item.uid = " . local_channel() . " ";
|
$uids = " and item.uid = " . local_channel() . " ";
|
||||||
|
|
||||||
@@ -439,12 +454,14 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
if($nouveau && $load) {
|
if($nouveau && $load) {
|
||||||
// "New Item View" - show all items unthreaded in reverse created date order
|
// "New Item View" - show all items unthreaded in reverse created date order
|
||||||
|
|
||||||
$items = q("SELECT item.*, item.id AS item_id, received FROM item
|
$items = q("SELECT item.*, item.id AS item_id, received FROM item
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
|
$net_query
|
||||||
WHERE true $uids $item_normal
|
WHERE true $uids $item_normal
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$simple_update
|
$simple_update
|
||||||
$sql_extra $sql_nets
|
$sql_extra $sql_options $sql_nets
|
||||||
|
$net_query2
|
||||||
ORDER BY item.received DESC $pager_sql "
|
ORDER BY item.received DESC $pager_sql "
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -466,25 +483,26 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
if($load) {
|
if($load) {
|
||||||
|
|
||||||
// Fetch a page full of parent items for this page
|
// Fetch a page full of parent items for this page
|
||||||
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
WHERE true $uids $item_normal
|
$net_query
|
||||||
AND item.parent = item.id
|
WHERE true $uids $item_thread_top $item_normal
|
||||||
|
AND item.mid = item.parent_mid
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$sql_extra3 $sql_extra $sql_nets
|
$sql_extra3 $sql_extra $sql_options $sql_nets
|
||||||
|
$net_query2
|
||||||
ORDER BY $ordering DESC $pager_sql "
|
ORDER BY $ordering DESC $pager_sql "
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// this is an update
|
// this is an update
|
||||||
$r = q("SELECT item.parent AS item_id FROM item
|
$r = q("SELECT item.parent AS item_id FROM item
|
||||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||||
|
$net_query
|
||||||
WHERE true $uids $item_normal_update $simple_update
|
WHERE true $uids $item_normal_update $simple_update
|
||||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||||
$sql_extra3 $sql_extra $sql_nets "
|
$sql_extra3 $sql_extra $sql_options $sql_nets $net_query2"
|
||||||
);
|
);
|
||||||
$_SESSION['loadtime'] = datetime_convert();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
}
|
}
|
||||||
@@ -523,13 +541,12 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($parents_str) {
|
if($parents_str) {
|
||||||
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
|
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
|
||||||
$update_unseen .= " AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
|
|
||||||
$update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
|
$update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($parents_str) {
|
if($parents_str) {
|
||||||
$update_unseen = " AND parent IN ( " . dbesc($parents_str) . " ) AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
|
$update_unseen = " AND parent IN ( " . dbesc($parents_str) . " )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -549,7 +566,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
$o .= conversation($items,$mode,$update,$page_mode);
|
$o .= conversation($items,$mode,$update,$page_mode);
|
||||||
|
|
||||||
if(($items) && (! $update))
|
if(($items) && (! $update))
|
||||||
$o .= alt_pager($a,count($items));
|
$o .= alt_pager(count($items));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,15 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
require_once('library/urlify/URLify.php');
|
require_once('library/urlify/URLify.php');
|
||||||
$result = array('error' => false, 'message' => '');
|
$result = array('error' => false, 'message' => '');
|
||||||
$n = trim($_REQUEST['name']);
|
$n = trim($_REQUEST['name']);
|
||||||
|
|
||||||
$x = strtolower(\URLify::transliterate($n));
|
$x = false;
|
||||||
|
|
||||||
|
if(get_config('system','unicode_usernames')) {
|
||||||
|
$x = punify(mb_strtolower($n));
|
||||||
|
}
|
||||||
|
|
||||||
|
if((! $x) || strlen($x) > 64)
|
||||||
|
$x = strtolower(\URLify::transliterate($n));
|
||||||
|
|
||||||
$test = array();
|
$test = array();
|
||||||
|
|
||||||
@@ -43,7 +50,14 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
$result = array('error' => false, 'message' => '');
|
$result = array('error' => false, 'message' => '');
|
||||||
$n = trim($_REQUEST['nick']);
|
$n = trim($_REQUEST['nick']);
|
||||||
|
|
||||||
$x = strtolower(\URLify::transliterate($n));
|
$x = false;
|
||||||
|
|
||||||
|
if(get_config('system','unicode_usernames')) {
|
||||||
|
$x = punify(mb_strtolower($n));
|
||||||
|
}
|
||||||
|
|
||||||
|
if((! $x) || strlen($x) > 64)
|
||||||
|
$x = strtolower(\URLify::transliterate($n));
|
||||||
|
|
||||||
$test = array();
|
$test = array();
|
||||||
|
|
||||||
@@ -89,9 +103,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
change_channel($result['channel']['channel_id']);
|
change_channel($result['channel']['channel_id']);
|
||||||
|
|
||||||
if(! strlen($next_page = get_config('system','workflow_channel_next')))
|
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
|
||||||
$next_page = 'settings';
|
|
||||||
|
|
||||||
goaway(z_root() . '/' . $next_page);
|
goaway(z_root() . '/' . $next_page);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -134,16 +146,17 @@ class New_channel extends \Zotlabs\Web\Controller {
|
|||||||
$name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'), "*");
|
$name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'), "*");
|
||||||
$nickhub = '@' . \App::get_hostname();
|
$nickhub = '@' . \App::get_hostname();
|
||||||
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub), "*");
|
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub), "*");
|
||||||
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Account_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
|
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Channel_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
|
||||||
|
|
||||||
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
|
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
|
||||||
'$title' => t('Create Channel'),
|
'$title' => t('Create Channel'),
|
||||||
'$desc' => t('A channel is your identity on this network. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'),
|
'$desc' => t('A channel is a unique network identity. It can represent a person (social network profile), a forum (group), a business or celebrity page, a newsfeed, and many other things. Channels can make connections with other channels to share information with each other.') . ' ' . t('The type of channel you create affects the basic privacy settings, the permissions that are granted to connections/friends, and also the channel\'s visibility across the network.'),
|
||||||
'$label_import' => t('or <a href="import">import an existing channel</a> from another location.'),
|
'$label_import' => t('or <a href="import">import an existing channel</a> from another location.'),
|
||||||
'$name' => $name,
|
'$name' => $name,
|
||||||
'$role' => $role,
|
'$role' => $role,
|
||||||
'$default_role' => $default_role,
|
'$default_role' => $default_role,
|
||||||
'$nickname' => $nickname,
|
'$nickname' => $nickname,
|
||||||
|
'$validate' => t('Validate'),
|
||||||
'$submit' => t('Create'),
|
'$submit' => t('Create'),
|
||||||
'$channel_usage_message' => $channel_usage_message
|
'$channel_usage_message' => $channel_usage_message
|
||||||
));
|
));
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user