mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-23 09:45:45 -04:00
Compare commits
1497 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52ad5b7df5 | ||
|
|
1b1d11dcf1 | ||
|
|
35200e5f1b | ||
|
|
091ef33f18 | ||
|
|
aa01c2f4db | ||
|
|
740015339d | ||
|
|
b7778ca1f9 | ||
|
|
ddd77ee6ee | ||
|
|
b625b5f645 | ||
|
|
c9e272a78d | ||
|
|
9bfb63fd98 | ||
|
|
21ecf54b73 | ||
|
|
429e3ce30a | ||
|
|
26e20d35c2 | ||
|
|
f40406514c | ||
|
|
ed79bef51b | ||
|
|
0cde7f9897 | ||
|
|
85e21ce617 | ||
|
|
157a9e895c | ||
|
|
7e2635adfe | ||
|
|
b655d04b34 | ||
|
|
7f84933cab | ||
|
|
36220fdde8 | ||
|
|
67848c03ed | ||
|
|
685d05f98b | ||
|
|
931afe98b1 | ||
|
|
4a6f775334 | ||
|
|
5fa3e10701 | ||
|
|
896d29d0c0 | ||
|
|
4c633a9fb8 | ||
|
|
5fd1674d50 | ||
|
|
67cbeaa3d4 | ||
|
|
23f3d554b8 | ||
|
|
95355ddec0 | ||
|
|
cbab7d2150 | ||
|
|
4284088611 | ||
|
|
bb70223509 | ||
|
|
98fb2ec639 | ||
|
|
a8cef79b1a | ||
|
|
5076e38c1c | ||
|
|
e000d98cc5 | ||
|
|
38cc88c861 | ||
|
|
48e74035f2 | ||
|
|
38bccecc04 | ||
|
|
3ebe35f7f7 | ||
|
|
b81f1111d1 | ||
|
|
ac8db6479e | ||
|
|
d903772831 | ||
|
|
cc71e507cb | ||
|
|
fe44ebee93 | ||
|
|
c80e009cf3 | ||
|
|
f6e8ce5516 | ||
|
|
f808a2b5a1 | ||
|
|
51a2e64a89 | ||
|
|
bf24a106ce | ||
|
|
1387b88ba4 | ||
|
|
d9ece80fda | ||
|
|
b88a9c2627 | ||
|
|
18dbc490fe | ||
|
|
d753492382 | ||
|
|
8c26db63dd | ||
|
|
5d7d30f789 | ||
|
|
63a3f5149a | ||
|
|
c28e27357a | ||
|
|
fa6e5e4d75 | ||
|
|
cae0a26ac0 | ||
|
|
156010050c | ||
|
|
524551a05c | ||
|
|
b89387d608 | ||
|
|
cef1c09db6 | ||
|
|
712759ea4b | ||
|
|
66fc12c928 | ||
|
|
f66fb8e2a8 | ||
|
|
bb786b1f61 | ||
|
|
62610b5ec0 | ||
|
|
2594178158 | ||
|
|
4866ed5283 | ||
|
|
86e93664d0 | ||
|
|
07f0043428 | ||
|
|
e4f15c078a | ||
|
|
35f29b5d8a | ||
|
|
3716f4e809 | ||
|
|
6cf040d3ee | ||
|
|
48a25b1b85 | ||
|
|
d448742ae5 | ||
|
|
f801f52274 | ||
|
|
eabbad176d | ||
|
|
e6d7f22ba9 | ||
|
|
36d73b3da9 | ||
|
|
dcd8fb289e | ||
|
|
0dc266153d | ||
|
|
7850ecbd95 | ||
|
|
1cb60c7f5e | ||
|
|
e4ed0f8acd | ||
|
|
28043726e6 | ||
|
|
9c5df51141 | ||
|
|
eedfb7de32 | ||
|
|
3fc955abfd | ||
|
|
615fa1119f | ||
|
|
7e736c5359 | ||
|
|
2f3c3db020 | ||
|
|
967d4da30a | ||
|
|
7a144b90fb | ||
|
|
4a028b6015 | ||
|
|
8da0f9d356 | ||
|
|
fc396f16ff | ||
|
|
b5e4a5f51c | ||
|
|
77ba647778 | ||
|
|
10491294d8 | ||
|
|
65cbc7c2bb | ||
|
|
1a75e3c24a | ||
|
|
b0b67fbcc4 | ||
|
|
254a6be277 | ||
|
|
fdf920b374 | ||
|
|
dffd82cb24 | ||
|
|
633693c94b | ||
|
|
9840d1ce73 | ||
|
|
6a45bd4372 | ||
|
|
b361fb4f89 | ||
|
|
530bc996ca | ||
|
|
2f2bd03b15 | ||
|
|
a8f179145b | ||
|
|
912ccb31a1 | ||
|
|
6959c9e423 | ||
|
|
53363d6808 | ||
|
|
1b9a350469 | ||
|
|
d0f7b1d9b7 | ||
|
|
86c0abe67e | ||
|
|
46cc64f2d8 | ||
|
|
9e29c13678 | ||
|
|
438ce44af9 | ||
|
|
e37ccb7a63 | ||
|
|
afaa8012c8 | ||
|
|
c4778e5e24 | ||
|
|
d5ee8d80ab | ||
|
|
1fbc131469 | ||
|
|
468af29e3e | ||
|
|
b05e7943c2 | ||
|
|
dbf0c1893c | ||
|
|
950006a4de | ||
|
|
2f7dfb0286 | ||
|
|
7c98aea524 | ||
|
|
688c5bdd20 | ||
|
|
4feff1cf89 | ||
|
|
df2d181602 | ||
|
|
752a9d904c | ||
|
|
a5b9fbaf00 | ||
|
|
7bf1c5f27b | ||
|
|
d841303c04 | ||
|
|
5e5b9895df | ||
|
|
ac8f798e56 | ||
|
|
5c8ec5cce4 | ||
|
|
19e509d997 | ||
|
|
38b230a128 | ||
|
|
b47fdd748f | ||
|
|
c69c7db4f7 | ||
|
|
de20d8f73a | ||
|
|
5deecfea28 | ||
|
|
dfa48ba17c | ||
|
|
b3928f3d2a | ||
|
|
009ecb0ff4 | ||
|
|
68ffddafb1 | ||
|
|
d3bc50e18d | ||
|
|
d3f741a8b6 | ||
|
|
ad4e8fd7f5 | ||
|
|
2c7597066c | ||
|
|
c06c2650e5 | ||
|
|
9d664df993 | ||
|
|
89ecc07eb0 | ||
|
|
9ffb10c0e6 | ||
|
|
dd4b8529c2 | ||
|
|
5d1d6299cd | ||
|
|
4e1c32e610 | ||
|
|
d6f98ab88e | ||
|
|
7188e719ef | ||
|
|
2328dfc851 | ||
|
|
30c00df4f3 | ||
|
|
e1b85a361c | ||
|
|
915328d92a | ||
|
|
6019a34da2 | ||
|
|
5a9e6c8a69 | ||
|
|
57231a8807 | ||
|
|
dd9f7ef6e9 | ||
|
|
8b76b5a0a6 | ||
|
|
3d3e7bafd5 | ||
|
|
a42ff1e6d4 | ||
|
|
ea8ff7037a | ||
|
|
2438af1cb5 | ||
|
|
a32626e489 | ||
|
|
3a9f149c80 | ||
|
|
a0e4f7ddb1 | ||
|
|
8189408190 | ||
|
|
db0a3a7534 | ||
|
|
5f612521da | ||
|
|
53efd4e470 | ||
|
|
22a9e4c9a9 | ||
|
|
56f0244360 | ||
|
|
60a7e68b1b | ||
|
|
ec6d4f8ac3 | ||
|
|
a6ab3dd36a | ||
|
|
6bf0f4225c | ||
|
|
4df5d44ef9 | ||
|
|
dd962027cc | ||
|
|
7c05500392 | ||
|
|
5d83469621 | ||
|
|
d03c27d18c | ||
|
|
7e8c7f86f0 | ||
|
|
b438ffead4 | ||
|
|
cbaaa1c57f | ||
|
|
f0690aadcc | ||
|
|
fc31ecdab0 | ||
|
|
6bfc5aa96c | ||
|
|
5505f5fa02 | ||
|
|
6349a7417f | ||
|
|
e1a55ba471 | ||
|
|
881406f82b | ||
|
|
293e405f5b | ||
|
|
8d6441704b | ||
|
|
9fcb3bf2e8 | ||
|
|
7d088c8d56 | ||
|
|
ed3d3b6f27 | ||
|
|
dcd5f00077 | ||
|
|
4aa9549828 | ||
|
|
bca3113fba | ||
|
|
a8a2c806f2 | ||
|
|
e00c5c6bf1 | ||
|
|
7e8c895ccd | ||
|
|
139c39c2ce | ||
|
|
6bae91dd7e | ||
|
|
c115e8ee60 | ||
|
|
ddebbcc0a0 | ||
|
|
4f3be92a0d | ||
|
|
9655b27f81 | ||
|
|
5a475453ab | ||
|
|
eb04dbc5ce | ||
|
|
2bf76928cc | ||
|
|
89d97c556a | ||
|
|
4ff2b8ed1b | ||
|
|
ed17e8a649 | ||
|
|
33700e9cf4 | ||
|
|
13b3594ff3 | ||
|
|
eebeb450c3 | ||
|
|
0fe449ba33 | ||
|
|
cd4454100b | ||
|
|
fb060c27ef | ||
|
|
fcd9e115c2 | ||
|
|
cf00a9dbfc | ||
|
|
bace238e9f | ||
|
|
7586bc9dcf | ||
|
|
7a294c3843 | ||
|
|
2599d78d0c | ||
|
|
fc6b337bbb | ||
|
|
ea17b46e94 | ||
|
|
9cf8931136 | ||
|
|
afb29176a4 | ||
|
|
1da0042ee5 | ||
|
|
76d8e59e9b | ||
|
|
1061027071 | ||
|
|
a403611ac9 | ||
|
|
2b3f931c85 | ||
|
|
9bf26cee6d | ||
|
|
d9066ef26b | ||
|
|
4610fa2774 | ||
|
|
fff720c00d | ||
|
|
7e26200510 | ||
|
|
1dbf89362f | ||
|
|
cc1453a8de | ||
|
|
a8def37dcf | ||
|
|
355a9ac7ee | ||
|
|
a8274bbfb3 | ||
|
|
7dadbbbac7 | ||
|
|
49f7d63290 | ||
|
|
0044906fab | ||
|
|
ac8706e919 | ||
|
|
5b48eb3657 | ||
|
|
43f04e4bc0 | ||
|
|
649260ce44 | ||
|
|
f091a3c9fc | ||
|
|
18338495af | ||
|
|
a3f9cf7e97 | ||
|
|
ef0f195fe8 | ||
|
|
469809183d | ||
|
|
8611e7f8a6 | ||
|
|
55e1026c98 | ||
|
|
9e1af2492f | ||
|
|
4eb40528a9 | ||
|
|
6ba77ce0e2 | ||
|
|
a256195767 | ||
|
|
23b53cd1ce | ||
|
|
26d69796d0 | ||
|
|
71307d3a2e | ||
|
|
acb114d0d1 | ||
|
|
1781df006f | ||
|
|
63f84ece6e | ||
|
|
d0d14579d1 | ||
|
|
b11db26edf | ||
|
|
6d7e364a0d | ||
|
|
7e99931733 | ||
|
|
8733d9f2a6 | ||
|
|
29da06c298 | ||
|
|
7a1afc315d | ||
|
|
244e813bfa | ||
|
|
0bc2a4f603 | ||
|
|
6abbadf6c8 | ||
|
|
8b4af7cf0b | ||
|
|
1ca6ef0f60 | ||
|
|
dae89ce91c | ||
|
|
056f3d352c | ||
|
|
620e8f2f0b | ||
|
|
7f7e049397 | ||
|
|
40d99c1716 | ||
|
|
2dd66df8eb | ||
|
|
eabf804dc9 | ||
|
|
b955c2d2c5 | ||
|
|
5a6141faa2 | ||
|
|
da460ff32f | ||
|
|
12c571a187 | ||
|
|
179eeb10a6 | ||
|
|
aac5fd96cc | ||
|
|
16930c1c54 | ||
|
|
76a2a5c432 | ||
|
|
de63e40a70 | ||
|
|
803e85caeb | ||
|
|
062dea8e13 | ||
|
|
959667c009 | ||
|
|
46152cc56b | ||
|
|
c8fc3ad7cd | ||
|
|
301e405769 | ||
|
|
229d82c4c7 | ||
|
|
d9759ba63c | ||
|
|
2d1dbc8f40 | ||
|
|
1b160c0a2d | ||
|
|
356c7003f2 | ||
|
|
83f8a03964 | ||
|
|
7ed32a764c | ||
|
|
4f69bcfc38 | ||
|
|
9a82b8414b | ||
|
|
0b05203cf4 | ||
|
|
4135a10211 | ||
|
|
7991db14be | ||
|
|
1509c9682b | ||
|
|
e7287152a2 | ||
|
|
082bd58805 | ||
|
|
e288f46967 | ||
|
|
efb0ac5996 | ||
|
|
984de8f46f | ||
|
|
2c819c8619 | ||
|
|
10ce6cc154 | ||
|
|
7c1d1f8bd3 | ||
|
|
bcaa0dacdf | ||
|
|
5dae0ef4f9 | ||
|
|
62bc5e8051 | ||
|
|
ef6e067a45 | ||
|
|
721496f922 | ||
|
|
be225164eb | ||
|
|
1650ac2edd | ||
|
|
bb1aa04689 | ||
|
|
67bb167cf8 | ||
|
|
b4be1da91e | ||
|
|
d41556a1ea | ||
|
|
50796079fa | ||
|
|
9acf007687 | ||
|
|
dafe0afa65 | ||
|
|
30d0f9888c | ||
|
|
2bd7d30a5b | ||
|
|
cab22f228a | ||
|
|
0545baaf56 | ||
|
|
fbd26e8d9d | ||
|
|
6ad4ed87a3 | ||
|
|
3c8de7b59d | ||
|
|
611e22d676 | ||
|
|
0c43a9bb5d | ||
|
|
eb85d381fd | ||
|
|
aab16123b5 | ||
|
|
1f8b4b14a4 | ||
|
|
4640253614 | ||
|
|
e646684493 | ||
|
|
257dcaaf8b | ||
|
|
a30934c563 | ||
|
|
5e6f6e2c3e | ||
|
|
620082c16b | ||
|
|
83c18f4d4a | ||
|
|
b2218574ee | ||
|
|
1b959a4731 | ||
|
|
8ee4a54c10 | ||
|
|
acb0604a71 | ||
|
|
26a7c88ddf | ||
|
|
70a0a83363 | ||
|
|
894f5bc79a | ||
|
|
b47b917eb0 | ||
|
|
c41c04cf11 | ||
|
|
0895756658 | ||
|
|
c6e65ec6da | ||
|
|
192b69b11a | ||
|
|
733a5ccb08 | ||
|
|
b0ca73c1ba | ||
|
|
367937e479 | ||
|
|
6e91d85bcb | ||
|
|
f995ef0124 | ||
|
|
4a26f0d2d4 | ||
|
|
90cf238019 | ||
|
|
97cb108937 | ||
|
|
34f6d9f714 | ||
|
|
76e644e18a | ||
|
|
a0cefe7fdb | ||
|
|
be4c9a9598 | ||
|
|
be852ba857 | ||
|
|
3370e8516f | ||
|
|
998dd58206 | ||
|
|
108cc7b270 | ||
|
|
ace8252569 | ||
|
|
56113b0bde | ||
|
|
b52e9731e3 | ||
|
|
61a8a16139 | ||
|
|
eff72aeb47 | ||
|
|
94316da63e | ||
|
|
ae35ac0cec | ||
|
|
2f9a044559 | ||
|
|
1f429a0033 | ||
|
|
a3ed0b94cd | ||
|
|
204838bd10 | ||
|
|
dd806bd031 | ||
|
|
8442693d7a | ||
|
|
cd526139fb | ||
|
|
75c8f656c9 | ||
|
|
459ec78a5e | ||
|
|
6bf5eea646 | ||
|
|
e9f49d9d9c | ||
|
|
9713436f49 | ||
|
|
406ea67bbc | ||
|
|
a24d254404 | ||
|
|
285781b887 | ||
|
|
40db68886d | ||
|
|
d5088549f8 | ||
|
|
03851ee7cc | ||
|
|
2d460117fc | ||
|
|
73cabbf822 | ||
|
|
411b7964ab | ||
|
|
bc45c5368e | ||
|
|
7a65b6cfe4 | ||
|
|
ee464c6589 | ||
|
|
d83f12e883 | ||
|
|
76770c69bf | ||
|
|
e9225b15d2 | ||
|
|
3056b96bb0 | ||
|
|
856945d838 | ||
|
|
be1c05a03f | ||
|
|
34717cc83c | ||
|
|
e73cde1612 | ||
|
|
a9b71f5b4a | ||
|
|
c99fb4b7f1 | ||
|
|
b28279241b | ||
|
|
5c5ae2969e | ||
|
|
3af691043d | ||
|
|
9615d02b35 | ||
|
|
7a55ead97d | ||
|
|
cd200ee706 | ||
|
|
db930b794d | ||
|
|
08bcd29eee | ||
|
|
3f75dd1083 | ||
|
|
eb2d6fca3a | ||
|
|
32423a7706 | ||
|
|
57cb4ccb74 | ||
|
|
12c9e64463 | ||
|
|
d872a0ca86 | ||
|
|
9c5ddf079a | ||
|
|
f094ac19d1 | ||
|
|
7f244a8039 | ||
|
|
14953fa5c9 | ||
|
|
75f73fffe1 | ||
|
|
897dd7f380 | ||
|
|
95f1366f0c | ||
|
|
feb5d3af89 | ||
|
|
875597cde1 | ||
|
|
f15c12376a | ||
|
|
b223e364c6 | ||
|
|
e1738e8021 | ||
|
|
a33dfff188 | ||
|
|
0c27fdd944 | ||
|
|
f897cd6bc8 | ||
|
|
1bc9672ec8 | ||
|
|
dfce7c6ca4 | ||
|
|
6e61e2a45b | ||
|
|
eabed9d0e5 | ||
|
|
2af61605f2 | ||
|
|
0992822ce5 | ||
|
|
f08777c9ac | ||
|
|
472ed909cd | ||
|
|
3ed19f5b00 | ||
|
|
a60b91b21e | ||
|
|
40dd8aa3d4 | ||
|
|
02459ebde0 | ||
|
|
774dc871cc | ||
|
|
7bb69e20f5 | ||
|
|
6e0be570dd | ||
|
|
5dd291fc60 | ||
|
|
630ccf3810 | ||
|
|
8d16092171 | ||
|
|
05c137c1ab | ||
|
|
83e0442b66 | ||
|
|
98cfad5f2d | ||
|
|
a48e795f8a | ||
|
|
f620274c6a | ||
|
|
ae5b3a83f1 | ||
|
|
5e23640563 | ||
|
|
7d3dfc3ed8 | ||
|
|
5b0991fabc | ||
|
|
0fa638399f | ||
|
|
d59c6aa887 | ||
|
|
b6ec8bf687 | ||
|
|
f28d6ad59e | ||
|
|
e841e48258 | ||
|
|
c0141a7d5e | ||
|
|
aa15867c95 | ||
|
|
8d87b529f5 | ||
|
|
900663b85f | ||
|
|
1e79107d0e | ||
|
|
52803a30b6 | ||
|
|
eb30658c68 | ||
|
|
f77aaf1def | ||
|
|
8c7bf6d2f3 | ||
|
|
94df121e0a | ||
|
|
873670594b | ||
|
|
09ef1b1bb6 | ||
|
|
31e9efdae0 | ||
|
|
bb2103ac45 | ||
|
|
e98c74bce7 | ||
|
|
feb03dc194 | ||
|
|
bb8f73b58a | ||
|
|
02da3adb5a | ||
|
|
28d1913d84 | ||
|
|
051ab698ed | ||
|
|
9014524477 | ||
|
|
316f68c12d | ||
|
|
9387be1aa7 | ||
|
|
c3ca257f18 | ||
|
|
d0ba2cf6d4 | ||
|
|
e33d8c288b | ||
|
|
34fbcfdfaa | ||
|
|
2e9738e204 | ||
|
|
9a7e8f4d68 | ||
|
|
7b445a5b39 | ||
|
|
ce13fef6aa | ||
|
|
38e99c8354 | ||
|
|
a85b1efa4f | ||
|
|
00a95f4b91 | ||
|
|
433951ab55 | ||
|
|
baa46e105c | ||
|
|
4e389b474a | ||
|
|
63c76eae0c | ||
|
|
9431785466 | ||
|
|
953391cca9 | ||
|
|
8e0fc9e762 | ||
|
|
fe4defe752 | ||
|
|
f32ba06564 | ||
|
|
a5a6488757 | ||
|
|
b8aabde6c3 | ||
|
|
44d4f0a484 | ||
|
|
09666ae8e9 | ||
|
|
4a60f45220 | ||
|
|
7b9946079f | ||
|
|
fe724acc3b | ||
|
|
4409b2b40a | ||
|
|
33f446fcd0 | ||
|
|
953d02e4b7 | ||
|
|
a124c120f4 | ||
|
|
5f8b093d79 | ||
|
|
f923d21df3 | ||
|
|
5a9e9284c2 | ||
|
|
c7c04aba3d | ||
|
|
33503349ec | ||
|
|
ef3994da30 | ||
|
|
2e758f11e7 | ||
|
|
7283e2e279 | ||
|
|
352dd364d2 | ||
|
|
d5c3363909 | ||
|
|
2ede8e3675 | ||
|
|
fe318d4eb8 | ||
|
|
c0bf3c8af1 | ||
|
|
175a3c4008 | ||
|
|
e9f3095f41 | ||
|
|
ebf540ffbc | ||
|
|
4f1031f92b | ||
|
|
ddb9db188b | ||
|
|
63e8f1f36b | ||
|
|
a3f77409a4 | ||
|
|
705ff97892 | ||
|
|
1bb2d0b954 | ||
|
|
0773b9bf92 | ||
|
|
da775d182a | ||
|
|
0f836c9d5e | ||
|
|
e77914fe3f | ||
|
|
ed785fbb1b | ||
|
|
25f34d8ad3 | ||
|
|
0a51ea1bfa | ||
|
|
9ffad65b65 | ||
|
|
8face5a66c | ||
|
|
edd91a7ed1 | ||
|
|
c5b32032a7 | ||
|
|
4bb93c4327 | ||
|
|
e11e99b2d1 | ||
|
|
2dce7c212f | ||
|
|
2ea87b65ca | ||
|
|
a6c42e8756 | ||
|
|
b688dc3995 | ||
|
|
59ac3d04eb | ||
|
|
97308ad2fb | ||
|
|
2dff10564c | ||
|
|
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 | ||
|
|
8970d30c93 | ||
|
|
75285fd452 | ||
|
|
76c8bbf7b8 | ||
|
|
eb3e43feec | ||
|
|
08bea83c03 | ||
|
|
8892568652 | ||
|
|
ce10a44e72 | ||
|
|
0f5bc00586 | ||
|
|
50ec3b300b | ||
|
|
2c5b6cf8dc | ||
|
|
f2ec84fb13 | ||
|
|
51d791d824 | ||
|
|
db08e2cea0 | ||
|
|
619f8f752b | ||
|
|
e8958b1fb8 | ||
|
|
07b67963f1 | ||
|
|
b0a491eaa8 | ||
|
|
47c14d3ca1 | ||
|
|
6a8c583220 | ||
|
|
468e976a88 | ||
|
|
25a63dc413 | ||
|
|
61e019e176 | ||
|
|
894b3706e7 | ||
|
|
e59237e680 | ||
|
|
b05c1c391c | ||
|
|
c09bab466a | ||
|
|
46cc360e4e | ||
|
|
d6ff8dc9b6 | ||
|
|
d0d72c7fd2 | ||
|
|
f0798f7833 | ||
|
|
3ce79dd6e1 | ||
|
|
ef7225b4f6 | ||
|
|
906cbbe45d | ||
|
|
dfb75840b8 | ||
|
|
75804d7ce5 | ||
|
|
62f0266f46 | ||
|
|
0600817ef7 | ||
|
|
214fa81ec6 | ||
|
|
98fd311891 | ||
|
|
0d415fb3c9 | ||
|
|
8d0cdf5c9a | ||
|
|
aa63c23839 | ||
|
|
0bb5f38ba5 | ||
|
|
6f21b3dc34 | ||
|
|
e13d7beac4 | ||
|
|
4562e1cc1c | ||
|
|
67dd9c2930 | ||
|
|
e9c91a3ef3 | ||
|
|
4cde513523 | ||
|
|
ada578e7e3 | ||
|
|
f826c09abc | ||
|
|
3bd7133ba3 | ||
|
|
ce38350e00 | ||
|
|
45923f408f | ||
|
|
94e92bb4bf | ||
|
|
3fadedcc54 | ||
|
|
e095cb8113 | ||
|
|
1fcf59ff94 | ||
|
|
5cfb63da50 | ||
|
|
38646fe0e1 | ||
|
|
e418a6b3d4 | ||
|
|
ab1dec813b | ||
|
|
4a71fb0831 | ||
|
|
5a8efc10d8 | ||
|
|
1aa9ce8fe5 | ||
|
|
32dfa4e868 | ||
|
|
b507ac1f98 | ||
|
|
601706b7b5 | ||
|
|
ef952a41b3 | ||
|
|
e7f6cd2cfa | ||
|
|
8e626a0142 | ||
|
|
d4af870bb6 | ||
|
|
89fbb86c7b | ||
|
|
8e4dea2334 | ||
|
|
8340d152e1 | ||
|
|
f825e27f1a | ||
|
|
e7143a265a | ||
|
|
c087d1e18b | ||
|
|
51d9c37f6b | ||
|
|
057da80f2f | ||
|
|
9c72963d7c | ||
|
|
64fe15b6f5 | ||
|
|
73766caa81 | ||
|
|
d92ceed737 | ||
|
|
4ff533769a | ||
|
|
e3ce0496f5 | ||
|
|
8ef422a79b | ||
|
|
4a6e6ba1b2 | ||
|
|
8b3535bd0f | ||
|
|
28b2db93dc | ||
|
|
439d41b194 | ||
|
|
08a8f195e7 | ||
|
|
fe960d7c28 | ||
|
|
07b628b667 | ||
|
|
fcb3674ce4 | ||
|
|
ad487ec9f7 | ||
|
|
7cfe4c0f01 | ||
|
|
77ffc385ab | ||
|
|
78146d6417 | ||
|
|
59779f2a0e | ||
|
|
b1e191ce21 | ||
|
|
7181cf9012 | ||
|
|
d304821977 | ||
|
|
55f3198c9c | ||
|
|
a3d39b223d | ||
|
|
5c5fc0a62f | ||
|
|
26b92c8564 | ||
|
|
f965d9dc9e | ||
|
|
538845cbf5 | ||
|
|
684b572aa8 | ||
|
|
869126259b | ||
|
|
a61c72b3b2 | ||
|
|
a07b5ba4dd | ||
|
|
412f177c56 | ||
|
|
215d615fc3 | ||
|
|
979c05b24d | ||
|
|
e5653945d3 | ||
|
|
0a55d6d511 | ||
|
|
95311ad07e | ||
|
|
ef4a0e5af5 | ||
|
|
3acc5b0508 | ||
|
|
981631752a | ||
|
|
4471f580d7 | ||
|
|
e5141dd91b | ||
|
|
9936670f44 | ||
|
|
6ac3fc4e07 | ||
|
|
babe14410c | ||
|
|
4cd0b745cb | ||
|
|
cf4588f16f | ||
|
|
d43542dd7a | ||
|
|
59caf141d1 | ||
|
|
71a30cd9a5 | ||
|
|
ef27a1ce6c | ||
|
|
75471ba10f | ||
|
|
5e47b767ea | ||
|
|
7ef641e256 |
@@ -34,22 +34,36 @@ Software
|
||||
## The basic steps (quick overview)
|
||||
|
||||
+ 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
|
||||
- mkdir -p /var/www
|
||||
- cd /var/www
|
||||
- git clone https://github.com/redmatrix/hubzilla.git html
|
||||
- cd /html/.homeinstall
|
||||
- cd html/.homeinstall
|
||||
- cp hubzilla-config.txt.template hubzilla-config.txt
|
||||
- nano hubzilla-config.txt
|
||||
- Read the comments carefully
|
||||
- Enter your values: db pass, domain, values for dyn DNS
|
||||
- Make sure your your external drive (for backups) is mounted
|
||||
- Make sure your external drive (for backups) is mounted
|
||||
- hubzilla-setup.sh as root
|
||||
- ... wait, wait, wait until the script is finised
|
||||
- reboot
|
||||
+ Open your domain with a browser and step throught the initial configuration of hubzilla.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If the check of the mail address fails when you try to register the very first user in the browser. Do...
|
||||
|
||||
cd /var/www/html
|
||||
util/config system.do_not_check_dns 1
|
||||
|
||||
## Optional - Set path to imagemagick
|
||||
|
||||
In Admin settings of hubzilla or via terminal
|
||||
|
||||
cd /var/www/html
|
||||
util/config system.imagick_convert_path /usr/bin/convert
|
||||
|
||||
# Step-by-Step in Detail
|
||||
|
||||
## Preparations Hardware
|
||||
@@ -120,7 +134,7 @@ There are two ways to get a domain...
|
||||
|
||||
The cost are around 10,- € once and 1,50 € per month (2017).
|
||||
|
||||
The cost are around 10,- € once and 1,50 € per month (2017).
|
||||
### Method 2: Register a free subdomain
|
||||
|
||||
...for example register at freedns.afraid.org
|
||||
|
||||
@@ -150,7 +164,7 @@ Make the directory for apache and change diretory to it
|
||||
|
||||
Clone hubzilla from git ("git pull" will update it later)
|
||||
|
||||
git clone https://github.com/redmatrix/hubzilla html
|
||||
git clone https://framagit.org/hubzilla/core html
|
||||
|
||||
Change to the install script
|
||||
|
||||
@@ -189,9 +203,16 @@ Leave db type "MySQL" untouched.
|
||||
|
||||
Follow the instructions in the next pages.
|
||||
|
||||
Recommended: Set path to imagemagick
|
||||
|
||||
- in admin settings of hubzilla or
|
||||
- via terminal
|
||||
|
||||
util/config system.imagick_convert_path /usr/bin/convert
|
||||
|
||||
After the daily script was executed at 05:30 (am)
|
||||
|
||||
- look at var/www/html/hubzilla-daily.log
|
||||
- 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
|
||||
@@ -213,4 +234,12 @@ to boot the Rapsi to the client console.
|
||||
|
||||
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
|
||||
|
||||
On a Raspian Stretch (Debian 9) the validation of the mail address fails for the very first user.
|
||||
This used to happen on some *bsd distros but there was some work to fix that a year ago (2017).
|
||||
|
||||
So if your system isn't registered in DNS or DNS isn't active do
|
||||
|
||||
cd /var/www/html
|
||||
util/config system.do_not_check_dns 1
|
||||
|
||||
|
||||
|
||||
@@ -136,17 +136,17 @@ function check_config {
|
||||
# backup is important and should be checked
|
||||
if [ -n "$backup_device_name" ]
|
||||
then
|
||||
device_mounted=0
|
||||
if [ ! -d "$backup_mount_point" ]
|
||||
then
|
||||
mkdir "$backup_mount_point"
|
||||
fi
|
||||
device_mounted=0
|
||||
if fdisk -l | grep -i "$backup_device_name.*linux"
|
||||
then
|
||||
print_info "ok - filesystem of external device is linux"
|
||||
if [ -n "$backup_device_pass" ]
|
||||
then
|
||||
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
|
||||
if [ ! -d /media/hubzilla_backup ]
|
||||
then
|
||||
mkdir /media/hubzilla_backup
|
||||
fi
|
||||
if mount /dev/mapper/cryptobackup /media/hubzilla_backup
|
||||
then
|
||||
device_mounted=1
|
||||
@@ -246,6 +246,11 @@ function install_apache {
|
||||
nocheck_install "apache2 apache2-utils"
|
||||
}
|
||||
|
||||
function install_imagemagick {
|
||||
print_info "installing imagemagick..."
|
||||
nocheck_install "imagemagick"
|
||||
}
|
||||
|
||||
function install_curl {
|
||||
print_info "installing curl..."
|
||||
nocheck_install "curl"
|
||||
@@ -567,7 +572,7 @@ function check_https {
|
||||
function install_hubzilla {
|
||||
print_info "installing hubzilla addons..."
|
||||
cd /var/www/html/
|
||||
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
|
||||
util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons
|
||||
mkdir -p "store/[data]/smarty3"
|
||||
chmod -R 777 store
|
||||
touch .htconfig.php
|
||||
@@ -641,7 +646,7 @@ function configure_cron_daily {
|
||||
# every 10 min for poller.php
|
||||
if [ -z "`grep 'poller.php' /etc/crontab`" ]
|
||||
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
|
||||
# Run external script daily at 05:30
|
||||
# - stop apache and mysql-server
|
||||
@@ -801,6 +806,7 @@ update_upgrade
|
||||
install_curl
|
||||
install_sendmail
|
||||
install_apache
|
||||
install_imagemagick
|
||||
install_php
|
||||
install_mysql
|
||||
install_phpmyadmin
|
||||
|
||||
26
.travis.yml
26
.travis.yml
@@ -62,28 +62,34 @@ matrix:
|
||||
fast_finish: true
|
||||
# Additional check combinations
|
||||
include:
|
||||
# PHP7.1, mariadb 10.1
|
||||
- php: '7.1'
|
||||
env: DB=mariadb MARIADB_VERSION=10.1 CODECOV=1
|
||||
# PHP7.2, mariadb 10.2
|
||||
- php: '7.2'
|
||||
env: DB=mariadb MARIADB_VERSION=10.2 CODECOV=1
|
||||
# use mariadb instead of MySQL
|
||||
addons:
|
||||
mariadb: '10.1'
|
||||
# PHP7.1, PostgreSQL 9.6
|
||||
- php: '7.1'
|
||||
mariadb: '10.2'
|
||||
# PHP7.2, PostgreSQL 9.6
|
||||
- php: '7.2'
|
||||
env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
|
||||
# Use newer postgres than 9.2 default
|
||||
addons:
|
||||
postgresql: '9.6'
|
||||
services:
|
||||
- postgresql
|
||||
# PHP7.1, old precise distribution with MySQL 5.5
|
||||
- php: '7.1'
|
||||
# PostgreSQL 10 with Docker container
|
||||
- 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
|
||||
dist: precise
|
||||
services:
|
||||
- mysql
|
||||
# MySQL 5.7 with Docker container
|
||||
- php: '7.1'
|
||||
- php: '7.2'
|
||||
env: DB=mysql MYSQL_VERSION=5.7
|
||||
sudo: required
|
||||
services:
|
||||
@@ -109,6 +115,8 @@ before_install:
|
||||
- travis_retry composer self-update
|
||||
# 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
|
||||
# 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:
|
||||
|
||||
320
CHANGELOG
320
CHANGELOG
@@ -1,3 +1,323 @@
|
||||
Hubzilla 3.6 (????-??-??)
|
||||
- Update jquery.timeago library
|
||||
- Implement Hookable CSP
|
||||
- ActivityStreams: accept header changes to support plume
|
||||
- Streamline inconsistencies in addon naming
|
||||
- SECURITY: hash the session_id in logs
|
||||
- Update justified gallery library
|
||||
- Hide channel in /cloud root if channel is hidden in directory
|
||||
- Add resend option to channel sources tp discard original author.
|
||||
- Provide flag to exclude privacy groups for federation plugin use in collect_recipients()
|
||||
- Upgrading from redmatrix is no longer supported
|
||||
- Deal with htmlentity encoding during authentication workflow
|
||||
- Rework mod group
|
||||
- Make droping posts of removed connections more memory efficient
|
||||
- Refactor getOutainfo() for DAV storage
|
||||
- Optionally report total available space when uploading
|
||||
- SECURITY: provide option to disable the cloud 'root' directory and make the cloud module require a target channel nickname
|
||||
- Add plink and llink to viewsource
|
||||
- Add new 'filter by name' feature
|
||||
- Remove network tabs
|
||||
- New activity filter widget
|
||||
- New activity order widget
|
||||
- Make menus editable by visitors with webpage write permissions
|
||||
- Move forum notifications to notifications
|
||||
- Move manage privacy groups to the panel channel menu
|
||||
- Don't remove items that are starred, filed, or that you replied to when removing a connection
|
||||
- Don't deliver local items more than once
|
||||
- Make navbar search use the module search function in /network and /channel
|
||||
- Paint the locks on private activitypub items red. Their privacy model is "slightly" different from hubzillas
|
||||
- Improve new channel creation workflow
|
||||
- Add hook 'get_system_apps'
|
||||
- Implement reset button for jot
|
||||
- Adjust accept header to make pleroma happy
|
||||
- Provide a general purpose GDPR document
|
||||
- Provide function to fetch photo contents from url
|
||||
- Make get_default_profile_photo() pluggable
|
||||
- Refactor tags/mentions
|
||||
- Refactor autocomplete mechanism
|
||||
- Display pubsites link in info area if invite only
|
||||
- Add cancel button to editor
|
||||
- Implement MessageFilter for pubstream and sourced messages
|
||||
- Add supported protocols to siteinfo
|
||||
- Allow pdf embeds
|
||||
- Allow uninstall of plugins which no longer exists via cmdline tool
|
||||
- Improve the homeinstall script
|
||||
- Provide easy access to the autoperms setting for forum and repository channels
|
||||
- Implement admin delete of files, photos and posts
|
||||
- Allow a different username to be used when importing a channel
|
||||
- Provide warnings about profile photo and cover photo permissions
|
||||
- Set the 'force' flag on attach_mkdir when initiated from a DAV operation
|
||||
|
||||
Bugfixes
|
||||
- Fix double file uploads when dropping files into jot
|
||||
- Fix jot collapsing when drag and drop to open jot
|
||||
- Fix wrong album name when moving photos
|
||||
- Fix wrong timestamp localization before first update in mod mail
|
||||
- Fix post exiration not propagated to other networks (which support it)
|
||||
- Fix sys channels visible in dirsearch
|
||||
- Fix remote_self not working correctly
|
||||
- Fix photos not syncing properly if destination is a postgres site
|
||||
- Fix wrong hubloc_url for activitypub hublocs
|
||||
- Fix z_check_dns() for BSD
|
||||
- Fix not null violation in oauth1
|
||||
- Fix DB issues with oauth2 on postgresql
|
||||
- Fix 'anybody authenticated' not correctly handled in can_comment_on_post()
|
||||
- Fix postgres issue if register mode is set to yes - with approval
|
||||
- Fix tag search not finding articles
|
||||
- Fix issue with mentions when markdown post addon is enabled
|
||||
- Fix duplicate addressbook entries on repeated channel imports
|
||||
|
||||
Addons
|
||||
- Cart: various display improvements
|
||||
- Cart: make cart work with postgresql DB backend
|
||||
- Cart: add new hzservice for service_classes
|
||||
- Cart: add storewide currency settings
|
||||
- Cart: provide channel app 'Shop' for cart addon
|
||||
- Cart: implement order updating
|
||||
- Cart: use CSP hook for paypals checkout.js
|
||||
- Cart: provide a cancel mechanism for orders
|
||||
- Cart: add paypal button
|
||||
- Gallery: new addon to display photo albums with the photoswipe library
|
||||
- Ldapauth: optionally auto create channel
|
||||
- Pubcrawl: new setting to ignore ActivityPub recipients in privacy groups
|
||||
- Diaspora: fix issue with displaying multiple photos
|
||||
- Pubcrawl: provide plink
|
||||
- Pubcrawl: hubloc_url should be baseurl, not actor url
|
||||
- Pubcrawl: deliver restricted posts from hubzilla as direct messages (there is no other way to address only a subset of followers in mastodon)
|
||||
- Pubcrawl: address comments to a restricted mastodon post to /followers
|
||||
|
||||
|
||||
Hubzilla 3.4.2 (2018-07-19)
|
||||
- Compatibility fix for future versions
|
||||
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
===========================
|
||||
|
||||
<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="https://framagit.org/hubzilla/core/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
|
||||
</p>
|
||||
|
||||
**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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
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
|
||||
* 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 {
|
||||
/**
|
||||
@@ -103,7 +107,7 @@ class AccessList {
|
||||
* @brief Return an array consisting of the current access list components
|
||||
* 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_gid => string of allowed gids
|
||||
* * \e string \b deny_cid => string of denied cids
|
||||
|
||||
@@ -2,35 +2,90 @@
|
||||
|
||||
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 {
|
||||
|
||||
/**
|
||||
* @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() {
|
||||
$limits = [];
|
||||
$perms = Permissions::Perms();
|
||||
$limits = array();
|
||||
|
||||
foreach($perms as $k => $v) {
|
||||
if(strstr($k,'view') || $k === 'post_comments')
|
||||
if(strstr($k, 'view'))
|
||||
$limits[$k] = PERMS_PUBLIC;
|
||||
else
|
||||
$limits[$k] = PERMS_SPECIFIC;
|
||||
}
|
||||
|
||||
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) {
|
||||
return Zlib\PConfig::Get($channel_id,'perm_limits',$perm);
|
||||
return intval(PConfig::Get($channel_id, 'perm_limits', $perm));
|
||||
}
|
||||
else {
|
||||
Zlib\PConfig::Load($channel_id);
|
||||
if(array_key_exists($channel_id,\App::$config) && array_key_exists('perm_limits',\App::$config[$channel_id]))
|
||||
return \App::$config[$channel_id]['perm_limits'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PConfig::Load($channel_id);
|
||||
if(array_key_exists($channel_id, \App::$config)
|
||||
&& array_key_exists('perm_limits', \App::$config[$channel_id]))
|
||||
return \App::$config[$channel_id]['perm_limits'];
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,24 @@ class PermissionRoles {
|
||||
|
||||
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':
|
||||
$ret['perms_auto'] = false;
|
||||
$ret['default_collection'] = true;
|
||||
@@ -263,6 +281,7 @@ class PermissionRoles {
|
||||
static public function roles() {
|
||||
$roles = [
|
||||
t('Social Networking') => [
|
||||
'social_federation' => t('Social - Federation'),
|
||||
'social' => t('Social - Mostly Public'),
|
||||
'social_restricted' => t('Social - Restricted'),
|
||||
'social_private' => t('Social - Private')
|
||||
@@ -289,6 +308,8 @@ class PermissionRoles {
|
||||
]
|
||||
];
|
||||
|
||||
call_hooks('list_permission_roles',$roles);
|
||||
|
||||
return $roles;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class Permissions {
|
||||
'post_comments' => t('Can comment on or like my posts'),
|
||||
'post_mail' => t('Can send me private mail messages'),
|
||||
'post_like' => t('Can like/dislike profiles and profile things'),
|
||||
'tag_deliver' => t('Can forward to all my channel connections via @+ mentions in posts'),
|
||||
'tag_deliver' => t('Can forward to all my channel connections via ! mentions in posts'),
|
||||
'chat' => t('Can chat with me'),
|
||||
'republish' => t('Can source my public posts in derived channels'),
|
||||
'delegate' => t('Can administer my channel')
|
||||
|
||||
@@ -50,14 +50,19 @@ class Cron {
|
||||
|
||||
// expire any expired items
|
||||
|
||||
$r = q("select id from item where expires > '2001-01-01 00:00:00' and expires < %s
|
||||
$r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
|
||||
and item_deleted = 0 ",
|
||||
db_utcnow()
|
||||
);
|
||||
if($r) {
|
||||
require_once('include/items.php');
|
||||
foreach($r as $rr)
|
||||
drop_item($rr['id'],false);
|
||||
foreach($r as $rr) {
|
||||
drop_item($rr['id'],false,(($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
|
||||
if($rr['item_wall']) {
|
||||
// The notifier isn't normally invoked unless item_drop is interactive.
|
||||
Zotlabs\Daemon\Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@ class Deliver {
|
||||
q("delete from dreport where dreport_queue = '%s'",
|
||||
dbesc($argv[$x])
|
||||
);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ class Expire {
|
||||
|
||||
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);
|
||||
|
||||
@@ -64,7 +65,7 @@ class Expire {
|
||||
|
||||
// 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);
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -90,8 +90,6 @@ class Notifier {
|
||||
|
||||
$item_id = $argv[2];
|
||||
|
||||
$extra = (($argc > 3) ? $argv[3] : null);
|
||||
|
||||
if(! $item_id)
|
||||
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;
|
||||
$top_level_post = true;
|
||||
}
|
||||
@@ -620,8 +618,8 @@ class Notifier {
|
||||
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
||||
}
|
||||
if($packet_type === 'keychange') {
|
||||
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
||||
$pmsg = get_pconfig($channel['channel_id'],'system','keychange');
|
||||
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
|
||||
}
|
||||
elseif($packet_type === 'request') {
|
||||
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
|
||||
@@ -642,7 +640,21 @@ class Notifier {
|
||||
}
|
||||
else {
|
||||
$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(
|
||||
[
|
||||
'hash' => $hash,
|
||||
|
||||
@@ -71,14 +71,18 @@ class Poller {
|
||||
|
||||
$randfunc = db_getfunc('RAND');
|
||||
|
||||
$contacts = q("SELECT * FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
|
||||
$contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed,
|
||||
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
|
||||
abook.abook_ignored, abook.abook_blocked,
|
||||
xchan.xchan_network,
|
||||
account.account_lastlog, account.account_flags
|
||||
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
|
||||
LEFT JOIN account on abook_account = account_id
|
||||
where abook_self = 0
|
||||
$sql_extra
|
||||
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
|
||||
intval(ACCOUNT_OK),
|
||||
intval(ACCOUNT_UNVERIFIED) // FIXME
|
||||
|
||||
);
|
||||
|
||||
if($contacts) {
|
||||
|
||||
@@ -13,10 +13,10 @@ class Queue {
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
||||
if(argc() > 1)
|
||||
$queue_id = argv(1);
|
||||
if($argc > 1)
|
||||
$queue_id = $argv[1];
|
||||
else
|
||||
$queue_id = 0;
|
||||
$queue_id = EMPTY_STR;
|
||||
|
||||
logger('queue: start');
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ namespace Zotlabs\Lib;
|
||||
*/
|
||||
class ActivityStreams {
|
||||
|
||||
public $raw = null;
|
||||
public $data;
|
||||
public $valid = false;
|
||||
public $id = '';
|
||||
@@ -33,7 +34,9 @@ class ActivityStreams {
|
||||
*/
|
||||
function __construct($string) {
|
||||
|
||||
$this->raw = $string;
|
||||
$this->data = json_decode($string, true);
|
||||
|
||||
if($this->data) {
|
||||
$this->valid = true;
|
||||
}
|
||||
@@ -204,7 +207,7 @@ class ActivityStreams {
|
||||
}
|
||||
|
||||
$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/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]);
|
||||
if($x['success'])
|
||||
return json_decode($x['body'], true);
|
||||
|
||||
|
||||
@@ -13,7 +13,12 @@ require_once('include/channel.php');
|
||||
|
||||
class Apps {
|
||||
|
||||
static public $installed_system_apps = null;
|
||||
static public $available_apps = null;
|
||||
static public $installed_apps = null;
|
||||
|
||||
static public $base_apps = null;
|
||||
|
||||
|
||||
|
||||
static public function get_system_apps($translate = true) {
|
||||
|
||||
@@ -45,6 +50,8 @@ class Apps {
|
||||
}
|
||||
}
|
||||
|
||||
call_hooks('get_system_apps',$ret);
|
||||
|
||||
return $ret;
|
||||
|
||||
}
|
||||
@@ -53,22 +60,52 @@ class Apps {
|
||||
static public function import_system_apps() {
|
||||
if(! local_channel())
|
||||
return;
|
||||
|
||||
self::$base_apps = get_config('system','base_apps',[
|
||||
'Connections',
|
||||
'Suggest Channels',
|
||||
'Grid',
|
||||
'Settings',
|
||||
'Files',
|
||||
'Channel Home',
|
||||
'View Profile',
|
||||
'Photos',
|
||||
'Events',
|
||||
'Directory',
|
||||
'Search',
|
||||
'Help',
|
||||
'Mail',
|
||||
'Profile Photo'
|
||||
]);
|
||||
|
||||
$apps = self::get_system_apps(false);
|
||||
|
||||
self::$installed_system_apps = q("select * from app where app_system = 1 and app_channel = %d",
|
||||
self::$available_apps = q("select * from app where app_channel = 0");
|
||||
|
||||
self::$installed_apps = q("select * from app where app_channel = %d",
|
||||
intval(local_channel())
|
||||
);
|
||||
|
||||
if($apps) {
|
||||
foreach($apps as $app) {
|
||||
$id = self::check_install_system_app($app);
|
||||
|
||||
// $id will be boolean true or false to install an app, or an integer id to update an existing app
|
||||
if($id !== false) {
|
||||
$app['uid'] = 0;
|
||||
$app['guid'] = hash('whirlpool',$app['name']);
|
||||
$app['system'] = 1;
|
||||
self::app_install(0,$app);
|
||||
}
|
||||
|
||||
$id = self::check_install_personal_app($app);
|
||||
// $id will be boolean true or false to install an app, or an integer id to update an existing app
|
||||
if($id === false)
|
||||
continue;
|
||||
if($id !== true) {
|
||||
// if we already installed this app, but it changed, preserve any categories we created
|
||||
$s = '';
|
||||
$r = q("select * from term where otype = %d and oid = %d",
|
||||
$s = EMPTY_STR;
|
||||
$r = q("select term from term where otype = %d and oid = %d",
|
||||
intval(TERM_OBJ_APP),
|
||||
intval($id)
|
||||
);
|
||||
@@ -85,6 +122,7 @@ class Apps {
|
||||
$app['guid'] = hash('whirlpool',$app['name']);
|
||||
$app['system'] = 1;
|
||||
self::app_install(local_channel(),$app);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,11 +133,11 @@ class Apps {
|
||||
*/
|
||||
|
||||
static public function check_install_system_app($app) {
|
||||
if((! is_array(self::$installed_system_apps)) || (! count(self::$installed_system_apps))) {
|
||||
if((! is_array(self::$available_apps)) || (! count(self::$available_apps))) {
|
||||
return true;
|
||||
}
|
||||
$notfound = true;
|
||||
foreach(self::$installed_system_apps as $iapp) {
|
||||
foreach(self::$available_apps as $iapp) {
|
||||
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
|
||||
$notfound = false;
|
||||
if(($iapp['app_version'] != $app['version'])
|
||||
@@ -113,12 +151,38 @@ class Apps {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Install the system app if no system apps have been installed, or if a new system app
|
||||
* is discovered, or if the version of a system app changes.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
static public function check_install_personal_app($app) {
|
||||
$installed = false;
|
||||
foreach(self::$installed_apps as $iapp) {
|
||||
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
|
||||
$installed = true;
|
||||
if(($iapp['app_version'] != $app['version'])
|
||||
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
|
||||
return intval($iapp['app_id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(! $installed && in_array($app['name'],self::$base_apps)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static public function app_name_compare($a,$b) {
|
||||
return strcasecmp($a['name'],$b['name']);
|
||||
}
|
||||
|
||||
|
||||
static public function parse_app_description($f,$translate = true) {
|
||||
|
||||
$ret = array();
|
||||
|
||||
$baseurl = z_root();
|
||||
@@ -194,6 +258,10 @@ class Apps {
|
||||
if(! is_public_profile())
|
||||
unset($ret);
|
||||
break;
|
||||
case 'public_stream':
|
||||
if(! can_view_public_stream())
|
||||
unset($ret);
|
||||
break;
|
||||
case 'observer':
|
||||
if(! $observer)
|
||||
unset($ret);
|
||||
@@ -221,13 +289,13 @@ class Apps {
|
||||
static public function translate_system_apps(&$arr) {
|
||||
$apps = array(
|
||||
'Apps' => t('Apps'),
|
||||
'Articles' => t('Articles'),
|
||||
'Cards' => t('Cards'),
|
||||
'Admin' => t('Site Admin'),
|
||||
'Report Bug' => t('Report Bug'),
|
||||
'View Bookmarks' => t('View Bookmarks'),
|
||||
'My Chatrooms' => t('My Chatrooms'),
|
||||
'Connections' => t('Connections'),
|
||||
'Firefox Share' => t('Firefox Share'),
|
||||
'Remote Diagnostics' => t('Remote Diagnostics'),
|
||||
'Suggest Channels' => t('Suggest Channels'),
|
||||
'Login' => t('Login'),
|
||||
@@ -282,6 +350,7 @@ class Apps {
|
||||
* modes:
|
||||
* view: normal mode for viewing an app via bbcode from a conversation or page
|
||||
* provides install/update button if you're logged in locally
|
||||
* install: like view but does not display app-bin options if they are present
|
||||
* list: normal mode for viewing an app on the app page
|
||||
* no buttons are shown
|
||||
* edit: viewing the app page in editing mode provides a delete button
|
||||
@@ -294,7 +363,7 @@ class Apps {
|
||||
return;
|
||||
|
||||
if(! $papp['photo'])
|
||||
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
|
||||
$papp['photo'] = 'icon:gear';
|
||||
|
||||
self::translate_system_apps($papp);
|
||||
|
||||
@@ -345,6 +414,10 @@ class Apps {
|
||||
if(! is_public_profile())
|
||||
return '';
|
||||
break;
|
||||
case 'public_stream':
|
||||
if(! can_view_public_stream())
|
||||
return '';
|
||||
break;
|
||||
case 'observer':
|
||||
$observer = \App::get_observer();
|
||||
if(! $observer)
|
||||
@@ -390,12 +463,15 @@ class Apps {
|
||||
));
|
||||
}
|
||||
|
||||
if($mode === 'install') {
|
||||
$papp['embed'] = true;
|
||||
}
|
||||
return replace_macros(get_markup_template('app.tpl'),array(
|
||||
'$app' => $papp,
|
||||
'$icon' => $icon,
|
||||
'$hosturl' => $hosturl,
|
||||
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
|
||||
'$install' => (($hosturl && $mode == 'view') ? $install_action : ''),
|
||||
'$install' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''),
|
||||
'$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''),
|
||||
'$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''),
|
||||
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
|
||||
@@ -458,21 +534,13 @@ class Apps {
|
||||
intval(TERM_OBJ_APP),
|
||||
intval($x[0]['id'])
|
||||
);
|
||||
if($x[0]['app_system']) {
|
||||
$r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
|
||||
dbesc($app['guid']),
|
||||
intval($uid)
|
||||
);
|
||||
}
|
||||
else {
|
||||
$r = q("delete from app where app_id = '%s' and app_channel = %d",
|
||||
dbesc($app['guid']),
|
||||
intval($uid)
|
||||
);
|
||||
$r = q("delete from app where app_id = '%s' and app_channel = %d",
|
||||
dbesc($app['guid']),
|
||||
intval($uid)
|
||||
);
|
||||
|
||||
// we don't sync system apps - they may be completely different on the other system
|
||||
build_sync_packet($uid,array('app' => $x));
|
||||
}
|
||||
// we don't sync system apps - they may be completely different on the other system
|
||||
build_sync_packet($uid,array('app' => $x));
|
||||
}
|
||||
else {
|
||||
self::app_undestroy($uid,$app);
|
||||
@@ -726,12 +794,19 @@ class Apps {
|
||||
$darray = array();
|
||||
$ret = array('success' => false);
|
||||
|
||||
$sys = get_sys_channel();
|
||||
|
||||
|
||||
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
|
||||
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
|
||||
|
||||
if((! $darray['app_url']) || (! $darray['app_channel']))
|
||||
if(! $darray['app_url'])
|
||||
return $ret;
|
||||
|
||||
if((! $arr['uid']) && (! $arr['author'])) {
|
||||
$arr['author'] = $sys['channel_hash'];
|
||||
}
|
||||
|
||||
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
|
||||
$x = import_xchan_photo($arr['photo'],get_observer_hash(),true);
|
||||
$arr['photo'] = $x[1];
|
||||
@@ -775,6 +850,7 @@ class Apps {
|
||||
dbesc($darray['app_plugin']),
|
||||
intval($darray['app_deleted'])
|
||||
);
|
||||
|
||||
if($r) {
|
||||
$ret['success'] = true;
|
||||
$ret['app_id'] = $darray['app_id'];
|
||||
@@ -861,6 +937,12 @@ class Apps {
|
||||
dbesc($darray['app_id']),
|
||||
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']) && (intval($darray['app_channel'])))
|
||||
return $ret;
|
||||
|
||||
if($x) {
|
||||
q("delete from term where otype = %d and oid = %d",
|
||||
intval(TERM_OBJ_APP),
|
||||
|
||||
@@ -266,7 +266,7 @@ class Chatroom {
|
||||
intval($room_id),
|
||||
dbesc($xchan),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc($arr['chat_text'])
|
||||
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
|
||||
);
|
||||
|
||||
$ret['success'] = true;
|
||||
|
||||
@@ -142,9 +142,9 @@ class Config {
|
||||
|
||||
|
||||
/**
|
||||
* @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).
|
||||
*
|
||||
* @param string $family
|
||||
|
||||
@@ -10,22 +10,12 @@ class DB_Upgrade {
|
||||
|
||||
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';
|
||||
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);
|
||||
$build = get_config('system', 'db_version', 0);
|
||||
if(! intval($build))
|
||||
$build = set_config('system', $this->config_name, $db_revision);
|
||||
$build = set_config('system', 'db_version', $db_revision);
|
||||
|
||||
if($build == $db_revision) {
|
||||
// Nothing to be done.
|
||||
@@ -40,82 +30,78 @@ class DB_Upgrade {
|
||||
|
||||
$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.
|
||||
// Run any existing update scripts to bring the database up to current.
|
||||
|
||||
require_once($update_file);
|
||||
|
||||
// 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.
|
||||
|
||||
if($db_revision == UPDATE_VERSION) {
|
||||
for($x = $stored; $x < $current; $x ++) {
|
||||
$func = $this->func_prefix . $x;
|
||||
if(function_exists($func)) {
|
||||
// There could be a lot of processes running or about to run.
|
||||
// We want exactly one process to run the update command.
|
||||
// So store the fact that we're taking responsibility
|
||||
// after first checking to see if somebody else already has.
|
||||
|
||||
// If the update fails or times-out completely you may need to
|
||||
// delete the config entry to try again.
|
||||
|
||||
if(get_config('database', $func))
|
||||
break;
|
||||
set_config('database',$func, '1');
|
||||
// call the specific update
|
||||
|
||||
$retval = $func();
|
||||
if($retval) {
|
||||
|
||||
// Prevent sending hundreds of thousands of emails by creating
|
||||
// a lockfile.
|
||||
|
||||
$lockfile = 'store/[data]/mailsent';
|
||||
|
||||
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
|
||||
return;
|
||||
@unlink($lockfile);
|
||||
//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'])
|
||||
);
|
||||
push_lang(($r) ? $r[0]['account_language'] : 'en');
|
||||
|
||||
z_mail(
|
||||
[
|
||||
'toEmail' => \App::$config['system']['admin_email'],
|
||||
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
|
||||
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
|
||||
[
|
||||
'$sitename' => \App::$config['system']['sitename'],
|
||||
'$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();
|
||||
}
|
||||
else {
|
||||
set_config('database',$func, 'success');
|
||||
}
|
||||
}
|
||||
for($x = $stored + 1; $x <= $current; $x ++) {
|
||||
$s = '_' . $x;
|
||||
$cls = '\\Zotlabs\Update\\' . $s ;
|
||||
if(! class_exists($cls)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// There could be a lot of processes running or about to run.
|
||||
// We want exactly one process to run the update command.
|
||||
// So store the fact that we're taking responsibility
|
||||
// after first checking to see if somebody else already has.
|
||||
|
||||
// If the update fails or times-out completely you may need to
|
||||
// delete the config entry to try again.
|
||||
|
||||
Config::Load('database');
|
||||
|
||||
if(get_config('database', $s))
|
||||
break;
|
||||
set_config('database',$s, '1');
|
||||
|
||||
|
||||
$c = new $cls();
|
||||
$retval = $c->run();
|
||||
|
||||
if($retval != UPDATE_SUCCESS) {
|
||||
|
||||
// Prevent sending hundreds of thousands of emails by creating
|
||||
// a lockfile.
|
||||
|
||||
$lockfile = 'store/[data]/mailsent';
|
||||
|
||||
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
|
||||
return;
|
||||
@unlink($lockfile);
|
||||
//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'])
|
||||
);
|
||||
push_lang(($r) ? $r[0]['account_language'] : 'en');
|
||||
z_mail(
|
||||
[
|
||||
'toEmail' => \App::$config['system']['admin_email'],
|
||||
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
|
||||
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
|
||||
[
|
||||
'$sitename' => \App::$config['system']['sitename'],
|
||||
'$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();
|
||||
}
|
||||
else {
|
||||
set_config('database',$s, 'success');
|
||||
}
|
||||
set_config('system', $this->config_name, $db_revision);
|
||||
}
|
||||
}
|
||||
set_config('system', 'db_version', $db_revision);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Zotlabs\Zot;
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
class DReport {
|
||||
|
||||
@@ -63,7 +63,9 @@ class Enotify {
|
||||
$thanks = t('Thank You,');
|
||||
$sitename = get_config('system','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;
|
||||
$hostname = \App::get_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.
|
||||
$possess_desc = t('%s <!item_type!>');
|
||||
|
||||
@@ -119,7 +126,7 @@ class Enotify {
|
||||
logger('notification: mail');
|
||||
$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]');
|
||||
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
|
||||
$tsitelink = sprintf( $sitelink, $siteurl . '/mail/' . $params['item']['id'] );
|
||||
@@ -128,18 +135,28 @@ class Enotify {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
$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'];
|
||||
@@ -181,26 +198,26 @@ class Enotify {
|
||||
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
|
||||
|
||||
// "a post"
|
||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]a %4$s[/zrl]'),
|
||||
$recip['channel_name'],
|
||||
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'),
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$action,
|
||||
$itemlink,
|
||||
$item_post_type);
|
||||
|
||||
// "George Bull's post"
|
||||
if($p)
|
||||
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
|
||||
$recip['channel_name'],
|
||||
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$action,
|
||||
$itemlink,
|
||||
$p[0]['author']['xchan_name'],
|
||||
$item_post_type);
|
||||
|
||||
// "your post"
|
||||
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]'),
|
||||
$recip['channel_name'],
|
||||
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$action,
|
||||
$itemlink,
|
||||
$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']);
|
||||
else
|
||||
$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;
|
||||
|
||||
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
||||
@@ -231,12 +248,12 @@ class Enotify {
|
||||
|
||||
$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))) {
|
||||
logger('notification: not a like activity. Ignoring.');
|
||||
pop_lang();
|
||||
return;
|
||||
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
|
||||
logger('notification: not a visible activity. Ignoring.');
|
||||
pop_lang();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$parent_mid = $params['parent_mid'];
|
||||
@@ -279,8 +296,7 @@ class Enotify {
|
||||
|
||||
// "your post"
|
||||
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]'),
|
||||
$recip['channel_name'],
|
||||
$dest_str = sprintf(t('%1$s liked [zrl=%2$s]your %3$s[/zrl]'),
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$itemlink,
|
||||
$item_post_type);
|
||||
@@ -295,7 +311,7 @@ class Enotify {
|
||||
// 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']);
|
||||
$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;
|
||||
|
||||
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
|
||||
@@ -308,10 +324,9 @@ class Enotify {
|
||||
if($params['type'] == NOTIFY_WALL) {
|
||||
$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]') ,
|
||||
$recip['channel_name'],
|
||||
$epreamble = sprintf( t('%1$s posted to [zrl=%2$s]your wall[/zrl]') ,
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$params['link']);
|
||||
|
||||
@@ -335,9 +350,8 @@ class Enotify {
|
||||
}
|
||||
|
||||
$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);
|
||||
$epreamble = sprintf( t('%1$s, %2$s [zrl=%3$s]tagged you[/zrl].') ,
|
||||
$recip['channel_name'],
|
||||
$preamble = sprintf( t('%1$s tagged you at %2$s') , $sender['xchan_name'], $sitename);
|
||||
$epreamble = sprintf( t('%1$s [zrl=%2$s]tagged you[/zrl].') ,
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$params['link']);
|
||||
|
||||
@@ -349,9 +363,8 @@ class Enotify {
|
||||
|
||||
if ($params['type'] == NOTIFY_POKE) {
|
||||
$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);
|
||||
$epreamble = sprintf( t('%1$s, %2$s [zrl=%2$s]poked you[/zrl].') ,
|
||||
$recip['channel_name'],
|
||||
$preamble = sprintf( t('%1$s poked you at %2$s') , $sender['xchan_name'], $sitename);
|
||||
$epreamble = sprintf( t('%1$s [zrl=%2$s]poked you[/zrl].') ,
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$params['link']);
|
||||
|
||||
@@ -367,9 +380,8 @@ class Enotify {
|
||||
|
||||
if ($params['type'] == NOTIFY_TAGSHARE) {
|
||||
$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);
|
||||
$epreamble = sprintf( t('%1$s, %2$s tagged [zrl=%3$s]your post[/zrl]') ,
|
||||
$recip['channel_name'],
|
||||
$preamble = sprintf( t('%1$s tagged your post at %2$s'),$sender['xchan_name'], $sitename);
|
||||
$epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') ,
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
|
||||
$itemlink);
|
||||
|
||||
@@ -381,9 +393,8 @@ class Enotify {
|
||||
|
||||
if ($params['type'] == NOTIFY_INTRO) {
|
||||
$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);
|
||||
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a new connection request[/zrl] from %3$s.'),
|
||||
$recip['channel_name'],
|
||||
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
|
||||
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a new connection request[/zrl] from %2$s.'),
|
||||
$siteurl . '/connections/ifpending',
|
||||
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
|
||||
$body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']);
|
||||
@@ -396,9 +407,8 @@ class Enotify {
|
||||
|
||||
if ($params['type'] == NOTIFY_SUGGEST) {
|
||||
$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);
|
||||
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a friend suggestion[/zrl] for %3$s from %4$s.'),
|
||||
$recip['channel_name'],
|
||||
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
|
||||
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'),
|
||||
$itemlink,
|
||||
'[zrl=' . $params['item']['url'] . ']' . $params['item']['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
|
||||
// (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 (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
|
||||
$seen = 1;
|
||||
@@ -600,6 +608,9 @@ class Enotify {
|
||||
$datarray['titemlink'] = $itemlink;
|
||||
$datarray['thanks'] = $thanks;
|
||||
$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['htmlversion'] = $htmlversion;
|
||||
$datarray['textversion'] = $textversion;
|
||||
@@ -646,7 +657,7 @@ class Enotify {
|
||||
'$banner' => $datarray['banner'],
|
||||
'$notify_icon' => \Zotlabs\Lib\System::get_notify_icon(),
|
||||
'$product' => $datarray['product'],
|
||||
'$preamble' => $datarray['preamble'],
|
||||
'$preamble' => $salutation . '<br><br>' . $datarray['preamble'],
|
||||
'$sitename' => $datarray['sitename'],
|
||||
'$siteurl' => $datarray['siteurl'],
|
||||
'$source_name' => $datarray['source_name'],
|
||||
@@ -657,6 +668,8 @@ class Enotify {
|
||||
'$hitemlink' => $datarray['hitemlink'],
|
||||
'$thanks' => $datarray['thanks'],
|
||||
'$site_admin' => $datarray['site_admin'],
|
||||
'$opt_out1' => $datarray['opt_out1'],
|
||||
'$opt_out2' => $datarray['hopt_out2'],
|
||||
'$title' => $datarray['title'],
|
||||
'$htmlversion' => $datarray['htmlversion'],
|
||||
));
|
||||
@@ -666,7 +679,7 @@ class Enotify {
|
||||
$email_text_body = replace_macros($tpl, array(
|
||||
'$banner' => $datarray['banner'],
|
||||
'$product' => $datarray['product'],
|
||||
'$preamble' => $datarray['preamble'],
|
||||
'$preamble' => $salutation . "\n\n" . $datarray['preamble'],
|
||||
'$sitename' => $datarray['sitename'],
|
||||
'$siteurl' => $datarray['siteurl'],
|
||||
'$source_name' => $datarray['source_name'],
|
||||
@@ -677,6 +690,8 @@ class Enotify {
|
||||
'$titemlink' => $datarray['titemlink'],
|
||||
'$thanks' => $datarray['thanks'],
|
||||
'$site_admin' => $datarray['site_admin'],
|
||||
'$opt_out1' => $datarray['opt_out1'],
|
||||
'$opt_out2' => $datarray['opt_out2'],
|
||||
'$title' => $datarray['title'],
|
||||
'$textversion' => $datarray['textversion'],
|
||||
));
|
||||
@@ -732,8 +747,8 @@ class Enotify {
|
||||
|
||||
// generate a mime boundary
|
||||
$mimeBoundary = rand(0, 9) . "-"
|
||||
.rand(10000000000, 9999999999) . "-"
|
||||
.rand(10000000000, 9999999999) . "=:"
|
||||
.rand(100000000, 999999999) . "-"
|
||||
.rand(100000000, 999999999) . "=:"
|
||||
.rand(10000, 99999);
|
||||
|
||||
// generate a multipart/alternative message header
|
||||
@@ -794,6 +809,20 @@ class Enotify {
|
||||
: 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
|
||||
|
||||
return array(
|
||||
@@ -801,7 +830,7 @@ class Enotify {
|
||||
'name' => $item['author']['xchan_name'],
|
||||
'url' => $item['author']['xchan_url'],
|
||||
'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'),
|
||||
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
|
||||
'notify_id' => 'undefined',
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* MarkdownSoap
|
||||
* @brief MarkdownSoap class.
|
||||
*
|
||||
* Purify Markdown for storage
|
||||
* @code{.php}
|
||||
* $x = new MarkdownSoap($string_to_be_cleansed);
|
||||
* $text = $x->clean();
|
||||
*
|
||||
* @endcode
|
||||
* What this does:
|
||||
* 1. extracts code blocks and privately escapes them from processing
|
||||
* 2. Run html purifier on the content
|
||||
* 3. put back the code blocks
|
||||
* 4. run htmlspecialchars on the entire content for safe storage
|
||||
*
|
||||
* At render time:
|
||||
* At render time:
|
||||
* @code{.php}
|
||||
* $markdown = \Zotlabs\Lib\MarkdownSoap::unescape($text);
|
||||
* $html = \Michelf\MarkdownExtra::DefaultTransform($markdown);
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class MarkdownSoap {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $str;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $token;
|
||||
|
||||
private $str;
|
||||
|
||||
function __construct($s) {
|
||||
$this->str = $s;
|
||||
$this->str = $s;
|
||||
$this->token = random_string(20);
|
||||
}
|
||||
|
||||
|
||||
function clean() {
|
||||
|
||||
$x = $this->extract_code($this->str);
|
||||
|
||||
$x = $this->purify($x);
|
||||
|
||||
$x = $this->putback_code($x);
|
||||
$x = $this->putback_code($x);
|
||||
|
||||
$x = $this->escape($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) {
|
||||
|
||||
|
||||
$text = preg_replace_callback('{
|
||||
(?:\n\n|\A\n?)
|
||||
( # $1 = the code block -- one or more lines, starting with a space/tab
|
||||
@@ -62,7 +77,7 @@ class MarkdownSoap {
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
function encode_code($matches) {
|
||||
return $this->token . ';' . base64_encode($matches[0]) . ';' ;
|
||||
}
|
||||
@@ -71,8 +86,17 @@ class MarkdownSoap {
|
||||
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) {
|
||||
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm',[ $this, 'decode_code' ], $s);
|
||||
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm', [ $this, 'decode_code' ], $s);
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -84,20 +108,25 @@ class MarkdownSoap {
|
||||
}
|
||||
|
||||
function protect_autolinks($s) {
|
||||
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/','[$1$2]($1$2)',$s);
|
||||
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/', '[$1$2]($1$2)', $s);
|
||||
return $s;
|
||||
}
|
||||
|
||||
function unprotect_autolinks($s) {
|
||||
return $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) {
|
||||
return htmlspecialchars_decode($s,ENT_QUOTES);
|
||||
return htmlspecialchars_decode($s, ENT_QUOTES);
|
||||
}
|
||||
}
|
||||
|
||||
79
Zotlabs/Lib/MessageFilter.php
Normal file
79
Zotlabs/Lib/MessageFilter.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
|
||||
|
||||
class MessageFilter {
|
||||
|
||||
|
||||
static public function evaluate($item,$incl,$excl) {
|
||||
|
||||
require_once('include/html2plain.php');
|
||||
|
||||
unobscure($item);
|
||||
|
||||
$text = prepare_text($item['body'],$item['mimetype']);
|
||||
$text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text);
|
||||
|
||||
|
||||
$lang = null;
|
||||
|
||||
if((strpos($incl,'lang=') !== false) || (strpos($excl,'lang=') !== false)) {
|
||||
$lang = detect_language($text);
|
||||
}
|
||||
|
||||
$tags = ((is_array($item['term']) && count($item['term'])) ? $item['term'] : false);
|
||||
|
||||
// exclude always has priority
|
||||
|
||||
$exclude = (($excl) ? explode("\n",$excl) : null);
|
||||
|
||||
if($exclude) {
|
||||
foreach($exclude as $word) {
|
||||
$word = trim($word);
|
||||
if(! $word)
|
||||
continue;
|
||||
if(substr($word,0,1) === '#' && $tags) {
|
||||
foreach($tags as $t)
|
||||
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
|
||||
return false;
|
||||
}
|
||||
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
|
||||
return false;
|
||||
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
|
||||
return false;
|
||||
elseif(stristr($text,$word) !== false)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$include = (($incl) ? explode("\n",$incl) : null);
|
||||
|
||||
if($include) {
|
||||
foreach($include as $word) {
|
||||
$word = trim($word);
|
||||
if(! $word)
|
||||
continue;
|
||||
if(substr($word,0,1) === '#' && $tags) {
|
||||
foreach($tags as $t)
|
||||
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
|
||||
return true;
|
||||
}
|
||||
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
|
||||
return true;
|
||||
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
|
||||
return true;
|
||||
elseif(stristr($text,$word) !== false)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -171,16 +171,23 @@ class NativeWiki {
|
||||
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
|
||||
dbesc($resource_id)
|
||||
);
|
||||
|
||||
if($r) {
|
||||
$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) {
|
||||
$r = array_merge($r,$q);
|
||||
}
|
||||
xchan_query($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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,36 @@
|
||||
|
||||
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 {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $permcats = [];
|
||||
|
||||
/**
|
||||
* @brief Permcat constructor.
|
||||
*
|
||||
* @param int $channel_id
|
||||
*/
|
||||
public function __construct($channel_id) {
|
||||
|
||||
$perms = [];
|
||||
@@ -16,16 +40,16 @@ class Permcat {
|
||||
|
||||
$role = get_pconfig($channel_id,'system','permissions_role');
|
||||
if($role) {
|
||||
$x = Zaccess\PermissionRoles::role_perms($role);
|
||||
$x = PermissionRoles::role_perms($role);
|
||||
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(! $perms) {
|
||||
$perms = Zaccess\Permissions::FilledAutoPerms($channel_id);
|
||||
$perms = Permissions::FilledAutoPerms($channel_id);
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
if(! $perms) {
|
||||
$perms = Zaccess\Permissions::FilledPerms([]);
|
||||
$perms = Permissions::FilledPerms([]);
|
||||
}
|
||||
|
||||
$this->permcats[] = [
|
||||
'name' => 'default',
|
||||
'localname' => t('default','permcat'),
|
||||
'perms' => Zaccess\Permissions::Operms($perms),
|
||||
'perms' => Permissions::Operms($perms),
|
||||
'system' => 1
|
||||
];
|
||||
|
||||
@@ -67,26 +91,39 @@ class Permcat {
|
||||
$this->permcats[] = [
|
||||
'name' => $p[$x][0],
|
||||
'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])
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Return array with permcats.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listing() {
|
||||
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) {
|
||||
if($name && $this->permcats) {
|
||||
foreach($this->permcats as $permcat) {
|
||||
if(strcasecmp($permcat['name'],$name) === 0) {
|
||||
if(strcasecmp($permcat['name'], $name) === 0) {
|
||||
return $permcat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ['error' => true];
|
||||
}
|
||||
|
||||
@@ -118,29 +155,32 @@ class Permcat {
|
||||
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
call_hooks('permcats',$permcats);
|
||||
/**
|
||||
* @hooks permcats
|
||||
* * \e array
|
||||
*/
|
||||
call_hooks('permcats', $permcats);
|
||||
|
||||
return $permcats;
|
||||
|
||||
}
|
||||
|
||||
static public function find_permcat($arr,$name) {
|
||||
static public function find_permcat($arr, $name) {
|
||||
if((! $arr) || (! $name))
|
||||
return false;
|
||||
|
||||
foreach($arr as $p)
|
||||
if($p['name'] == $name)
|
||||
return $p['value'];
|
||||
}
|
||||
|
||||
static public function update($channel_id, $name,$permarr) {
|
||||
PConfig::Set($channel_id,'permcat',$name,$permarr);
|
||||
static public function update($channel_id, $name, $permarr) {
|
||||
PConfig::Set($channel_id, 'permcat', $name, $permarr);
|
||||
}
|
||||
|
||||
static public function delete($channel_id,$name) {
|
||||
PConfig::Delete($channel_id,'permcat',$name);
|
||||
static public function delete($channel_id, $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);
|
||||
|
||||
}
|
||||
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() {
|
||||
if(is_array(\App::$config) && is_array(\App::$config['system']) && \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() {
|
||||
|
||||
@@ -102,6 +102,13 @@ class ThreadItem {
|
||||
if($item['author']['xchan_network'] === 'rss')
|
||||
$shareable = true;
|
||||
|
||||
$privacy_warning = false;
|
||||
if(($item['item_private'] == 1) && ($item['owner']['xchan_network'] === 'activitypub')) {
|
||||
$recips = get_iconfig($item['parent'], 'activitypub', 'recips');
|
||||
|
||||
if(! in_array($observer['xchan_url'], $recips['to']))
|
||||
$privacy_warning = true;
|
||||
}
|
||||
|
||||
$mode = $conv->get_mode();
|
||||
|
||||
@@ -141,6 +148,10 @@ class ThreadItem {
|
||||
'delete' => t('Delete'),
|
||||
);
|
||||
}
|
||||
elseif(is_site_admin()) {
|
||||
$drop = [ 'dropping' => true, 'delete' => t('Admin Delete') ];
|
||||
}
|
||||
|
||||
// FIXME
|
||||
if($observer_is_pageowner) {
|
||||
$multidrop = array(
|
||||
@@ -232,16 +243,9 @@ class ThreadItem {
|
||||
// FIXME check this permission
|
||||
if(($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) {
|
||||
|
||||
// FIXME we don't need all this stuff, some can be done in the template
|
||||
|
||||
$star = array(
|
||||
'do' => t("Add Star"),
|
||||
'undo' => t("Remove Star"),
|
||||
'toggle' => t("Toggle Star Status"),
|
||||
'classdo' => (intval($item['item_starred']) ? "hidden" : ""),
|
||||
'classundo' => (intval($item['item_starred']) ? "" : "hidden"),
|
||||
'isstarred' => (intval($item['item_starred']) ? "starred fa-star" : "unstarred fa-star-o"),
|
||||
'starred' => t('starred'),
|
||||
'isstarred' => ((intval($item['item_starred'])) ? true : false),
|
||||
);
|
||||
|
||||
}
|
||||
@@ -366,6 +370,7 @@ class ThreadItem {
|
||||
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
|
||||
'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
|
||||
'lock' => $lock,
|
||||
'privacy_warning' => $privacy_warning,
|
||||
'verified' => $verified,
|
||||
'unverified' => $unverified,
|
||||
'forged' => $forged,
|
||||
@@ -730,12 +735,11 @@ class ThreadItem {
|
||||
|
||||
$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());
|
||||
call_hooks('comment_buttons',$arr);
|
||||
$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(
|
||||
'$return_path' => '',
|
||||
@@ -744,7 +748,6 @@ class ThreadItem {
|
||||
'$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
|
||||
'$id' => $this->get_id(),
|
||||
'$parent' => $this->get_id(),
|
||||
'$qcomment' => $qcomment,
|
||||
'$comment_buttons' => $comment_buttons,
|
||||
'$profile_uid' => $conv->get_profile_owner(),
|
||||
'$mylink' => $observer['xchan_url'],
|
||||
@@ -758,7 +761,7 @@ class ThreadItem {
|
||||
'$edquote' => t('Quote'),
|
||||
'$edcode' => t('Code'),
|
||||
'$edimg' => t('Image'),
|
||||
'$edatt' => t('Attach File'),
|
||||
'$edatt' => t('Attach/Upload file'),
|
||||
'$edurl' => t('Insert Link'),
|
||||
'$edvideo' => t('Video'),
|
||||
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
|
||||
@@ -772,7 +775,8 @@ class ThreadItem {
|
||||
'$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)') ],
|
||||
'$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;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Zot;
|
||||
namespace Zotlabs\Lib;
|
||||
|
||||
|
||||
class Verify {
|
||||
@@ -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
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
/*
|
||||
* ACL selector json backend
|
||||
require_once 'include/acl_selectors.php';
|
||||
require_once 'include/group.php';
|
||||
|
||||
/**
|
||||
* @brief ACL selector json backend.
|
||||
*
|
||||
* This module provides JSON lists of connections and local/remote channels
|
||||
* (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.
|
||||
*
|
||||
* There are two primary output structural formats. One for the ACL widget and
|
||||
* 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 {
|
||||
|
||||
function init() {
|
||||
|
||||
logger('mod_acl: ' . print_r($_REQUEST,true));
|
||||
|
||||
|
||||
// logger('mod_acl: ' . print_r($_GET,true),LOGGER_DATA);
|
||||
|
||||
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
|
||||
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
|
||||
$search = (x($_REQUEST,'search') ? $_REQUEST['search'] : '');
|
||||
$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
|
||||
// 'g' => Groups only ACL request
|
||||
// 'f' => forums only ACL request
|
||||
@@ -79,7 +82,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
|
||||
if($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.
|
||||
// Would be MUCH easier if it instead returned a very large value
|
||||
@@ -89,10 +92,9 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
$order_extra2 = "CASE WHEN xchan_name LIKE "
|
||||
. 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' );
|
||||
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||
$sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) ";
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -265,15 +267,15 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
});
|
||||
}
|
||||
}
|
||||
if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_channel(),'system','taganyone'))) {
|
||||
if((count($r) < 100) && $type == 'c') {
|
||||
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
|
||||
FROM xchan
|
||||
WHERE xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc"
|
||||
);
|
||||
if($r2)
|
||||
$r = array_merge($r,$r2);
|
||||
}
|
||||
if((count($r) < 100) && $type == 'c') {
|
||||
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
|
||||
FROM xchan
|
||||
WHERE xchan_deleted = 0 and not xchan_network in ('rss','anon','unknown') $sql_extra2 order by $order_extra2 xchan_name asc"
|
||||
);
|
||||
if($r2) {
|
||||
$r = array_merge($r,$r2);
|
||||
$r = unique_multidim_array($r,'hash');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($type == 'm') {
|
||||
@@ -334,24 +336,23 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
if($r) {
|
||||
foreach($r as $g) {
|
||||
|
||||
if(($g['network'] === 'rss') && ($type != 'a'))
|
||||
if(in_array($g['network'],['rss','anon','unknown']) && ($type != 'a'))
|
||||
continue;
|
||||
|
||||
$g['hash'] = urlencode($g['hash']);
|
||||
|
||||
if(! $g['nick']) {
|
||||
$t = explode(' ',strtolower($g['name']));
|
||||
$g['nick'] = $t[0] . '@';
|
||||
$g['nick'] = $g['url'];
|
||||
}
|
||||
|
||||
if(in_array($g['hash'],$permitted) && in_array($type, [ 'c', 'f' ]) && (! $noforums)) {
|
||||
if(in_array($g['hash'],$permitted) && $type === 'f' && (! $noforums)) {
|
||||
$contacts[] = array(
|
||||
"type" => "c",
|
||||
"photo" => "images/twopeople.png",
|
||||
"name" => $g['name'] . (($type === 'f') ? '' : '+'),
|
||||
"id" => urlencode($g['id']) . (($type === 'f') ? '' : '+'),
|
||||
"name" => $g['name'],
|
||||
"id" => urlencode($g['id']),
|
||||
"xid" => $g['hash'],
|
||||
"link" => $g['nick'],
|
||||
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
|
||||
"nick" => substr($g['nick'],0,strpos($g['nick'],'@')),
|
||||
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
|
||||
"taggable" => 'taggable',
|
||||
@@ -365,8 +366,8 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
"name" => $g['name'],
|
||||
"id" => urlencode($g['id']),
|
||||
"xid" => $g['hash'],
|
||||
"link" => $g['nick'],
|
||||
"nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
|
||||
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
|
||||
"nick" => ((strpos($g['nick'],'@')) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
|
||||
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
|
||||
"taggable" => '',
|
||||
"label" => '',
|
||||
@@ -382,15 +383,13 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
'count' => $count,
|
||||
'items' => $items,
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
echo json_encode($o);
|
||||
|
||||
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function navbar_complete(&$a) {
|
||||
|
||||
// logger('navbar_complete');
|
||||
@@ -434,7 +433,7 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
|
||||
if($url) {
|
||||
$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);
|
||||
if($x['success']) {
|
||||
@@ -447,5 +446,5 @@ class Acl extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -100,8 +100,12 @@ class Admin extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
// pending registrations
|
||||
$r = q("SELECT COUNT(id) AS rtotal FROM register WHERE uid != '0'");
|
||||
$pending = $r[0]['rtotal'];
|
||||
|
||||
$pdg = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d ) > 0 ",
|
||||
intval(ACCOUNT_PENDING)
|
||||
);
|
||||
|
||||
$pending = (($pdg) ? count($pdg) : 0);
|
||||
|
||||
// available channels, primary and clones
|
||||
$channels = array();
|
||||
@@ -140,7 +144,7 @@ class Admin extends \Zotlabs\Web\Controller {
|
||||
'$accounts' => array( t('Registered accounts'), $accounts),
|
||||
'$pending' => array( t('Pending registrations'), $pending),
|
||||
'$channels' => array( t('Registered channels'), $channels),
|
||||
'$plugins' => array( t('Active plugins'), $plugins ),
|
||||
'$plugins' => array( t('Active addons'), $plugins ),
|
||||
'$version' => array( t('Version'), STD_VERSION),
|
||||
'$vmaster' => array( t('Repository version (master)'), $vmaster),
|
||||
'$vdev' => array( t('Repository version (dev)'), $vdev),
|
||||
|
||||
@@ -16,6 +16,7 @@ class Accounts {
|
||||
*/
|
||||
|
||||
function post() {
|
||||
|
||||
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
|
||||
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
|
||||
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
|
||||
@@ -24,7 +25,7 @@ class Accounts {
|
||||
|
||||
// change to switch structure?
|
||||
// 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++) {
|
||||
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
|
||||
$op = ($blocked[$i]) ? '& ~' : '| ';
|
||||
@@ -43,13 +44,13 @@ class Accounts {
|
||||
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
|
||||
}
|
||||
// registration approved button was submitted
|
||||
if (x($_POST, 'page_users_approve')) {
|
||||
if (x($_POST, 'page_accounts_approve')) {
|
||||
foreach ($pending as $hash) {
|
||||
account_allow($hash);
|
||||
}
|
||||
}
|
||||
// registration deny button was submitted
|
||||
if (x($_POST, 'page_users_deny')) {
|
||||
if (x($_POST, 'page_accounts_deny')) {
|
||||
foreach ($pending as $hash) {
|
||||
account_deny($hash);
|
||||
}
|
||||
@@ -132,12 +133,13 @@ class Accounts {
|
||||
|
||||
$base = z_root() . '/admin/accounts?f=';
|
||||
$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,
|
||||
(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),
|
||||
db_concat('ch.channel_address', ' '),
|
||||
intval(ACCOUNT_BLOCKED | ACCOUNT_PENDING),
|
||||
intval(\App::$pager['itemspage']),
|
||||
intval(\App::$pager['start'])
|
||||
);
|
||||
@@ -202,4 +204,4 @@ class Accounts {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace Zotlabs\Module\Admin;
|
||||
|
||||
use \Zotlabs\Storage\GitRepo as GitRepo;
|
||||
use \Zotlabs\Storage\GitRepo;
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
class Plugins {
|
||||
class Addons {
|
||||
|
||||
/**
|
||||
* @brief
|
||||
@@ -20,7 +20,7 @@ class Plugins {
|
||||
$func($a);
|
||||
}
|
||||
|
||||
goaway(z_root() . '/admin/plugins/' . argv(2) );
|
||||
goaway(z_root() . '/admin/addons/' . argv(2) );
|
||||
}
|
||||
elseif(argc() > 2) {
|
||||
switch(argv(2)) {
|
||||
@@ -243,7 +243,7 @@ class Plugins {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Plugins admin page.
|
||||
* @brief Addons admin page.
|
||||
*
|
||||
* @return string with parsed HTML
|
||||
*/
|
||||
@@ -278,7 +278,7 @@ class Plugins {
|
||||
$info['disabled'] = 1-intval($x);
|
||||
|
||||
if (x($_GET,"a") && $_GET['a']=="t"){
|
||||
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
|
||||
check_form_security_token_redirectOnErr('/admin/addons', 'admin_addons', 't');
|
||||
$pinstalled = false;
|
||||
// Toggle plugin status
|
||||
$idx = array_search($plugin, \App::$plugins);
|
||||
@@ -298,9 +298,9 @@ class Plugins {
|
||||
if($pinstalled) {
|
||||
@require_once("addon/$plugin/$plugin.php");
|
||||
if(function_exists($plugin.'_plugin_admin'))
|
||||
goaway(z_root() . '/admin/plugins/' . $plugin);
|
||||
goaway(z_root() . '/admin/addons/' . $plugin);
|
||||
}
|
||||
goaway(z_root() . '/admin/plugins' );
|
||||
goaway(z_root() . '/admin/addons' );
|
||||
}
|
||||
|
||||
// display plugin details
|
||||
@@ -339,7 +339,7 @@ class Plugins {
|
||||
$t = get_markup_template('admin_plugins_details.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
'$page' => t('Plugins'),
|
||||
'$page' => t('Addons'),
|
||||
'$toggle' => t('Toggle'),
|
||||
'$settings' => t('Settings'),
|
||||
'$baseurl' => z_root(),
|
||||
@@ -358,11 +358,11 @@ class Plugins {
|
||||
'$disabled' => t('Disabled - version incompatibility'),
|
||||
|
||||
'$admin_form' => $admin_form,
|
||||
'$function' => 'plugins',
|
||||
'$function' => 'addons',
|
||||
'$screenshot' => '',
|
||||
'$readme' => $readme,
|
||||
|
||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
||||
'$form_security_token' => get_form_security_token('admin_addons'),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -407,11 +407,11 @@ class Plugins {
|
||||
|
||||
$admin_plugins_add_repo_form= replace_macros(
|
||||
get_markup_template('admin_plugins_addrepo.tpl'), array(
|
||||
'$post' => 'admin/plugins/addrepo',
|
||||
'$desc' => t('Enter the public git repository URL of the plugin repo.'),
|
||||
'$repoURL' => array('repoURL', t('Plugin repo git URL'), '', ''),
|
||||
'$post' => 'admin/addons/addrepo',
|
||||
'$desc' => t('Enter the public git repository URL of the addon repo.'),
|
||||
'$repoURL' => array('repoURL', t('Addon repo git URL'), '', ''),
|
||||
'$repoName' => array('repoName', t('Custom repo name'), '', '', t('(optional)')),
|
||||
'$submit' => t('Download Plugin Repo')
|
||||
'$submit' => t('Download Addon Repo')
|
||||
)
|
||||
);
|
||||
$newRepoModalID = random_string(3);
|
||||
@@ -434,17 +434,17 @@ class Plugins {
|
||||
$t = get_markup_template('admin_plugins.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
'$page' => t('Plugins'),
|
||||
'$page' => t('Addons'),
|
||||
'$submit' => t('Submit'),
|
||||
'$baseurl' => z_root(),
|
||||
'$function' => 'plugins',
|
||||
'$function' => 'addons',
|
||||
'$plugins' => $plugins,
|
||||
'$disabled' => t('Disabled - version incompatibility'),
|
||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
||||
'$form_security_token' => get_form_security_token('admin_addons'),
|
||||
'$allowManageRepos' => $allowManageRepos,
|
||||
'$managerepos' => t('Manage Repos'),
|
||||
'$installedtitle' => t('Installed Plugin Repositories'),
|
||||
'$addnewrepotitle' => t('Install a New Plugin Repository'),
|
||||
'$installedtitle' => t('Installed Addon Repositories'),
|
||||
'$addnewrepotitle' => t('Install a New Addon Repository'),
|
||||
'$expandform' => false,
|
||||
'$form' => $admin_plugins_add_repo_form,
|
||||
'$newRepoModal' => $newRepoModal,
|
||||
@@ -7,36 +7,38 @@ namespace Zotlabs\Module\Admin;
|
||||
class Dbsync {
|
||||
|
||||
|
||||
|
||||
|
||||
function get() {
|
||||
$o = '';
|
||||
|
||||
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
|
||||
set_config('database', 'update_r' . intval(argv(3)), 'success');
|
||||
if(intval(get_config('system','db_version')) <= intval(argv(3)))
|
||||
set_config('system','db_version',intval(argv(3)) + 1);
|
||||
// remove the old style config if it exists
|
||||
del_config('database', 'update_r' . intval(argv(3)));
|
||||
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);
|
||||
goaway(z_root() . '/admin/dbsync');
|
||||
}
|
||||
|
||||
if(argc() > 2 && intval(argv(2))) {
|
||||
require_once('install/update.php');
|
||||
$func = 'update_r' . intval(argv(2));
|
||||
if(function_exists($func)) {
|
||||
$retval = $func();
|
||||
$x = intval(argv(2));
|
||||
$s = '_' . $x;
|
||||
$cls = '\\Zotlabs\Update\\' . $s ;
|
||||
if(class_exists($cls)) {
|
||||
$c = new $cls();
|
||||
$retval = $c->run();
|
||||
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) {
|
||||
$o .= sprintf( t('Update %s was successfully applied.'), $func);
|
||||
set_config('database',$func, 'success');
|
||||
$o .= sprintf( t('Update %s was successfully applied.'), $s);
|
||||
set_config('database',$s, 'success');
|
||||
}
|
||||
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
|
||||
$o .= sprintf( t('Update function %s could not be found.'), $func);
|
||||
$o .= sprintf( t('Update function %s could not be found.'), $s);
|
||||
|
||||
return $o;
|
||||
}
|
||||
@@ -45,23 +47,25 @@ class Dbsync {
|
||||
$r = q("select * from config where cat = 'database' ");
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
$upd = intval(substr($rr['k'],8));
|
||||
$upd = intval(substr($rr['k'],-4));
|
||||
if($rr['v'] === 'success')
|
||||
continue;
|
||||
$failed[] = $upd;
|
||||
}
|
||||
}
|
||||
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(),
|
||||
'$banner' => t('Failed Updates'),
|
||||
'$desc' => '',
|
||||
'$mark' => t('Mark success (if update was manually applied)'),
|
||||
'$apply' => t('Attempt to execute this update step automatically'),
|
||||
'$failed' => $failed
|
||||
if(count($failed)) {
|
||||
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
|
||||
'$base' => z_root(),
|
||||
'$banner' => t('Failed Updates'),
|
||||
'$desc' => '',
|
||||
'$mark' => t('Mark success (if update was manually applied)'),
|
||||
'$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;
|
||||
}
|
||||
|
||||
@@ -9,17 +9,37 @@ class Profs {
|
||||
|
||||
if(array_key_exists('basic',$_REQUEST)) {
|
||||
$arr = explode(',',$_REQUEST['basic']);
|
||||
for($x = 0; $x < count($arr); $x ++)
|
||||
if(trim($arr[$x]))
|
||||
$arr[$x] = trim($arr[$x]);
|
||||
set_config('system','profile_fields_basic',$arr);
|
||||
|
||||
array_walk($arr,'array_trim');
|
||||
$narr = [];
|
||||
if(count($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)) {
|
||||
$arr = explode(',',$_REQUEST['advanced']);
|
||||
for($x = 0; $x < count($arr); $x ++)
|
||||
if(trim($arr[$x]))
|
||||
$arr[$x] = trim($arr[$x]);
|
||||
set_config('system','profile_fields_advanced',$arr);
|
||||
array_walk($arr,'array_trim');
|
||||
$narr = [];
|
||||
if(count($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');
|
||||
}
|
||||
@@ -98,6 +118,7 @@ class Profs {
|
||||
$basic = '';
|
||||
$barr = array();
|
||||
$fields = get_profile_fields_basic();
|
||||
|
||||
if(! $fields)
|
||||
$fields = get_profile_fields_basic(1);
|
||||
if($fields) {
|
||||
|
||||
@@ -16,7 +16,13 @@ class Security {
|
||||
|
||||
$block_public = ((x($_POST,'block_public')) ? True : False);
|
||||
set_config('system','block_public',$block_public);
|
||||
|
||||
|
||||
$cloud_noroot = ((x($_POST,'cloud_noroot')) ? 1 : 0);
|
||||
set_config('system','cloud_disable_siteroot',1 - $cloud_noroot);
|
||||
|
||||
$cloud_disksize = ((x($_POST,'cloud_disksize')) ? 1 : 0);
|
||||
set_config('system','cloud_report_disksize',$cloud_disksize);
|
||||
|
||||
$ws = $this->trim_array_elems(explode("\n",$_POST['whitelisted_sites']));
|
||||
set_config('system','whitelisted_sites',$ws);
|
||||
|
||||
@@ -52,24 +58,24 @@ class Security {
|
||||
function get() {
|
||||
|
||||
$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_str = ((is_array($blacksites)) ? implode($blacksites,"\n") : '');
|
||||
$blacksites_str = ((is_array($blacksites)) ? implode("\n",$blacksites) : '');
|
||||
|
||||
|
||||
$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_str = ((is_array($blackchannels)) ? implode($blackchannels,"\n") : '');
|
||||
$blackchannels_str = ((is_array($blackchannels)) ? implode("\n",$blackchannels) : '');
|
||||
|
||||
|
||||
$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_str = ((is_array($blackembeds)) ? implode($blackembeds,"\n") : '');
|
||||
$blackembeds_str = ((is_array($blackembeds)) ? implode("\n",$blackembeds) : '');
|
||||
|
||||
$embed_coop = intval(get_config('system','embed_coop'));
|
||||
|
||||
@@ -87,6 +93,8 @@ class Security {
|
||||
'$page' => t('Security'),
|
||||
'$form_security_token' => get_form_security_token('admin_security'),
|
||||
'$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently authenticated.")),
|
||||
'$cloud_noroot' => [ 'cloud_noroot', t('Provide a cloud root directory'), 1 - intval(get_config('system','cloud_disable_siteroot')), t('The cloud root directory lists all channel names which provide public files') ],
|
||||
'$cloud_disksize' => [ 'cloud_disksize', t('Show total disk space available to cloud uploads'), intval(get_config('system','cloud_report_disksize')), '' ],
|
||||
'$transport_security' => array('transport_security', t('Set "Transport Security" HTTP header'),intval(get_config('system','transport_security_header')),''),
|
||||
'$content_security' => array('content_security', t('Set "Content Security Policy" HTTP header'),intval(get_config('system','content_security_policy')),''),
|
||||
'$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
|
||||
|
||||
@@ -24,28 +24,39 @@ class Site {
|
||||
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
|
||||
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
|
||||
$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'])) : '');
|
||||
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 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);
|
||||
$invite_only = ((x($_POST,'invite_only')) ? True : False);
|
||||
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
|
||||
|
||||
$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'])) : '');
|
||||
$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);
|
||||
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
|
||||
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
|
||||
$force_publish = ((x($_POST,'publish_all')) ? True : False);
|
||||
$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);
|
||||
$enable_context_help = ((x($_POST,'enable_context_help')) ? True : False);
|
||||
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
|
||||
$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);
|
||||
$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());
|
||||
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
|
||||
@@ -64,7 +75,11 @@ class Site {
|
||||
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
|
||||
$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']) : 300);
|
||||
$force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000);
|
||||
$pub_incl = escape_tags(trim($_POST['pub_incl']));
|
||||
$pub_excl = escape_tags(trim($_POST['pub_excl']));
|
||||
|
||||
$permissions_role = escape_tags(trim($_POST['permissions_role']));
|
||||
|
||||
$techlevel = null;
|
||||
if(array_key_exists('techlevel', $_POST))
|
||||
@@ -76,17 +91,24 @@ class Site {
|
||||
set_config('system', 'poll_interval', $poll_interval);
|
||||
set_config('system', 'maxloadavg', $maxloadavg);
|
||||
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', 'sitename', $sitename);
|
||||
set_config('system', 'login_on_homepage', $login_on_homepage);
|
||||
set_config('system', 'enable_context_help', $enable_context_help);
|
||||
set_config('system', 'verify_email', $verify_email);
|
||||
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', 'from_email', $from_email);
|
||||
set_config('system', 'from_email_name' , $from_email_name);
|
||||
set_config('system', 'imagick_convert_path' , $imagick_path);
|
||||
set_config('system', 'thumbnail_security' , $thumbnail_security);
|
||||
set_config('system', 'default_permissions_role', $permissions_role);
|
||||
set_config('system', 'pubstream_incl',$pub_incl);
|
||||
set_config('system', 'pubstream_excl',$pub_excl);
|
||||
|
||||
set_config('system', 'techlevel_lock', $techlevel_lock);
|
||||
|
||||
@@ -114,15 +136,16 @@ class Site {
|
||||
set_config('system','siteinfo',$siteinfo);
|
||||
set_config('system', 'language', $language);
|
||||
set_config('system', 'theme', $theme);
|
||||
if ( $theme_mobile === '---' ) {
|
||||
del_config('system', 'mobile_theme');
|
||||
} else {
|
||||
set_config('system', 'mobile_theme', $theme_mobile);
|
||||
}
|
||||
// if ( $theme_mobile === '---' ) {
|
||||
// del_config('system', 'mobile_theme');
|
||||
// } else {
|
||||
// set_config('system', 'mobile_theme', $theme_mobile);
|
||||
// }
|
||||
// set_config('system','site_channel', $site_channel);
|
||||
set_config('system','maximagesize', $maximagesize);
|
||||
|
||||
set_config('system','register_policy', $register_policy);
|
||||
set_config('system','minimum_age', $minimum_age);
|
||||
set_config('system','invitation_only', $invite_only);
|
||||
set_config('system','access_policy', $access_policy);
|
||||
set_config('system','account_abandon_days', $abandon_days);
|
||||
@@ -130,6 +153,8 @@ class Site {
|
||||
set_config('system','allowed_sites', $allowed_sites);
|
||||
set_config('system','publish_all', $force_publish);
|
||||
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 == '') {
|
||||
del_config('system', 'directory_submit_url');
|
||||
@@ -209,9 +234,10 @@ class Site {
|
||||
$realm = get_directory_realm();
|
||||
|
||||
// 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) {
|
||||
$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_PRIMARY),
|
||||
dbesc($realm)
|
||||
@@ -267,6 +293,12 @@ class Site {
|
||||
'5' => t('Wizard - I probably know more than you do')
|
||||
];
|
||||
|
||||
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
|
||||
$default_role = get_config('system','default_permissions_role','social');
|
||||
|
||||
$role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles);
|
||||
|
||||
|
||||
$homelogin = get_config('system','login_on_homepage');
|
||||
$enable_context_help = get_config('system','enable_context_help');
|
||||
|
||||
@@ -288,19 +320,21 @@ 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') ],
|
||||
|
||||
'$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")),
|
||||
'$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),
|
||||
'$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")),
|
||||
'$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.")),
|
||||
'$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.")),
|
||||
'$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),
|
||||
'$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.")),
|
||||
'$role' => $role,
|
||||
'$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.")),
|
||||
'$mirror_frontpage' => array('mirror_frontpage', t("Preserve site homepage URL"), get_config('system','mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')),
|
||||
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
|
||||
@@ -308,6 +342,12 @@ 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).")),
|
||||
'$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.')),
|
||||
'$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.')),
|
||||
'$incl' => array('pub_incl',t('Only import Public stream posts with this text'), get_config('system','pubstream_incl'),t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
|
||||
'$excl' => array('pub_excl',t('Do not import Public stream posts with this text'), get_config('system','pubstream_excl'),t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
|
||||
|
||||
|
||||
'$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.")),
|
||||
|
||||
@@ -322,12 +362,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).")),
|
||||
'$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.")),
|
||||
'$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',300), t("Always defer immediate delivery if queue contains more than this number of entries.")),
|
||||
'$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.")),
|
||||
'$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.")),
|
||||
'$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('Default: profiles')),
|
||||
|
||||
'$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"),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -39,10 +39,12 @@ class Api extends \Zotlabs\Web\Controller {
|
||||
|
||||
// get consumer/client from request token
|
||||
try {
|
||||
$request = OAuth1Request::from_request();
|
||||
$request = \OAuth1Request::from_request();
|
||||
}
|
||||
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))
|
||||
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());
|
||||
set_config('oauth', $verifier, local_channel());
|
||||
@@ -63,7 +65,7 @@ class Api extends \Zotlabs\Web\Controller {
|
||||
$glue = '?';
|
||||
if(strstr($consumer->callback_url,$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();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class Appman extends \Zotlabs\Web\Controller {
|
||||
'photo' => escape_tags($_REQUEST['photo']),
|
||||
'version' => escape_tags($_REQUEST['version']),
|
||||
'price' => escape_tags($_REQUEST['price']),
|
||||
'page' => escape_tags($_REQUEST['page']),
|
||||
'requires' => escape_tags($_REQUEST['requires']),
|
||||
'system' => intval($_REQUEST['system']),
|
||||
'plugin' => escape_tags($_REQUEST['plugin']),
|
||||
|
||||
@@ -15,6 +15,8 @@ class Apps extends \Zotlabs\Web\Controller {
|
||||
else
|
||||
$mode = 'list';
|
||||
|
||||
$available = ((argc() == 2 && argv(1) === 'available') ? true : false);
|
||||
|
||||
$_SESSION['return_url'] = \App::$query_string;
|
||||
|
||||
$apps = array();
|
||||
@@ -23,7 +25,7 @@ class Apps extends \Zotlabs\Web\Controller {
|
||||
Zlib\Apps::import_system_apps();
|
||||
$syslist = array();
|
||||
$cat = ((array_key_exists('cat',$_GET) && $_GET['cat']) ? [ escape_tags($_GET['cat']) ] : '');
|
||||
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $cat);
|
||||
$list = Zlib\Apps::app_list((($available) ? 0 : local_channel()), (($mode == 'edit') ? true : false), $cat);
|
||||
if($list) {
|
||||
foreach($list as $x) {
|
||||
$syslist[] = Zlib\Apps::app_encode($x);
|
||||
@@ -39,7 +41,7 @@ class Apps extends \Zotlabs\Web\Controller {
|
||||
// logger('apps: ' . print_r($syslist,true));
|
||||
|
||||
foreach($syslist as $app) {
|
||||
$apps[] = Zlib\Apps::app_render($app,$mode);
|
||||
$apps[] = Zlib\Apps::app_render($app,(($available) ? 'install' : $mode));
|
||||
}
|
||||
|
||||
return replace_macros(get_markup_template('myapps.tpl'), array(
|
||||
@@ -48,7 +50,7 @@ class Apps extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Apps'),
|
||||
'$apps' => $apps,
|
||||
'$authed' => ((local_channel()) ? true : false),
|
||||
'$manage' => t('Manage apps'),
|
||||
'$manage' => (($available) ? '' : t('Manage apps')),
|
||||
'$create' => (($mode == 'edit') ? t('Create new app') : '')
|
||||
));
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@ class Article_edit extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Edit Article'),
|
||||
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||
'$id' => $itm[0]['id'],
|
||||
'$cancel' => t('Cancel'),
|
||||
'$editor' => $editor
|
||||
));
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
nav_set_selected(t('Cards'));
|
||||
nav_set_selected(t('Articles'));
|
||||
|
||||
head_add_link([
|
||||
'rel' => 'alternate',
|
||||
@@ -102,6 +102,7 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
'permissions' => $channel_acl,
|
||||
'showacl' => (($is_owner) ? true : false),
|
||||
'visitor' => true,
|
||||
'body' => '[summary][/summary]',
|
||||
'hide_location' => false,
|
||||
'hide_voting' => false,
|
||||
'profile_uid' => intval($owner),
|
||||
@@ -126,21 +127,26 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
$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_extra .= "and item.id = " . intval($r[0]['iid']) . " ";
|
||||
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
|
||||
}
|
||||
}
|
||||
|
||||
$r = q("select * from item
|
||||
where item.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(ITEM_TYPE_ARTICLE)
|
||||
);
|
||||
@@ -151,6 +157,8 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
|
||||
if($r) {
|
||||
|
||||
$pager_total = count($r);
|
||||
|
||||
$parents_str = ids_to_querystr($r,'id');
|
||||
|
||||
$items = q("SELECT item.*, item.id AS item_id
|
||||
@@ -172,13 +180,18 @@ class Articles extends \Zotlabs\Web\Controller {
|
||||
|
||||
$mode = 'articles';
|
||||
|
||||
$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,$mode,false,$page_mode);
|
||||
|
||||
$o = replace_macros(get_markup_template('cards.tpl'), [
|
||||
'$title' => t('Articles'),
|
||||
'$editor' => $editor,
|
||||
'$content' => $content,
|
||||
'$pager' => alt_pager($a,count($items))
|
||||
'$pager' => alt_pager($pager_total)
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
||||
@@ -2,70 +2,95 @@
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Identity\OAuth2Storage;
|
||||
|
||||
class Authorize extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
||||
function get() {
|
||||
|
||||
|
||||
// workaround for HTTP-auth in CGI mode
|
||||
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
|
||||
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
|
||||
if(strlen($userpass)) {
|
||||
list($name, $password) = explode(':', $userpass);
|
||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||
}
|
||||
}
|
||||
|
||||
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
|
||||
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
|
||||
if(strlen($userpass)) {
|
||||
list($name, $password) = explode(':', $userpass);
|
||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
if (!local_channel()) {
|
||||
return login();
|
||||
} else {
|
||||
// TODO: Fully implement the dynamic client registration protocol:
|
||||
// OpenID Connect Dynamic Client Registration 1.0 Client Metadata
|
||||
// http://openid.net/specs/openid-connect-registration-1_0.html
|
||||
$app = array(
|
||||
'name' => (x($_REQUEST, 'client_name') ? urldecode($_REQUEST['client_name']) : t('Unknown App')),
|
||||
'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(
|
||||
'$title' => t('Authorize'),
|
||||
'$authorize' => sprintf( t('Do you authorize the app %s to access your channel data?'), '<a style="float: none;" href="' . $app['url'] . '">' . $app['name'] . '</a> '),
|
||||
'$app' => $app,
|
||||
'$yes' => t('Allow'),
|
||||
'$no' => t('Deny'),
|
||||
'$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;
|
||||
}
|
||||
}
|
||||
|
||||
// display an authorization form
|
||||
if (empty($_POST)) {
|
||||
function post() {
|
||||
if (! local_channel()) {
|
||||
return;
|
||||
}
|
||||
|
||||
return '
|
||||
<form method="post">
|
||||
<label>Do You Authorize TestClient?</label><br />
|
||||
<input type="submit" name="authorized" value="yes">
|
||||
<input type="submit" name="authorized" value="no">
|
||||
</form>';
|
||||
}
|
||||
$storage = new OAuth2Storage(\DBA::$dba->db);
|
||||
$s = new \Zotlabs\Identity\OAuth2Server($storage);
|
||||
|
||||
// print the authorization code if the user has authorized your client
|
||||
$is_authorized = ($_POST['authorized'] === 'yes');
|
||||
$oauth2_server->handleAuthorizeRequest($request, $response, $is_authorized);
|
||||
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");
|
||||
// TODO: The automatic client registration protocol below should adhere more
|
||||
// closely to "OAuth 2.0 Dynamic Client Registration Protocol" defined
|
||||
// at https://tools.ietf.org/html/rfc7591
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ class Card_edit extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Edit Card'),
|
||||
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||
'$id' => $itm[0]['id'],
|
||||
'$cancel' => t('Cancel'),
|
||||
'$editor' => $editor
|
||||
));
|
||||
|
||||
|
||||
@@ -9,18 +9,22 @@ require_once('include/acl_selectors.php');
|
||||
class Cards extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
profile_load($which);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Zotlabs\Web\Controller::get()
|
||||
*/
|
||||
function get($update = 0, $load = false) {
|
||||
|
||||
|
||||
if(observer_prohibited(true)) {
|
||||
return login();
|
||||
}
|
||||
@@ -31,13 +35,13 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
if(! feature_enabled(\App::$profile_uid,'cards')) {
|
||||
if(! feature_enabled(\App::$profile_uid, 'cards')) {
|
||||
return;
|
||||
}
|
||||
|
||||
nav_set_selected(t('Cards'));
|
||||
|
||||
head_add_link([
|
||||
head_add_link([
|
||||
'rel' => 'alternate',
|
||||
'type' => 'application/json+oembed',
|
||||
'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'])) : '');
|
||||
|
||||
|
||||
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);
|
||||
|
||||
|
||||
$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')) {
|
||||
|
||||
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(
|
||||
$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']
|
||||
);
|
||||
];
|
||||
}
|
||||
else {
|
||||
$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 = [
|
||||
'webpage' => ITEM_TYPE_CARD,
|
||||
@@ -95,9 +99,9 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
'content_label' => t('Add Card'),
|
||||
'button' => t('Create'),
|
||||
'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'),
|
||||
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
|
||||
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
|
||||
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
|
||||
'permissions' => $channel_acl,
|
||||
'showacl' => (($is_owner) ? true : false),
|
||||
@@ -110,7 +114,7 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
'layoutselect' => false,
|
||||
'expanded' => false,
|
||||
'novoting' => false,
|
||||
'catsenabled' => feature_enabled($owner,'categories'),
|
||||
'catsenabled' => feature_enabled($owner, 'categories'),
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true
|
||||
];
|
||||
@@ -119,28 +123,34 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
$x['title'] = $_REQUEST['title'];
|
||||
if($_REQUEST['body'])
|
||||
$x['body'] = $_REQUEST['body'];
|
||||
$editor = status_editor($a,$x);
|
||||
|
||||
$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 = 'CARD' and iconfig.v = '%s' limit 1",
|
||||
dbesc($selected_card)
|
||||
);
|
||||
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
|
||||
where item.uid = %d and item_type = %d
|
||||
$sql_extra order by item.created desc",
|
||||
|
||||
$r = q("select * from item
|
||||
where uid = %d and item_type = %d
|
||||
$sql_extra $sql_item order by item.created desc $pager_sql",
|
||||
intval($owner),
|
||||
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_blocked = 0 ";
|
||||
|
||||
$items_result = [];
|
||||
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
|
||||
FROM item
|
||||
@@ -164,24 +177,27 @@ class Cards extends \Zotlabs\Web\Controller {
|
||||
if($items) {
|
||||
xchan_query($items);
|
||||
$items = fetch_post_tags($items, true);
|
||||
$items = conv_sort($items,'updated');
|
||||
$items_result = conv_sort($items, 'updated');
|
||||
}
|
||||
else
|
||||
$items = [];
|
||||
}
|
||||
|
||||
$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'), [
|
||||
'$title' => t('Cards'),
|
||||
'$editor' => $editor,
|
||||
'$content' => $content,
|
||||
'$pager' => alt_pager($a,count($items))
|
||||
'$pager' => alt_pager($pager_total)
|
||||
]);
|
||||
|
||||
return $o;
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
|
||||
goaway('search' . '?f=&search=' . $_GET['search']);
|
||||
|
||||
$which = null;
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
@@ -82,7 +85,9 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
|
||||
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
|
||||
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post');
|
||||
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
||||
$search = ((x($_GET,'search')) ? $_GET['search'] : EMPTY_STR);
|
||||
|
||||
$groups = array();
|
||||
|
||||
@@ -118,9 +123,12 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
$static = channel_manual_conv_update(\App::$profile['profile_uid']);
|
||||
|
||||
//$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']);
|
||||
|
||||
// $o .= common_friends_visitor_widget(\App::$profile['profile_uid']);
|
||||
// search terms header
|
||||
if($search) {
|
||||
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
|
||||
'$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8')
|
||||
));
|
||||
}
|
||||
|
||||
if($channel && $is_owner) {
|
||||
$channel_acl = array(
|
||||
@@ -152,7 +160,8 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
'editor_autocomplete' => true,
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true,
|
||||
'jotnets' => true
|
||||
'jotnets' => true,
|
||||
'reset' => t('Reset form')
|
||||
);
|
||||
|
||||
$o .= status_editor($a,$x);
|
||||
@@ -178,6 +187,19 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
|
||||
|
||||
if($search) {
|
||||
$search = escape_tags($search);
|
||||
if(strpos($search,'#') === 0) {
|
||||
$sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
|
||||
}
|
||||
else {
|
||||
$sql_extra .= sprintf(" AND item.body like '%s' ",
|
||||
dbesc(protect_sprintf('%' . $search . '%'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
head_add_link([
|
||||
'rel' => 'alternate',
|
||||
'type' => 'application/json+oembed',
|
||||
@@ -204,7 +226,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
$_SESSION['loadtime'] = datetime_convert();
|
||||
}
|
||||
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 )
|
||||
WHERE uid = %d $item_normal_update
|
||||
AND item_wall = 1 $simple_update
|
||||
@@ -228,18 +250,29 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
if($datequery) {
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
|
||||
$order = 'post';
|
||||
}
|
||||
if($datequery2) {
|
||||
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
|
||||
}
|
||||
|
||||
if($datequery || $datequery2) {
|
||||
$sql_extra2 .= " and item.item_thread_top != 0 ";
|
||||
}
|
||||
|
||||
if($order === 'post')
|
||||
$ordering = "created";
|
||||
else
|
||||
$ordering = "commented";
|
||||
|
||||
|
||||
$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']));
|
||||
|
||||
if($load || ($checkjs->disabled())) {
|
||||
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",
|
||||
dbesc($mid . '%'),
|
||||
intval(\App::$profile['profile_uid'])
|
||||
@@ -249,13 +282,13 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
else {
|
||||
$r = q("SELECT distinct id AS item_id, created FROM item
|
||||
left join abook on item.author_xchan = abook.abook_xchan
|
||||
WHERE uid = %d $item_normal
|
||||
AND item_wall = 1 and item_thread_top = 1
|
||||
AND (abook_blocked = 0 or abook.abook_flags is null)
|
||||
$sql_extra $sql_extra2
|
||||
ORDER BY created DESC $pager_sql ",
|
||||
$r = q("SELECT DISTINCT item.parent AS item_id, $ordering FROM item
|
||||
left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
|
||||
WHERE true and item.uid = %d $item_normal
|
||||
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||
AND item.item_wall = 1 AND item.item_thread_top = 1
|
||||
$sql_extra $sql_extra2
|
||||
ORDER BY $ordering DESC $pager_sql ",
|
||||
intval(\App::$profile['profile_uid'])
|
||||
);
|
||||
}
|
||||
@@ -264,7 +297,6 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
$r = array();
|
||||
}
|
||||
}
|
||||
|
||||
if($r) {
|
||||
|
||||
$parents_str = ids_to_querystr($r,'item_id');
|
||||
@@ -280,7 +312,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
xchan_query($items);
|
||||
$items = fetch_post_tags($items, true);
|
||||
$items = conv_sort($items,'created');
|
||||
$items = conv_sort($items,$ordering);
|
||||
|
||||
if($load && $mid && (! count($items))) {
|
||||
// This will happen if we don't have sufficient permissions
|
||||
@@ -312,8 +344,8 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
|
||||
'$gid' => '0',
|
||||
'$cid' => '0',
|
||||
'$cmin' => '0',
|
||||
'$cmax' => '0',
|
||||
'$cmin' => '(-1)',
|
||||
'$cmax' => '(-1)',
|
||||
'$star' => '0',
|
||||
'$liked' => '0',
|
||||
'$conv' => '0',
|
||||
@@ -323,9 +355,9 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
'$fh' => '0',
|
||||
'$static' => $static,
|
||||
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
|
||||
'$search' => '',
|
||||
'$search' => $search,
|
||||
'$xchan' => '',
|
||||
'$order' => '',
|
||||
'$order' => $order,
|
||||
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
|
||||
'$file' => '',
|
||||
'$cats' => (($category) ? urlencode($category) : ''),
|
||||
@@ -371,16 +403,17 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$mode = (($search) ? 'search' : 'channel');
|
||||
|
||||
if($checkjs->disabled()) {
|
||||
$o .= conversation($items,'channel',$update,'traditional');
|
||||
$o .= conversation($items,$mode,$update,'traditional');
|
||||
}
|
||||
else {
|
||||
$o .= conversation($items,'channel',$update,$page_mode);
|
||||
$o .= conversation($items,$mode,$update,$page_mode);
|
||||
}
|
||||
|
||||
if((! $update) || ($checkjs->disabled())) {
|
||||
$o .= alt_pager($a,count($items));
|
||||
$o .= alt_pager(count($items));
|
||||
if ($mid && $items[0]['title'])
|
||||
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class Chanview extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
if($_REQUEST['address']) {
|
||||
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
|
||||
dbesc($_REQUEST['address'])
|
||||
dbesc(punify($_REQUEST['address']))
|
||||
);
|
||||
}
|
||||
elseif(local_channel() && intval($_REQUEST['cid'])) {
|
||||
|
||||
@@ -60,7 +60,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
|
||||
intval(\App::$data['chat']['room_id']),
|
||||
dbesc(get_observer_hash()),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc($arr['chat_text'])
|
||||
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
|
||||
);
|
||||
|
||||
$ret['success'] = true;
|
||||
@@ -119,10 +119,10 @@ class Chatsvc extends \Zotlabs\Web\Controller {
|
||||
$rv['xchan_network'] = 'unknown';
|
||||
$rv['xchan_url'] = z_root();
|
||||
$rv['xchan_hidden'] = 1;
|
||||
$rv['xchan_photo_mimetype'] = 'image/jpeg';
|
||||
$rv['xchan_photo_l'] = get_default_profile_photo(300);
|
||||
$rv['xchan_photo_m'] = get_default_profile_photo(80);
|
||||
$rv['xchan_photo_s'] = get_default_profile_photo(48);
|
||||
$rv['xchan_photo_mimetype'] = 'image/png';
|
||||
$rv['xchan_photo_l'] = z_root() . '/' . get_default_profile_photo(300);
|
||||
$rv['xchan_photo_m'] = z_root() . '/' . get_default_profile_photo(80);
|
||||
$rv['xchan_photo_s'] = z_root() . '/' . get_default_profile_photo(48);
|
||||
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
|
||||
'name' => $rr['xchan_name'],
|
||||
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
|
||||
'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' : '')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,11 +35,20 @@ class Cloud extends \Zotlabs\Web\Controller {
|
||||
if (argc() > 1)
|
||||
$which = argv(1);
|
||||
|
||||
|
||||
if (argc() < 2 && intval(get_config('system','cloud_disable_siteroot'))) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
construct_page();
|
||||
killme();
|
||||
}
|
||||
|
||||
$profile = 0;
|
||||
|
||||
if ($which)
|
||||
profile_load( $which, $profile);
|
||||
|
||||
|
||||
|
||||
$auth = new \Zotlabs\Storage\BasicAuth();
|
||||
|
||||
$ob_hash = get_observer_hash();
|
||||
@@ -60,6 +69,12 @@ class Cloud extends \Zotlabs\Web\Controller {
|
||||
// if we arrived at this path with any query parameters in the url, build a clean url without
|
||||
// them and redirect.
|
||||
|
||||
if(! array_key_exists('cloud_sort',$_SESSION)) {
|
||||
$_SESSION['cloud_sort'] = 'name';
|
||||
}
|
||||
|
||||
$_SESSION['cloud_sort'] = (($_REQUEST['sort']) ? trim(notags($_REQUEST['sort'])) : $_SESSION['cloud_sort']);
|
||||
|
||||
$x = clean_query_string();
|
||||
if($x !== \App::$query_string)
|
||||
goaway(z_root() . '/' . $x);
|
||||
@@ -110,6 +125,9 @@ class Cloud extends \Zotlabs\Web\Controller {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
|
||||
nav_set_selected('Connections');
|
||||
|
||||
$active = false;
|
||||
$blocked = false;
|
||||
$hidden = false;
|
||||
$ignored = false;
|
||||
@@ -44,11 +45,16 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
if(! $_REQUEST['aj'])
|
||||
$_SESSION['return_url'] = \App::$query_string;
|
||||
|
||||
$search_flags = '';
|
||||
$search_flags = "";
|
||||
$head = '';
|
||||
|
||||
if(argc() == 2) {
|
||||
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':
|
||||
$search_flags = " and abook_blocked = 1 ";
|
||||
$head = t('Blocked');
|
||||
@@ -101,8 +107,9 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
case 'all':
|
||||
$head = t('All');
|
||||
default:
|
||||
$search_flags = '';
|
||||
$all = true;
|
||||
$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 and abook_not_here = 0 ";
|
||||
$active = true;
|
||||
$head = t('Active');
|
||||
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(
|
||||
'label' => t('New Connections'),
|
||||
'url' => z_root() . '/connections/pending',
|
||||
@@ -136,12 +150,6 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
'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(
|
||||
@@ -187,6 +195,13 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
// '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['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
|
||||
$phone = '';
|
||||
|
||||
$status_str = '';
|
||||
$status = array(
|
||||
((intval($rr['abook_active'])) ? t('Active') : ''),
|
||||
((intval($rr['abook_pending'])) ? t('Pending approval') : ''),
|
||||
((intval($rr['abook_archived'])) ? t('Archived') : ''),
|
||||
((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_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) {
|
||||
if(!$str)
|
||||
@@ -283,7 +304,8 @@ class Connections extends \Zotlabs\Web\Controller {
|
||||
'ignore_hover' => t('Ignore connection'),
|
||||
'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false),
|
||||
'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();
|
||||
}
|
||||
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(
|
||||
'$header' => t('Connections') . (($head) ? ': ' . $head : ''),
|
||||
'$tabs' => $tabs,
|
||||
|
||||
@@ -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 = '';
|
||||
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
|
||||
if(! $clonable) {
|
||||
@@ -866,11 +849,11 @@ class Connedit extends \Zotlabs\Web\Controller {
|
||||
$o .= replace_macros($tpl, [
|
||||
'$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),
|
||||
'$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_enable' => feature_enabled(local_channel(),'permcats'),
|
||||
'$addr' => $contact['xchan_addr'],
|
||||
'$primeurl' => $contact['xchan_url'],
|
||||
'$addr' => unpunify($contact['xchan_addr']),
|
||||
'$primeurl' => unpunify($contact['xchan_url']),
|
||||
'$section' => $section,
|
||||
'$sections' => $sections,
|
||||
'$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.'),
|
||||
'$lastupdtext' => t('Last update:'),
|
||||
'$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']),
|
||||
'$multiprofs' => $multiprofs,
|
||||
'$contact_id' => $contact['abook_id'],
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/photo/photo_driver.php');
|
||||
require_once('include/channel.php');
|
||||
require_once('include/photos.php');
|
||||
|
||||
|
||||
|
||||
@@ -64,12 +65,12 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
$image_id = substr($image_id,0,-2);
|
||||
}
|
||||
|
||||
|
||||
$srcX = $_POST['xstart'];
|
||||
$srcY = $_POST['ystart'];
|
||||
$srcW = $_POST['xfinal'] - $srcX;
|
||||
$srcH = $_POST['yfinal'] - $srcY;
|
||||
|
||||
|
||||
|
||||
$srcX = intval($_POST['xstart']);
|
||||
$srcY = intval($_POST['ystart']);
|
||||
$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",
|
||||
intval(local_channel())
|
||||
@@ -84,10 +85,41 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
|
||||
if($r) {
|
||||
|
||||
$base_image = $r[0];
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
|
||||
|
||||
|
||||
$max_thumb = intval(get_config('system','max_thumbnail',1600));
|
||||
$iscaled = false;
|
||||
if(intval($r[0]['height']) > $max_thumb || intval($r[0]['width']) > $max_thumb) {
|
||||
$imagick_path = get_config('system','imagick_convert_path');
|
||||
if($imagick_path && @file_exists($imagick_path) && intval($r[0]['os_storage'])) {
|
||||
|
||||
$fname = dbunescbin($r[0]['content']);
|
||||
$tmp_name = $fname . '-001';
|
||||
$newsize = photo_calculate_scale(array_merge(getimagesize($fname),['max' => $max_thumb]));
|
||||
$cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $fname) . ' -resize ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name);
|
||||
// logger('imagick thumbnail command: ' . $cmd);
|
||||
for($x = 0; $x < 4; $x ++) {
|
||||
exec($cmd);
|
||||
if(file_exists($tmp_name)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(file_exists($tmp_name)) {
|
||||
$base_image = $r[0];
|
||||
$gis = getimagesize($tmp_name);
|
||||
logger('gis: ' . print_r($gis,true));
|
||||
$base_image['width'] = $gis[0];
|
||||
$base_image['height'] = $gis[1];
|
||||
$base_image['content'] = @file_get_contents($tmp_name);
|
||||
$iscaled = true;
|
||||
@unlink($tmp_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(! $iscaled) {
|
||||
$base_image = $r[0];
|
||||
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
|
||||
}
|
||||
|
||||
$im = photo_factory($base_image['content'], $base_image['mimetype']);
|
||||
if($im->is_valid()) {
|
||||
|
||||
@@ -119,10 +151,10 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
intval(local_channel())
|
||||
);
|
||||
|
||||
$orig_srcx = ( $r[0]['width'] / $scaled_width ) * $srcX;
|
||||
$orig_srcy = ( $r[0]['height'] / $scaled_height ) * $srcY;
|
||||
$orig_srcw = ( $srcW / $scaled_width ) * $r[0]['width'];
|
||||
$orig_srch = ( $srcH / $scaled_height ) * $r[0]['height'];
|
||||
$orig_srcx = ( $base_image['width'] / $scaled_width ) * $srcX;
|
||||
$orig_srcy = ( $base_image['height'] / $scaled_height ) * $srcY;
|
||||
$orig_srcw = ( $srcW / $scaled_width ) * $base_image['width'];
|
||||
$orig_srch = ( $srcH / $scaled_height ) * $base_image['height'];
|
||||
|
||||
$im->cropImageRect(1200,435,$orig_srcx, $orig_srcy, $orig_srcw, $orig_srch);
|
||||
|
||||
@@ -207,7 +239,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);
|
||||
|
||||
if(! $ph->is_valid()) {
|
||||
@@ -355,14 +387,27 @@ class Cover_photo extends \Zotlabs\Web\Controller {
|
||||
|
||||
$o .= replace_macros($tpl,array(
|
||||
'$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_profiles' => t('Select a profile:'),
|
||||
'$title' => t('Upload Cover Photo'),
|
||||
'$title' => t('Change Cover Photo'),
|
||||
'$submit' => t('Upload'),
|
||||
'$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"),
|
||||
/// @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);
|
||||
|
||||
@@ -22,7 +22,7 @@ class Defperms extends \Zotlabs\Web\Controller {
|
||||
|
||||
$r = q("SELECT abook.*, xchan.*
|
||||
FROM abook left join xchan on abook_xchan = xchan_hash
|
||||
WHERE abook_self = 1 and abook_id = %d LIMIT 1",
|
||||
WHERE abook_self = 1 and abook_channel = %d LIMIT 1",
|
||||
intval(local_channel())
|
||||
);
|
||||
if($r) {
|
||||
@@ -237,7 +237,7 @@ class Defperms extends \Zotlabs\Web\Controller {
|
||||
$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'), '', '',$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_enable' => feature_enabled(local_channel(),'permcats'),
|
||||
'$section' => $section,
|
||||
|
||||
@@ -17,7 +17,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
intval(local_channel()),
|
||||
dbesc($_GET['ignore'])
|
||||
);
|
||||
goaway(z_root() . '/directory?suggest=1');
|
||||
goaway(z_root() . '/directory?f=&suggest=1');
|
||||
}
|
||||
|
||||
$observer = get_observer_hash();
|
||||
@@ -101,6 +101,11 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
if($suggest) {
|
||||
|
||||
$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
|
||||
$addresses = array();
|
||||
@@ -294,9 +299,9 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
if(strlen($out))
|
||||
$out .= ', ';
|
||||
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
|
||||
$out .= $k;
|
||||
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'">' . $k . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +395,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
|
||||
$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(
|
||||
'$search' => $search,
|
||||
'$desc' => t('Find'),
|
||||
@@ -399,7 +404,7 @@ class Directory extends \Zotlabs\Web\Controller {
|
||||
'$entries' => $entries,
|
||||
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
|
||||
'$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'),
|
||||
'$normal' => t('Alphabetic'),
|
||||
'$reverse' => t('Reverse Alphabetic'),
|
||||
|
||||
@@ -97,7 +97,10 @@ class Dirsearch extends \Zotlabs\Web\Controller {
|
||||
else
|
||||
$sync = false;
|
||||
|
||||
|
||||
if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) {
|
||||
$hub = \App::get_hostname();
|
||||
}
|
||||
|
||||
if($hub)
|
||||
$hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
|
||||
else
|
||||
@@ -254,7 +257,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
|
||||
else {
|
||||
|
||||
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash
|
||||
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
|
||||
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_system = 0 and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
|
||||
$safesql $order $qlimit "
|
||||
);
|
||||
|
||||
@@ -313,7 +316,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
|
||||
|
||||
$ret['results'] = $entries;
|
||||
if($kw) {
|
||||
$k = dir_tagadelic($kw);
|
||||
$k = dir_tagadelic($kw, $hub);
|
||||
if($k) {
|
||||
$ret['keywords'] = array();
|
||||
foreach($k as $kv) {
|
||||
|
||||
@@ -67,8 +67,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
'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),
|
||||
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
|
||||
'permissions' => $channel_acl,
|
||||
'bang' => '',
|
||||
'visitor' => true,
|
||||
@@ -78,7 +77,8 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
'editor_autocomplete' => true,
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true,
|
||||
'jotnets' => true
|
||||
'jotnets' => true,
|
||||
'reset' => t('Reset form')
|
||||
);
|
||||
|
||||
$o = '<div id="jot-popup">';
|
||||
@@ -102,7 +102,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
if($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 . '%')
|
||||
);
|
||||
|
||||
@@ -110,6 +110,14 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
$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($target_item['item_blocked'] == ITEM_MODERATED) {
|
||||
goaway(z_root() . '/moderate/' . $target_item['id']);
|
||||
@@ -124,7 +132,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
$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",
|
||||
intval($target_item['uid']),
|
||||
intval($target_item['id'])
|
||||
intval($target_item['parent'])
|
||||
);
|
||||
if($x && $y) {
|
||||
goaway(z_root() . '/page/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
|
||||
@@ -134,6 +142,41 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
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);
|
||||
|
||||
@@ -170,8 +213,8 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
'$uid' => '0',
|
||||
'$gid' => '0',
|
||||
'$cid' => '0',
|
||||
'$cmin' => '0',
|
||||
'$cmax' => '99',
|
||||
'$cmin' => '(-1)',
|
||||
'$cmax' => '(-1)',
|
||||
'$star' => '0',
|
||||
'$liked' => '0',
|
||||
'$conv' => '0',
|
||||
@@ -215,6 +258,7 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
|
||||
|
||||
if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
|
||||
|
||||
$r = null;
|
||||
|
||||
require_once('include/channel.php');
|
||||
@@ -235,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
|
||||
// make that content unsearchable by ensuring the owner uid can't match
|
||||
@@ -281,7 +325,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
|
||||
// make that content unsearchable by ensuring the owner_xchan can't match
|
||||
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
|
||||
@@ -343,14 +387,15 @@ class Display extends \Zotlabs\Web\Controller {
|
||||
case 'atom':
|
||||
|
||||
$atom = replace_macros(get_markup_template('atom_feed.tpl'), array(
|
||||
'$version' => xmlify(\Zotlabs\Lib\System::get_project_version()),
|
||||
'$red' => xmlify(\Zotlabs\Lib\System::get_platform_name()),
|
||||
'$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']),
|
||||
'$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 ];
|
||||
|
||||
@@ -138,6 +138,7 @@ class Editblock extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Edit Block'),
|
||||
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||
'$id' => $itm[0]['id'],
|
||||
'$cancel' => t('Cancel'),
|
||||
'$editor' => $editor
|
||||
));
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ class Editlayout extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Edit Layout'),
|
||||
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||
'$id' => $itm[0]['id'],
|
||||
'$cancel' => t('Cancel'),
|
||||
'$editor' => $editor
|
||||
));
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class Editpost extends \Zotlabs\Web\Controller {
|
||||
'editor_autocomplete'=> true,
|
||||
'bbco_autocomplete'=> 'bbcode',
|
||||
'return_path' => $_SESSION['return_url'],
|
||||
'button' => t('Edit'),
|
||||
'button' => t('Submit'),
|
||||
'hide_voting' => true,
|
||||
'hide_future' => true,
|
||||
'hide_location' => true,
|
||||
@@ -106,6 +106,7 @@ class Editpost extends \Zotlabs\Web\Controller {
|
||||
|
||||
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
|
||||
'$title' => t('Edit post'),
|
||||
'$cancel' => t('Cancel'),
|
||||
'$editor' => $editor
|
||||
));
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@ class Editwebpage extends \Zotlabs\Web\Controller {
|
||||
'$title' => t('Edit Webpage'),
|
||||
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
|
||||
'$editor' => $editor,
|
||||
'$cancel' => t('Cancel'),
|
||||
'$id' => $itm[0]['id']
|
||||
));
|
||||
|
||||
|
||||
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 {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
||||
|
||||
$perms = get_all_perms($owner, $ob_hash);
|
||||
|
||||
if(! $perms['view_storage']) {
|
||||
if(! ($perms['view_storage'] || is_site_admin())){
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
@@ -75,15 +75,29 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
||||
// need to return for anyone other than the owner, despite the perms check for now.
|
||||
|
||||
$is_owner = (((local_channel()) && ($owner == local_channel())) ? true : false);
|
||||
if(! $is_owner) {
|
||||
if(! ($is_owner || is_site_admin())){
|
||||
info( t('Permission Denied.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
if(argc() > 3 && argv(3) === 'delete') {
|
||||
|
||||
if(argc() > 4 && argv(4) === 'json')
|
||||
$json_return = true;
|
||||
|
||||
|
||||
$admin_delete = false;
|
||||
|
||||
if(! $perms['write_storage']) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
if(is_site_admin()) {
|
||||
$admin_delete = true;
|
||||
}
|
||||
else {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
if($json_return)
|
||||
json_return_and_die([ 'success' => false ]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$file = intval(argv(2));
|
||||
@@ -92,22 +106,31 @@ class Filestorage extends \Zotlabs\Web\Controller {
|
||||
intval($owner)
|
||||
);
|
||||
if(! $r) {
|
||||
if($json_return)
|
||||
json_return_and_die([ 'success' => false ]);
|
||||
|
||||
notice( t('File not found.') . EOL);
|
||||
goaway(z_root() . '/cloud/' . $which);
|
||||
}
|
||||
|
||||
$f = $r[0];
|
||||
$channel = \App::get_channel();
|
||||
|
||||
$channel = channelx_by_n($owner);
|
||||
|
||||
$url = get_cloud_url($channel['channel_id'], $channel['channel_address'], $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)));
|
||||
if(! $admin_delete) {
|
||||
$sync = attach_export_data($channel, $f['hash'], true);
|
||||
if($sync) {
|
||||
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
|
||||
}
|
||||
}
|
||||
|
||||
if(json_return)
|
||||
json_return_and_die([ 'success' => true ]);
|
||||
|
||||
goaway(dirname($url));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,21 +14,26 @@ class Follow extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$uid = local_channel();
|
||||
$url = notags(trim($_REQUEST['url']));
|
||||
$url = notags(trim(punify($_REQUEST['url'])));
|
||||
$return_url = $_SESSION['return_url'];
|
||||
$confirm = intval($_REQUEST['confirm']);
|
||||
|
||||
$interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1);
|
||||
$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['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();
|
||||
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'))
|
||||
\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 ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,17 @@ require_once('include/group.php');
|
||||
|
||||
class Group extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
if(! local_channel()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
\App::$profile_uid = local_channel();
|
||||
|
||||
nav_set_selected('Privacy Groups');
|
||||
}
|
||||
|
||||
function post() {
|
||||
|
||||
if(! local_channel()) {
|
||||
@@ -22,12 +33,10 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
$r = group_add(local_channel(),$name,$public);
|
||||
if($r) {
|
||||
info( t('Privacy group created.') . EOL );
|
||||
$r = group_byname(local_channel(),$name);
|
||||
if($r)
|
||||
goaway(z_root() . '/group/' . $r);
|
||||
}
|
||||
else
|
||||
notice( t('Could not create privacy group.') . EOL );
|
||||
else {
|
||||
notice( t('Could not create privacy group.') . EOL );
|
||||
}
|
||||
goaway(z_root() . '/group');
|
||||
|
||||
}
|
||||
@@ -74,30 +83,59 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
notice( t('Permission denied') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Switch to text mode interface if we have more than 'n' contacts or group members
|
||||
|
||||
$switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit');
|
||||
if($switchtotext === false)
|
||||
$switchtotext = get_config('system','groupedit_image_limit');
|
||||
if($switchtotext === false)
|
||||
$switchtotext = 400;
|
||||
|
||||
$tpl = get_markup_template('group_edit.tpl');
|
||||
$context = array('$submit' => t('Submit'));
|
||||
|
||||
if((argc() == 2) && (argv(1) === 'new')) {
|
||||
|
||||
return replace_macros($tpl, $context + array(
|
||||
'$title' => t('Create a group of channels.'),
|
||||
'$gname' => array('groupname',t('Privacy group name: '), '', ''),
|
||||
'$gid' => 'new',
|
||||
'$public' => array('public',t('Members are visible to other channels'), false, ''),
|
||||
|
||||
|
||||
if((argc() == 1) || ((argc() == 2) && (argv(1) === 'new'))) {
|
||||
|
||||
$new = (((argc() == 2) && (argv(1) === 'new')) ? true : false);
|
||||
|
||||
$groups = q("SELECT id, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
|
||||
intval(local_channel())
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
foreach($groups as $group) {
|
||||
$entries[$i]['name'] = $group['gname'];
|
||||
$entries[$i]['id'] = $group['id'];
|
||||
$entries[$i]['count'] = count(group_get_members($group['id']));
|
||||
$i++;
|
||||
}
|
||||
|
||||
$tpl = get_markup_template('privacy_groups.tpl');
|
||||
$o = replace_macros($tpl, [
|
||||
'$title' => t('Privacy Groups'),
|
||||
'$add_new_label' => t('Add Group'),
|
||||
'$new' => $new,
|
||||
|
||||
// new group form
|
||||
'$gname' => array('groupname',t('Privacy group name')),
|
||||
'$public' => array('public',t('Members are visible to other channels'), false),
|
||||
'$form_security_token' => get_form_security_token("group_edit"),
|
||||
));
|
||||
|
||||
|
||||
'$submit' => t('Submit'),
|
||||
|
||||
// groups list
|
||||
'$title' => t('Privacy Groups'),
|
||||
'$name_label' => t('Name'),
|
||||
'$count_label' => t('Members'),
|
||||
'$entries' => $entries
|
||||
]);
|
||||
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$context = array('$submit' => t('Submit'));
|
||||
$tpl = get_markup_template('group_edit.tpl');
|
||||
|
||||
if((argc() == 3) && (argv(1) === 'drop')) {
|
||||
check_form_security_token_redirectOnErr('/group', 'group_drop', 't');
|
||||
@@ -172,22 +210,17 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
$preselected[] = $member['xchan_hash'];
|
||||
}
|
||||
}
|
||||
|
||||
$drop_tpl = get_markup_template('group_drop.tpl');
|
||||
$drop_txt = replace_macros($drop_tpl, array(
|
||||
'$id' => $group['id'],
|
||||
'$delete' => t('Delete'),
|
||||
'$form_security_token' => get_form_security_token("group_drop"),
|
||||
));
|
||||
|
||||
|
||||
|
||||
$context = $context + array(
|
||||
'$title' => t('Privacy group editor'),
|
||||
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
|
||||
'$details_label' => t('Edit'),
|
||||
'$gname' => array('groupname',t('Privacy group name: '),$group['gname'], ''),
|
||||
'$gid' => $group['id'],
|
||||
'$drop' => $drop_txt,
|
||||
'$public' => array('public',t('Members are visible to other channels'), $group['visible'], ''),
|
||||
'$form_security_token' => get_form_security_token('group_edit'),
|
||||
'$form_security_token_edit' => get_form_security_token('group_edit'),
|
||||
'$delete' => t('Delete Group'),
|
||||
'$form_security_token_drop' => get_form_security_token("group_drop"),
|
||||
);
|
||||
|
||||
}
|
||||
@@ -196,14 +229,14 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
|
||||
$groupeditor = array(
|
||||
'label_members' => t('Members'),
|
||||
'label_members' => t('Group members'),
|
||||
'members' => array(),
|
||||
'label_contacts' => t('All Connected Channels'),
|
||||
'label_contacts' => t('Not in this group'),
|
||||
'contacts' => array(),
|
||||
);
|
||||
|
||||
$sec_token = addslashes(get_form_security_token('group_member_change'));
|
||||
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
|
||||
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : 'card');
|
||||
foreach($members as $member) {
|
||||
if($member['xchan_url']) {
|
||||
$member['archived'] = (intval($member['abook_archived']) ? true : false);
|
||||
@@ -219,7 +252,7 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
|
||||
if(count($r)) {
|
||||
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
|
||||
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : 'card');
|
||||
foreach($r as $member) {
|
||||
if(! in_array($member['xchan_hash'],$preselected)) {
|
||||
$member['archived'] = (intval($member['abook_archived']) ? true : false);
|
||||
@@ -230,7 +263,7 @@ class Group extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$context['$groupeditor'] = $groupeditor;
|
||||
$context['$desc'] = t('Click on a channel to add or remove.');
|
||||
$context['$desc'] = t('Click a channel to toggle membership');
|
||||
|
||||
if($change) {
|
||||
$tpl = get_markup_template('groupeditor.tpl');
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ require_once('include/conversation.php');
|
||||
class Home extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
|
||||
$ret = array();
|
||||
|
||||
call_hooks('home_init',$ret);
|
||||
@@ -89,11 +89,11 @@ class Home extends \Zotlabs\Web\Controller {
|
||||
|
||||
$sitename = get_config('system','sitename');
|
||||
if($sitename)
|
||||
$o .= '<h1 class="home-welcome">' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
|
||||
$o .= '<h1 class="home-welcome">' . sprintf( t('Welcome to %s') ,$sitename) . '</h1>';
|
||||
|
||||
$loginbox = get_config('system','login_on_homepage');
|
||||
if(intval($loginbox) || $loginbox === false)
|
||||
$o .= login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
|
||||
$o .= login(true);
|
||||
|
||||
return $o;
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ class Hq extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
}
|
||||
|
||||
killme();
|
||||
|
||||
}
|
||||
|
||||
function get($update = 0, $load = false) {
|
||||
@@ -50,9 +52,9 @@ class Hq extends \Zotlabs\Web\Controller {
|
||||
$item_normal_update = item_normal_update();
|
||||
|
||||
if(! $item_hash) {
|
||||
$r = q("SELECT mid FROM item
|
||||
WHERE uid = %d
|
||||
AND mid = parent_mid
|
||||
$r = q("SELECT mid FROM item
|
||||
WHERE uid = %d $item_normal
|
||||
AND mid = parent_mid
|
||||
ORDER BY created DESC LIMIT 1",
|
||||
intval(local_channel())
|
||||
);
|
||||
@@ -118,8 +120,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
||||
'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),
|
||||
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
|
||||
'permissions' => $channel_acl,
|
||||
'bang' => '',
|
||||
'visitor' => true,
|
||||
@@ -129,19 +130,18 @@ class Hq extends \Zotlabs\Web\Controller {
|
||||
'editor_autocomplete' => true,
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true,
|
||||
'jotnets' => true
|
||||
'jotnets' => true,
|
||||
'reset' => t('Reset form')
|
||||
];
|
||||
|
||||
$o = replace_macros(get_markup_template("hq.tpl"),
|
||||
[
|
||||
'$no_messages' => (($target_item) ? false : true),
|
||||
'$no_messages_label' => t('Welcome to hubzilla!')
|
||||
'$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ],
|
||||
'$editor' => status_editor($a,$x)
|
||||
]
|
||||
);
|
||||
|
||||
$o = '<div id="jot-popup">';
|
||||
$o .= status_editor($a,$x);
|
||||
$o .= '</div>';
|
||||
|
||||
}
|
||||
|
||||
if(! $update && ! $load) {
|
||||
@@ -266,23 +266,20 @@ class Hq extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if($r) {
|
||||
$parents_str = ids_to_querystr($r,'item_id');
|
||||
if($parents_str) {
|
||||
$items = q("SELECT item.*, item.id AS item_id
|
||||
FROM item
|
||||
WHERE parent IN ( %s ) $item_normal ",
|
||||
dbesc($parents_str)
|
||||
);
|
||||
$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');
|
||||
}
|
||||
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) {
|
||||
|
||||
@@ -6,6 +6,7 @@ require_once('include/zot.php');
|
||||
require_once('include/channel.php');
|
||||
require_once('include/import.php');
|
||||
require_once('include/perm_upgrade.php');
|
||||
require_once('library/urlify/URLify.php');
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,7 @@ class Import extends \Zotlabs\Web\Controller {
|
||||
$filename = basename($_FILES['filename']['name']);
|
||||
$filesize = intval($_FILES['filename']['size']);
|
||||
$filetype = $_FILES['filename']['type'];
|
||||
$newname = trim(strtolower($_REQUEST['newname']));
|
||||
|
||||
// import channel from file
|
||||
if($src) {
|
||||
@@ -64,7 +66,7 @@ class Import extends \Zotlabs\Web\Controller {
|
||||
notice( t('Nothing to import.') . EOL);
|
||||
return;
|
||||
} 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);
|
||||
}
|
||||
|
||||
@@ -114,15 +116,16 @@ class Import extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
|
||||
$v1 = substr($data['compatibility']['database'],-4);
|
||||
$v2 = substr(DB_UPDATE_VERSION,-4);
|
||||
if($v2 > $v1) {
|
||||
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
|
||||
notice($t);
|
||||
}
|
||||
|
||||
}
|
||||
// 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.
|
||||
// if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
|
||||
// $v1 = substr($data['compatibility']['database'],-4);
|
||||
// $v2 = substr(DB_UPDATE_VERSION,-4);
|
||||
// if($v2 > $v1) {
|
||||
// $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
|
||||
// notice($t);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
if($moving)
|
||||
$seize = 1;
|
||||
@@ -145,7 +148,20 @@ class Import extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$channel = import_channel($data['channel'], $account_id, $seize);
|
||||
if($newname) {
|
||||
$x = false;
|
||||
|
||||
if(get_config('system','unicode_usernames')) {
|
||||
$x = punify(mb_strtolower($newname));
|
||||
}
|
||||
|
||||
if((! $x) || strlen($x) > 64) {
|
||||
$x = strtolower(\URLify::transliterate($newname));
|
||||
}
|
||||
$newname = $x;
|
||||
}
|
||||
|
||||
$channel = import_channel($data['channel'], $account_id, $seize, $newname);
|
||||
}
|
||||
else {
|
||||
$moving = false;
|
||||
@@ -362,11 +378,27 @@ class Import extends \Zotlabs\Web\Controller {
|
||||
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 ++;
|
||||
if(intval($abook['abook_feed']))
|
||||
$feeds ++;
|
||||
$friends ++;
|
||||
if(intval($abook['abook_feed']))
|
||||
$feeds ++;
|
||||
}
|
||||
|
||||
translate_abook_perms_inbound($channel,$abook_copy);
|
||||
|
||||
@@ -515,16 +547,20 @@ 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.'),
|
||||
'$label_filename' => t('File to Upload'),
|
||||
'$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'),
|
||||
'$label_old_pass' => t('Your old login password'),
|
||||
|
||||
'$old_address' => [ 'old_address', t('Your old identity address (xyz@example.com)'), '', ''],
|
||||
'$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.'),
|
||||
'$label_import_primary' => t('Make this hub my primary location'),
|
||||
'$label_import_moving' => t('Move this channel (disable all previous locations)'),
|
||||
'$label_import_posts' => t('Import a few months of posts if possible (limited by available memory'),
|
||||
|
||||
'$make_primary' => [ 'make_primary', t('Make this hub my primary location'), false, '', [ t('No'), t('Yes') ] ],
|
||||
'$moving' => [ 'moving', t('Move this channel (disable all previous locations)'), false, '', [ t('No'), t('Yes') ] ],
|
||||
'$newname' => [ 'newname', t('Use this channel nickname instead of the one provided'), '', t('Leave blank to keep your existing channel nickname. You will be randomly assigned a similar nickname if either name is already allocated on this site.')],
|
||||
|
||||
'$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'),
|
||||
'$submit' => t('Submit')
|
||||
));
|
||||
|
||||
@@ -113,7 +113,7 @@ class Invite extends \Zotlabs\Web\Controller {
|
||||
$invite_code = autoname(8) . rand(1000,9999);
|
||||
$nmessage = str_replace('$invite_code',$invite_code,$message);
|
||||
|
||||
$r = q("INSERT INTO register (hash,created) VALUES ('%s', '%s') ",
|
||||
$r = q("INSERT INTO register (hash,created,uid,password,lang) VALUES ('%s', '%s',0,'','') ",
|
||||
dbesc($invite_code),
|
||||
dbesc(datetime_convert())
|
||||
);
|
||||
|
||||
@@ -39,6 +39,7 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
$uid = local_channel();
|
||||
$channel = null;
|
||||
$observer = null;
|
||||
$datarray = [];
|
||||
|
||||
|
||||
/**
|
||||
@@ -467,6 +468,7 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
$private = intval($acl->is_private() || $parent_item['item_private']);
|
||||
$public_policy = $parent_item['public_policy'];
|
||||
$owner_hash = $parent_item['owner_xchan'];
|
||||
$webpage = $parent_item['item_type'];
|
||||
}
|
||||
|
||||
if((! $allow_empty) && (! strlen($body))) {
|
||||
@@ -504,7 +506,12 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
$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();
|
||||
$str_contact_allow = $gacl['allow_cid'];
|
||||
@@ -516,34 +523,17 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
|
||||
require_once('include/text.php');
|
||||
|
||||
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
|
||||
require_once('include/markdown.php');
|
||||
$body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
|
||||
$body = markdown_to_bb($body,true,['preserve_lf' => true]);
|
||||
$body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body);
|
||||
|
||||
}
|
||||
|
||||
// BBCODE alert: the following functions assume bbcode input
|
||||
// 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
|
||||
|
||||
// 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 == '')) {
|
||||
$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)),
|
||||
intval($profile_uid)
|
||||
);
|
||||
if($x)
|
||||
$body .= "\n\n@group+" . $x[0]['abook_id'] . "\n";
|
||||
}
|
||||
|
||||
$body = cleanup_bbcode($body);
|
||||
|
||||
// Look for tags and linkify them
|
||||
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
||||
|
||||
logger('linkify: ' . print_r($results,true));
|
||||
if($results) {
|
||||
|
||||
// Set permissions based on tag replacements
|
||||
@@ -621,6 +611,21 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
$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++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -722,7 +727,6 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
if(!$thr_parent)
|
||||
$thr_parent = $mid;
|
||||
|
||||
$datarray = array();
|
||||
|
||||
$item_thread_top = ((! $parent) ? 1 : 0);
|
||||
|
||||
@@ -755,6 +759,7 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
|
||||
if ((! $plink) && ($item_thread_top)) {
|
||||
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
|
||||
$plink = substr($plink,0,190);
|
||||
}
|
||||
|
||||
$datarray['aid'] = $channel['channel_account_id'];
|
||||
@@ -816,6 +821,12 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
$datarray['plink'] = $plink;
|
||||
$datarray['route'] = $route;
|
||||
|
||||
|
||||
// A specific ACL over-rides public_policy completely
|
||||
|
||||
if(! empty_acl($datarray))
|
||||
$datarray['public_policy'] = '';
|
||||
|
||||
if($iconfig)
|
||||
$datarray['iconfig'] = $iconfig;
|
||||
|
||||
@@ -1063,24 +1074,36 @@ class Item extends \Zotlabs\Web\Controller {
|
||||
if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) {
|
||||
|
||||
require_once('include/items.php');
|
||||
$i = q("select id, uid, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
|
||||
|
||||
|
||||
$i = q("select id, uid, item_origin, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
|
||||
intval(argv(2))
|
||||
);
|
||||
|
||||
if($i) {
|
||||
$can_delete = false;
|
||||
$local_delete = false;
|
||||
if(local_channel() && local_channel() == $i[0]['uid'])
|
||||
|
||||
if(local_channel() && local_channel() == $i[0]['uid']) {
|
||||
$local_delete = true;
|
||||
|
||||
$sys = get_sys_channel();
|
||||
if(is_site_admin() && $sys['channel_id'] == $i[0]['uid'])
|
||||
$can_delete = true;
|
||||
}
|
||||
|
||||
$ob_hash = get_observer_hash();
|
||||
if($ob_hash && ($ob_hash === $i[0]['author_xchan'] || $ob_hash === $i[0]['owner_xchan'] || $ob_hash === $i[0]['source_xchan']))
|
||||
if($ob_hash && ($ob_hash === $i[0]['author_xchan'] || $ob_hash === $i[0]['owner_xchan'] || $ob_hash === $i[0]['source_xchan'])) {
|
||||
$can_delete = true;
|
||||
|
||||
}
|
||||
|
||||
// The site admin can delete any post/item on the site.
|
||||
// If the item originated on this site+channel the deletion will propagate downstream.
|
||||
// Otherwise just the local copy is removed.
|
||||
|
||||
if(is_site_admin()) {
|
||||
$local_delete = true;
|
||||
if(intval($i[0]['item_origin']))
|
||||
$can_delete = true;
|
||||
}
|
||||
|
||||
|
||||
if(! ($can_delete || $local_delete)) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
|
||||
@@ -9,9 +9,41 @@ require_once('include/items.php');
|
||||
|
||||
class Like extends \Zotlabs\Web\Controller {
|
||||
|
||||
function get() {
|
||||
|
||||
|
||||
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 = '';
|
||||
$o = EMPTY_STR;
|
||||
|
||||
$sys_channel = get_sys_channel();
|
||||
$sys_channel_id = (($sys_channel) ? $sys_channel['channel_id'] : 0);
|
||||
@@ -35,48 +67,17 @@ class Like extends \Zotlabs\Web\Controller {
|
||||
if(! $verb)
|
||||
$verb = 'like';
|
||||
|
||||
switch($verb) {
|
||||
case 'like':
|
||||
case 'unlike':
|
||||
$activity = ACTIVITY_LIKE;
|
||||
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;
|
||||
$activity = $this->reaction_to_activity($verb);
|
||||
|
||||
if(! $activity) {
|
||||
return EMPTY_STR;
|
||||
}
|
||||
|
||||
|
||||
$extended_like = false;
|
||||
$object = $target = null;
|
||||
$post_type = '';
|
||||
$objtype = '';
|
||||
$post_type = EMPTY_STR;
|
||||
$objtype = EMPTY_STR;
|
||||
|
||||
if(argc() == 3) {
|
||||
|
||||
@@ -295,10 +296,11 @@ class Like extends \Zotlabs\Web\Controller {
|
||||
notice( t('Permission denied') . EOL);
|
||||
killme();
|
||||
}
|
||||
|
||||
|
||||
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
|
||||
dbesc($item['owner_xchan'])
|
||||
);
|
||||
|
||||
if($r)
|
||||
$thread_owner = $r[0];
|
||||
else
|
||||
@@ -417,6 +419,7 @@ class Like extends \Zotlabs\Web\Controller {
|
||||
|
||||
$arr['item_origin'] = 1;
|
||||
$arr['item_notshown'] = 1;
|
||||
$arr['item_type'] = $item['item_type'];
|
||||
|
||||
if(intval($item['item_wall']))
|
||||
$arr['item_wall'] = 1;
|
||||
|
||||
@@ -55,10 +55,10 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
$h = explode("\n",$result['header']);
|
||||
foreach ($h as $l) {
|
||||
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
|
||||
$hdrs[$k] = $v;
|
||||
$hdrs[strtolower($k)] = $v;
|
||||
}
|
||||
if (array_key_exists('Content-Type', $hdrs))
|
||||
$type = $hdrs['Content-Type'];
|
||||
if (array_key_exists('content-type', $hdrs))
|
||||
$type = $hdrs['content-type'];
|
||||
if($type) {
|
||||
$zrl = is_matrix_url($url);
|
||||
if(stripos($type,'image/') !== false) {
|
||||
@@ -82,6 +82,10 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
echo $br . '[audio]' . $url . '[/audio]' . $br;
|
||||
killme();
|
||||
}
|
||||
if(strtolower($type) === 'application/pdf' || strtolower($type) === 'application/x-pdf') {
|
||||
echo $br . '[embed]' . $url . '[/embed]' . $br;
|
||||
killme();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,9 +124,9 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
|
||||
$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);
|
||||
|
||||
if($siteinfo["title"] == "") {
|
||||
|
||||
@@ -10,7 +10,7 @@ class Login extends \Zotlabs\Web\Controller {
|
||||
if(remote_channel() && $_SESSION['atoken'])
|
||||
goaway(z_root());
|
||||
|
||||
return login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||
return login(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,13 @@ namespace Zotlabs\Module;
|
||||
class Logout extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
\App::$session->nuke();
|
||||
if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
|
||||
$_SESSION = $_SESSION['delegate_push'];
|
||||
}
|
||||
else {
|
||||
\App::$session->nuke();
|
||||
}
|
||||
goaway(z_root());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,16 @@ class Magic extends \Zotlabs\Web\Controller {
|
||||
logger('mod_magic: args: ' . print_r($_REQUEST,true),LOGGER_DATA);
|
||||
|
||||
$addr = ((x($_REQUEST,'addr')) ? $_REQUEST['addr'] : '');
|
||||
$bdest = ((x($_REQUEST,'bdest')) ? $_REQUEST['bdest'] : '');
|
||||
$dest = ((x($_REQUEST,'dest')) ? $_REQUEST['dest'] : '');
|
||||
$test = ((x($_REQUEST,'test')) ? intval($_REQUEST['test']) : 0);
|
||||
$rev = ((x($_REQUEST,'rev')) ? intval($_REQUEST['rev']) : 0);
|
||||
$owa = ((x($_REQUEST,'owa')) ? intval($_REQUEST['owa']) : 0);
|
||||
$delegate = ((x($_REQUEST,'delegate')) ? $_REQUEST['delegate'] : '');
|
||||
|
||||
|
||||
if($bdest)
|
||||
$dest = hex2bin($bdest);
|
||||
|
||||
$parsed = parse_url($dest);
|
||||
if(! $parsed) {
|
||||
if($test) {
|
||||
@@ -112,6 +116,8 @@ class Magic extends \Zotlabs\Web\Controller {
|
||||
if($r && intval($r[0]['channel_id'])) {
|
||||
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
|
||||
if($allowed) {
|
||||
$tmp = $_SESSION;
|
||||
$_SESSION['delegate_push'] = $tmp;
|
||||
$_SESSION['delegate_channel'] = $r[0]['channel_id'];
|
||||
$_SESSION['delegate'] = get_observer_hash();
|
||||
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
|
||||
@@ -137,6 +143,9 @@ class Magic extends \Zotlabs\Web\Controller {
|
||||
|
||||
if($owa) {
|
||||
|
||||
$dest = strip_zids($dest);
|
||||
$dest = strip_query_param($dest,'f');
|
||||
|
||||
$headers = [];
|
||||
$headers['Accept'] = 'application/x-zot+json' ;
|
||||
$headers['X-Open-Web-Auth'] = random_string();
|
||||
@@ -166,7 +175,7 @@ class Magic extends \Zotlabs\Web\Controller {
|
||||
|
||||
$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))
|
||||
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;
|
||||
|
||||
@@ -67,14 +67,14 @@ class Mail extends \Zotlabs\Web\Controller {
|
||||
if(! $recipient) {
|
||||
$channel = \App::get_channel();
|
||||
|
||||
$j = \Zotlabs\Zot\Finger::run($rstr,$channel);
|
||||
$j = \Zotlabs\Zot\Finger::run(punify($rstr),$channel);
|
||||
|
||||
if(! $j['success']) {
|
||||
notice( t('Unable to lookup recipient.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
logger('message_post: lookup: ' . $url . ' ' . print_r($j,true));
|
||||
logger('message_post: lookup: ' . $rstr . ' ' . print_r($j,true));
|
||||
|
||||
if(! $j['guid']) {
|
||||
notice( t('Unable to communicate with requested channel.'));
|
||||
|
||||
@@ -156,7 +156,7 @@ class Manage extends \Zotlabs\Web\Controller {
|
||||
|
||||
if($delegates) {
|
||||
for($x = 0; $x < count($delegates); $x ++) {
|
||||
$delegates[$x]['link'] = 'magic?f=&dest=' . urlencode($delegates[$x]['xchan_url'])
|
||||
$delegates[$x]['link'] = 'magic?f=&bdest=' . bin2hex($delegates[$x]['xchan_url'])
|
||||
. '&delegate=' . urlencode($delegates[$x]['xchan_addr']);
|
||||
$delegates[$x]['channel_name'] = $delegates[$x]['xchan_name'];
|
||||
$delegates[$x]['delegate'] = 1;
|
||||
|
||||
@@ -7,18 +7,36 @@ require_once('include/channel.php');
|
||||
|
||||
class Menu extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
||||
function init() {
|
||||
if (array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||
|
||||
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
if ($sys && intval($sys['channel_id'])) {
|
||||
if($sys && intval($sys['channel_id'])) {
|
||||
\App::$is_sys = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
else
|
||||
return;
|
||||
|
||||
profile_load($which);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function post() {
|
||||
function post() {
|
||||
|
||||
$uid = local_channel();
|
||||
if(! \App::$profile) {
|
||||
return;
|
||||
}
|
||||
|
||||
$which = argv(1);
|
||||
|
||||
|
||||
$uid = \App::$profile['channel_id'];
|
||||
|
||||
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
@@ -43,7 +61,7 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
if($r) {
|
||||
menu_sync_packet($uid,get_observer_hash(),$menu_id);
|
||||
//info( t('Menu updated.') . EOL);
|
||||
goaway(z_root() . '/mitem/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/mitem/' . $which . '/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
else
|
||||
notice( t('Unable to update menu.'). EOL);
|
||||
@@ -54,7 +72,7 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
menu_sync_packet($uid,get_observer_hash(),$r);
|
||||
|
||||
//info( t('Menu created.') . EOL);
|
||||
goaway(z_root() . '/mitem/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/mitem/' . $which . '/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
else
|
||||
notice( t('Unable to create menu.'). EOL);
|
||||
@@ -67,27 +85,71 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
|
||||
function get() {
|
||||
|
||||
|
||||
|
||||
if(! \App::$profile) {
|
||||
notice( t('Requested profile is not available.') . EOL );
|
||||
\App::$error = 404;
|
||||
return;
|
||||
}
|
||||
|
||||
$which = argv(1);
|
||||
|
||||
$_SESSION['return_url'] = \App::$query_string;
|
||||
|
||||
$uid = local_channel();
|
||||
|
||||
if (\App::$is_sys && is_site_admin()) {
|
||||
$owner = 0;
|
||||
$channel = null;
|
||||
$observer = \App::get_observer();
|
||||
|
||||
$channel = \App::get_channel();
|
||||
|
||||
if(\App::$is_sys && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
$uid = intval($sys['channel_id']);
|
||||
if($sys && intval($sys['channel_id'])) {
|
||||
$uid = $owner = intval($sys['channel_id']);
|
||||
$channel = $sys;
|
||||
$observer = $sys;
|
||||
}
|
||||
}
|
||||
|
||||
if(! $uid) {
|
||||
|
||||
if(! $owner) {
|
||||
// Figure out who the page owner is.
|
||||
$r = channelx_by_nick($which);
|
||||
if($r) {
|
||||
$owner = intval($r['channel_id']);
|
||||
}
|
||||
}
|
||||
|
||||
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||
|
||||
$perms = get_all_perms($owner,$ob_hash);
|
||||
|
||||
if(! $perms['write_pages']) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return '';
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the observer, check their permissions
|
||||
|
||||
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||
|
||||
$perms = get_all_perms($owner,$ob_hash);
|
||||
|
||||
if(! $perms['write_pages']) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if(argc() == 2) {
|
||||
|
||||
if(argc() == 1) {
|
||||
|
||||
$channel = (($sys) ? $sys : \App::get_channel());
|
||||
$channel = (($sys) ? $sys : channelx_by_n($owner));
|
||||
|
||||
// list menus
|
||||
$x = menu_list($uid);
|
||||
$x = menu_list($owner);
|
||||
if($x) {
|
||||
for($y = 0; $y < count($x); $y ++) {
|
||||
$m = menu_fetch($x[$y]['menu_name'],$uid,get_observer_hash());
|
||||
$m = menu_fetch($x[$y]['menu_name'],$owner,get_observer_hash());
|
||||
if($m)
|
||||
$x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($channel,$m))) . '[/element]';
|
||||
$x[$y]['bookmark'] = (($x[$y]['menu_flags'] & MENU_BOOKMARK) ? true : false);
|
||||
@@ -100,6 +162,7 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
'$menu_bookmark' => array('menu_bookmark', t('Allow Bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
|
||||
'$submit' => t('Submit and proceed'),
|
||||
'$sys' => \App::$is_sys,
|
||||
'$nick' => $which,
|
||||
'$display' => 'none'
|
||||
));
|
||||
|
||||
@@ -119,6 +182,7 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
'$hintdrop' => t('Delete this menu'),
|
||||
'$hintcontent' => t('Edit menu contents'),
|
||||
'$hintedit' => t('Edit this menu'),
|
||||
'$nick' => $which,
|
||||
'$sys' => \App::$is_sys
|
||||
));
|
||||
|
||||
@@ -126,19 +190,19 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
|
||||
}
|
||||
|
||||
if(argc() > 1) {
|
||||
if(intval(argv(1))) {
|
||||
if(argc() > 2) {
|
||||
if(intval(argv(2))) {
|
||||
|
||||
if(argc() == 3 && argv(2) == 'drop') {
|
||||
menu_sync_packet($uid,get_observer_hash(),intval(argv(1)),true);
|
||||
$r = menu_delete_id(intval(argv(1)),$uid);
|
||||
if(argc() == 4 && argv(3) == 'drop') {
|
||||
menu_sync_packet($owner,get_observer_hash(),intval(argv(1)),true);
|
||||
$r = menu_delete_id(intval(argv(2)),$owner);
|
||||
if(!$r)
|
||||
notice( t('Menu could not be deleted.'). EOL);
|
||||
|
||||
goaway(z_root() . '/menu' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
|
||||
$m = menu_fetch_id(intval(argv(1)),$uid);
|
||||
$m = menu_fetch_id(intval(argv(2)),$owner);
|
||||
|
||||
if(! $m) {
|
||||
notice( t('Menu not found.') . EOL);
|
||||
@@ -148,14 +212,15 @@ class Menu extends \Zotlabs\Web\Controller {
|
||||
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
|
||||
'$header' => t('Edit Menu'),
|
||||
'$sys' => \App::$is_sys,
|
||||
'$menu_id' => intval(argv(1)),
|
||||
'$menu_edit_link' => 'mitem/' . intval(argv(1)) . ((\App::$is_sys) ? '?f=&sys=1' : ''),
|
||||
'$menu_id' => intval(argv(2)),
|
||||
'$menu_edit_link' => 'mitem/' . $which . '/' . intval(argv(1)) . ((\App::$is_sys) ? '?f=&sys=1' : ''),
|
||||
'$hintedit' => t('Add or remove entries to this menu'),
|
||||
'$editcontents' => t('Edit menu contents'),
|
||||
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
|
||||
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
|
||||
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
|
||||
'$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
|
||||
'$nick' => $which,
|
||||
'$submit' => t('Submit and proceed')
|
||||
));
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
|
||||
));
|
||||
|
||||
|
||||
$o .= alt_pager($a,count($r));
|
||||
$o .= alt_pager(count($r));
|
||||
|
||||
return $o;
|
||||
|
||||
|
||||
@@ -8,22 +8,25 @@ require_once('include/acl_selectors.php');
|
||||
class Mitem extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
$uid = local_channel();
|
||||
|
||||
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||
|
||||
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
$uid = intval($sys['channel_id']);
|
||||
\App::$is_sys = true;
|
||||
if($sys && intval($sys['channel_id'])) {
|
||||
\App::$is_sys = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
else
|
||||
return;
|
||||
|
||||
profile_load($which);
|
||||
|
||||
if(! $uid)
|
||||
if(argc() < 3)
|
||||
return;
|
||||
|
||||
if(argc() < 2)
|
||||
return;
|
||||
|
||||
$m = menu_fetch_id(intval(argv(1)),$uid);
|
||||
$m = menu_fetch_id(intval(argv(2)),\App::$profile['channel_id']);
|
||||
if(! $m) {
|
||||
notice( t('Menu not found.') . EOL);
|
||||
return '';
|
||||
@@ -32,19 +35,27 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
|
||||
}
|
||||
|
||||
function post() {
|
||||
function post() {
|
||||
|
||||
$uid = local_channel();
|
||||
|
||||
if(\App::$is_sys && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
$uid = intval($sys['channel_id']);
|
||||
}
|
||||
|
||||
if(! $uid) {
|
||||
if(! \App::$profile) {
|
||||
return;
|
||||
}
|
||||
|
||||
$which = argv(1);
|
||||
|
||||
|
||||
$uid = \App::$profile['channel_id'];
|
||||
|
||||
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
|
||||
$sys = get_sys_channel();
|
||||
$uid = intval($sys['channel_id']);
|
||||
\App::$is_sys = true;
|
||||
}
|
||||
|
||||
if(! $uid)
|
||||
return;
|
||||
|
||||
|
||||
if(! \App::$data['menu'])
|
||||
return;
|
||||
|
||||
@@ -63,14 +74,14 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
$_REQUEST['mitem_flags'] |= MENU_ITEM_NEWWIN;
|
||||
|
||||
|
||||
$mitem_id = ((argc() > 2) ? intval(argv(2)) : 0);
|
||||
$mitem_id = ((argc() > 3) ? intval(argv(3)) : 0);
|
||||
if($mitem_id) {
|
||||
$_REQUEST['mitem_id'] = $mitem_id;
|
||||
$r = menu_edit_item($_REQUEST['menu_id'],$uid,$_REQUEST);
|
||||
if($r) {
|
||||
menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
|
||||
//info( t('Menu element updated.') . EOL);
|
||||
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
else
|
||||
notice( t('Unable to update menu element.') . EOL);
|
||||
@@ -82,10 +93,10 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
|
||||
//info( t('Menu element added.') . EOL);
|
||||
if($_REQUEST['submit']) {
|
||||
goaway(z_root() . '/menu' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
if($_REQUEST['submit-more']) {
|
||||
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
|
||||
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -96,12 +107,15 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
|
||||
function get() {
|
||||
function get() {
|
||||
|
||||
$uid = local_channel();
|
||||
$channel = \App::get_channel();
|
||||
$owner = \App::$profile['channel_id'];
|
||||
$channel = channelx_by_n($owner);
|
||||
$observer = \App::get_observer();
|
||||
|
||||
|
||||
$which = argv(1);
|
||||
|
||||
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
|
||||
|
||||
if(\App::$is_sys && is_site_admin()) {
|
||||
@@ -116,15 +130,15 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
return '';
|
||||
}
|
||||
|
||||
if(argc() < 2 || (! \App::$data['menu'])) {
|
||||
if(argc() < 3 || (! \App::$data['menu'])) {
|
||||
notice( t('Not found.') . EOL);
|
||||
return '';
|
||||
}
|
||||
|
||||
$m = menu_fetch(\App::$data['menu']['menu_name'],$uid,$ob_hash);
|
||||
$m = menu_fetch(\App::$data['menu']['menu_name'],$owner,$ob_hash);
|
||||
\App::$data['menu_item'] = $m;
|
||||
|
||||
$menu_list = menu_list($uid);
|
||||
$menu_list = menu_list($owner);
|
||||
|
||||
foreach($menu_list as $menus) {
|
||||
if($menus['menu_name'] != $m['menu']['menu_name'])
|
||||
@@ -135,10 +149,10 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
|
||||
$lockstate = (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock');
|
||||
|
||||
if(argc() == 2) {
|
||||
if(argc() == 3) {
|
||||
$r = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d order by mitem_order asc, mitem_desc asc",
|
||||
intval(\App::$data['menu']['menu_id']),
|
||||
intval($uid)
|
||||
intval($owner)
|
||||
);
|
||||
|
||||
if($_GET['display']) {
|
||||
@@ -167,6 +181,7 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
'$display' => $display,
|
||||
'$lockstate' => $lockstate,
|
||||
'$menu_names' => $menu_names,
|
||||
'$nick' => $which,
|
||||
'$sys' => \App::$is_sys
|
||||
));
|
||||
|
||||
@@ -187,40 +202,41 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
'$hintnew' => t('Add menu element'),
|
||||
'$hintdrop' => t('Delete this menu item'),
|
||||
'$hintedit' => t('Edit this menu item'),
|
||||
'$nick' => $which,
|
||||
));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
if(argc() > 2) {
|
||||
|
||||
if(intval(argv(2))) {
|
||||
if(argc() > 3) {
|
||||
|
||||
if(intval(argv(3))) {
|
||||
|
||||
$m = q("select * from menu_item where mitem_id = %d and mitem_channel_id = %d limit 1",
|
||||
intval(argv(2)),
|
||||
intval($uid)
|
||||
intval(argv(3)),
|
||||
intval($owner)
|
||||
);
|
||||
|
||||
if(! $m) {
|
||||
notice( t('Menu item not found.') . EOL);
|
||||
goaway(z_root() . '/menu'. ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/menu/'. $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
|
||||
$mitem = $m[0];
|
||||
|
||||
$lockstate = (($mitem['allow_cid'] || $mitem['allow_gid'] || $mitem['deny_cid'] || $mitem['deny_gid']) ? 'lock' : 'unlock');
|
||||
|
||||
if(argc() == 4 && argv(3) == 'drop') {
|
||||
menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
|
||||
$r = menu_del_item($mitem['mitem_menu_id'], $uid, intval(argv(2)));
|
||||
menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
|
||||
if(argc() == 5 && argv(4) == 'drop') {
|
||||
menu_sync_packet($owner,get_observer_hash(),$mitem['mitem_menu_id']);
|
||||
$r = menu_del_item($mitem['mitem_menu_id'], $owner, intval(argv(3)));
|
||||
menu_sync_packet($owner,get_observer_hash(),$mitem['mitem_menu_id']);
|
||||
if($r)
|
||||
info( t('Menu item deleted.') . EOL);
|
||||
else
|
||||
notice( t('Menu item could not be deleted.'). EOL);
|
||||
|
||||
goaway(z_root() . '/mitem/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
goaway(z_root() . '/mitem/' . $which . '/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
|
||||
}
|
||||
|
||||
// edit menu item
|
||||
@@ -234,7 +250,7 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
'$allow_gid' => acl2json($mitem['allow_gid']),
|
||||
'$deny_cid' => acl2json($mitem['deny_cid']),
|
||||
'$deny_gid' => acl2json($mitem['deny_gid']),
|
||||
'$mitem_id' => intval(argv(2)),
|
||||
'$mitem_id' => intval(argv(3)),
|
||||
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
|
||||
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'),
|
||||
'$usezid' => array('usezid', t('Use magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), '', array(t('No'), t('Yes'))),
|
||||
@@ -242,7 +258,8 @@ class Mitem extends \Zotlabs\Web\Controller {
|
||||
'$mitem_order' => array('mitem_order', t('Order in list'),$mitem['mitem_order'],t('Higher numbers will sink to bottom of listing')),
|
||||
'$submit' => t('Submit'),
|
||||
'$lockstate' => $lockstate,
|
||||
'$menu_names' => $menu_names
|
||||
'$menu_names' => $menu_names,
|
||||
'$nick' => $which
|
||||
));
|
||||
|
||||
return $o;
|
||||
|
||||
@@ -14,9 +14,12 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
\App::set_pager_itemspage(60);
|
||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||
|
||||
//show all items
|
||||
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(ITEM_MODERATED)
|
||||
);
|
||||
@@ -26,7 +29,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
if(argc() == 2) {
|
||||
$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(local_channel()),
|
||||
intval(ITEM_MODERATED)
|
||||
@@ -47,17 +50,26 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
);
|
||||
|
||||
if($r) {
|
||||
$item = $r[0];
|
||||
|
||||
if($action === 'approve') {
|
||||
q("update item set item_blocked = 0 where uid = %d and id = %d",
|
||||
intval(local_channel()),
|
||||
intval($post_id)
|
||||
);
|
||||
|
||||
$item['item_blocked'] = 0;
|
||||
|
||||
item_update_parent_commented($item);
|
||||
|
||||
notice( t('Comment approved') . EOL);
|
||||
}
|
||||
elseif($action === 'drop') {
|
||||
drop_item($post_id,false);
|
||||
notice( t('Comment deleted') . EOL);
|
||||
}
|
||||
|
||||
// refetch the item after changes have been made
|
||||
|
||||
$r = q("select * from item where id = %d",
|
||||
intval($post_id)
|
||||
@@ -83,6 +95,7 @@ class Moderate extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$o = conversation($items,'moderate',false,'traditional');
|
||||
$o .= alt_pager(count($items));
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
|
||||
goaway('search' . '?f=&search=' . $_GET['search']);
|
||||
|
||||
if(count($_GET) < 2) {
|
||||
$network_options = get_pconfig(local_channel(),'system','network_page_default');
|
||||
@@ -57,13 +60,26 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
|
||||
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
|
||||
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
|
||||
$nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0);
|
||||
$static = ((x($_GET,'static')) ? intval($_GET['static']) : 0);
|
||||
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
|
||||
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
|
||||
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
|
||||
$verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
|
||||
|
||||
|
||||
|
||||
$order = get_pconfig(local_channel(), 'mod_network', 'order', 0);
|
||||
switch($order) {
|
||||
case 0:
|
||||
$order = 'comment';
|
||||
break;
|
||||
case 1:
|
||||
$order = 'post';
|
||||
break;
|
||||
case 2:
|
||||
$nouveau = true;
|
||||
break;
|
||||
}
|
||||
|
||||
$search = (($_GET['search']) ? $_GET['search'] : '');
|
||||
if($search) {
|
||||
$_GET['netsearch'] = escape_tags($search);
|
||||
@@ -84,7 +100,7 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if($datequery)
|
||||
$_GET['order'] = 'post';
|
||||
$order = 'post';
|
||||
|
||||
|
||||
// filter by collection (e.g. group)
|
||||
@@ -107,32 +123,34 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if no tabs are selected, defaults to comments
|
||||
|
||||
$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));
|
||||
|
||||
$cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
|
||||
$star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
|
||||
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment');
|
||||
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
|
||||
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
|
||||
$spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
|
||||
$cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
|
||||
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
|
||||
$cmin = ((array_key_exists('cmin',$_GET)) ? intval($_GET['cmin']) : $default_cmin);
|
||||
$cmax = ((array_key_exists('cmax',$_GET)) ? intval($_GET['cmax']) : $default_cmax);
|
||||
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
|
||||
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
|
||||
$net = ((x($_GET,'net')) ? $_GET['net'] : '');
|
||||
$pf = ((x($_GET,'pf')) ? $_GET['pf'] : '');
|
||||
|
||||
$deftag = '';
|
||||
|
||||
if(x($_GET,'search') || x($_GET,'file'))
|
||||
|
||||
if(x($_GET,'search') || $file || (!$pf && $cid))
|
||||
$nouveau = true;
|
||||
|
||||
if($cid) {
|
||||
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
|
||||
$cid_r = q("SELECT abook.abook_xchan, xchan.xchan_addr, xchan.xchan_name, xchan.xchan_url, xchan.xchan_photo_s, xchan.xchan_pubforum from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and abook_blocked = 0 limit 1",
|
||||
intval($cid),
|
||||
intval(local_channel())
|
||||
);
|
||||
if(! $r) {
|
||||
|
||||
if(! $cid_r) {
|
||||
if($update) {
|
||||
killme();
|
||||
}
|
||||
@@ -140,14 +158,14 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
goaway(z_root() . '/network');
|
||||
// NOTREACHED
|
||||
}
|
||||
if($_GET['pf'] === '1')
|
||||
$deftag = '@' . t('forum') . '+' . intval($cid) . '+';
|
||||
if($pf)
|
||||
$deftag = '!{' . (($cid_r[0]['xchan_addr']) ? $cid_r[0]['xchan_addr'] : $cid_r[0]['xchan_url']) . '}';
|
||||
else
|
||||
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
||||
$def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
|
||||
}
|
||||
|
||||
if(! $update) {
|
||||
$tabs = network_tabs();
|
||||
$tabs = ''; //network_tabs();
|
||||
$o .= $tabs;
|
||||
|
||||
// search terms header
|
||||
@@ -182,7 +200,8 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
'editor_autocomplete' => true,
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true,
|
||||
'jotnets' => true
|
||||
'jotnets' => true,
|
||||
'reset' => t('Reset form')
|
||||
);
|
||||
if($deftag)
|
||||
$x['pretext'] = $deftag;
|
||||
@@ -206,24 +225,25 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
: '');
|
||||
|
||||
$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) {
|
||||
$contact_str = '';
|
||||
$contacts = group_get_members($group);
|
||||
if($contacts) {
|
||||
foreach($contacts as $c) {
|
||||
if($contact_str)
|
||||
$contact_str .= ',';
|
||||
$contact_str .= "'" . $c['xchan'] . "'";
|
||||
}
|
||||
$contact_str = ids_to_querystr($contacts,'xchan',true);
|
||||
}
|
||||
else {
|
||||
$contact_str = ' 0 ';
|
||||
info( t('Privacy group is empty'));
|
||||
$contact_str = " '0' ";
|
||||
if(! $update) {
|
||||
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 ) ";
|
||||
|
||||
$x = group_rec_byhash(local_channel(), $group_hash);
|
||||
@@ -239,35 +259,41 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$o .= $status_editor;
|
||||
|
||||
}
|
||||
|
||||
elseif($cid) {
|
||||
|
||||
$r = q("SELECT abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and abook_blocked = 0 limit 1",
|
||||
intval($cid),
|
||||
intval(local_channel())
|
||||
);
|
||||
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($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' => '<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 .= $title;
|
||||
$o .= $status_editor;
|
||||
}
|
||||
else {
|
||||
notice( t('Invalid connection.') . EOL);
|
||||
goaway(z_root() . '/network');
|
||||
elseif($cid_r) {
|
||||
$item_thread_top = '';
|
||||
|
||||
if($load || $update) {
|
||||
if(!$pf && $nouveau) {
|
||||
$sql_extra = " AND author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ";
|
||||
}
|
||||
else {
|
||||
$ttype = (($pf) ? TERM_FORUM : TERM_MENTION);
|
||||
|
||||
$p1 = q("SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal ");
|
||||
$p2 = q("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND ttype = $ttype AND term = '" . dbesc($cid_r[0]['xchan_name']) . "'");
|
||||
|
||||
$p_str = ids_to_querystr(array_merge($p1,$p2),'parent');
|
||||
$sql_extra = " AND item.parent IN ( $p_str ) ";
|
||||
}
|
||||
}
|
||||
|
||||
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
||||
'$title' => '<a href="' . zid($cid_r[0]['xchan_url']) . '" ><img src="' . zid($cid_r[0]['xchan_photo_s']) . '" alt="' . urlencode($cid_r[0]['xchan_name']) . '" /></a> <a href="' . zid($cid_r[0]['xchan_url']) . '" >' . $cid_r[0]['xchan_name'] . '</a>'
|
||||
));
|
||||
|
||||
$o = $tabs;
|
||||
$o .= $title;
|
||||
$o .= $status_editor;
|
||||
}
|
||||
elseif($xchan) {
|
||||
$r = q("select * from xchan where xchan_hash = '%s'",
|
||||
dbesc($xchan)
|
||||
);
|
||||
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 ) ";
|
||||
$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>'
|
||||
$r = q("select * from xchan where xchan_hash = '%s'",
|
||||
dbesc($xchan)
|
||||
);
|
||||
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($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
|
||||
$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 .= $title;
|
||||
@@ -309,8 +335,8 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
'$uid' => ((local_channel()) ? local_channel() : '0'),
|
||||
'$gid' => (($gid) ? $gid : '0'),
|
||||
'$cid' => (($cid) ? $cid : '0'),
|
||||
'$cmin' => (($cmin) ? $cmin : '0'),
|
||||
'$cmax' => (($cmax) ? $cmax : '0'),
|
||||
'$cmin' => (($cmin) ? $cmin : '(-1)'),
|
||||
'$cmax' => (($cmax) ? $cmax : '(-1)'),
|
||||
'$star' => (($star) ? $star : '0'),
|
||||
'$liked' => (($liked) ? $liked : '0'),
|
||||
'$conv' => (($conv) ? $conv : '0'),
|
||||
@@ -331,7 +357,8 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
'$mid' => '',
|
||||
'$verb' => $verb,
|
||||
'$net' => $net,
|
||||
'$dbegin' => $datequery2
|
||||
'$dbegin' => $datequery2,
|
||||
'$pf' => (($pf) ? $pf : '0'),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -370,9 +397,16 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if($conv) {
|
||||
$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']))
|
||||
);
|
||||
$item_thread_top = '';
|
||||
|
||||
if($nouveau) {
|
||||
$sql_extra .= " AND author_xchan = '" . dbesc($channel['channel_hash']) . "' ";
|
||||
}
|
||||
else {
|
||||
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan = '%s' or item_mentionsme = 1 )) ",
|
||||
dbesc(protect_sprintf($channel['channel_hash']))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if($update && ! $load) {
|
||||
@@ -387,8 +421,9 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
|
||||
}
|
||||
|
||||
|
||||
if(($cmin != 0) || ($cmax != 99)) {
|
||||
// cmin and cmax are both -1 when the affinity tool is disabled
|
||||
|
||||
if(($cmin != (-1)) || ($cmax != (-1))) {
|
||||
|
||||
// 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
|
||||
@@ -406,7 +441,6 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
if($cmax == 99)
|
||||
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
|
||||
|
||||
|
||||
}
|
||||
|
||||
$net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
|
||||
@@ -446,15 +480,15 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
if($nouveau && $load) {
|
||||
// "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, created FROM item
|
||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||
$net_query
|
||||
WHERE true $uids $item_normal
|
||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||
$simple_update
|
||||
$sql_extra $sql_nets
|
||||
$sql_extra $sql_options $sql_nets
|
||||
$net_query2
|
||||
ORDER BY item.received DESC $pager_sql "
|
||||
ORDER BY item.created DESC $pager_sql "
|
||||
);
|
||||
|
||||
require_once('include/items.php');
|
||||
@@ -468,25 +502,22 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
// Normal conversation view
|
||||
|
||||
if($order === 'post')
|
||||
$ordering = "created";
|
||||
$ordering = "created";
|
||||
else
|
||||
$ordering = "commented";
|
||||
$ordering = "commented";
|
||||
|
||||
if($load) {
|
||||
|
||||
// Fetch a page full of parent items for this page
|
||||
|
||||
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
|
||||
$r = q("SELECT item.parent AS item_id FROM item
|
||||
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
|
||||
$net_query
|
||||
WHERE true $uids $item_normal
|
||||
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)
|
||||
$sql_extra3 $sql_extra $sql_nets
|
||||
$sql_extra3 $sql_extra $sql_options $sql_nets
|
||||
$net_query2
|
||||
ORDER BY $ordering DESC $pager_sql "
|
||||
);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -496,7 +527,7 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
$net_query
|
||||
WHERE true $uids $item_normal_update $simple_update
|
||||
and (abook.abook_blocked = 0 or abook.abook_flags is null)
|
||||
$sql_extra3 $sql_extra $sql_nets $net_query2"
|
||||
$sql_extra3 $sql_extra $sql_options $sql_nets $net_query2"
|
||||
);
|
||||
$_SESSION['loadtime'] = datetime_convert();
|
||||
}
|
||||
@@ -556,11 +587,14 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$mode = (($nouveau) ? 'network-new' : 'network');
|
||||
|
||||
if($search)
|
||||
$mode = 'search';
|
||||
|
||||
$o .= conversation($items,$mode,$update,$page_mode);
|
||||
|
||||
if(($items) && (! $update))
|
||||
$o .= alt_pager($a,count($items));
|
||||
$o .= alt_pager(count($items));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,15 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
require_once('library/urlify/URLify.php');
|
||||
$result = array('error' => false, 'message' => '');
|
||||
$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();
|
||||
|
||||
@@ -34,7 +41,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
$test[] = legal_webbie($x);
|
||||
// fullname plus random number
|
||||
$test[] = legal_webbie($x) . mt_rand(1000,9999);
|
||||
|
||||
|
||||
json_return_and_die(check_webbie($test));
|
||||
}
|
||||
|
||||
@@ -42,11 +49,32 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
require_once('library/urlify/URLify.php');
|
||||
$result = array('error' => false, 'message' => '');
|
||||
$n = trim($_REQUEST['nick']);
|
||||
|
||||
$x = strtolower(\URLify::transliterate($n));
|
||||
|
||||
if(! $n) {
|
||||
$n = trim($_REQUEST['name']);
|
||||
}
|
||||
|
||||
$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();
|
||||
|
||||
// first name
|
||||
if(strpos($x,' '))
|
||||
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
|
||||
if($test[0]) {
|
||||
// first name plus first initial of last
|
||||
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
|
||||
// first name plus random number
|
||||
$test[] = $test[0] . mt_rand(1000,9999);
|
||||
}
|
||||
|
||||
$n = legal_webbie($x);
|
||||
if(strlen($n)) {
|
||||
$test[] = $n;
|
||||
@@ -89,9 +117,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
|
||||
change_channel($result['channel']['channel_id']);
|
||||
|
||||
if(! strlen($next_page = get_config('system','workflow_channel_next')))
|
||||
$next_page = 'settings';
|
||||
|
||||
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
|
||||
goaway(z_root() . '/' . $next_page);
|
||||
|
||||
}
|
||||
@@ -112,7 +138,7 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
intval($aid)
|
||||
);
|
||||
if($r && (! intval($r[0]['total']))) {
|
||||
$default_role = get_config('system','default_permissions_role');
|
||||
$default_role = get_config('system','default_permissions_role','social');
|
||||
}
|
||||
|
||||
$limit = account_service_class_fetch(get_account_id(),'total_identities');
|
||||
@@ -124,26 +150,41 @@ class New_channel extends \Zotlabs\Web\Controller {
|
||||
$channel_usage_message = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$name_help = '<span id="name_help_loading" style="display:none">' . t('Loading') . '</span><span id="name_help_text">';
|
||||
$name_help .= (($default_role)
|
||||
? t('Your real name is recommended.')
|
||||
: t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"')
|
||||
);
|
||||
$name_help .= '</span>';
|
||||
|
||||
$nick_help = '<span id="nick_help_loading" style="display:none">' . t('Loading') . '</span><span id="nick_help_text">';
|
||||
$nick_help .= t('This will be used to create a unique network address (like an email address).');
|
||||
if(! get_config('system','unicode_usernames')) {
|
||||
$nick_help .= ' ' . t('Allowed characters are a-z 0-9, - and _');
|
||||
}
|
||||
$nick_help .= '<span>';
|
||||
|
||||
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" );
|
||||
|
||||
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
|
||||
if((get_account_techlevel() < 4) && $privacy_role !== 'custom')
|
||||
unset($perm_roles[t('Other')]);
|
||||
|
||||
$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('Channel name'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), $name_help, "*");
|
||||
$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), "*");
|
||||
$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);
|
||||
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), $nick_help, "*");
|
||||
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel permission role compatible with your usage needs and privacy requirements.') . '<br>' . '<a href="help/member/member_guide#Channel_Permission_Roles" target="_blank">' . t('Read more about channel permission roles') . '</a>',$perm_roles);
|
||||
|
||||
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
|
||||
'$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.'),
|
||||
'$title' => t('Create a Channel'),
|
||||
'$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.') ,
|
||||
'$label_import' => t('or <a href="import">import an existing channel</a> from another location.'),
|
||||
'$name' => $name,
|
||||
'$role' => $role,
|
||||
'$role' => $role,
|
||||
'$default_role' => $default_role,
|
||||
'$nickname' => $nickname,
|
||||
'$validate' => t('Validate'),
|
||||
'$submit' => t('Create'),
|
||||
'$channel_usage_message' => $channel_usage_message
|
||||
));
|
||||
|
||||
@@ -7,8 +7,8 @@ class Nojs extends \Zotlabs\Web\Controller {
|
||||
function init() {
|
||||
$n = ((argc() > 1) ? intval(argv(1)) : 1);
|
||||
setcookie('jsdisabled', $n, 0, '/');
|
||||
$p = $_GET['redir'];
|
||||
$hasq = strpos($p,'?');
|
||||
$p = hex2bin($_GET['redir']);
|
||||
$hasq = strpbrk($p,'?&');
|
||||
goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=' . $n);
|
||||
|
||||
}
|
||||
|
||||
@@ -41,8 +41,6 @@ class Notifications extends \Zotlabs\Web\Controller {
|
||||
$notifications_available = 1;
|
||||
foreach ($r as $rr) {
|
||||
$x = strip_tags(bbcode($rr['msg']));
|
||||
if(strpos($x,','))
|
||||
$x = substr($x,strpos($x,',')+1);
|
||||
$notif_content .= replace_macros(get_markup_template('notify.tpl'),array(
|
||||
'$item_link' => z_root().'/notify/view/'. $rr['id'],
|
||||
'$item_image' => $rr['photo'],
|
||||
|
||||
151
Zotlabs/Module/Oauth2testvehicle.php
Normal file
151
Zotlabs/Module/Oauth2testvehicle.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
/**
|
||||
* The OAuth2TestVehicle class is a way to test the registration of an OAuth2
|
||||
* client app. It allows you to walk through the steps of registering a client,
|
||||
* requesting an authorization code for that client, and then requesting an
|
||||
* access token for use in authentication against the Hubzilla API endpoints.
|
||||
*/
|
||||
class OAuth2TestVehicle extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
killme();
|
||||
|
||||
// If there is a 'code' and 'state' parameter then this is a client app
|
||||
// callback issued after the authorization code request
|
||||
// TODO: Check state value and compare to original sent value
|
||||
// "You should first compare this state value to ensure it matches the
|
||||
// one you started with. You can typically store the state value in a
|
||||
// cookie, and compare it when the user comes back. This ensures your
|
||||
// redirection endpoint isn't able to be tricked into attempting to
|
||||
// exchange arbitrary authorization codes."
|
||||
$_SESSION['redirect_uri'] = z_root() . '/oauth2testvehicle';
|
||||
$_SESSION['authorization_code'] = (x($_REQUEST, 'code') ? $_REQUEST['code'] : $_SESSION['authorization_code']);
|
||||
$_SESSION['state'] = (x($_REQUEST, 'state') ? $_REQUEST['state'] : $_SESSION['state'] );
|
||||
$_SESSION['client_id'] = (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : $_SESSION['client_id'] );
|
||||
$_SESSION['client_secret'] = (x($_REQUEST, 'client_secret') ? $_REQUEST['client_secret'] : $_SESSION['client_secret']);
|
||||
$_SESSION['access_token'] = (x($_REQUEST, 'access_token') ? $_REQUEST['access_token'] : $_SESSION['access_token'] );
|
||||
$_SESSION['api_response'] = (x($_SESSION, 'api_response') ? $_SESSION['api_response'] : '');
|
||||
}
|
||||
function get() {
|
||||
|
||||
$o .= replace_macros(get_markup_template('oauth2testvehicle.tpl'), array(
|
||||
'$baseurl' => z_root(),
|
||||
'$api_response' => $_SESSION['api_response'],
|
||||
/*
|
||||
endpoints => array(
|
||||
array(
|
||||
'path_to_endpoint',
|
||||
array(
|
||||
array('field_name_1', 'value'),
|
||||
array('field_name_2', 'value'),
|
||||
...
|
||||
),
|
||||
'submit_button_name',
|
||||
'Description of API action'
|
||||
)
|
||||
)
|
||||
*/
|
||||
'$endpoints' => array(
|
||||
array(
|
||||
'authorize',
|
||||
array(
|
||||
array('response_type', 'code'),
|
||||
array('client_id', (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : 'oauth2_test_app')),
|
||||
array('redirect_uri', $_SESSION['redirect_uri']),
|
||||
array('state', 'xyz'),
|
||||
// OpenID Connect Dynamic Client Registration 1.0 Client Metadata
|
||||
// http://openid.net/specs/openid-connect-registration-1_0.html
|
||||
array('client_name', 'OAuth2 Test App'),
|
||||
array('logo_uri', urlencode(z_root() . '/images/icons/plugin.png')),
|
||||
array('client_uri', urlencode('https://client.example.com/website')),
|
||||
array('application_type', 'web'), // would be 'native' for mobile app
|
||||
),
|
||||
'oauth_authorize',
|
||||
'Authorize a test client app',
|
||||
'GET',
|
||||
(($_REQUEST['code'] && $_REQUEST['state']) ? true : false),
|
||||
),
|
||||
array(
|
||||
'oauth2testvehicle',
|
||||
array(
|
||||
array('action', 'request_token'),
|
||||
array('grant_type', 'authorization_code'),
|
||||
array('code', $_SESSION['authorization_code']),
|
||||
array('redirect_uri', $_SESSION['redirect_uri']),
|
||||
array('client_id', ($_SESSION['client_id'] ? $_SESSION['client_id'] : 'oauth2_test_app')),
|
||||
array('client_secret', $_SESSION['client_secret']),
|
||||
),
|
||||
'oauth_token_request',
|
||||
'Request a token',
|
||||
'POST',
|
||||
($_SESSION['success'] === 'request_token'),
|
||||
),
|
||||
array(
|
||||
'oauth2testvehicle',
|
||||
array(
|
||||
array('action', 'api_files'),
|
||||
array('access_token', $_SESSION['access_token']),
|
||||
),
|
||||
'oauth_api_files',
|
||||
'API: Get channel files',
|
||||
'POST',
|
||||
($_SESSION['success'] === 'api_files'),
|
||||
)
|
||||
)
|
||||
));
|
||||
$_SESSION['success'] = '';
|
||||
return $o;
|
||||
}
|
||||
|
||||
function post() {
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'api_files':
|
||||
$access_token = $_SESSION['access_token'];
|
||||
$url = z_root() . '/api/z/1.0/files/';
|
||||
$headers = [];
|
||||
$headers[] = 'Authorization: Bearer ' . $access_token;
|
||||
$post = z_fetch_url($url, false, 0, array(
|
||||
'custom' => 'GET',
|
||||
'headers' => $headers,
|
||||
));
|
||||
logger(json_encode($post, JSON_PRETTY_PRINT), LOGGER_DEBUG);
|
||||
$response = json_decode($post['body'], true);
|
||||
$_SESSION['api_response'] = json_encode($response, JSON_PRETTY_PRINT);
|
||||
break;
|
||||
case 'request_token':
|
||||
$grant_type = (x($_POST, 'grant_type') ? $_POST['grant_type'] : '');
|
||||
$redirect_uri = (x($_POST, 'redirect_uri') ? $_POST['redirect_uri'] : '');
|
||||
$client_id = (x($_POST, 'client_id') ? $_POST['client_id'] : '');
|
||||
$code = (x($_POST, 'code') ? $_POST['code'] : '');
|
||||
$client_secret = (x($_POST, 'client_secret') ? $_POST['client_secret'] : '');
|
||||
$url = z_root() . '/token/';
|
||||
$params = http_build_query(array(
|
||||
'grant_type' => $grant_type,
|
||||
'redirect_uri' => urlencode($redirect_uri),
|
||||
'client_id' => $client_id,
|
||||
'code' => $code,
|
||||
));
|
||||
$post = z_post_url($url, $params, 0, array(
|
||||
'http_auth' => $client_id . ':' . $client_secret,
|
||||
));
|
||||
logger(json_encode($post, JSON_PRETTY_PRINT), LOGGER_DEBUG);
|
||||
$response = json_decode($post['body'], true);
|
||||
logger(json_encode($response, JSON_PRETTY_PRINT), LOGGER_DEBUG);
|
||||
if($response['access_token']) {
|
||||
info('Access token received: ' . $response['access_token'] . EOL);
|
||||
$_SESSION['success'] = 'request_token';
|
||||
$_SESSION['access_token'] = $response['access_token'];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
23
Zotlabs/Module/Oauthinfo.php
Normal file
23
Zotlabs/Module/Oauthinfo.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
|
||||
class Oauthinfo extends \Zotlabs\Web\Controller {
|
||||
|
||||
|
||||
function init() {
|
||||
|
||||
$ret = [
|
||||
'issuer' => z_root(),
|
||||
'authorization_endpoint' => z_root() . '/authorize',
|
||||
'token_endpoint' => z_root() . '/token',
|
||||
'response_types_supported' => [ 'code', 'token', 'id_token', 'code id_token', 'token id_token' ]
|
||||
];
|
||||
|
||||
|
||||
json_return_and_die($ret);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
69
Zotlabs/Module/Ochannel.php
Normal file
69
Zotlabs/Module/Ochannel.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/contact_widgets.php');
|
||||
require_once('include/items.php');
|
||||
require_once("include/bbcode.php");
|
||||
require_once('include/security.php');
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/permissions.php');
|
||||
|
||||
/**
|
||||
* @brief Channel Controller for broken OStatus implementations
|
||||
*
|
||||
*/
|
||||
class Ochannel extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
$which = null;
|
||||
if(argc() > 1)
|
||||
$which = argv(1);
|
||||
if(! $which) {
|
||||
if(local_channel()) {
|
||||
$channel = \App::get_channel();
|
||||
if($channel && $channel['channel_address'])
|
||||
$which = $channel['channel_address'];
|
||||
}
|
||||
}
|
||||
if(! $which) {
|
||||
notice( t('You must be logged in to see this page.') . EOL );
|
||||
return;
|
||||
}
|
||||
|
||||
$profile = 0;
|
||||
$channel = \App::get_channel();
|
||||
|
||||
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
|
||||
$which = $channel['channel_address'];
|
||||
$profile = argv(1);
|
||||
}
|
||||
|
||||
head_add_link( [
|
||||
'rel' => 'alternate',
|
||||
'type' => 'application/atom+xml',
|
||||
'href' => z_root() . '/ofeed/' . $which
|
||||
]);
|
||||
|
||||
|
||||
// Run profile_load() here to make sure the theme is set before
|
||||
// we start loading content
|
||||
|
||||
profile_load($which,$profile);
|
||||
}
|
||||
|
||||
function get($update = 0, $load = false) {
|
||||
|
||||
if(argc() < 2)
|
||||
return;
|
||||
|
||||
if($load)
|
||||
$_SESSION['loadtime'] = datetime_convert();
|
||||
|
||||
return '<script>window.location.href = "' . z_root() . '/' . str_replace('ochannel/','channel/',\App::$query_string) . '";</script>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
$url = $args['url'];
|
||||
$maxwidth = intval($args['maxwidth']);
|
||||
$maxheight = intval($args['maxheight']);
|
||||
logger('processing display');
|
||||
|
||||
if(preg_match('#//(.*?)/display/(.*?)(&|\?|$)#',$url,$matches)) {
|
||||
$res = $matches[2];
|
||||
}
|
||||
@@ -125,6 +125,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
"' profile='".$p[0]['author']['xchan_url'] .
|
||||
"' avatar='".$p[0]['author']['xchan_photo_s'].
|
||||
"' link='".$p[0]['plink'].
|
||||
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
|
||||
"' posted='".$p[0]['created'].
|
||||
"' message_id='".$p[0]['mid']."']";
|
||||
if($p[0]['title'])
|
||||
@@ -209,6 +210,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
"' profile='".$p[0]['author']['xchan_url'] .
|
||||
"' avatar='".$p[0]['author']['xchan_photo_s'].
|
||||
"' link='".$p[0]['plink'].
|
||||
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
|
||||
"' posted='".$p[0]['created'].
|
||||
"' message_id='".$p[0]['mid']."']";
|
||||
if($p[0]['title'])
|
||||
@@ -292,6 +294,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
"' profile='".$p[0]['author']['xchan_url'] .
|
||||
"' avatar='".$p[0]['author']['xchan_photo_s'].
|
||||
"' link='".$p[0]['plink'].
|
||||
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
|
||||
"' posted='".$p[0]['created'].
|
||||
"' message_id='".$p[0]['mid']."']";
|
||||
if($p[0]['title'])
|
||||
@@ -366,6 +369,7 @@ class Oep extends \Zotlabs\Web\Controller {
|
||||
"' profile='".$p[0]['author']['xchan_url'] .
|
||||
"' avatar='".$p[0]['author']['xchan_photo_s'].
|
||||
"' link='".$p[0]['plink'].
|
||||
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
|
||||
"' posted='".$p[0]['created'].
|
||||
"' message_id='".$p[0]['mid']."']";
|
||||
if($p[0]['title'])
|
||||
|
||||
@@ -34,6 +34,15 @@ class Owa extends \Zotlabs\Web\Controller {
|
||||
where hubloc_addr = '%s' ",
|
||||
dbesc(str_replace('acct:','',$keyId))
|
||||
);
|
||||
if(! $r) {
|
||||
$found = discover_by_webbie(str_replace('acct:','',$keyId));
|
||||
if($found) {
|
||||
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
|
||||
where hubloc_addr = '%s' ",
|
||||
dbesc(str_replace('acct:','',$keyId))
|
||||
);
|
||||
}
|
||||
}
|
||||
if($r) {
|
||||
foreach($r as $hubloc) {
|
||||
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
|
||||
@@ -42,7 +51,7 @@ class Owa extends \Zotlabs\Web\Controller {
|
||||
logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
|
||||
$ret['success'] = true;
|
||||
$token = random_string(32);
|
||||
\Zotlabs\Zot\Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
|
||||
\Zotlabs\Lib\Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
|
||||
$result = '';
|
||||
openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
|
||||
$ret['encrypted_token'] = base64url_encode($result);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user