Compare commits
507 Commits
09ab2be907
...
b8088d9686
Author | SHA1 | Date |
---|---|---|
~keith | b8088d9686 | |
Philipp | f826ce70ce | |
Hypolite Petovan | c5076bec18 | |
Hypolite Petovan | 07dd548a10 | |
Hypolite Petovan | 9561910e83 | |
Hypolite Petovan | 3865733e18 | |
Hypolite Petovan | 6a205b2e10 | |
Michael | eae1383f48 | |
Michael | b402a760a8 | |
Michael | a183723254 | |
Michael | 96a36568e2 | |
Michael | f569ccbbc2 | |
Michael | 3c169b534e | |
Hypolite Petovan | e24078a4d2 | |
Michael | 8bba8663fb | |
Michael | f44c9e7975 | |
Philipp | 01c0c0a1ba | |
Hypolite Petovan | fed17d031c | |
Hypolite Petovan | 2bdf2b02e3 | |
Hypolite Petovan | a2adb1cd93 | |
René Wagner | b99e7a9e92 | |
Hypolite Petovan | f418687a71 | |
Michael | e31533d0d3 | |
Michael | deccea0228 | |
Michael | c65fff6f93 | |
Hypolite Petovan | 0c4ebce391 | |
Roland Häder | 498d7f690a | |
Roland Häder | 03e09627e4 | |
Hypolite Petovan | 4189e01987 | |
Hypolite Petovan | 80dc593159 | |
Tobias Diekershoff | 606dd9f5e6 | |
Tobias Diekershoff | 80a897f2f3 | |
Michael Vogel | ff2af0a2e3 | |
Roland Häder | 3c50d5b70f | |
Roland Häder | 2f1336339f | |
Hypolite Petovan | 42199d9264 | |
Hypolite Petovan | 22bfd3b4d6 | |
Hypolite Petovan | 3456ae7809 | |
Hypolite Petovan | 158d21db14 | |
Roland Häder | 039a4b8c72 | |
Roland Häder | 913a4a5dc0 | |
Roland Häder | ceffd0ef6c | |
Roland Häder | 71e82bc861 | |
Roland Häder | b1cf4cbbd5 | |
Hypolite Petovan | db82bdfc44 | |
Roland Häder | 5306bb3e31 | |
Hypolite Petovan | a7e9457ef2 | |
Michael | 842a4bb904 | |
Hypolite Petovan | 2555596158 | |
Michael | ebd175872d | |
Michael | 1a0b63659b | |
Michael | f54a886a5e | |
Philipp | f03c5c7f89 | |
Tobias Diekershoff | 9b310b0dd7 | |
Hypolite Petovan | 5f92473c6e | |
Hypolite Petovan | dc2d96a502 | |
Hypolite Petovan | 142b399c84 | |
Hypolite Petovan | a3651e464d | |
Roland Häder | bf9f09182e | |
Philipp | 05b15f2824 | |
Roland Häder | 54b89365bb | |
Philipp | b5bc1b0844 | |
Tobias Diekershoff | b72d727a06 | |
Tobias Diekershoff | 19155a4bb2 | |
Roland Häder | e8fe0c52e7 | |
Philipp | b4b9f426db | |
Hypolite Petovan | 6040dfa5e8 | |
Philipp | c3df570324 | |
Hypolite Petovan | 52cc6ff3cb | |
Tobias Diekershoff | 965314f213 | |
Hypolite Petovan | 40f734da58 | |
Hypolite Petovan | 854c8e6685 | |
Philipp | 4978765b90 | |
Philipp | a9963dc54b | |
Philipp | 7b3caca276 | |
Philipp | 44a9683008 | |
Philipp | cafb23f8f0 | |
Philipp | f15878195c | |
Philipp | 7b35c570f9 | |
Philipp | 134f98e22e | |
Philipp | a1997d73c2 | |
Philipp | f1cbb41a60 | |
Philipp | d76a2b6ad6 | |
Philipp | 37ff477b55 | |
Philipp | fa8a32e83c | |
Philipp | f83784cc63 | |
Philipp | b3f9cef94a | |
Hypolite Petovan | a11c125f81 | |
Hypolite Petovan | fc2cdd3992 | |
Philipp | 8ad83e5d5c | |
Hypolite Petovan | 0ac1c5fbf2 | |
Hypolite Petovan | c815bbab52 | |
Philipp | 84201f0915 | |
Philipp | fad1763e28 | |
Philipp | ee71086133 | |
Philipp | 22198ea495 | |
Philipp | bf39b5a948 | |
Hypolite Petovan | f609386ca1 | |
Hypolite Petovan | 1235814b02 | |
Hypolite Petovan | 5868e5ac90 | |
Philipp | dd1482d791 | |
Hypolite Petovan | 5985563149 | |
Philipp | eecc456e0c | |
Philipp | b4ffb0bde0 | |
Philipp | 8dda6144a9 | |
Philipp | bfe68702db | |
Hypolite Petovan | a729f3255d | |
Philipp | 7c4611af19 | |
Philipp | 0b66b6e0d5 | |
Philipp | 940619325d | |
Michael Vogel | 66a4c30eb7 | |
Hypolite Petovan | eaf1485c6f | |
Michael Vogel | 92f1a4533b | |
Tobias Diekershoff | ce64148c8d | |
Tobias Diekershoff | 5a21458ae9 | |
Michael | 4930737cc4 | |
Hypolite Petovan | 660912351c | |
Michael | d3e167c77c | |
Hypolite Petovan | 693db1b750 | |
Michael | cfbba97e0a | |
Hypolite Petovan | 5b2af862d4 | |
Michael | 867e23054d | |
Michael | d47d78f2d4 | |
Hypolite Petovan | de6eabde58 | |
Hypolite Petovan | 956f196f7c | |
Hypolite Petovan | 979e226d27 | |
Michael | ae6d67ed1f | |
Hypolite Petovan | 83390d4b00 | |
Michael | c9f17e1ef5 | |
Hypolite Petovan | b36d4eb0dd | |
Hypolite Petovan | 47d9f91009 | |
Michael | d2da2492b7 | |
Hypolite Petovan | ba9f145ef7 | |
Hypolite Petovan | 058abc0336 | |
Michael | ee1acba9eb | |
Hypolite Petovan | 7fc37832f7 | |
Hypolite Petovan | 429b2e0992 | |
Michael | 11944dda32 | |
Hypolite Petovan | c54bfd423a | |
Tobias Diekershoff | 95fe66e0b9 | |
Philipp | 692566d93b | |
Tobias Diekershoff | d8fe8b1e8b | |
Michael | 196dda9487 | |
Michael | 5874de4743 | |
Hypolite Petovan | 69b13155f9 | |
Tobias Diekershoff | f4dbd69e0e | |
Hypolite Petovan | d369f1e1e0 | |
Philipp | 4a2f67aa9a | |
Philipp | a2eb0c7378 | |
Philipp | 315ed3ed22 | |
Philipp | 3a8bcb3fbf | |
Philipp | dfb5792773 | |
Philipp | fb2b2f5c58 | |
Philipp | 7ac86e49d1 | |
Hypolite Petovan | 99d5441007 | |
Michael | ae82737445 | |
Hypolite Petovan | f3abef0979 | |
Roland Häder | c36da392f8 | |
Roland Häder | 2773ac9909 | |
Roland Häder | 66b9cace9f | |
Hypolite Petovan | bbe05f523f | |
Roland Häder | 54d3d03252 | |
Roland Häder | 26e0469de7 | |
Roland Häder | abe02a646c | |
Roland Häder | 3a2f5091d9 | |
Hypolite Petovan | 33a7260c35 | |
Michael | 6f68679375 | |
Hypolite Petovan | abf52c0c11 | |
Hypolite Petovan | ab9b60b9d2 | |
Tobias Diekershoff | 27376a3dae | |
Michael | d43122c6d8 | |
Michael Vogel | 810ea228f0 | |
Michael | 27e9f2b223 | |
Michael | 33ac39c335 | |
Philipp | 497fc4e432 | |
Hypolite Petovan | e198edf652 | |
Michael | fdfa1f8630 | |
Michael | 20291ddc2b | |
Philipp | 8c084fedad | |
Michael | e96fd5166a | |
Michael | 4ff7c37f85 | |
Michael | 62a0d55fc8 | |
Tobias Diekershoff | 54951b7be6 | |
Michael | b1de40cb42 | |
Michael | 9bac8153ae | |
Michael Vogel | 66b0d5e847 | |
Tobias Diekershoff | a994b76ebc | |
Tobias Diekershoff | 3a158d00eb | |
Michael | 018858934b | |
Hypolite Petovan | b33b70f0ab | |
Michael | 9ffa053c90 | |
Michael Vogel | f371095d3a | |
Michael | b4661b35fd | |
Michael | f8f0dfa91a | |
Hypolite Petovan | bcc1350f1d | |
Hypolite Petovan | e556dc3c31 | |
Hypolite Petovan | d826fe0a3b | |
Hypolite Petovan | 7e06127d74 | |
Tobias Diekershoff | a192e099ab | |
Hypolite Petovan | d6fe212a49 | |
Tobias Diekershoff | 9383d7849b | |
Tobias Diekershoff | 49ed627aed | |
Hypolite Petovan | 1585f711ee | |
Michael | 8e1af9277a | |
Hypolite Petovan | f71a5b20e5 | |
Tobias Diekershoff | f862d73f49 | |
Michael | 34c3f189fc | |
Roland Häder | 1f9fc13d03 | |
Roland Häder | ebf3b7e62d | |
Roland Häder | 85ed0742cf | |
Roland Häder | 8f92d1cc8e | |
Roland Häder | da66730e4f | |
Michael | 1cf66ba0cc | |
Michael | 3e868416c7 | |
Michael | 88aceeb27f | |
Tobias Diekershoff | e5ae5c7e67 | |
Tobias Diekershoff | 5a800e2d09 | |
Tobias Diekershoff | b5d3651f3f | |
Tobias Diekershoff | 7109d2a6a8 | |
Tobias Diekershoff | 99b09858d2 | |
Tobias Diekershoff | d989602c1c | |
Tobias Diekershoff | 1fd9558e60 | |
Michael | c2e57c5c0e | |
Tobias Diekershoff | 8936ae26fd | |
Philipp | 1cc3fa6d77 | |
Michael | da2afbeae3 | |
Michael | e69b04d2df | |
Michael Vogel | b1364a2327 | |
Hypolite Petovan | 0480d9aebd | |
Hypolite Petovan | ec9059c395 | |
Michael | 0e82f64d71 | |
Michael | f1f13db24f | |
Michael | 68d6e11d83 | |
Philipp | 04564f0320 | |
Hypolite Petovan | 9e74a1bd06 | |
Michael | a67a364b91 | |
Hypolite Petovan | ec1da90094 | |
Michael | 747139d186 | |
Michael | aeb4645ba6 | |
Hypolite Petovan | 0b0567081a | |
Michael | 028de0e228 | |
Tobias Diekershoff | c8406f6cd0 | |
Michael | a21c04d55d | |
Tobias Diekershoff | 7e8c48a539 | |
Tobias Diekershoff | 656e74605f | |
Hypolite Petovan | a10f55bb85 | |
Hypolite Petovan | 424dad886f | |
Michael | 0d3aa681b4 | |
Michael Vogel | 2b03edd59e | |
Tobias Diekershoff | b56a9cf419 | |
Hypolite Petovan | a4b0ebf160 | |
Hypolite Petovan | bee6506d33 | |
Michael Vogel | b5ad8c3e15 | |
Hypolite Petovan | a36ea64bb4 | |
Michael | 4552d36373 | |
Hypolite Petovan | 47dd19ab95 | |
Michael | 4a37c978c2 | |
Hypolite Petovan | 345d307ae0 | |
Hypolite Petovan | c0447ced48 | |
Hypolite Petovan | 9d2edcf0e1 | |
Michael Vogel | 49c5d62530 | |
Hypolite Petovan | 2cbc11403e | |
Michael | b92e23273d | |
Michael | d646d4eb1d | |
Hypolite Petovan | 616c4695f4 | |
Michael | 1ddeaaad4a | |
Hypolite Petovan | 885f90afa3 | |
Michael | 33d48f7d55 | |
Michael | ee03e4de08 | |
Michael | a07fd7d7c2 | |
Michael | f340fc6efa | |
Michael | 21bd2a8396 | |
Michael | f8d4ab1830 | |
Michael | ef934db614 | |
Michael | 1ef5730d3d | |
Michael | d7a9745ffd | |
Tobias Diekershoff | 71cc10835f | |
Michael | 8e9acfe210 | |
Hypolite Petovan | 1422e8a510 | |
Michael | 48182a95fb | |
Hypolite Petovan | fe442683ef | |
Michael | 6b917718fd | |
Tobias Diekershoff | b0d0d98a14 | |
Michael | 4c8a58c445 | |
Hypolite Petovan | e840166d7d | |
Michael | f9b7f3acdb | |
Hypolite Petovan | b84f2b471a | |
Tobias Diekershoff | 964d54ee45 | |
Hypolite Petovan | fa3f5d8d9c | |
Michael | 4d39ec8b63 | |
Philipp | e1bf708552 | |
Michael | bde7283b04 | |
Hypolite Petovan | 241bd47896 | |
Michael Vogel | 0a7c9c66b5 | |
Michael | 045238070b | |
Hypolite Petovan | 168827c8ae | |
Michael | 4b8c631216 | |
Hypolite Petovan | 3895da3618 | |
Michael | 8347f0144b | |
Michael | 5127784acb | |
Michael | 7395ae22f7 | |
Hypolite Petovan | 38cf0666bd | |
Michael | 1afbcb2486 | |
Michael | bf4c5ba84f | |
Hypolite Petovan | 844ed720b2 | |
Michael | 0de458e134 | |
Michael | 1612715626 | |
Michael | 6fb5e13b08 | |
Michael | 8d9cb974af | |
Michael | 54d25ebc91 | |
Hypolite Petovan | 034f0ec1e4 | |
Michael | 1e29c6f705 | |
Michael | 2d6735a616 | |
Michael | 8eb4ab2a33 | |
Michael | d43b85e94b | |
Michael | 59004711ec | |
Hypolite Petovan | 1edcd65e0e | |
Michael | a653c6350d | |
Hypolite Petovan | c0e009ac6f | |
Hypolite Petovan | 39bc4a5881 | |
Michael | 9587787089 | |
Michael | 6140f850e1 | |
Michael | ff80a25966 | |
Tobias Diekershoff | 560f061380 | |
Hypolite Petovan | 89cc704b8a | |
Michael | b10496f4e9 | |
Michael | d821afb418 | |
Hypolite Petovan | fa71ec462b | |
Michael | c65f78e579 | |
Hypolite Petovan | c12ac42695 | |
Michael | 2def5e9f02 | |
Hypolite Petovan | 38096ce4cb | |
Philipp | 0ce7b49cb3 | |
Hypolite Petovan | 57a98c45f1 | |
Michael | 4c52772d84 | |
Michael | 5e51ab95fb | |
Hypolite Petovan | afac91fa34 | |
Hypolite Petovan | e56e543a79 | |
Philipp | d80646ccc7 | |
Michael | 297ddbb8c8 | |
Michael | 63ec808fb9 | |
Philipp | 883a2ee71b | |
Philipp | 5c88813775 | |
Philipp | 2d4598a4db | |
Philipp | 60b1cac166 | |
Philipp | 006dbcf4ce | |
Philipp | ad62265d08 | |
Hypolite Petovan | e83dfab6cd | |
Michael | 22ed028ba1 | |
Michael | e584185c0a | |
Michael | 662c846402 | |
Michael Vogel | 81f7feabc6 | |
Hypolite Petovan | 3e1b6890b7 | |
Hypolite Petovan | df559a24c0 | |
Michael | bca9069b22 | |
Michael Vogel | 08ead52433 | |
Hypolite Petovan | 5a236e0af2 | |
Hypolite Petovan | 02e9a867ae | |
Hypolite Petovan | 080aa55302 | |
Michael Vogel | b00947025a | |
Michael Vogel | 260310e878 | |
Michael | 3911c9450b | |
Michael | bd817d2391 | |
Matthew Exon | 7613433357 | |
Hypolite Petovan | 6ca725e5b6 | |
Hypolite Petovan | ded5a0ac6a | |
Michael Vogel | 98a4c7a56c | |
Hypolite Petovan | be9bbe1709 | |
Michael | 97e5477bde | |
Hypolite Petovan | 264b8f27fd | |
Michael | e1341b6ad3 | |
Michael | 30eb511da3 | |
Michael | 4939be065e | |
Hypolite Petovan | 6a9d91c824 | |
Michael Vogel | c87150819b | |
Michael Vogel | f7d054674d | |
Michael Vogel | 0fa281247d | |
Tobias Diekershoff | 3f3e1a2bf4 | |
Michael Vogel | 6ee8a966bf | |
Tobias Diekershoff | 94cd729cca | |
Michael | 36668dfdb1 | |
Hypolite Petovan | 4deee0932c | |
Hypolite Petovan | ddfc0f2cd9 | |
Michael Vogel | 7ae500f28d | |
Michael Vogel | d55a5cd17b | |
Michael Vogel | 199d8bbf35 | |
Hypolite Petovan | 0747eb4961 | |
Michael Vogel | 6ba2c4bb01 | |
Michael Vogel | 3650feb256 | |
Michael Vogel | f08b08e0d8 | |
Michael Vogel | 2525b3f2ae | |
Michael Vogel | e5c24f33f0 | |
Philipp | 3ec9d51ec8 | |
Hypolite Petovan | 3043ef4192 | |
Michael | 79b64cc44f | |
Hypolite Petovan | 636325efcc | |
Philipp | 7c64ab890a | |
Hypolite Petovan | 6db79aa741 | |
Michael | ff89c1a8bf | |
Hypolite Petovan | 60d1779717 | |
Hypolite Petovan | cacfc6ec92 | |
Hypolite Petovan | bdd80eeaaf | |
Philipp | 77798482cb | |
Tobias Diekershoff | 9d6e4d7483 | |
Philipp | 2123b4d071 | |
Michael | 63e1ad7dba | |
Michael | ff677a1b27 | |
Hypolite Petovan | 7da43fe28a | |
Michael | 8b41783aaa | |
Michael | a0b99f61ea | |
Hypolite Petovan | f762a38dbb | |
Michael | 0121c2845a | |
Michael | da658cbf1d | |
Michael | d7212cbbbc | |
Michael | ec8377a8c7 | |
Michael | 7c9f10e58f | |
Philipp | f0622163b2 | |
Michael | 2a4c6d44bb | |
Michael | f0d151932e | |
Michael | 6eb9dff807 | |
Hypolite Petovan | 934a3a6721 | |
Hypolite Petovan | 8f283985f0 | |
Hypolite Petovan | acaa15b6fb | |
Michael | e2cb705468 | |
Michael | 437c230a6f | |
Michael | 96ae2c8f56 | |
Philipp | 2ad587faf4 | |
Michael | f5d6671fbd | |
Michael | 12d4bae28f | |
Michael | 075638c0ae | |
Michael | f93418b295 | |
Tobias Diekershoff | da655f5159 | |
Michael | c3d478aeed | |
Michael | 7c756a3bcb | |
Michael | 767883476f | |
Michael | b0326afae3 | |
Michael | 144547009b | |
Michael | de2d486e95 | |
Michael | f22a4ba6f5 | |
Michael | 4304aa9eec | |
Michael | 9f2d3e6f88 | |
Tobias Diekershoff | dd59ad9032 | |
Tobias Diekershoff | 6557efd786 | |
Michael | f7be610629 | |
Hypolite Petovan | 93acaff014 | |
Michael | 3e28d62bdb | |
Philipp | 2a2e1a9e12 | |
Michael | cc43b567cb | |
Michael | 9ca470cc94 | |
Michael | f7b85092b0 | |
Michael | 757a5c2de9 | |
Hypolite Petovan | 312e4d8844 | |
Michael | 3a840aa22d | |
Philipp | b8a1014a90 | |
Michael | 61cbcf85a1 | |
Michael | 3052ae71b7 | |
Michael | 4e02c347b6 | |
Hypolite Petovan | 45729f0107 | |
Michael | d54cf9cc21 | |
Michael | 2173fb38e0 | |
Hypolite Petovan | 1e4e7d5b58 | |
Michael | a0eaff8fd5 | |
Michael | ceb88c10e6 | |
Michael | 1db70b8935 | |
Michael | dd8279afc2 | |
Tobias Diekershoff | fde853897f | |
Michael | 15d975f143 | |
Philipp | 453667023e | |
Tobias Diekershoff | 97992cf1c6 | |
Tobias Diekershoff | aaaf928650 | |
Michael | 4e3102bfb3 | |
Hypolite Petovan | 2957a3def6 | |
Michael | 2a0ca80630 | |
Philipp | 17a394e23c | |
Hypolite Petovan | 5f62a59d2f | |
Philipp | 59b4f2e993 | |
Roland Häder | 4c6940583a | |
Roland Häder | b3906326a4 | |
Tobias Diekershoff | d0a011f049 | |
Michael | 51331ced9b | |
Michael | a4f1df68e4 | |
Hypolite Petovan | 037b4b7928 | |
Michael | 531085890a | |
Michael | 6070221364 | |
Hypolite Petovan | efa1344c64 | |
Michael | 3e2c684319 | |
Michael | bb52e5a804 | |
Michael | 4d617c9c48 | |
Michael | 5b3145d7ce | |
Hypolite Petovan | 946db2ab45 | |
pankraz | bd02340162 | |
Philipp | 9be09f7df5 | |
Roland Häder | c1c37da545 | |
Roland Häder | 52d1b9905e | |
Hypolite Petovan | 579758d8b1 | |
Roland Häder | f579d687a9 | |
Hypolite Petovan | 21f3a56c42 | |
Hypolite Petovan | 23cf850198 | |
Michael | c6de91a8ec | |
Roland Häder | 88cdb695b1 | |
Michael | bc3a6b2bb7 | |
Michael | 5c5ae00370 | |
Roland Häder | ff5673e2d8 | |
Roland Häder | cfa575b8e5 | |
Roland Häder | 074bae33c9 | |
Roland Häder | 33c7abd376 | |
Roland Häder | 9794ce0c87 |
50
CHANGELOG
50
CHANGELOG
|
@ -1,10 +1,58 @@
|
||||||
Version 2022.09 (unreleased)
|
Version 2022.12 (unreleased)
|
||||||
Friendica Core
|
Friendica Core
|
||||||
|
|
||||||
Friendica Addons
|
Friendica Addons
|
||||||
|
BREAKING: The functions from the boot.php file have been moved into better fitting classes
|
||||||
|
this may break your custom addons. See the pull requests #1293 and #1294 in the
|
||||||
|
addon repository about the needed changes to your addons.
|
||||||
|
|
||||||
Closed Issues
|
Closed Issues
|
||||||
|
|
||||||
|
Version 2022.10 (2022-10-14)
|
||||||
|
Friendica Core
|
||||||
|
Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN
|
||||||
|
Added a check for too long passwords (due Blowfish hashing algorithm) [MrPetovan]
|
||||||
|
Added an API endpoint to create events [MrPetovan, pankraz]
|
||||||
|
Added the possibility to store profile avatars in a separate directory [annando]
|
||||||
|
Added an option to not fetch parent postings [annando]
|
||||||
|
Added an option to reject postings by language received by the relay [annando]
|
||||||
|
Added a notification mail to all users when the server block list is updated [MrPetovan]
|
||||||
|
Added a download link to the CSV file of the server block list on the about page [MrPetovan]
|
||||||
|
Added support for youtube short URLs [annando]
|
||||||
|
Updates to the themes (frio, smoothly) [AlessandroLorenzi, HankG, MrPetovan, tobiasd]
|
||||||
|
General code cleanup [annando, fabrixxm, Quix0r, tobiasd]
|
||||||
|
Enhanced the performance (cache, database, rendering) [annando, Quix0r]
|
||||||
|
Enhanced the language detection [annando]
|
||||||
|
Enhanced the display of the reason why a posting is shown to a user [annando]
|
||||||
|
Enhanced the fetching of missing postings [annando]
|
||||||
|
Enhanced the server detection [annando]
|
||||||
|
Enhanced the UI for 2FA logins [nupplaphil]
|
||||||
|
Enhanced the Woodpecker integration [nupplaphil]
|
||||||
|
Enhanced integration with ejabberd [nupplaphil]
|
||||||
|
Fixed a federation problem with Diaspora* during the author signature check [annando]
|
||||||
|
Fixed a problem with Forwarded-For headers [nupplaphil]
|
||||||
|
Fixed a problem with the encoding of mails send [MrPetovan]
|
||||||
|
Fixed a problem with weird formatted date notations [annando, MrPetovan]
|
||||||
|
Fixed a problem following some RSS feeds [mexon]
|
||||||
|
Fixed a problem with quoted reshares from Twitter [annando]
|
||||||
|
Updated dependencies [MrPetovan]
|
||||||
|
Replace SFTP-publish with docker-publish [nupplaphil]
|
||||||
|
Removed the poke functionality [MrPetovan]
|
||||||
|
|
||||||
|
Friendica Addons
|
||||||
|
Added GD translation, updates to the translation AR, FR
|
||||||
|
Removed the addons: morechoice, morepokes
|
||||||
|
Marked the addon whindowsphonepush as unsupported
|
||||||
|
twitter:
|
||||||
|
Valid post body can be empty [MrPetovan]
|
||||||
|
Support of Twitter threads was added [annando]
|
||||||
|
|
||||||
|
Closed Issues
|
||||||
|
11177, 11317, 11458, 11471, 11566, 11614, 11625, 11635, 11636, 11638,
|
||||||
|
11651, 11661, 11666, 11695, 11700, 11704, 11706, 11708, 11712, 11716,
|
||||||
|
11722, 11723, 11724, 11726, 11731, 11732, 11751, 11765, 11775, 11778,
|
||||||
|
11779, 11794, 11798, 11799, 11800, 11824, 11826, 11851, 11861, 11870,
|
||||||
|
11909, 11920, 11931, 11938, 11943, 11952, 11953, 11969, 11975
|
||||||
|
|
||||||
Version 2022.06 (2022-06-11)
|
Version 2022.06 (2022-06-11)
|
||||||
Friendica Core
|
Friendica Core
|
||||||
|
|
|
@ -10,6 +10,7 @@ Aditoo
|
||||||
AgnesElisa
|
AgnesElisa
|
||||||
Albert
|
Albert
|
||||||
Aleksandr "M.O.Z.G" Dikov
|
Aleksandr "M.O.Z.G" Dikov
|
||||||
|
Alessandro Lorenzi
|
||||||
Alex
|
Alex
|
||||||
Alexander An
|
Alexander An
|
||||||
Alexander Fortin
|
Alexander Fortin
|
||||||
|
@ -66,6 +67,7 @@ Christian Vogeley
|
||||||
Christian Wiwie
|
Christian Wiwie
|
||||||
Cohan Robinson
|
Cohan Robinson
|
||||||
Colby Sollars
|
Colby Sollars
|
||||||
|
Copiis
|
||||||
Copiis Praeesse
|
Copiis Praeesse
|
||||||
CrystalStiletto
|
CrystalStiletto
|
||||||
Cyboulette
|
Cyboulette
|
||||||
|
@ -120,6 +122,7 @@ Gregory Smith
|
||||||
gudzpoz
|
gudzpoz
|
||||||
guzzisti
|
guzzisti
|
||||||
Haakon Meland Eriksen
|
Haakon Meland Eriksen
|
||||||
|
Hank Grabowski
|
||||||
Hans Meine
|
Hans Meine
|
||||||
Hauke
|
Hauke
|
||||||
Hauke Altmann
|
Hauke Altmann
|
||||||
|
@ -199,6 +202,7 @@ mpanhans
|
||||||
mytbk
|
mytbk
|
||||||
nathilia-peirce
|
nathilia-peirce
|
||||||
Nicola Spanti
|
Nicola Spanti
|
||||||
|
Nicolas Derive
|
||||||
nobody
|
nobody
|
||||||
nupplaPhil
|
nupplaPhil
|
||||||
Olaf Conradi
|
Olaf Conradi
|
||||||
|
@ -208,6 +212,7 @@ Olivier Mehani
|
||||||
Olivier Migeot
|
Olivier Migeot
|
||||||
ominds
|
ominds
|
||||||
ozero dien
|
ozero dien
|
||||||
|
pankraz
|
||||||
Paolo Wave
|
Paolo Wave
|
||||||
Pascal
|
Pascal
|
||||||
Pascal Deklerck
|
Pascal Deklerck
|
||||||
|
@ -310,6 +315,7 @@ Valvin
|
||||||
Vasudev Kamath
|
Vasudev Kamath
|
||||||
Vasya Novikov
|
Vasya Novikov
|
||||||
very-ape
|
very-ape
|
||||||
|
Viktor Nilsson
|
||||||
Vinzenz Vietzke
|
Vinzenz Vietzke
|
||||||
vislav
|
vislav
|
||||||
vladimir N
|
vladimir N
|
||||||
|
@ -318,8 +324,10 @@ VVelox
|
||||||
Vít Šesták 'v6ak'
|
Vít Šesták 'v6ak'
|
||||||
Waldemar Stoczkowski
|
Waldemar Stoczkowski
|
||||||
Walter Bulbazor
|
Walter Bulbazor
|
||||||
|
Wanting Chen
|
||||||
Wil Tur
|
Wil Tur
|
||||||
Wouter Broers
|
Wouter Broers
|
||||||
|
Xiaofei Xu
|
||||||
XMPPはいいぞ
|
XMPPはいいぞ
|
||||||
Yasen Pramatarov
|
Yasen Pramatarov
|
||||||
Yasmine A
|
Yasmine A
|
||||||
|
|
2
Doxyfile
2
Doxyfile
|
@ -1,4 +1,4 @@
|
||||||
INPUT = README.md index.php boot.php update.php bin/ mod/ include/ view/ src/ VERSION
|
INPUT = README.md index.php update.php bin/ mod/ view/ src/ VERSION
|
||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
PROJECT_NAME = "Friendica"
|
PROJECT_NAME = "Friendica"
|
||||||
PROJECT_LOGO = images/friendica-64.png
|
PROJECT_LOGO = images/friendica-64.png
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
server_ip = "192.168.22.10"
|
server_ip = "192.168.56.10"
|
||||||
server_memory = "2048" # MB
|
server_memory = "2048" # MB
|
||||||
server_timezone = "UTC"
|
server_timezone = "UTC"
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ if (php_sapi_name() !== 'cli') {
|
||||||
}
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
|
use Friendica\DI;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
|
@ -33,6 +34,8 @@ require dirname(__DIR__) . '/vendor/autoload.php';
|
||||||
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
|
||||||
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]);
|
$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['console']]);
|
||||||
|
|
||||||
|
/// @fixme Necessary until Hooks inside the Logger can get loaded without the DI-class
|
||||||
|
DI::init($dice);
|
||||||
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
\Friendica\Core\Logger\Handler\ErrorHandler::register($dice->create(\Psr\Log\LoggerInterface::class));
|
||||||
|
|
||||||
(new Friendica\Core\Console($dice, $argv))->execute();
|
(new Friendica\Core\Console($dice, $argv))->execute();
|
||||||
|
|
|
@ -45,7 +45,7 @@ $longopts = ['foreground'];
|
||||||
$options = getopt($shortopts, $longopts);
|
$options = getopt($shortopts, $longopts);
|
||||||
|
|
||||||
// Ensure that daemon.php is executed from the base path of the installation
|
// Ensure that daemon.php is executed from the base path of the installation
|
||||||
if (!file_exists('boot.php') && (sizeof($_SERVER['argv']) != 0)) {
|
if (!file_exists('index.php') && (sizeof($_SERVER['argv']) != 0)) {
|
||||||
$directory = dirname($_SERVER['argv'][0]);
|
$directory = dirname($_SERVER['argv'][0]);
|
||||||
|
|
||||||
if (substr($directory, 0, 1) != '/') {
|
if (substr($directory, 0, 1) != '/') {
|
||||||
|
|
|
@ -45,13 +45,13 @@ apt-get install -qq apache2
|
||||||
a2enmod rewrite actions ssl
|
a2enmod rewrite actions ssl
|
||||||
cp /vagrant/bin/dev/vagrant_vhost.sh /usr/local/bin/vhost
|
cp /vagrant/bin/dev/vagrant_vhost.sh /usr/local/bin/vhost
|
||||||
chmod guo+x /usr/local/bin/vhost
|
chmod guo+x /usr/local/bin/vhost
|
||||||
vhost -s 192.168.22.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local
|
vhost -s 192.168.56.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.local
|
||||||
a2dissite 000-default
|
a2dissite 000-default
|
||||||
service apache2 restart
|
service apache2 restart
|
||||||
|
|
||||||
#Install php
|
#Install php
|
||||||
echo ">>> Installing PHP7"
|
echo ">>> Installing PHP7"
|
||||||
apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip
|
apt-get install -qq php libapache2-mod-php php-cli php-mysql php-curl php-gd php-mbstring php-xml imagemagick php-imagick php-zip php-gmp
|
||||||
systemctl restart apache2
|
systemctl restart apache2
|
||||||
|
|
||||||
echo ">>> Installing PHP8"
|
echo ">>> Installing PHP8"
|
||||||
|
@ -59,7 +59,7 @@ apt-get install -qq -y lsb-release ca-certificates apt-transport-https software-
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
|
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
|
||||||
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
|
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
|
||||||
apt update
|
apt update
|
||||||
apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip
|
apt-get install -qq php8.0 php8.0-cli php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-imagick php8.0-zip php8.0-gmp
|
||||||
systemctl restart apache2
|
systemctl restart apache2
|
||||||
|
|
||||||
#Install mysql
|
#Install mysql
|
||||||
|
|
|
@ -40,7 +40,7 @@ $longopts = ['spawn', 'no_cron'];
|
||||||
$options = getopt($shortopts, $longopts);
|
$options = getopt($shortopts, $longopts);
|
||||||
|
|
||||||
// Ensure that worker.php is executed from the base path of the installation
|
// Ensure that worker.php is executed from the base path of the installation
|
||||||
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
if (!file_exists("index.php") && (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
$directory = dirname($_SERVER["argv"][0]);
|
$directory = dirname($_SERVER["argv"][0]);
|
||||||
|
|
||||||
if (substr($directory, 0, 1) != '/') {
|
if (substr($directory, 0, 1) != '/') {
|
||||||
|
|
194
boot.php
194
boot.php
|
@ -1,194 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @copyright Copyright (C) 2010-2022, the Friendica project
|
|
||||||
*
|
|
||||||
* @license GNU AGPL version 3 or any later version
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* Friendica is a communications platform for integrated social communications
|
|
||||||
* utilising decentralised communications and linkage to several indie social
|
|
||||||
* projects - as well as popular mainstream providers.
|
|
||||||
*
|
|
||||||
* Our mission is to free our friends and families from the clutches of
|
|
||||||
* data-harvesting corporations, and pave the way to a future where social
|
|
||||||
* communications are free and open and flow between alternate providers as
|
|
||||||
* easily as email does today.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Friendica\Model\Contact;
|
|
||||||
|
|
||||||
define('FRIENDICA_PLATFORM', 'Friendica');
|
|
||||||
define('FRIENDICA_CODENAME', 'Giant Rhubarb');
|
|
||||||
define('FRIENDICA_VERSION', '2022.09-dev');
|
|
||||||
define('DFRN_PROTOCOL_VERSION', '2.23');
|
|
||||||
define('NEW_TABLE_STRUCTURE_VERSION', 1288);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant with a HTML line break.
|
|
||||||
*
|
|
||||||
* Contains a HTML line break (br) element and a real carriage return with line
|
|
||||||
* feed for the source.
|
|
||||||
* This can be used in HTML and JavaScript where needed a line break.
|
|
||||||
*/
|
|
||||||
define('EOL', "<br />\r\n");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name CP
|
|
||||||
*
|
|
||||||
* Type of the community page
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('CP_NO_INTERNAL_COMMUNITY', -2);
|
|
||||||
define('CP_NO_COMMUNITY_PAGE', -1);
|
|
||||||
define('CP_USERS_ON_SERVER', 0);
|
|
||||||
define('CP_GLOBAL_COMMUNITY', 1);
|
|
||||||
define('CP_USERS_AND_GLOBAL', 2);
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name Gravity
|
|
||||||
*
|
|
||||||
* Item weight for query ordering
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('GRAVITY_PARENT', 0);
|
|
||||||
define('GRAVITY_ACTIVITY', 3);
|
|
||||||
define('GRAVITY_COMMENT', 6);
|
|
||||||
define('GRAVITY_UNKNOWN', 9);
|
|
||||||
/* @}*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @name Priority
|
|
||||||
*
|
|
||||||
* Process priority for the worker
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
define('PRIORITY_UNDEFINED', 0);
|
|
||||||
define('PRIORITY_CRITICAL', 10);
|
|
||||||
define('PRIORITY_HIGH', 20);
|
|
||||||
define('PRIORITY_MEDIUM', 30);
|
|
||||||
define('PRIORITY_LOW', 40);
|
|
||||||
define('PRIORITY_NEGLIGIBLE', 50);
|
|
||||||
define('PRIORITIES', [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE]);
|
|
||||||
/* @}*/
|
|
||||||
|
|
||||||
// Normally this constant is defined - but not if "pcntl" isn't installed
|
|
||||||
if (!defined('SIGTERM')) {
|
|
||||||
define('SIGTERM', 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Depending on the PHP version this constant does exist - or not.
|
|
||||||
* See here: http://php.net/manual/en/curl.constants.php#117928
|
|
||||||
*/
|
|
||||||
if (!defined('CURLE_OPERATION_TIMEDOUT')) {
|
|
||||||
define('CURLE_OPERATION_TIMEDOUT', CURLE_OPERATION_TIMEOUTED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!function_exists('exif_imagetype')) {
|
|
||||||
function exif_imagetype($file)
|
|
||||||
{
|
|
||||||
$size = getimagesize($file);
|
|
||||||
return $size[2];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the user id of locally logged in user or false.
|
|
||||||
*
|
|
||||||
* @return int|bool user id or false
|
|
||||||
*/
|
|
||||||
function local_user()
|
|
||||||
{
|
|
||||||
if (!empty($_SESSION['authenticated']) && !empty($_SESSION['uid'])) {
|
|
||||||
return intval($_SESSION['uid']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the public contact id of logged in user or false.
|
|
||||||
*
|
|
||||||
* @return int|bool public contact id or false
|
|
||||||
*/
|
|
||||||
function public_contact()
|
|
||||||
{
|
|
||||||
static $public_contact_id = false;
|
|
||||||
|
|
||||||
if (!$public_contact_id && !empty($_SESSION['authenticated'])) {
|
|
||||||
if (!empty($_SESSION['my_address'])) {
|
|
||||||
// Local user
|
|
||||||
$public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0, false));
|
|
||||||
} elseif (!empty($_SESSION['visitor_home'])) {
|
|
||||||
// Remote user
|
|
||||||
$public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0, false));
|
|
||||||
}
|
|
||||||
} elseif (empty($_SESSION['authenticated'])) {
|
|
||||||
$public_contact_id = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $public_contact_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns public contact id of authenticated site visitor or false
|
|
||||||
*
|
|
||||||
* @return int|bool visitor_id or false
|
|
||||||
*/
|
|
||||||
function remote_user()
|
|
||||||
{
|
|
||||||
if (empty($_SESSION['authenticated'])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_SESSION['visitor_id'])) {
|
|
||||||
return intval($_SESSION['visitor_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show an error message to user.
|
|
||||||
*
|
|
||||||
* This function save text in session, to be shown to the user at next page load
|
|
||||||
*
|
|
||||||
* @param string $s - Text of notice
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
|
|
||||||
*/
|
|
||||||
function notice(string $s)
|
|
||||||
{
|
|
||||||
\Friendica\DI::sysmsg()->addNotice($s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show an info message to user.
|
|
||||||
*
|
|
||||||
* This function save text in session, to be shown to the user at next page load
|
|
||||||
*
|
|
||||||
* @param string $s - Text of notice
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @deprecated since version 2022.09, use \Friendica\Navigation\SystemMessages instead
|
|
||||||
*/
|
|
||||||
function info(string $s)
|
|
||||||
{
|
|
||||||
\Friendica\DI::sysmsg()->addInfo($s);
|
|
||||||
}
|
|
|
@ -41,7 +41,6 @@
|
||||||
"michelf/php-markdown": "^1.7",
|
"michelf/php-markdown": "^1.7",
|
||||||
"minishlink/web-push": "^6.0",
|
"minishlink/web-push": "^6.0",
|
||||||
"mobiledetect/mobiledetectlib": "^2.8",
|
"mobiledetect/mobiledetectlib": "^2.8",
|
||||||
"monolog/monolog": "^1.25",
|
|
||||||
"nikic/fast-route": "^1.3",
|
"nikic/fast-route": "^1.3",
|
||||||
"paragonie/hidden-string": "^1.0",
|
"paragonie/hidden-string": "^1.0",
|
||||||
"patrickschur/language-detection": "^5.0.0",
|
"patrickschur/language-detection": "^5.0.0",
|
||||||
|
@ -50,6 +49,7 @@
|
||||||
"pragmarx/google2fa": "^5.0",
|
"pragmarx/google2fa": "^5.0",
|
||||||
"pragmarx/recovery": "^0.2",
|
"pragmarx/recovery": "^0.2",
|
||||||
"psr/container": "^1.0",
|
"psr/container": "^1.0",
|
||||||
|
"psr/log": "^1.1",
|
||||||
"seld/cli-prompt": "^1.0",
|
"seld/cli-prompt": "^1.0",
|
||||||
"smarty/smarty": "^4",
|
"smarty/smarty": "^4",
|
||||||
"ua-parser/uap-php": "^3.9",
|
"ua-parser/uap-php": "^3.9",
|
||||||
|
@ -59,7 +59,6 @@
|
||||||
"bower-asset/chart-js": "^2.8",
|
"bower-asset/chart-js": "^2.8",
|
||||||
"bower-asset/dompurify": "^1.0",
|
"bower-asset/dompurify": "^1.0",
|
||||||
"bower-asset/fork-awesome": "^1.1",
|
"bower-asset/fork-awesome": "^1.1",
|
||||||
"bower-asset/vue": "^2.6",
|
|
||||||
"npm-asset/cropperjs": "1.2.2",
|
"npm-asset/cropperjs": "1.2.2",
|
||||||
"npm-asset/es-jquery-sortable": "^0.9.13",
|
"npm-asset/es-jquery-sortable": "^0.9.13",
|
||||||
"npm-asset/fullcalendar": "^3.10",
|
"npm-asset/fullcalendar": "^3.10",
|
||||||
|
@ -83,10 +82,7 @@
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Friendica\\": "src/",
|
"Friendica\\": "src/",
|
||||||
"Friendica\\Addon\\": "addon/"
|
"Friendica\\Addon\\": "addon/"
|
||||||
},
|
}
|
||||||
"files": [
|
|
||||||
"boot.php"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
238
database.sql
238
database.sql
|
@ -1,6 +1,6 @@
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Friendica 2022.09-dev (Giant Rhubarb)
|
-- Friendica 2022.12-dev (Giant Rhubarb)
|
||||||
-- DB_UPDATE_VERSION 1479
|
-- DB_UPDATE_VERSION 1486
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `gserver` (
|
CREATE TABLE IF NOT EXISTS `gserver` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`nurl` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`version` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`version` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`site_name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`site_name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`info` text COMMENT '',
|
`info` text COMMENT '',
|
||||||
|
@ -22,8 +22,8 @@ CREATE TABLE IF NOT EXISTS `gserver` (
|
||||||
`local-posts` int unsigned COMMENT 'Number of local posts',
|
`local-posts` int unsigned COMMENT 'Number of local posts',
|
||||||
`local-comments` int unsigned COMMENT 'Number of local comments',
|
`local-comments` int unsigned COMMENT 'Number of local comments',
|
||||||
`directory-type` tinyint DEFAULT 0 COMMENT 'Type of directory service (Poco, Mastodon)',
|
`directory-type` tinyint DEFAULT 0 COMMENT 'Type of directory service (Poco, Mastodon)',
|
||||||
`poco` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`poco` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`noscrape` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`noscrape` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`network` char(4) NOT NULL DEFAULT '' COMMENT '',
|
`network` char(4) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`protocol` tinyint unsigned COMMENT 'The protocol of the server',
|
`protocol` tinyint unsigned COMMENT 'The protocol of the server',
|
||||||
`platform` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`platform` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
|
@ -104,7 +104,7 @@ CREATE TABLE IF NOT EXISTS `user` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `item-uri` (
|
CREATE TABLE IF NOT EXISTS `item-uri` (
|
||||||
`id` int unsigned NOT NULL auto_increment,
|
`id` int unsigned NOT NULL auto_increment,
|
||||||
`uri` varbinary(255) NOT NULL COMMENT 'URI of an item',
|
`uri` varbinary(383) NOT NULL COMMENT 'URI of an item',
|
||||||
`guid` varbinary(255) COMMENT 'A unique identifier for an item',
|
`guid` varbinary(255) COMMENT 'A unique identifier for an item',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
UNIQUE INDEX `uri` (`uri`),
|
UNIQUE INDEX `uri` (`uri`),
|
||||||
|
@ -127,26 +127,28 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`keywords` text COMMENT 'public keywords (interests) of the contact',
|
`keywords` text COMMENT 'public keywords (interests) of the contact',
|
||||||
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
|
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
|
||||||
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
|
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
|
||||||
`avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`avatar` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`header` varchar(255) COMMENT 'Header picture',
|
`header` varbinary(383) COMMENT 'Header picture',
|
||||||
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`nurl` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the contact url',
|
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the contact url',
|
||||||
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`alias` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`pubkey` text COMMENT 'RSA public key 4096 bit',
|
`pubkey` text COMMENT 'RSA public key 4096 bit',
|
||||||
`prvkey` text COMMENT 'RSA private key 4096 bit',
|
`prvkey` text COMMENT 'RSA private key 4096 bit',
|
||||||
`batch` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`batch` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`notify` varchar(255) COMMENT '',
|
`notify` varbinary(383) COMMENT '',
|
||||||
`poll` varchar(255) COMMENT '',
|
`poll` varbinary(383) COMMENT '',
|
||||||
`subscribe` varchar(255) COMMENT '',
|
`subscribe` varbinary(383) COMMENT '',
|
||||||
`last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last try to update the contact info',
|
`last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last try to update the contact info',
|
||||||
|
`next-update` datetime COMMENT 'Next connection request',
|
||||||
`success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful contact update',
|
`success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful contact update',
|
||||||
`failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed update',
|
`failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last failed update',
|
||||||
`failed` boolean COMMENT 'Connection failed',
|
`failed` boolean COMMENT 'Connection failed',
|
||||||
`term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last post',
|
`last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last post',
|
||||||
`last-discovery` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last follower discovery',
|
`last-discovery` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'date of the last follower discovery',
|
||||||
|
`local-data` boolean COMMENT 'Is true when there are posts with this contact on the system',
|
||||||
`blocked` boolean NOT NULL DEFAULT '1' COMMENT 'Node-wide block status',
|
`blocked` boolean NOT NULL DEFAULT '1' COMMENT 'Node-wide block status',
|
||||||
`block_reason` text COMMENT 'Node-wide block reason',
|
`block_reason` text COMMENT 'Node-wide block reason',
|
||||||
`readonly` boolean NOT NULL DEFAULT '0' COMMENT 'posts of the contact are readonly',
|
`readonly` boolean NOT NULL DEFAULT '0' COMMENT 'posts of the contact are readonly',
|
||||||
|
@ -155,7 +157,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`archive` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`archive` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`unsearchable` boolean NOT NULL DEFAULT '0' COMMENT 'Contact prefers to not be searchable',
|
`unsearchable` boolean NOT NULL DEFAULT '0' COMMENT 'Contact prefers to not be searchable',
|
||||||
`sensitive` boolean NOT NULL DEFAULT '0' COMMENT 'Contact posts sensitive content',
|
`sensitive` boolean NOT NULL DEFAULT '0' COMMENT 'Contact posts sensitive content',
|
||||||
`baseurl` varchar(255) DEFAULT '' COMMENT 'baseurl of the contact',
|
`baseurl` varbinary(383) DEFAULT '' COMMENT 'baseurl of the contact',
|
||||||
`gsid` int unsigned COMMENT 'Global Server ID',
|
`gsid` int unsigned COMMENT 'Global Server ID',
|
||||||
`bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '',
|
`bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '',
|
||||||
`reason` text COMMENT '',
|
`reason` text COMMENT '',
|
||||||
|
@ -164,7 +166,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`rel` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'The kind of the relation between the user and the contact',
|
`rel` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'The kind of the relation between the user and the contact',
|
||||||
`protocol` char(4) NOT NULL DEFAULT '' COMMENT 'Protocol of the contact',
|
`protocol` char(4) NOT NULL DEFAULT '' COMMENT 'Protocol of the contact',
|
||||||
`subhub` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`subhub` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`hub-verify` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`hub-verify` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`rating` tinyint NOT NULL DEFAULT 0 COMMENT 'Automatically detected feed poll frequency',
|
`rating` tinyint NOT NULL DEFAULT 0 COMMENT 'Automatically detected feed poll frequency',
|
||||||
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Feed poll priority',
|
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Feed poll priority',
|
||||||
`attag` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`attag` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
|
@ -175,15 +177,15 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
`fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||||
`ffi_keyword_denylist` text COMMENT '',
|
`ffi_keyword_denylist` text COMMENT '',
|
||||||
`photo` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo of the contact',
|
`photo` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo of the contact',
|
||||||
`thumb` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (thumb size)',
|
`thumb` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo (thumb size)',
|
||||||
`micro` varchar(255) DEFAULT '' COMMENT 'Link to the profile photo (micro size)',
|
`micro` varbinary(383) DEFAULT '' COMMENT 'Link to the profile photo (micro size)',
|
||||||
`name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`request` varchar(255) COMMENT '',
|
`request` varbinary(383) COMMENT '',
|
||||||
`confirm` varchar(255) COMMENT '',
|
`confirm` varbinary(383) COMMENT '',
|
||||||
`poco` varchar(255) COMMENT '',
|
`poco` varbinary(383) COMMENT '',
|
||||||
`writable` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`writable` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`forum` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a forum. Deprecated, use \'contact-type\' = \'community\' and \'manually-approve\' = false instead',
|
`forum` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a forum. Deprecated, use \'contact-type\' = \'community\' and \'manually-approve\' = false instead',
|
||||||
`prv` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a private group. Deprecated, use \'contact-type\' = \'community\' and \'manually-approve\' = true instead',
|
`prv` boolean NOT NULL DEFAULT '0' COMMENT 'contact is a private group. Deprecated, use \'contact-type\' = \'community\' and \'manually-approve\' = true instead',
|
||||||
|
@ -191,8 +193,8 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
`site-pubkey` text COMMENT 'Deprecated',
|
`site-pubkey` text COMMENT 'Deprecated',
|
||||||
`gender` varchar(32) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
`gender` varchar(32) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
||||||
`duplex` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
`duplex` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
||||||
`issued-id` varchar(255) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
`issued-id` varbinary(383) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
||||||
`dfrn-id` varchar(255) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
`dfrn-id` varbinary(383) NOT NULL DEFAULT '' COMMENT 'Deprecated',
|
||||||
`aes_allow` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
`aes_allow` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
||||||
`ret-aes` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
`ret-aes` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
||||||
`usehub` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
`usehub` boolean NOT NULL DEFAULT '0' COMMENT 'Deprecated',
|
||||||
|
@ -213,12 +215,14 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
INDEX `attag_uid` (`attag`(96),`uid`),
|
INDEX `attag_uid` (`attag`(96),`uid`),
|
||||||
INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`),
|
INDEX `network_uid_lastupdate` (`network`,`uid`,`last-update`),
|
||||||
INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`),
|
INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`),
|
||||||
|
INDEX `next-update` (`next-update`),
|
||||||
|
INDEX `local-data-next-update` (`local-data`,`next-update`),
|
||||||
INDEX `uid_lastitem` (`uid`,`last-item`),
|
INDEX `uid_lastitem` (`uid`,`last-item`),
|
||||||
INDEX `baseurl` (`baseurl`(64)),
|
INDEX `baseurl` (`baseurl`(64)),
|
||||||
INDEX `uid_contact-type` (`uid`,`contact-type`),
|
INDEX `uid_contact-type` (`uid`,`contact-type`),
|
||||||
INDEX `uid_self_contact-type` (`uid`,`self`,`contact-type`),
|
INDEX `uid_self_contact-type` (`uid`,`self`,`contact-type`),
|
||||||
INDEX `self_network_uid` (`self`,`network`,`uid`),
|
INDEX `self_network_uid` (`self`,`network`,`uid`),
|
||||||
INDEX `gsid` (`gsid`),
|
INDEX `gsid_uid_failed` (`gsid`,`uid`,`failed`),
|
||||||
INDEX `uri-id` (`uri-id`),
|
INDEX `uri-id` (`uri-id`),
|
||||||
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
@ -231,7 +235,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
|
||||||
CREATE TABLE IF NOT EXISTS `tag` (
|
CREATE TABLE IF NOT EXISTS `tag` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT '',
|
`id` int unsigned NOT NULL auto_increment COMMENT '',
|
||||||
`name` varchar(96) NOT NULL DEFAULT '' COMMENT '',
|
`name` varchar(96) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`url` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`type` tinyint unsigned COMMENT 'Type of the tag (Unknown, General Collection, Follower Collection or Account)',
|
`type` tinyint unsigned COMMENT 'Type of the tag (Unknown, General Collection, Follower Collection or Account)',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
UNIQUE INDEX `type_name_url` (`name`,`url`),
|
UNIQUE INDEX `type_name_url` (`name`,`url`),
|
||||||
|
@ -305,6 +309,20 @@ CREATE TABLE IF NOT EXISTS `2fa_trusted_browser` (
|
||||||
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
|
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication trusted browsers';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication trusted browsers';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- TABLE account-user
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS `account-user` (
|
||||||
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
|
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the account url',
|
||||||
|
`uid` mediumint unsigned NOT NULL COMMENT 'User ID',
|
||||||
|
PRIMARY KEY(`id`),
|
||||||
|
UNIQUE INDEX `uri-id_uid` (`uri-id`,`uid`),
|
||||||
|
INDEX `uid_uri-id` (`uid`,`uri-id`),
|
||||||
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Remote and local accounts';
|
||||||
|
|
||||||
--
|
--
|
||||||
-- TABLE addon
|
-- TABLE addon
|
||||||
--
|
--
|
||||||
|
@ -325,17 +343,17 @@ CREATE TABLE IF NOT EXISTS `addon` (
|
||||||
-- TABLE apcontact
|
-- TABLE apcontact
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `apcontact` (
|
CREATE TABLE IF NOT EXISTS `apcontact` (
|
||||||
`url` varbinary(255) NOT NULL COMMENT 'URL of the contact',
|
`url` varbinary(383) NOT NULL COMMENT 'URL of the contact',
|
||||||
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url',
|
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url',
|
||||||
`uuid` varchar(255) COMMENT '',
|
`uuid` varbinary(255) COMMENT '',
|
||||||
`type` varchar(20) NOT NULL COMMENT '',
|
`type` varchar(20) NOT NULL COMMENT '',
|
||||||
`following` varchar(255) COMMENT '',
|
`following` varbinary(383) COMMENT '',
|
||||||
`followers` varchar(255) COMMENT '',
|
`followers` varbinary(383) COMMENT '',
|
||||||
`inbox` varchar(255) NOT NULL COMMENT '',
|
`inbox` varbinary(383) NOT NULL COMMENT '',
|
||||||
`outbox` varchar(255) COMMENT '',
|
`outbox` varbinary(383) COMMENT '',
|
||||||
`sharedinbox` varchar(255) COMMENT '',
|
`sharedinbox` varbinary(383) COMMENT '',
|
||||||
`featured` varchar(255) COMMENT 'Address for the collection of featured posts',
|
`featured` varbinary(383) COMMENT 'Address for the collection of featured posts',
|
||||||
`featured-tags` varchar(255) COMMENT 'Address for the collection of featured tags',
|
`featured-tags` varbinary(383) COMMENT 'Address for the collection of featured tags',
|
||||||
`manually-approve` boolean COMMENT '',
|
`manually-approve` boolean COMMENT '',
|
||||||
`discoverable` boolean COMMENT 'Mastodon extension: true if profile is published in their directory',
|
`discoverable` boolean COMMENT 'Mastodon extension: true if profile is published in their directory',
|
||||||
`suspended` boolean COMMENT 'Mastodon extension: true if profile is suspended',
|
`suspended` boolean COMMENT 'Mastodon extension: true if profile is suspended',
|
||||||
|
@ -344,13 +362,13 @@ CREATE TABLE IF NOT EXISTS `apcontact` (
|
||||||
`about` text COMMENT '',
|
`about` text COMMENT '',
|
||||||
`xmpp` varchar(255) COMMENT 'XMPP address',
|
`xmpp` varchar(255) COMMENT 'XMPP address',
|
||||||
`matrix` varchar(255) COMMENT 'Matrix address',
|
`matrix` varchar(255) COMMENT 'Matrix address',
|
||||||
`photo` varchar(255) COMMENT '',
|
`photo` varbinary(383) COMMENT '',
|
||||||
`header` varchar(255) COMMENT 'Header picture',
|
`header` varbinary(383) COMMENT 'Header picture',
|
||||||
`addr` varchar(255) COMMENT '',
|
`addr` varchar(255) COMMENT '',
|
||||||
`alias` varchar(255) COMMENT '',
|
`alias` varbinary(383) COMMENT '',
|
||||||
`pubkey` text COMMENT '',
|
`pubkey` text COMMENT '',
|
||||||
`subscribe` varchar(255) COMMENT '',
|
`subscribe` varbinary(383) COMMENT '',
|
||||||
`baseurl` varchar(255) COMMENT 'baseurl of the ap contact',
|
`baseurl` varbinary(383) COMMENT 'baseurl of the ap contact',
|
||||||
`gsid` int unsigned COMMENT 'Global Server ID',
|
`gsid` int unsigned COMMENT 'Global Server ID',
|
||||||
`generator` varchar(255) COMMENT 'Name of the contact\'s system',
|
`generator` varchar(255) COMMENT 'Name of the contact\'s system',
|
||||||
`following_count` int unsigned DEFAULT 0 COMMENT 'Number of following contacts',
|
`following_count` int unsigned DEFAULT 0 COMMENT 'Number of following contacts',
|
||||||
|
@ -377,8 +395,8 @@ CREATE TABLE IF NOT EXISTS `application` (
|
||||||
`client_id` varchar(64) NOT NULL COMMENT '',
|
`client_id` varchar(64) NOT NULL COMMENT '',
|
||||||
`client_secret` varchar(64) NOT NULL COMMENT '',
|
`client_secret` varchar(64) NOT NULL COMMENT '',
|
||||||
`name` varchar(255) NOT NULL COMMENT '',
|
`name` varchar(255) NOT NULL COMMENT '',
|
||||||
`redirect_uri` varchar(255) NOT NULL COMMENT '',
|
`redirect_uri` varbinary(383) NOT NULL COMMENT '',
|
||||||
`website` varchar(255) COMMENT '',
|
`website` varbinary(383) COMMENT '',
|
||||||
`scopes` varchar(255) COMMENT '',
|
`scopes` varchar(255) COMMENT '',
|
||||||
`read` boolean COMMENT 'Read scope',
|
`read` boolean COMMENT 'Read scope',
|
||||||
`write` boolean COMMENT 'Write scope',
|
`write` boolean COMMENT 'Write scope',
|
||||||
|
@ -395,7 +413,7 @@ CREATE TABLE IF NOT EXISTS `application-marker` (
|
||||||
`application-id` int unsigned NOT NULL COMMENT '',
|
`application-id` int unsigned NOT NULL COMMENT '',
|
||||||
`uid` mediumint unsigned NOT NULL COMMENT 'Owner User id',
|
`uid` mediumint unsigned NOT NULL COMMENT 'Owner User id',
|
||||||
`timeline` varchar(64) NOT NULL COMMENT 'Marker (home, notifications)',
|
`timeline` varchar(64) NOT NULL COMMENT 'Marker (home, notifications)',
|
||||||
`last_read_id` varchar(255) COMMENT 'Marker id for the timeline',
|
`last_read_id` varbinary(383) COMMENT 'Marker id for the timeline',
|
||||||
`version` smallint unsigned COMMENT 'Version number',
|
`version` smallint unsigned COMMENT 'Version number',
|
||||||
`updated_at` datetime COMMENT 'creation time',
|
`updated_at` datetime COMMENT 'creation time',
|
||||||
PRIMARY KEY(`application-id`,`uid`,`timeline`),
|
PRIMARY KEY(`application-id`,`uid`,`timeline`),
|
||||||
|
@ -492,7 +510,7 @@ CREATE TABLE IF NOT EXISTS `contact-relation` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `conv` (
|
CREATE TABLE IF NOT EXISTS `conv` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this conversation',
|
`guid` varbinary(255) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this conversation',
|
||||||
`recips` text COMMENT 'sender_handle;recipient_handle',
|
`recips` text COMMENT 'sender_handle;recipient_handle',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
||||||
`creator` varchar(255) NOT NULL DEFAULT '' COMMENT 'handle of creator',
|
`creator` varchar(255) NOT NULL DEFAULT '' COMMENT 'handle of creator',
|
||||||
|
@ -534,7 +552,7 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `delayed-post` (
|
CREATE TABLE IF NOT EXISTS `delayed-post` (
|
||||||
`id` int unsigned NOT NULL auto_increment,
|
`id` int unsigned NOT NULL auto_increment,
|
||||||
`uri` varchar(255) COMMENT 'URI of the post that will be distributed later',
|
`uri` varbinary(383) COMMENT 'URI of the post that will be distributed later',
|
||||||
`uid` mediumint unsigned COMMENT 'Owner User id',
|
`uid` mediumint unsigned COMMENT 'Owner User id',
|
||||||
`delayed` datetime COMMENT 'delay time',
|
`delayed` datetime COMMENT 'delay time',
|
||||||
`wid` int unsigned COMMENT 'Workerqueue id',
|
`wid` int unsigned COMMENT 'Workerqueue id',
|
||||||
|
@ -559,7 +577,7 @@ CREATE TABLE IF NOT EXISTS `diaspora-interaction` (
|
||||||
-- TABLE endpoint
|
-- TABLE endpoint
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `endpoint` (
|
CREATE TABLE IF NOT EXISTS `endpoint` (
|
||||||
`url` varbinary(255) NOT NULL COMMENT 'URL of the contact',
|
`url` varbinary(383) NOT NULL COMMENT 'URL of the contact',
|
||||||
`type` varchar(20) NOT NULL COMMENT '',
|
`type` varchar(20) NOT NULL COMMENT '',
|
||||||
`owner-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url',
|
`owner-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the apcontact url',
|
||||||
PRIMARY KEY(`url`),
|
PRIMARY KEY(`url`),
|
||||||
|
@ -572,10 +590,10 @@ CREATE TABLE IF NOT EXISTS `endpoint` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `event` (
|
CREATE TABLE IF NOT EXISTS `event` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`guid` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
||||||
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact_id (ID of the contact in contact table)',
|
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact_id (ID of the contact in contact table)',
|
||||||
`uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`uri` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the event uri',
|
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the event uri',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time',
|
||||||
`edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'last edit time',
|
`edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'last edit time',
|
||||||
|
@ -605,22 +623,23 @@ CREATE TABLE IF NOT EXISTS `event` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `fcontact` (
|
CREATE TABLE IF NOT EXISTS `fcontact` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'unique id',
|
`guid` varbinary(255) NOT NULL DEFAULT '' COMMENT 'unique id',
|
||||||
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the fcontact url',
|
`uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the fcontact url',
|
||||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`request` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`request` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`batch` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`batch` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`notify` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`notify` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`poll` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`poll` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`confirm` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`confirm` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
`priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||||
`network` char(4) NOT NULL DEFAULT '' COMMENT '',
|
`network` char(4) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`alias` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`pubkey` text COMMENT '',
|
`pubkey` text COMMENT '',
|
||||||
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`interacting_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts this contact interactes with',
|
`interacting_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts this contact interactes with',
|
||||||
`interacted_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts that interacted with this contact',
|
`interacted_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts that interacted with this contact',
|
||||||
|
@ -637,7 +656,7 @@ CREATE TABLE IF NOT EXISTS `fcontact` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `fetch-entry` (
|
CREATE TABLE IF NOT EXISTS `fetch-entry` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`url` varbinary(255) COMMENT 'url that awaiting to be fetched',
|
`url` varbinary(383) COMMENT 'url that awaiting to be fetched',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of the fetch request',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of the fetch request',
|
||||||
`wid` int unsigned COMMENT 'Workerqueue id',
|
`wid` int unsigned COMMENT 'Workerqueue id',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
|
@ -655,9 +674,9 @@ CREATE TABLE IF NOT EXISTS `fsuggest` (
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
||||||
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
|
`cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`request` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`request` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`note` text COMMENT '',
|
`note` text COMMENT '',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
|
@ -728,10 +747,10 @@ CREATE TABLE IF NOT EXISTS `hook` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `inbox-entry` (
|
CREATE TABLE IF NOT EXISTS `inbox-entry` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`activity-id` varbinary(255) COMMENT 'id of the incoming activity',
|
`activity-id` varbinary(383) COMMENT 'id of the incoming activity',
|
||||||
`object-id` varbinary(255) COMMENT '',
|
`object-id` varbinary(383) COMMENT '',
|
||||||
`in-reply-to-id` varbinary(255) COMMENT '',
|
`in-reply-to-id` varbinary(383) COMMENT '',
|
||||||
`conversation` varbinary(255) COMMENT '',
|
`conversation` varbinary(383) COMMENT '',
|
||||||
`type` varchar(64) COMMENT 'Type of the activity',
|
`type` varchar(64) COMMENT 'Type of the activity',
|
||||||
`object-type` varchar(64) COMMENT 'Type of the object activity',
|
`object-type` varchar(64) COMMENT 'Type of the object activity',
|
||||||
`object-object-type` varchar(64) COMMENT 'Type of the object\'s object activity',
|
`object-object-type` varchar(64) COMMENT 'Type of the object\'s object activity',
|
||||||
|
@ -765,7 +784,7 @@ CREATE TABLE IF NOT EXISTS `inbox-entry-receiver` (
|
||||||
-- TABLE inbox-status
|
-- TABLE inbox-status
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `inbox-status` (
|
CREATE TABLE IF NOT EXISTS `inbox-status` (
|
||||||
`url` varbinary(255) NOT NULL COMMENT 'URL of the inbox',
|
`url` varbinary(383) NOT NULL COMMENT 'URL of the inbox',
|
||||||
`uri-id` int unsigned COMMENT 'Item-uri id of inbox url',
|
`uri-id` int unsigned COMMENT 'Item-uri id of inbox url',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of this entry',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date of this entry',
|
||||||
`success` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful delivery',
|
`success` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of the last successful delivery',
|
||||||
|
@ -790,7 +809,7 @@ CREATE TABLE IF NOT EXISTS `intro` (
|
||||||
`knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`duplex` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated',
|
`duplex` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated',
|
||||||
`note` text COMMENT '',
|
`note` text COMMENT '',
|
||||||
`hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`hash` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`blocked` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated',
|
`blocked` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated',
|
||||||
`ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
|
@ -822,11 +841,11 @@ CREATE TABLE IF NOT EXISTS `locks` (
|
||||||
CREATE TABLE IF NOT EXISTS `mail` (
|
CREATE TABLE IF NOT EXISTS `mail` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
||||||
`guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this private message',
|
`guid` varbinary(255) NOT NULL DEFAULT '' COMMENT 'A unique identifier for this private message',
|
||||||
`from-name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name of the sender',
|
`from-name` varchar(255) NOT NULL DEFAULT '' COMMENT 'name of the sender',
|
||||||
`from-photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'contact photo link of the sender',
|
`from-photo` varbinary(383) NOT NULL DEFAULT '' COMMENT 'contact photo link of the sender',
|
||||||
`from-url` varchar(255) NOT NULL DEFAULT '' COMMENT 'profile linke of the sender',
|
`from-url` varbinary(383) NOT NULL DEFAULT '' COMMENT 'profile linke of the sender',
|
||||||
`contact-id` varchar(255) COMMENT 'contact.id',
|
`contact-id` varbinary(255) COMMENT 'contact.id',
|
||||||
`author-id` int unsigned COMMENT 'Link to the contact table with uid=0 of the author of the mail',
|
`author-id` int unsigned COMMENT 'Link to the contact table with uid=0 of the author of the mail',
|
||||||
`convid` int unsigned COMMENT 'conv.id',
|
`convid` int unsigned COMMENT 'conv.id',
|
||||||
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
|
@ -835,11 +854,11 @@ CREATE TABLE IF NOT EXISTS `mail` (
|
||||||
`reply` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`reply` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`replied` boolean NOT NULL DEFAULT '0' COMMENT '',
|
`replied` boolean NOT NULL DEFAULT '0' COMMENT '',
|
||||||
`unknown` boolean NOT NULL DEFAULT '0' COMMENT 'if sender not in the contact table this is 1',
|
`unknown` boolean NOT NULL DEFAULT '0' COMMENT 'if sender not in the contact table this is 1',
|
||||||
`uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`uri` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`uri-id` int unsigned COMMENT 'Item-uri id of the related mail',
|
`uri-id` int unsigned COMMENT 'Item-uri id of the related mail',
|
||||||
`parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`parent-uri` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`parent-uri-id` int unsigned COMMENT 'Item-uri id of the parent of the related mail',
|
`parent-uri-id` int unsigned COMMENT 'Item-uri id of the parent of the related mail',
|
||||||
`thr-parent` varchar(255) COMMENT '',
|
`thr-parent` varbinary(383) COMMENT '',
|
||||||
`thr-parent-id` int unsigned COMMENT 'Id of the item-uri table that contains the thread parent uri',
|
`thr-parent-id` int unsigned COMMENT 'Id of the item-uri table that contains the thread parent uri',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time of the private message',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time of the private message',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
|
@ -916,6 +935,7 @@ CREATE TABLE IF NOT EXISTS `notification` (
|
||||||
INDEX `target-uri-id` (`target-uri-id`),
|
INDEX `target-uri-id` (`target-uri-id`),
|
||||||
INDEX `parent-uri-id` (`parent-uri-id`),
|
INDEX `parent-uri-id` (`parent-uri-id`),
|
||||||
INDEX `seen_uid` (`seen`,`uid`),
|
INDEX `seen_uid` (`seen`,`uid`),
|
||||||
|
INDEX `uid_type_parent-uri-id_actor-id` (`uid`,`type`,`parent-uri-id`,`actor-id`),
|
||||||
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
FOREIGN KEY (`vid`) REFERENCES `verb` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT,
|
FOREIGN KEY (`vid`) REFERENCES `verb` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT,
|
||||||
FOREIGN KEY (`actor-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
FOREIGN KEY (`actor-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
@ -930,12 +950,12 @@ CREATE TABLE IF NOT EXISTS `notify` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`type` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
`type` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||||
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`msg` mediumtext COMMENT '',
|
`msg` mediumtext COMMENT '',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Owner User id',
|
||||||
`link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`link` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`iid` int unsigned COMMENT '',
|
`iid` int unsigned COMMENT '',
|
||||||
`parent` int unsigned COMMENT '',
|
`parent` int unsigned COMMENT '',
|
||||||
`uri-id` int unsigned COMMENT 'Item-uri id of the related post',
|
`uri-id` int unsigned COMMENT 'Item-uri id of the related post',
|
||||||
|
@ -979,7 +999,7 @@ CREATE TABLE IF NOT EXISTS `notify-threads` (
|
||||||
-- TABLE oembed
|
-- TABLE oembed
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `oembed` (
|
CREATE TABLE IF NOT EXISTS `oembed` (
|
||||||
`url` varbinary(255) NOT NULL COMMENT 'page url',
|
`url` varbinary(383) NOT NULL COMMENT 'page url',
|
||||||
`maxwidth` mediumint unsigned NOT NULL COMMENT 'Maximum width passed to Oembed',
|
`maxwidth` mediumint unsigned NOT NULL COMMENT 'Maximum width passed to Oembed',
|
||||||
`content` mediumtext COMMENT 'OEmbed data of the page',
|
`content` mediumtext COMMENT 'OEmbed data of the page',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of creation',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of creation',
|
||||||
|
@ -1149,9 +1169,12 @@ CREATE TABLE IF NOT EXISTS `post-category` (
|
||||||
CREATE TABLE IF NOT EXISTS `post-collection` (
|
CREATE TABLE IF NOT EXISTS `post-collection` (
|
||||||
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
||||||
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0 - Featured',
|
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0 - Featured',
|
||||||
|
`author-id` int unsigned COMMENT 'Author of the featured post',
|
||||||
PRIMARY KEY(`uri-id`,`type`),
|
PRIMARY KEY(`uri-id`,`type`),
|
||||||
INDEX `type` (`type`),
|
INDEX `type` (`type`),
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
INDEX `author-id` (`author-id`),
|
||||||
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Collection of posts';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Collection of posts';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1163,6 +1186,7 @@ CREATE TABLE IF NOT EXISTS `post-content` (
|
||||||
`content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`body` mediumtext COMMENT 'item body content',
|
`body` mediumtext COMMENT 'item body content',
|
||||||
`raw-body` mediumtext COMMENT 'Body without embedded media links',
|
`raw-body` mediumtext COMMENT 'Body without embedded media links',
|
||||||
|
`quote-uri-id` int unsigned COMMENT 'Id of the item-uri table that contains the quoted uri',
|
||||||
`location` varchar(255) NOT NULL DEFAULT '' COMMENT 'text location where this item originated',
|
`location` varchar(255) NOT NULL DEFAULT '' COMMENT 'text location where this item originated',
|
||||||
`coord` varchar(255) NOT NULL DEFAULT '' COMMENT 'longitude/latitude pair representing location where this item originated',
|
`coord` varchar(255) NOT NULL DEFAULT '' COMMENT 'longitude/latitude pair representing location where this item originated',
|
||||||
`language` text COMMENT 'Language information about this post',
|
`language` text COMMENT 'Language information about this post',
|
||||||
|
@ -1174,12 +1198,14 @@ CREATE TABLE IF NOT EXISTS `post-content` (
|
||||||
`target-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams target type if applicable (URI)',
|
`target-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams target type if applicable (URI)',
|
||||||
`target` text COMMENT 'JSON encoded target structure if used',
|
`target` text COMMENT 'JSON encoded target structure if used',
|
||||||
`resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT 'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
|
`resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT 'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
|
||||||
`plink` varchar(255) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
|
`plink` varbinary(383) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
|
||||||
PRIMARY KEY(`uri-id`),
|
PRIMARY KEY(`uri-id`),
|
||||||
INDEX `plink` (`plink`(191)),
|
INDEX `plink` (`plink`(191)),
|
||||||
INDEX `resource-id` (`resource-id`),
|
INDEX `resource-id` (`resource-id`),
|
||||||
FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`),
|
FULLTEXT INDEX `title-content-warning-body` (`title`,`content-warning`,`body`),
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
INDEX `quote-uri-id` (`quote-uri-id`),
|
||||||
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`quote-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1241,7 +1267,7 @@ CREATE TABLE IF NOT EXISTS `post-history` (
|
||||||
`target-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams target type if applicable (URI)',
|
`target-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams target type if applicable (URI)',
|
||||||
`target` text COMMENT 'JSON encoded target structure if used',
|
`target` text COMMENT 'JSON encoded target structure if used',
|
||||||
`resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT 'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
|
`resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT 'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
|
||||||
`plink` varchar(255) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
|
`plink` varbinary(383) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
|
||||||
PRIMARY KEY(`uri-id`,`edited`),
|
PRIMARY KEY(`uri-id`,`edited`),
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Post history';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Post history';
|
||||||
|
@ -1266,6 +1292,7 @@ CREATE TABLE IF NOT EXISTS `post-media` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
`uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
|
||||||
`url` varbinary(1024) NOT NULL COMMENT 'Media URL',
|
`url` varbinary(1024) NOT NULL COMMENT 'Media URL',
|
||||||
|
`media-uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the activities uri-id',
|
||||||
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type',
|
`type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Media type',
|
||||||
`mimetype` varchar(60) COMMENT '',
|
`mimetype` varchar(60) COMMENT '',
|
||||||
`height` smallint unsigned COMMENT 'Height of the media',
|
`height` smallint unsigned COMMENT 'Height of the media',
|
||||||
|
@ -1276,16 +1303,18 @@ CREATE TABLE IF NOT EXISTS `post-media` (
|
||||||
`preview-width` smallint unsigned COMMENT 'Width of the preview picture',
|
`preview-width` smallint unsigned COMMENT 'Width of the preview picture',
|
||||||
`description` text COMMENT '',
|
`description` text COMMENT '',
|
||||||
`name` varchar(255) COMMENT 'Name of the media',
|
`name` varchar(255) COMMENT 'Name of the media',
|
||||||
`author-url` varbinary(255) COMMENT 'URL of the author of the media',
|
`author-url` varbinary(383) COMMENT 'URL of the author of the media',
|
||||||
`author-name` varchar(255) COMMENT 'Name of the author of the media',
|
`author-name` varchar(255) COMMENT 'Name of the author of the media',
|
||||||
`author-image` varbinary(255) COMMENT 'Image of the author of the media',
|
`author-image` varbinary(383) COMMENT 'Image of the author of the media',
|
||||||
`publisher-url` varbinary(255) COMMENT 'URL of the publisher of the media',
|
`publisher-url` varbinary(383) COMMENT 'URL of the publisher of the media',
|
||||||
`publisher-name` varchar(255) COMMENT 'Name of the publisher of the media',
|
`publisher-name` varchar(255) COMMENT 'Name of the publisher of the media',
|
||||||
`publisher-image` varbinary(255) COMMENT 'Image of the publisher of the media',
|
`publisher-image` varbinary(383) COMMENT 'Image of the publisher of the media',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
|
UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)),
|
||||||
INDEX `uri-id-id` (`uri-id`,`id`),
|
INDEX `uri-id-id` (`uri-id`,`id`),
|
||||||
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
INDEX `media-uri-id` (`media-uri-id`),
|
||||||
|
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
|
||||||
|
FOREIGN KEY (`media-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
|
||||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';
|
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1408,6 +1437,7 @@ CREATE TABLE IF NOT EXISTS `post-user` (
|
||||||
INDEX `author-id_uid` (`author-id`,`uid`),
|
INDEX `author-id_uid` (`author-id`,`uid`),
|
||||||
INDEX `author-id_received` (`author-id`,`received`),
|
INDEX `author-id_received` (`author-id`,`received`),
|
||||||
INDEX `parent-uri-id_uid` (`parent-uri-id`,`uid`),
|
INDEX `parent-uri-id_uid` (`parent-uri-id`,`uid`),
|
||||||
|
INDEX `uid_wall_received` (`uid`,`wall`,`received`),
|
||||||
INDEX `uid_contactid` (`uid`,`contact-id`),
|
INDEX `uid_contactid` (`uid`,`contact-id`),
|
||||||
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
|
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
|
||||||
INDEX `uid_unseen` (`uid`,`unseen`),
|
INDEX `uid_unseen` (`uid`,`unseen`),
|
||||||
|
@ -1549,8 +1579,8 @@ CREATE TABLE IF NOT EXISTS `profile` (
|
||||||
`homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
|
`xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
|
||||||
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
|
`matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
|
||||||
`photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`thumb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`thumb` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish default profile in local directory',
|
`publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish default profile in local directory',
|
||||||
`net-publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish profile in global directory',
|
`net-publish` boolean NOT NULL DEFAULT '0' COMMENT 'publish profile in global directory',
|
||||||
PRIMARY KEY(`id`),
|
PRIMARY KEY(`id`),
|
||||||
|
@ -1585,7 +1615,7 @@ CREATE TABLE IF NOT EXISTS `profile_field` (
|
||||||
CREATE TABLE IF NOT EXISTS `push_subscriber` (
|
CREATE TABLE IF NOT EXISTS `push_subscriber` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
||||||
`callback_url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`callback_url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`topic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`topic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`push` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter',
|
`push` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter',
|
||||||
|
@ -1604,7 +1634,7 @@ CREATE TABLE IF NOT EXISTS `push_subscriber` (
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `register` (
|
CREATE TABLE IF NOT EXISTS `register` (
|
||||||
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
`id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
|
||||||
`hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`hash` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||||
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
`uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
|
||||||
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
`password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
|
||||||
|
@ -1704,7 +1734,7 @@ CREATE TABLE IF NOT EXISTS `user-contact` (
|
||||||
`fetch_further_information` tinyint unsigned COMMENT '',
|
`fetch_further_information` tinyint unsigned COMMENT '',
|
||||||
`ffi_keyword_denylist` text COMMENT '',
|
`ffi_keyword_denylist` text COMMENT '',
|
||||||
`subhub` boolean COMMENT '',
|
`subhub` boolean COMMENT '',
|
||||||
`hub-verify` varchar(255) COMMENT '',
|
`hub-verify` varbinary(383) COMMENT '',
|
||||||
`protocol` char(4) COMMENT 'Protocol of the contact',
|
`protocol` char(4) COMMENT 'Protocol of the contact',
|
||||||
`rating` tinyint COMMENT 'Automatically detected feed poll frequency',
|
`rating` tinyint COMMENT 'Automatically detected feed poll frequency',
|
||||||
`priority` tinyint unsigned COMMENT 'Feed poll priority',
|
`priority` tinyint unsigned COMMENT 'Feed poll priority',
|
||||||
|
@ -1720,7 +1750,7 @@ CREATE TABLE IF NOT EXISTS `user-contact` (
|
||||||
-- TABLE arrived-activity
|
-- TABLE arrived-activity
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `arrived-activity` (
|
CREATE TABLE IF NOT EXISTS `arrived-activity` (
|
||||||
`object-id` varbinary(255) NOT NULL COMMENT 'object id of the incoming activity',
|
`object-id` varbinary(383) NOT NULL COMMENT 'object id of the incoming activity',
|
||||||
`received` datetime COMMENT 'Receiving date',
|
`received` datetime COMMENT 'Receiving date',
|
||||||
PRIMARY KEY(`object-id`)
|
PRIMARY KEY(`object-id`)
|
||||||
) ENGINE=MEMORY DEFAULT COLLATE utf8mb4_general_ci COMMENT='Id of arrived activities';
|
) ENGINE=MEMORY DEFAULT COLLATE utf8mb4_general_ci COMMENT='Id of arrived activities';
|
||||||
|
@ -1729,7 +1759,7 @@ CREATE TABLE IF NOT EXISTS `arrived-activity` (
|
||||||
-- TABLE fetched-activity
|
-- TABLE fetched-activity
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS `fetched-activity` (
|
CREATE TABLE IF NOT EXISTS `fetched-activity` (
|
||||||
`object-id` varbinary(255) NOT NULL COMMENT 'object id of fetched activity',
|
`object-id` varbinary(383) NOT NULL COMMENT 'object id of fetched activity',
|
||||||
`received` datetime COMMENT 'Receiving date',
|
`received` datetime COMMENT 'Receiving date',
|
||||||
PRIMARY KEY(`object-id`)
|
PRIMARY KEY(`object-id`)
|
||||||
) ENGINE=MEMORY DEFAULT COLLATE utf8mb4_general_ci COMMENT='Id of fetched activities';
|
) ENGINE=MEMORY DEFAULT COLLATE utf8mb4_general_ci COMMENT='Id of fetched activities';
|
||||||
|
@ -1783,6 +1813,8 @@ CREATE VIEW `post-user-view` AS SELECT
|
||||||
`post-user`.`thr-parent-id` AS `thr-parent-id`,
|
`post-user`.`thr-parent-id` AS `thr-parent-id`,
|
||||||
`conversation-item-uri`.`uri` AS `conversation`,
|
`conversation-item-uri`.`uri` AS `conversation`,
|
||||||
`post-thread-user`.`conversation-id` AS `conversation-id`,
|
`post-thread-user`.`conversation-id` AS `conversation-id`,
|
||||||
|
`quote-item-uri`.`uri` AS `quote-uri`,
|
||||||
|
`post-content`.`quote-uri-id` AS `quote-uri-id`,
|
||||||
`item-uri`.`guid` AS `guid`,
|
`item-uri`.`guid` AS `guid`,
|
||||||
`post-user`.`wall` AS `wall`,
|
`post-user`.`wall` AS `wall`,
|
||||||
`post-user`.`gravity` AS `gravity`,
|
`post-user`.`gravity` AS `gravity`,
|
||||||
|
@ -1938,6 +1970,7 @@ CREATE VIEW `post-user-view` AS SELECT
|
||||||
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
|
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
|
||||||
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
|
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-user`.`uri-id`
|
||||||
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
|
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-user`.`uri-id`
|
||||||
|
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
|
||||||
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
|
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-user`.`uri-id` AND `post-user`.`origin`
|
||||||
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
|
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-user`.`uri-id`
|
||||||
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
|
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-user`.`psid`
|
||||||
|
@ -1961,6 +1994,8 @@ CREATE VIEW `post-thread-user-view` AS SELECT
|
||||||
`post-user`.`thr-parent-id` AS `thr-parent-id`,
|
`post-user`.`thr-parent-id` AS `thr-parent-id`,
|
||||||
`conversation-item-uri`.`uri` AS `conversation`,
|
`conversation-item-uri`.`uri` AS `conversation`,
|
||||||
`post-thread-user`.`conversation-id` AS `conversation-id`,
|
`post-thread-user`.`conversation-id` AS `conversation-id`,
|
||||||
|
`quote-item-uri`.`uri` AS `quote-uri`,
|
||||||
|
`post-content`.`quote-uri-id` AS `quote-uri-id`,
|
||||||
`item-uri`.`guid` AS `guid`,
|
`item-uri`.`guid` AS `guid`,
|
||||||
`post-thread-user`.`wall` AS `wall`,
|
`post-thread-user`.`wall` AS `wall`,
|
||||||
`post-user`.`gravity` AS `gravity`,
|
`post-user`.`gravity` AS `gravity`,
|
||||||
|
@ -2114,6 +2149,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT
|
||||||
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
|
LEFT JOIN `event` ON `event`.`id` = `post-user`.`event-id`
|
||||||
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
|
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread-user`.`uri-id`
|
||||||
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
|
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread-user`.`uri-id`
|
||||||
|
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
|
||||||
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
|
LEFT JOIN `post-delivery-data` ON `post-delivery-data`.`uri-id` = `post-thread-user`.`uri-id` AND `post-thread-user`.`origin`
|
||||||
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
|
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread-user`.`uri-id`
|
||||||
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
|
LEFT JOIN `permissionset` ON `permissionset`.`id` = `post-thread-user`.`psid`
|
||||||
|
@ -2133,6 +2169,8 @@ CREATE VIEW `post-view` AS SELECT
|
||||||
`post`.`thr-parent-id` AS `thr-parent-id`,
|
`post`.`thr-parent-id` AS `thr-parent-id`,
|
||||||
`conversation-item-uri`.`uri` AS `conversation`,
|
`conversation-item-uri`.`uri` AS `conversation`,
|
||||||
`post-thread`.`conversation-id` AS `conversation-id`,
|
`post-thread`.`conversation-id` AS `conversation-id`,
|
||||||
|
`quote-item-uri`.`uri` AS `quote-uri`,
|
||||||
|
`post-content`.`quote-uri-id` AS `quote-uri-id`,
|
||||||
`item-uri`.`guid` AS `guid`,
|
`item-uri`.`guid` AS `guid`,
|
||||||
`post`.`gravity` AS `gravity`,
|
`post`.`gravity` AS `gravity`,
|
||||||
`external-item-uri`.`uri` AS `extid`,
|
`external-item-uri`.`uri` AS `extid`,
|
||||||
|
@ -2255,6 +2293,7 @@ CREATE VIEW `post-view` AS SELECT
|
||||||
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
|
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
|
||||||
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
|
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post`.`uri-id`
|
||||||
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
|
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post`.`uri-id`
|
||||||
|
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
|
||||||
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
|
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post`.`uri-id`
|
||||||
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
|
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
|
||||||
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
|
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
|
||||||
|
@ -2272,6 +2311,8 @@ CREATE VIEW `post-thread-view` AS SELECT
|
||||||
`post`.`thr-parent-id` AS `thr-parent-id`,
|
`post`.`thr-parent-id` AS `thr-parent-id`,
|
||||||
`conversation-item-uri`.`uri` AS `conversation`,
|
`conversation-item-uri`.`uri` AS `conversation`,
|
||||||
`post-thread`.`conversation-id` AS `conversation-id`,
|
`post-thread`.`conversation-id` AS `conversation-id`,
|
||||||
|
`quote-item-uri`.`uri` AS `quote-uri`,
|
||||||
|
`post-content`.`quote-uri-id` AS `quote-uri-id`,
|
||||||
`item-uri`.`guid` AS `guid`,
|
`item-uri`.`guid` AS `guid`,
|
||||||
`post`.`gravity` AS `gravity`,
|
`post`.`gravity` AS `gravity`,
|
||||||
`external-item-uri`.`uri` AS `extid`,
|
`external-item-uri`.`uri` AS `extid`,
|
||||||
|
@ -2394,6 +2435,7 @@ CREATE VIEW `post-thread-view` AS SELECT
|
||||||
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
|
LEFT JOIN `verb` ON `verb`.`id` = `post`.`vid`
|
||||||
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
|
LEFT JOIN `diaspora-interaction` ON `diaspora-interaction`.`uri-id` = `post-thread`.`uri-id`
|
||||||
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
|
LEFT JOIN `post-content` ON `post-content`.`uri-id` = `post-thread`.`uri-id`
|
||||||
|
LEFT JOIN `item-uri` AS `quote-item-uri` ON `quote-item-uri`.`id` = `post-content`.`quote-uri-id`
|
||||||
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
|
LEFT JOIN `post-question` ON `post-question`.`uri-id` = `post-thread`.`uri-id`
|
||||||
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
|
LEFT JOIN `post` AS `parent-post` ON `parent-post`.`uri-id` = `post`.`parent-uri-id`
|
||||||
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
|
LEFT JOIN `contact` AS `parent-post-author` ON `parent-post-author`.`id` = `parent-post`.`author-id`;
|
||||||
|
@ -2419,7 +2461,7 @@ DROP VIEW IF EXISTS `collection-view`;
|
||||||
CREATE VIEW `collection-view` AS SELECT
|
CREATE VIEW `collection-view` AS SELECT
|
||||||
`post-collection`.`uri-id` AS `uri-id`,
|
`post-collection`.`uri-id` AS `uri-id`,
|
||||||
`post-collection`.`type` AS `type`,
|
`post-collection`.`type` AS `type`,
|
||||||
`post`.`author-id` AS `cid`,
|
`post-collection`.`author-id` AS `cid`,
|
||||||
`post`.`received` AS `received`,
|
`post`.`received` AS `received`,
|
||||||
`post`.`created` AS `created`,
|
`post`.`created` AS `created`,
|
||||||
`post-thread`.`commented` AS `commented`,
|
`post-thread`.`commented` AS `commented`,
|
||||||
|
@ -2427,7 +2469,7 @@ CREATE VIEW `collection-view` AS SELECT
|
||||||
`post`.`visible` AS `visible`,
|
`post`.`visible` AS `visible`,
|
||||||
`post`.`deleted` AS `deleted`,
|
`post`.`deleted` AS `deleted`,
|
||||||
`post`.`thr-parent-id` AS `thr-parent-id`,
|
`post`.`thr-parent-id` AS `thr-parent-id`,
|
||||||
`post`.`author-id` AS `author-id`,
|
`post-collection`.`author-id` AS `author-id`,
|
||||||
`post`.`gravity` AS `gravity`
|
`post`.`gravity` AS `gravity`
|
||||||
FROM `post-collection`
|
FROM `post-collection`
|
||||||
INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
|
INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
|
||||||
|
|
|
@ -410,13 +410,13 @@ Ex: Wed May 23 06:01:13 +0000 2007
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>startTime</code></td>
|
<td><code>start_time</code></td>
|
||||||
<td>String (UTC <code>YYYY-MM-DD HH:II:SS)</code>)</td>
|
<td>String (UTC <code>YYYY-MM-DD HH:II:SS)</code>)</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>endTime</code></td>
|
<td><code>end_time</code></td>
|
||||||
<td>String (UTC <code>YYYY-MM-DD HH:II:SS)</code>)</td>
|
<td>String (UTC <code>YYYY-MM-DD HH:II:SS)</code>)</td>
|
||||||
<td>Optional (null date is <code>0001-01-01 00:00:00</code></td>
|
<td>Optional (null date is <code>0001-01-01 00:00:00</code></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -24,6 +24,32 @@ Returns a list of [Event](help/API-Entities#Event) entities for the current logg
|
||||||
- `since_id`: (optional) minimum event id for pagination
|
- `since_id`: (optional) minimum event id for pagination
|
||||||
- `count`: maximum number of items returned, default 20
|
- `count`: maximum number of items returned, default 20
|
||||||
|
|
||||||
|
### POST api/friendica/event_create
|
||||||
|
|
||||||
|
Create a new event for the current logged in user.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `id` : (optional) id of event, event will be amended if supplied
|
||||||
|
- `name` : name of the event (required)
|
||||||
|
- `start_time` : start of the event (ISO), required
|
||||||
|
- `end_time` : (optional) end of the event, event is open end, if not supplied
|
||||||
|
- `desc` : (optional) description of the event
|
||||||
|
- `place` : (optional) location of the event
|
||||||
|
- `publish` : (optional) create message for event
|
||||||
|
- `allow_cid` : (optional) ACL-formatted list of allowed contact ids if private event
|
||||||
|
- `allow_gid` : (optional) ACL-formatted list of disallowed contact ids if private event
|
||||||
|
- `deny_cid` : (optional) ACL-formatted list of allowed group ids if private event
|
||||||
|
- `deny_gid` : (optional) ACL-formatted list of disallowed group ids if private event
|
||||||
|
|
||||||
|
### POST api/friendica/event_delete
|
||||||
|
|
||||||
|
Delete event from calendar (not the message)
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `id` : id of event to be deleted
|
||||||
|
|
||||||
### GET api/externalprofile/show
|
### GET api/externalprofile/show
|
||||||
|
|
||||||
Returns a [Contact](help/API-Entities#Contact) entity for the provided profile URL.
|
Returns a [Contact](help/API-Entities#Contact) entity for the provided profile URL.
|
||||||
|
|
|
@ -281,7 +281,7 @@ $data = [
|
||||||
'submit' => [
|
'submit' => [
|
||||||
'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'),
|
'catavatar-usecat' => DI::l10n()->t('Use Cat as Avatar'),
|
||||||
'catavatar-morecat' => DI::l10n()->t('Another random Cat!'),
|
'catavatar-morecat' => DI::l10n()->t('Another random Cat!'),
|
||||||
'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
|
'catavatar-emailcat' => DI::pConfig()->get(Session::getLocalUser(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
@ -919,6 +919,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
|
||||||
Hook::callAll('block', $hook_data);
|
Hook::callAll('block', $hook_data);
|
||||||
Hook::callAll('unblock', $hook_data);
|
Hook::callAll('unblock', $hook_data);
|
||||||
|
|
||||||
|
### src/Core/Logger/Factory.php
|
||||||
|
|
||||||
|
Hook::callAll('logger_instance', $data);
|
||||||
|
|
||||||
### src/Core/StorageManager
|
### src/Core/StorageManager
|
||||||
|
|
||||||
Hook::callAll('storage_instance', $data);
|
Hook::callAll('storage_instance', $data);
|
||||||
|
|
|
@ -6,7 +6,7 @@ Using Composer
|
||||||
|
|
||||||
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
||||||
|
|
||||||
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
|
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
|
||||||
|
|
||||||
* [Class autoloading](help/autoloader)
|
* [Class autoloading](help/autoloader)
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ function doSomething(array $intros)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => local_user()]);
|
$intros = \Friendica\Database\DBA::selectToArray('intros', [], ['uid' => Session::getLocalUser()]);
|
||||||
|
|
||||||
doSomething($intros);
|
doSomething($intros);
|
||||||
```
|
```
|
||||||
|
@ -47,7 +47,7 @@ function doSomething(\Friendica\Contact\Introductions\Collection\Introductions $
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var $intros \Friendica\Contact\Introductions\Collection\Introductions */
|
/** @var $intros \Friendica\Contact\Introductions\Collection\Introductions */
|
||||||
$intros = \Friendica\DI::intro()->selecForUser(local_user());
|
$intros = \Friendica\DI::intro()->selecForUser(Session::getLocalUser());
|
||||||
|
|
||||||
doSomething($intros);
|
doSomething($intros);
|
||||||
```
|
```
|
||||||
|
|
|
@ -47,7 +47,7 @@ Friendica uses an implementation of [Domain-Driven-Design](help/Developer-Domain
|
||||||
|
|
||||||
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
||||||
|
|
||||||
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
|
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
|
||||||
|
|
||||||
If you want to have git automatically update the dependencies with composer, you can use the `post-merge` [git-hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) with a script similar to this one:
|
If you want to have git automatically update the dependencies with composer, you can use the `post-merge` [git-hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) with a script similar to this one:
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ Due to the large variety of operating systems and PHP platforms in existence we
|
||||||
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
|
* The POSIX module of PHP needs to be activated (e.g. [RHEL, CentOS](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) have disabled it)
|
||||||
* Some form of email server or email gateway such that PHP mail() works.
|
* Some form of email server or email gateway such that PHP mail() works.
|
||||||
If you cannot set up your own email server, you can use the [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) addon and use a remote SMTP server.
|
If you cannot set up your own email server, you can use the [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) addon and use a remote SMTP server.
|
||||||
* MySQL 5.6+ or an equivalent alternative for MySQL (MariaDB, Percona Server etc.)
|
* MySQL with support of InnoDB and Barracuda (we suggest a MariaDB server as all development is done using these, but alternatives like MySQL or Percona Server etc. might work as well)
|
||||||
* ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks (Windows)
|
* ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks (Windows)
|
||||||
* installation into a top-level domain or sub-domain (without a directory/path component in the URL) is RECOMMENDED. Directory paths will not be as convenient to use and have not been thoroughly tested. This is REQUIRED if you wish to communicate with the Diaspora network.
|
* installation into a top-level domain or sub-domain (without a directory/path component in the URL) is RECOMMENDED. Directory paths will not be as convenient to use and have not been thoroughly tested. This is REQUIRED if you wish to communicate with the Diaspora network.
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Getting started
|
||||||
No need to setup up a webserver, database etc. before actually starting.
|
No need to setup up a webserver, database etc. before actually starting.
|
||||||
Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica.
|
Vagrant creates a virtual machine for you that you can just run inside VirtualBox and start to work directly on Friendica.
|
||||||
|
|
||||||
It brings an Debian Bullseye with PHP 7.4 and MariaDB 10.5.11.
|
It brings an Debian Bullseye with PHP 8.0 and MariaDB 10.5.11.
|
||||||
|
|
||||||
What you need to do:
|
What you need to do:
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ This will start the virtual machine.
|
||||||
Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica.
|
Be patient: When it runs for the first time, it downloads a Debian Server image and installs Friendica.
|
||||||
4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server.
|
4. Run `vagrant ssh` to log into the virtual machine to log in to the VM in case you need to debug something on the server.
|
||||||
5. Open you test installation in a browser.
|
5. Open you test installation in a browser.
|
||||||
Go to friendica.local (or 192.168.22.10).
|
Go to friendica.local (or 192.168.56.10).
|
||||||
friendica.local is using a self-signed TLS certificate, so you will need to add an exception to trust the certificate the first time you are visiting the page.
|
friendica.local is using a self-signed TLS certificate, so you will need to add an exception to trust the certificate the first time you are visiting the page.
|
||||||
The mysql database is called "friendica", the mysql user and password both are "friendica".
|
The mysql database is called "friendica", the mysql user and password both are "friendica".
|
||||||
6. Work on Friendica's code in your git clone on your machine (not in the VM).
|
6. Work on Friendica's code in your git clone on your machine (not in the VM).
|
||||||
|
|
|
@ -6,7 +6,7 @@ Autoloader with Composer
|
||||||
|
|
||||||
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
Friendica uses [Composer](https://getcomposer.org) to manage dependencies libraries and the class autoloader both for libraries and namespaced Friendica classes.
|
||||||
|
|
||||||
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application through `boot.php`.
|
It's a command-line tool that downloads required libraries into the `vendor` folder and makes any namespaced class in `src` available through the whole application.
|
||||||
|
|
||||||
* [Using Composer](help/Composer)
|
* [Using Composer](help/Composer)
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ Namespaces are useful to keep classes separated and avoid names conflicts (could
|
||||||
|
|
||||||
Let's say now that you need to load some items in a view, maybe in a fictional `mod/network.php`.
|
Let's say now that you need to load some items in a view, maybe in a fictional `mod/network.php`.
|
||||||
In order for the Composer autoloader to work, it must first be included.
|
In order for the Composer autoloader to work, it must first be included.
|
||||||
In Friendica this is already done at the top of `boot.php`, with `require_once('vendor/autoload.php');`.
|
|
||||||
|
|
||||||
The code will be something like:
|
The code will be something like:
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ Database Tables
|
||||||
| [2fa_app_specific_password](help/database/db_2fa_app_specific_password) | Two-factor app-specific _password |
|
| [2fa_app_specific_password](help/database/db_2fa_app_specific_password) | Two-factor app-specific _password |
|
||||||
| [2fa_recovery_codes](help/database/db_2fa_recovery_codes) | Two-factor authentication recovery codes |
|
| [2fa_recovery_codes](help/database/db_2fa_recovery_codes) | Two-factor authentication recovery codes |
|
||||||
| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers |
|
| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers |
|
||||||
|
| [account-user](help/database/db_account-user) | Remote and local accounts |
|
||||||
| [addon](help/database/db_addon) | registered addons |
|
| [addon](help/database/db_addon) | registered addons |
|
||||||
| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation |
|
| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation |
|
||||||
| [application](help/database/db_application) | OAuth application |
|
| [application](help/database/db_application) | OAuth application |
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
Table account-user
|
||||||
|
===========
|
||||||
|
|
||||||
|
Remote and local accounts
|
||||||
|
|
||||||
|
Fields
|
||||||
|
------
|
||||||
|
|
||||||
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
|
| ------ | ------------------------------------------------------------ | ------------------ | ---- | --- | ------- | -------------- |
|
||||||
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
|
| uri-id | Id of the item-uri table entry that contains the account url | int unsigned | NO | | NULL | |
|
||||||
|
| uid | User ID | mediumint unsigned | NO | | NULL | |
|
||||||
|
|
||||||
|
Indexes
|
||||||
|
------------
|
||||||
|
|
||||||
|
| Name | Fields |
|
||||||
|
| ---------- | ------------------- |
|
||||||
|
| PRIMARY | id |
|
||||||
|
| uri-id_uid | UNIQUE, uri-id, uid |
|
||||||
|
| uid_uri-id | uid, uri-id |
|
||||||
|
|
||||||
|
Foreign Keys
|
||||||
|
------------
|
||||||
|
|
||||||
|
| Field | Target Table | Target Field |
|
||||||
|
|-------|--------------|--------------|
|
||||||
|
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
| uid | [user](help/database/db_user) | uid |
|
||||||
|
|
||||||
|
Return to [database documentation](help/database)
|
|
@ -8,17 +8,17 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ---------------- | ------------------------------------------------------------------- | -------------- | ---- | --- | ------------------- | ----- |
|
| ---------------- | ------------------------------------------------------------------- | -------------- | ---- | --- | ------------------- | ----- |
|
||||||
| url | URL of the contact | varbinary(255) | NO | PRI | NULL | |
|
| url | URL of the contact | varbinary(383) | NO | PRI | NULL | |
|
||||||
| uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
|
||||||
| uuid | | varchar(255) | YES | | NULL | |
|
| uuid | | varbinary(255) | YES | | NULL | |
|
||||||
| type | | varchar(20) | NO | | NULL | |
|
| type | | varchar(20) | NO | | NULL | |
|
||||||
| following | | varchar(255) | YES | | NULL | |
|
| following | | varbinary(383) | YES | | NULL | |
|
||||||
| followers | | varchar(255) | YES | | NULL | |
|
| followers | | varbinary(383) | YES | | NULL | |
|
||||||
| inbox | | varchar(255) | NO | | NULL | |
|
| inbox | | varbinary(383) | NO | | NULL | |
|
||||||
| outbox | | varchar(255) | YES | | NULL | |
|
| outbox | | varbinary(383) | YES | | NULL | |
|
||||||
| sharedinbox | | varchar(255) | YES | | NULL | |
|
| sharedinbox | | varbinary(383) | YES | | NULL | |
|
||||||
| featured | Address for the collection of featured posts | varchar(255) | YES | | NULL | |
|
| featured | Address for the collection of featured posts | varbinary(383) | YES | | NULL | |
|
||||||
| featured-tags | Address for the collection of featured tags | varchar(255) | YES | | NULL | |
|
| featured-tags | Address for the collection of featured tags | varbinary(383) | YES | | NULL | |
|
||||||
| manually-approve | | boolean | YES | | NULL | |
|
| manually-approve | | boolean | YES | | NULL | |
|
||||||
| discoverable | Mastodon extension: true if profile is published in their directory | boolean | YES | | NULL | |
|
| discoverable | Mastodon extension: true if profile is published in their directory | boolean | YES | | NULL | |
|
||||||
| suspended | Mastodon extension: true if profile is suspended | boolean | YES | | NULL | |
|
| suspended | Mastodon extension: true if profile is suspended | boolean | YES | | NULL | |
|
||||||
|
@ -27,13 +27,13 @@ Fields
|
||||||
| about | | text | YES | | NULL | |
|
| about | | text | YES | | NULL | |
|
||||||
| xmpp | XMPP address | varchar(255) | YES | | NULL | |
|
| xmpp | XMPP address | varchar(255) | YES | | NULL | |
|
||||||
| matrix | Matrix address | varchar(255) | YES | | NULL | |
|
| matrix | Matrix address | varchar(255) | YES | | NULL | |
|
||||||
| photo | | varchar(255) | YES | | NULL | |
|
| photo | | varbinary(383) | YES | | NULL | |
|
||||||
| header | Header picture | varchar(255) | YES | | NULL | |
|
| header | Header picture | varbinary(383) | YES | | NULL | |
|
||||||
| addr | | varchar(255) | YES | | NULL | |
|
| addr | | varchar(255) | YES | | NULL | |
|
||||||
| alias | | varchar(255) | YES | | NULL | |
|
| alias | | varbinary(383) | YES | | NULL | |
|
||||||
| pubkey | | text | YES | | NULL | |
|
| pubkey | | text | YES | | NULL | |
|
||||||
| subscribe | | varchar(255) | YES | | NULL | |
|
| subscribe | | varbinary(383) | YES | | NULL | |
|
||||||
| baseurl | baseurl of the ap contact | varchar(255) | YES | | NULL | |
|
| baseurl | baseurl of the ap contact | varbinary(383) | YES | | NULL | |
|
||||||
| gsid | Global Server ID | int unsigned | YES | | NULL | |
|
| gsid | Global Server ID | int unsigned | YES | | NULL | |
|
||||||
| generator | Name of the contact's system | varchar(255) | YES | | NULL | |
|
| generator | Name of the contact's system | varchar(255) | YES | | NULL | |
|
||||||
| following_count | Number of following contacts | int unsigned | YES | | 0 | |
|
| following_count | Number of following contacts | int unsigned | YES | | 0 | |
|
||||||
|
|
|
@ -11,7 +11,7 @@ Fields
|
||||||
| application-id | | int unsigned | NO | PRI | NULL | |
|
| application-id | | int unsigned | NO | PRI | NULL | |
|
||||||
| uid | Owner User id | mediumint unsigned | NO | PRI | NULL | |
|
| uid | Owner User id | mediumint unsigned | NO | PRI | NULL | |
|
||||||
| timeline | Marker (home, notifications) | varchar(64) | NO | PRI | NULL | |
|
| timeline | Marker (home, notifications) | varchar(64) | NO | PRI | NULL | |
|
||||||
| last_read_id | Marker id for the timeline | varchar(255) | YES | | NULL | |
|
| last_read_id | Marker id for the timeline | varbinary(383) | YES | | NULL | |
|
||||||
| version | Version number | smallint unsigned | YES | | NULL | |
|
| version | Version number | smallint unsigned | YES | | NULL | |
|
||||||
| updated_at | creation time | datetime | YES | | NULL | |
|
| updated_at | creation time | datetime | YES | | NULL | |
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@ Fields
|
||||||
------
|
------
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------------- | --------------- | ------------ | ---- | --- | ------- | -------------- |
|
| ------------- | --------------- | -------------- | ---- | --- | ------- | -------------- |
|
||||||
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | generated index | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| client_id | | varchar(64) | NO | | NULL | |
|
| client_id | | varchar(64) | NO | | NULL | |
|
||||||
| client_secret | | varchar(64) | NO | | NULL | |
|
| client_secret | | varchar(64) | NO | | NULL | |
|
||||||
| name | | varchar(255) | NO | | NULL | |
|
| name | | varchar(255) | NO | | NULL | |
|
||||||
| redirect_uri | | varchar(255) | NO | | NULL | |
|
| redirect_uri | | varbinary(383) | NO | | NULL | |
|
||||||
| website | | varchar(255) | YES | | NULL | |
|
| website | | varbinary(383) | YES | | NULL | |
|
||||||
| scopes | | varchar(255) | YES | | NULL | |
|
| scopes | | varchar(255) | YES | | NULL | |
|
||||||
| read | Read scope | boolean | YES | | NULL | |
|
| read | Read scope | boolean | YES | | NULL | |
|
||||||
| write | Write scope | boolean | YES | | NULL | |
|
| write | Write scope | boolean | YES | | NULL | |
|
||||||
|
|
|
@ -8,7 +8,7 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------- | ---------------------------------- | -------------- | ---- | --- | ------- | ----- |
|
| --------- | ---------------------------------- | -------------- | ---- | --- | ------- | ----- |
|
||||||
| object-id | object id of the incoming activity | varbinary(255) | NO | PRI | NULL | |
|
| object-id | object id of the incoming activity | varbinary(383) | NO | PRI | NULL | |
|
||||||
| received | Receiving date | datetime | YES | | NULL | |
|
| received | Receiving date | datetime | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
|
|
|
@ -20,26 +20,28 @@ Fields
|
||||||
| keywords | public keywords (interests) of the contact | text | YES | | NULL | |
|
| keywords | public keywords (interests) of the contact | text | YES | | NULL | |
|
||||||
| xmpp | XMPP address | varchar(255) | NO | | | |
|
| xmpp | XMPP address | varchar(255) | NO | | | |
|
||||||
| matrix | Matrix address | varchar(255) | NO | | | |
|
| matrix | Matrix address | varchar(255) | NO | | | |
|
||||||
| avatar | | varchar(255) | NO | | | |
|
| avatar | | varbinary(383) | NO | | | |
|
||||||
| header | Header picture | varchar(255) | YES | | NULL | |
|
| header | Header picture | varbinary(383) | YES | | NULL | |
|
||||||
| url | | varchar(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| nurl | | varchar(255) | NO | | | |
|
| nurl | | varbinary(383) | NO | | | |
|
||||||
| uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | |
|
||||||
| addr | | varchar(255) | NO | | | |
|
| addr | | varchar(255) | NO | | | |
|
||||||
| alias | | varchar(255) | NO | | | |
|
| alias | | varbinary(383) | NO | | | |
|
||||||
| pubkey | RSA public key 4096 bit | text | YES | | NULL | |
|
| pubkey | RSA public key 4096 bit | text | YES | | NULL | |
|
||||||
| prvkey | RSA private key 4096 bit | text | YES | | NULL | |
|
| prvkey | RSA private key 4096 bit | text | YES | | NULL | |
|
||||||
| batch | | varchar(255) | NO | | | |
|
| batch | | varbinary(383) | NO | | | |
|
||||||
| notify | | varchar(255) | YES | | NULL | |
|
| notify | | varbinary(383) | YES | | NULL | |
|
||||||
| poll | | varchar(255) | YES | | NULL | |
|
| poll | | varbinary(383) | YES | | NULL | |
|
||||||
| subscribe | | varchar(255) | YES | | NULL | |
|
| subscribe | | varbinary(383) | YES | | NULL | |
|
||||||
| last-update | Date of the last try to update the contact info | datetime | NO | | 0001-01-01 00:00:00 | |
|
| last-update | Date of the last try to update the contact info | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
| next-update | Next connection request | datetime | YES | | NULL | |
|
||||||
| success_update | Date of the last successful contact update | datetime | NO | | 0001-01-01 00:00:00 | |
|
| success_update | Date of the last successful contact update | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| failure_update | Date of the last failed update | datetime | NO | | 0001-01-01 00:00:00 | |
|
| failure_update | Date of the last failed update | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| failed | Connection failed | boolean | YES | | NULL | |
|
| failed | Connection failed | boolean | YES | | NULL | |
|
||||||
| term-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| term-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| last-item | date of the last post | datetime | NO | | 0001-01-01 00:00:00 | |
|
| last-item | date of the last post | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| last-discovery | date of the last follower discovery | datetime | NO | | 0001-01-01 00:00:00 | |
|
| last-discovery | date of the last follower discovery | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
| local-data | Is true when there are posts with this contact on the system | boolean | YES | | NULL | |
|
||||||
| blocked | Node-wide block status | boolean | NO | | 1 | |
|
| blocked | Node-wide block status | boolean | NO | | 1 | |
|
||||||
| block_reason | Node-wide block reason | text | YES | | NULL | |
|
| block_reason | Node-wide block reason | text | YES | | NULL | |
|
||||||
| readonly | posts of the contact are readonly | boolean | NO | | 0 | |
|
| readonly | posts of the contact are readonly | boolean | NO | | 0 | |
|
||||||
|
@ -48,7 +50,7 @@ Fields
|
||||||
| archive | | boolean | NO | | 0 | |
|
| archive | | boolean | NO | | 0 | |
|
||||||
| unsearchable | Contact prefers to not be searchable | boolean | NO | | 0 | |
|
| unsearchable | Contact prefers to not be searchable | boolean | NO | | 0 | |
|
||||||
| sensitive | Contact posts sensitive content | boolean | NO | | 0 | |
|
| sensitive | Contact posts sensitive content | boolean | NO | | 0 | |
|
||||||
| baseurl | baseurl of the contact | varchar(255) | YES | | | |
|
| baseurl | baseurl of the contact | varbinary(383) | YES | | | |
|
||||||
| gsid | Global Server ID | int unsigned | YES | | NULL | |
|
| gsid | Global Server ID | int unsigned | YES | | NULL | |
|
||||||
| bd | | date | NO | | 0001-01-01 | |
|
| bd | | date | NO | | 0001-01-01 | |
|
||||||
| reason | | text | YES | | NULL | |
|
| reason | | text | YES | | NULL | |
|
||||||
|
@ -57,7 +59,7 @@ Fields
|
||||||
| rel | The kind of the relation between the user and the contact | tinyint unsigned | NO | | 0 | |
|
| rel | The kind of the relation between the user and the contact | tinyint unsigned | NO | | 0 | |
|
||||||
| protocol | Protocol of the contact | char(4) | NO | | | |
|
| protocol | Protocol of the contact | char(4) | NO | | | |
|
||||||
| subhub | | boolean | NO | | 0 | |
|
| subhub | | boolean | NO | | 0 | |
|
||||||
| hub-verify | | varchar(255) | NO | | | |
|
| hub-verify | | varbinary(383) | NO | | | |
|
||||||
| rating | Automatically detected feed poll frequency | tinyint | NO | | 0 | |
|
| rating | Automatically detected feed poll frequency | tinyint | NO | | 0 | |
|
||||||
| priority | Feed poll priority | tinyint unsigned | NO | | 0 | |
|
| priority | Feed poll priority | tinyint unsigned | NO | | 0 | |
|
||||||
| attag | | varchar(255) | NO | | | |
|
| attag | | varchar(255) | NO | | | |
|
||||||
|
@ -68,15 +70,15 @@ Fields
|
||||||
| notify_new_posts | | boolean | NO | | 0 | |
|
| notify_new_posts | | boolean | NO | | 0 | |
|
||||||
| fetch_further_information | | tinyint unsigned | NO | | 0 | |
|
| fetch_further_information | | tinyint unsigned | NO | | 0 | |
|
||||||
| ffi_keyword_denylist | | text | YES | | NULL | |
|
| ffi_keyword_denylist | | text | YES | | NULL | |
|
||||||
| photo | Link to the profile photo of the contact | varchar(255) | YES | | | |
|
| photo | Link to the profile photo of the contact | varbinary(383) | YES | | | |
|
||||||
| thumb | Link to the profile photo (thumb size) | varchar(255) | YES | | | |
|
| thumb | Link to the profile photo (thumb size) | varbinary(383) | YES | | | |
|
||||||
| micro | Link to the profile photo (micro size) | varchar(255) | YES | | | |
|
| micro | Link to the profile photo (micro size) | varbinary(383) | YES | | | |
|
||||||
| name-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| name-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| uri-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| uri-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| avatar-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| avatar-date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| request | | varchar(255) | YES | | NULL | |
|
| request | | varbinary(383) | YES | | NULL | |
|
||||||
| confirm | | varchar(255) | YES | | NULL | |
|
| confirm | | varbinary(383) | YES | | NULL | |
|
||||||
| poco | | varchar(255) | YES | | NULL | |
|
| poco | | varbinary(383) | YES | | NULL | |
|
||||||
| writable | | boolean | NO | | 0 | |
|
| writable | | boolean | NO | | 0 | |
|
||||||
| forum | contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead | boolean | NO | | 0 | |
|
| forum | contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead | boolean | NO | | 0 | |
|
||||||
| prv | contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead | boolean | NO | | 0 | |
|
| prv | contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead | boolean | NO | | 0 | |
|
||||||
|
@ -84,8 +86,8 @@ Fields
|
||||||
| site-pubkey | Deprecated | text | YES | | NULL | |
|
| site-pubkey | Deprecated | text | YES | | NULL | |
|
||||||
| gender | Deprecated | varchar(32) | NO | | | |
|
| gender | Deprecated | varchar(32) | NO | | | |
|
||||||
| duplex | Deprecated | boolean | NO | | 0 | |
|
| duplex | Deprecated | boolean | NO | | 0 | |
|
||||||
| issued-id | Deprecated | varchar(255) | NO | | | |
|
| issued-id | Deprecated | varbinary(383) | NO | | | |
|
||||||
| dfrn-id | Deprecated | varchar(255) | NO | | | |
|
| dfrn-id | Deprecated | varbinary(383) | NO | | | |
|
||||||
| aes_allow | Deprecated | boolean | NO | | 0 | |
|
| aes_allow | Deprecated | boolean | NO | | 0 | |
|
||||||
| ret-aes | Deprecated | boolean | NO | | 0 | |
|
| ret-aes | Deprecated | boolean | NO | | 0 | |
|
||||||
| usehub | Deprecated | boolean | NO | | 0 | |
|
| usehub | Deprecated | boolean | NO | | 0 | |
|
||||||
|
@ -112,12 +114,14 @@ Indexes
|
||||||
| attag_uid | attag(96), uid |
|
| attag_uid | attag(96), uid |
|
||||||
| network_uid_lastupdate | network, uid, last-update |
|
| network_uid_lastupdate | network, uid, last-update |
|
||||||
| uid_network_self_lastupdate | uid, network, self, last-update |
|
| uid_network_self_lastupdate | uid, network, self, last-update |
|
||||||
|
| next-update | next-update |
|
||||||
|
| local-data-next-update | local-data, next-update |
|
||||||
| uid_lastitem | uid, last-item |
|
| uid_lastitem | uid, last-item |
|
||||||
| baseurl | baseurl(64) |
|
| baseurl | baseurl(64) |
|
||||||
| uid_contact-type | uid, contact-type |
|
| uid_contact-type | uid, contact-type |
|
||||||
| uid_self_contact-type | uid, self, contact-type |
|
| uid_self_contact-type | uid, self, contact-type |
|
||||||
| self_network_uid | self, network, uid |
|
| self_network_uid | self, network, uid |
|
||||||
| gsid | gsid |
|
| gsid_uid_failed | gsid, uid, failed |
|
||||||
| uri-id | uri-id |
|
| uri-id | uri-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
|
|
|
@ -9,7 +9,7 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------- | ----------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
| ------- | ----------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| guid | A unique identifier for this conversation | varchar(255) | NO | | | |
|
| guid | A unique identifier for this conversation | varbinary(255) | NO | | | |
|
||||||
| recips | sender_handle;recipient_handle | text | YES | | NULL | |
|
| recips | sender_handle;recipient_handle | text | YES | | NULL | |
|
||||||
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
||||||
| creator | handle of creator | varchar(255) | NO | | | |
|
| creator | handle of creator | varchar(255) | NO | | | |
|
||||||
|
|
|
@ -9,7 +9,7 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------- | ---------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
|
| ------- | ---------------------------------------------- | ------------------ | ---- | --- | ------- | -------------- |
|
||||||
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| uri | URI of the post that will be distributed later | varchar(255) | YES | | NULL | |
|
| uri | URI of the post that will be distributed later | varbinary(383) | YES | | NULL | |
|
||||||
| uid | Owner User id | mediumint unsigned | YES | | NULL | |
|
| uid | Owner User id | mediumint unsigned | YES | | NULL | |
|
||||||
| delayed | delay time | datetime | YES | | NULL | |
|
| delayed | delay time | datetime | YES | | NULL | |
|
||||||
| wid | Workerqueue id | int unsigned | YES | | NULL | |
|
| wid | Workerqueue id | int unsigned | YES | | NULL | |
|
||||||
|
|
|
@ -8,7 +8,7 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------------ | -------------------------------------------------------------- | -------------- | ---- | --- | ------- | ----- |
|
| ------------ | -------------------------------------------------------------- | -------------- | ---- | --- | ------- | ----- |
|
||||||
| url | URL of the contact | varbinary(255) | NO | PRI | NULL | |
|
| url | URL of the contact | varbinary(383) | NO | PRI | NULL | |
|
||||||
| type | | varchar(20) | NO | | NULL | |
|
| type | | varchar(20) | NO | | NULL | |
|
||||||
| owner-uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
|
| owner-uri-id | Id of the item-uri table entry that contains the apcontact url | int unsigned | YES | | NULL | |
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------- | ---------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
| --------- | ---------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| guid | | varchar(255) | NO | | | |
|
| guid | | varbinary(255) | NO | | | |
|
||||||
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
||||||
| cid | contact_id (ID of the contact in contact table) | int unsigned | NO | | 0 | |
|
| cid | contact_id (ID of the contact in contact table) | int unsigned | NO | | 0 | |
|
||||||
| uri | | varchar(255) | NO | | | |
|
| uri | | varbinary(383) | NO | | | |
|
||||||
| uri-id | Id of the item-uri table entry that contains the event uri | int unsigned | YES | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the event uri | int unsigned | YES | | NULL | |
|
||||||
| created | creation time | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | creation time | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| edited | last edit time | datetime | NO | | 0001-01-01 00:00:00 | |
|
| edited | last edit time | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
|
@ -9,22 +9,23 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ----------------- | ------------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
|
| ----------------- | ------------------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| guid | unique id | varchar(255) | NO | | | |
|
| guid | unique id | varbinary(255) | NO | | | |
|
||||||
| url | | varchar(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| uri-id | Id of the item-uri table entry that contains the fcontact url | int unsigned | YES | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the fcontact url | int unsigned | YES | | NULL | |
|
||||||
| name | | varchar(255) | NO | | | |
|
| name | | varchar(255) | NO | | | |
|
||||||
| photo | | varchar(255) | NO | | | |
|
| photo | | varbinary(383) | NO | | | |
|
||||||
| request | | varchar(255) | NO | | | |
|
| request | | varbinary(383) | NO | | | |
|
||||||
| nick | | varchar(255) | NO | | | |
|
| nick | | varchar(255) | NO | | | |
|
||||||
| addr | | varchar(255) | NO | | | |
|
| addr | | varchar(255) | NO | | | |
|
||||||
| batch | | varchar(255) | NO | | | |
|
| batch | | varbinary(383) | NO | | | |
|
||||||
| notify | | varchar(255) | NO | | | |
|
| notify | | varbinary(383) | NO | | | |
|
||||||
| poll | | varchar(255) | NO | | | |
|
| poll | | varbinary(383) | NO | | | |
|
||||||
| confirm | | varchar(255) | NO | | | |
|
| confirm | | varbinary(383) | NO | | | |
|
||||||
| priority | | tinyint unsigned | NO | | 0 | |
|
| priority | | tinyint unsigned | NO | | 0 | |
|
||||||
| network | | char(4) | NO | | | |
|
| network | | char(4) | NO | | | |
|
||||||
| alias | | varchar(255) | NO | | | |
|
| alias | | varbinary(383) | NO | | | |
|
||||||
| pubkey | | text | YES | | NULL | |
|
| pubkey | | text | YES | | NULL | |
|
||||||
|
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| updated | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| interacting_count | Number of contacts this contact interactes with | int unsigned | YES | | 0 | |
|
| interacting_count | Number of contacts this contact interactes with | int unsigned | YES | | 0 | |
|
||||||
| interacted_count | Number of contacts that interacted with this contact | int unsigned | YES | | 0 | |
|
| interacted_count | Number of contacts that interacted with this contact | int unsigned | YES | | 0 | |
|
||||||
|
|
|
@ -9,7 +9,7 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------- | ---------------------------------- | -------------- | ---- | --- | ------------------- | -------------- |
|
| ------- | ---------------------------------- | -------------- | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| url | url that awaiting to be fetched | varbinary(255) | YES | | NULL | |
|
| url | url that awaiting to be fetched | varbinary(383) | YES | | NULL | |
|
||||||
| created | Creation date of the fetch request | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | Creation date of the fetch request | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| wid | Workerqueue id | int unsigned | YES | | NULL | |
|
| wid | Workerqueue id | int unsigned | YES | | NULL | |
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------- | ----------------------------- | -------------- | ---- | --- | ------- | ----- |
|
| --------- | ----------------------------- | -------------- | ---- | --- | ------- | ----- |
|
||||||
| object-id | object id of fetched activity | varbinary(255) | NO | PRI | NULL | |
|
| object-id | object id of fetched activity | varbinary(383) | NO | PRI | NULL | |
|
||||||
| received | Receiving date | datetime | YES | | NULL | |
|
| received | Receiving date | datetime | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
|
|
|
@ -12,9 +12,9 @@ Fields
|
||||||
| uid | User id | mediumint unsigned | NO | | 0 | |
|
| uid | User id | mediumint unsigned | NO | | 0 | |
|
||||||
| cid | | int unsigned | NO | | 0 | |
|
| cid | | int unsigned | NO | | 0 | |
|
||||||
| name | | varchar(255) | NO | | | |
|
| name | | varchar(255) | NO | | | |
|
||||||
| url | | varchar(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| request | | varchar(255) | NO | | | |
|
| request | | varbinary(383) | NO | | | |
|
||||||
| photo | | varchar(255) | NO | | | |
|
| photo | | varbinary(383) | NO | | | |
|
||||||
| note | | text | YES | | NULL | |
|
| note | | text | YES | | NULL | |
|
||||||
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------------------- | -------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
|
| --------------------- | -------------------------------------------------- | ---------------- | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| url | | varchar(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| nurl | | varchar(255) | NO | | | |
|
| nurl | | varbinary(383) | NO | | | |
|
||||||
| version | | varchar(255) | NO | | | |
|
| version | | varchar(255) | NO | | | |
|
||||||
| site_name | | varchar(255) | NO | | | |
|
| site_name | | varchar(255) | NO | | | |
|
||||||
| info | | text | YES | | NULL | |
|
| info | | text | YES | | NULL | |
|
||||||
|
@ -22,8 +22,8 @@ Fields
|
||||||
| local-posts | Number of local posts | int unsigned | YES | | NULL | |
|
| local-posts | Number of local posts | int unsigned | YES | | NULL | |
|
||||||
| local-comments | Number of local comments | int unsigned | YES | | NULL | |
|
| local-comments | Number of local comments | int unsigned | YES | | NULL | |
|
||||||
| directory-type | Type of directory service (Poco, Mastodon) | tinyint | YES | | 0 | |
|
| directory-type | Type of directory service (Poco, Mastodon) | tinyint | YES | | 0 | |
|
||||||
| poco | | varchar(255) | NO | | | |
|
| poco | | varbinary(383) | NO | | | |
|
||||||
| noscrape | | varchar(255) | NO | | | |
|
| noscrape | | varbinary(383) | NO | | | |
|
||||||
| network | | char(4) | NO | | | |
|
| network | | char(4) | NO | | | |
|
||||||
| protocol | The protocol of the server | tinyint unsigned | YES | | NULL | |
|
| protocol | The protocol of the server | tinyint unsigned | YES | | NULL | |
|
||||||
| platform | | varchar(255) | NO | | | |
|
| platform | | varchar(255) | NO | | | |
|
||||||
|
|
|
@ -9,10 +9,10 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------------------ | -------------------------------------- | -------------- | ---- | --- | ------- | -------------- |
|
| ------------------ | -------------------------------------- | -------------- | ---- | --- | ------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| activity-id | id of the incoming activity | varbinary(255) | YES | | NULL | |
|
| activity-id | id of the incoming activity | varbinary(383) | YES | | NULL | |
|
||||||
| object-id | | varbinary(255) | YES | | NULL | |
|
| object-id | | varbinary(383) | YES | | NULL | |
|
||||||
| in-reply-to-id | | varbinary(255) | YES | | NULL | |
|
| in-reply-to-id | | varbinary(383) | YES | | NULL | |
|
||||||
| conversation | | varbinary(255) | YES | | NULL | |
|
| conversation | | varbinary(383) | YES | | NULL | |
|
||||||
| type | Type of the activity | varchar(64) | YES | | NULL | |
|
| type | Type of the activity | varchar(64) | YES | | NULL | |
|
||||||
| object-type | Type of the object activity | varchar(64) | YES | | NULL | |
|
| object-type | Type of the object activity | varchar(64) | YES | | NULL | |
|
||||||
| object-object-type | Type of the object's object activity | varchar(64) | YES | | NULL | |
|
| object-object-type | Type of the object's object activity | varchar(64) | YES | | NULL | |
|
||||||
|
|
|
@ -8,7 +8,7 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| -------- | ------------------------------------ | -------------- | ---- | --- | ------------------- | ----- |
|
| -------- | ------------------------------------ | -------------- | ---- | --- | ------------------- | ----- |
|
||||||
| url | URL of the inbox | varbinary(255) | NO | PRI | NULL | |
|
| url | URL of the inbox | varbinary(383) | NO | PRI | NULL | |
|
||||||
| uri-id | Item-uri id of inbox url | int unsigned | YES | | NULL | |
|
| uri-id | Item-uri id of inbox url | int unsigned | YES | | NULL | |
|
||||||
| created | Creation date of this entry | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | Creation date of this entry | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| success | Date of the last successful delivery | datetime | NO | | 0001-01-01 00:00:00 | |
|
| success | Date of the last successful delivery | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
|
@ -16,7 +16,7 @@ Fields
|
||||||
| knowyou | | boolean | NO | | 0 | |
|
| knowyou | | boolean | NO | | 0 | |
|
||||||
| duplex | deprecated | boolean | NO | | 0 | |
|
| duplex | deprecated | boolean | NO | | 0 | |
|
||||||
| note | | text | YES | | NULL | |
|
| note | | text | YES | | NULL | |
|
||||||
| hash | | varchar(255) | NO | | | |
|
| hash | | varbinary(255) | NO | | | |
|
||||||
| datetime | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| datetime | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| blocked | deprecated | boolean | NO | | 0 | |
|
| blocked | deprecated | boolean | NO | | 0 | |
|
||||||
| ignore | | boolean | NO | | 0 | |
|
| ignore | | boolean | NO | | 0 | |
|
||||||
|
|
|
@ -9,7 +9,7 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ----- | ------------------------------- | -------------- | ---- | --- | ------- | -------------- |
|
| ----- | ------------------------------- | -------------- | ---- | --- | ------- | -------------- |
|
||||||
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| uri | URI of an item | varbinary(255) | NO | | NULL | |
|
| uri | URI of an item | varbinary(383) | NO | | NULL | |
|
||||||
| guid | A unique identifier for an item | varbinary(255) | YES | | NULL | |
|
| guid | A unique identifier for an item | varbinary(255) | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
|
|
|
@ -10,11 +10,11 @@ Fields
|
||||||
| ------------- | -------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
| ------------- | -------------------------------------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
||||||
| guid | A unique identifier for this private message | varchar(255) | NO | | | |
|
| guid | A unique identifier for this private message | varbinary(255) | NO | | | |
|
||||||
| from-name | name of the sender | varchar(255) | NO | | | |
|
| from-name | name of the sender | varchar(255) | NO | | | |
|
||||||
| from-photo | contact photo link of the sender | varchar(255) | NO | | | |
|
| from-photo | contact photo link of the sender | varbinary(383) | NO | | | |
|
||||||
| from-url | profile linke of the sender | varchar(255) | NO | | | |
|
| from-url | profile linke of the sender | varbinary(383) | NO | | | |
|
||||||
| contact-id | contact.id | varchar(255) | YES | | NULL | |
|
| contact-id | contact.id | varbinary(255) | YES | | NULL | |
|
||||||
| author-id | Link to the contact table with uid=0 of the author of the mail | int unsigned | YES | | NULL | |
|
| author-id | Link to the contact table with uid=0 of the author of the mail | int unsigned | YES | | NULL | |
|
||||||
| convid | conv.id | int unsigned | YES | | NULL | |
|
| convid | conv.id | int unsigned | YES | | NULL | |
|
||||||
| title | | varchar(255) | NO | | | |
|
| title | | varchar(255) | NO | | | |
|
||||||
|
@ -23,11 +23,11 @@ Fields
|
||||||
| reply | | boolean | NO | | 0 | |
|
| reply | | boolean | NO | | 0 | |
|
||||||
| replied | | boolean | NO | | 0 | |
|
| replied | | boolean | NO | | 0 | |
|
||||||
| unknown | if sender not in the contact table this is 1 | boolean | NO | | 0 | |
|
| unknown | if sender not in the contact table this is 1 | boolean | NO | | 0 | |
|
||||||
| uri | | varchar(255) | NO | | | |
|
| uri | | varbinary(383) | NO | | | |
|
||||||
| uri-id | Item-uri id of the related mail | int unsigned | YES | | NULL | |
|
| uri-id | Item-uri id of the related mail | int unsigned | YES | | NULL | |
|
||||||
| parent-uri | | varchar(255) | NO | | | |
|
| parent-uri | | varbinary(383) | NO | | | |
|
||||||
| parent-uri-id | Item-uri id of the parent of the related mail | int unsigned | YES | | NULL | |
|
| parent-uri-id | Item-uri id of the parent of the related mail | int unsigned | YES | | NULL | |
|
||||||
| thr-parent | | varchar(255) | YES | | NULL | |
|
| thr-parent | | varbinary(383) | YES | | NULL | |
|
||||||
| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | YES | | NULL | |
|
| thr-parent-id | Id of the item-uri table that contains the thread parent uri | int unsigned | YES | | NULL | |
|
||||||
| created | creation time of the private message | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | creation time of the private message | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ Indexes
|
||||||
| target-uri-id | target-uri-id |
|
| target-uri-id | target-uri-id |
|
||||||
| parent-uri-id | parent-uri-id |
|
| parent-uri-id | parent-uri-id |
|
||||||
| seen_uid | seen, uid |
|
| seen_uid | seen, uid |
|
||||||
|
| uid_type_parent-uri-id_actor-id | uid, type, parent-uri-id, actor-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -11,12 +11,12 @@ Fields
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| type | | smallint unsigned | NO | | 0 | |
|
| type | | smallint unsigned | NO | | 0 | |
|
||||||
| name | | varchar(255) | NO | | | |
|
| name | | varchar(255) | NO | | | |
|
||||||
| url | | varchar(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| photo | | varchar(255) | NO | | | |
|
| photo | | varbinary(383) | NO | | | |
|
||||||
| date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| date | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| msg | | mediumtext | YES | | NULL | |
|
| msg | | mediumtext | YES | | NULL | |
|
||||||
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
| uid | Owner User id | mediumint unsigned | NO | | 0 | |
|
||||||
| link | | varchar(255) | NO | | | |
|
| link | | varbinary(383) | NO | | | |
|
||||||
| iid | | int unsigned | YES | | NULL | |
|
| iid | | int unsigned | YES | | NULL | |
|
||||||
| parent | | int unsigned | YES | | NULL | |
|
| parent | | int unsigned | YES | | NULL | |
|
||||||
| uri-id | Item-uri id of the related post | int unsigned | YES | | NULL | |
|
| uri-id | Item-uri id of the related post | int unsigned | YES | | NULL | |
|
||||||
|
|
|
@ -8,7 +8,7 @@ Fields
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| -------- | ------------------------------ | ------------------ | ---- | --- | ------------------- | ----- |
|
| -------- | ------------------------------ | ------------------ | ---- | --- | ------------------- | ----- |
|
||||||
| url | page url | varbinary(255) | NO | PRI | NULL | |
|
| url | page url | varbinary(383) | NO | PRI | NULL | |
|
||||||
| maxwidth | Maximum width passed to Oembed | mediumint unsigned | NO | PRI | NULL | |
|
| maxwidth | Maximum width passed to Oembed | mediumint unsigned | NO | PRI | NULL | |
|
||||||
| content | OEmbed data of the page | mediumtext | YES | | NULL | |
|
| content | OEmbed data of the page | mediumtext | YES | | NULL | |
|
||||||
| created | datetime of creation | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | datetime of creation | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
|
|
|
@ -7,17 +7,19 @@ Fields
|
||||||
------
|
------
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| ------ | --------------------------------------------------------- | ---------------- | ---- | --- | ------- | ----- |
|
| --------- | --------------------------------------------------------- | ---------------- | ---- | --- | ------- | ----- |
|
||||||
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
||||||
| type | 0 - Featured | tinyint unsigned | NO | PRI | 0 | |
|
| type | 0 - Featured | tinyint unsigned | NO | PRI | 0 | |
|
||||||
|
| author-id | Author of the featured post | int unsigned | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
------------
|
------------
|
||||||
|
|
||||||
| Name | Fields |
|
| Name | Fields |
|
||||||
| ------- | ------------ |
|
| --------- | ------------ |
|
||||||
| PRIMARY | uri-id, type |
|
| PRIMARY | uri-id, type |
|
||||||
| type | type |
|
| type | type |
|
||||||
|
| author-id | author-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
------------
|
------------
|
||||||
|
@ -25,5 +27,6 @@ Foreign Keys
|
||||||
| Field | Target Table | Target Field |
|
| Field | Target Table | Target Field |
|
||||||
|-------|--------------|--------------|
|
|-------|--------------|--------------|
|
||||||
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
| author-id | [contact](help/database/db_contact) | id |
|
||||||
|
|
||||||
Return to [database documentation](help/database)
|
Return to [database documentation](help/database)
|
||||||
|
|
|
@ -7,12 +7,13 @@ Fields
|
||||||
------
|
------
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------ | ---- | --- | ------- | ----- |
|
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------- | ---- | --- | ------- | ----- |
|
||||||
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
||||||
| title | item title | varchar(255) | NO | | | |
|
| title | item title | varchar(255) | NO | | | |
|
||||||
| content-warning | | varchar(255) | NO | | | |
|
| content-warning | | varchar(255) | NO | | | |
|
||||||
| body | item body content | mediumtext | YES | | NULL | |
|
| body | item body content | mediumtext | YES | | NULL | |
|
||||||
| raw-body | Body without embedded media links | mediumtext | YES | | NULL | |
|
| raw-body | Body without embedded media links | mediumtext | YES | | NULL | |
|
||||||
|
| quote-uri-id | Id of the item-uri table that contains the quoted uri | int unsigned | YES | | NULL | |
|
||||||
| location | text location where this item originated | varchar(255) | NO | | | |
|
| location | text location where this item originated | varchar(255) | NO | | | |
|
||||||
| coord | longitude/latitude pair representing location where this item originated | varchar(255) | NO | | | |
|
| coord | longitude/latitude pair representing location where this item originated | varchar(255) | NO | | | |
|
||||||
| language | Language information about this post | text | YES | | NULL | |
|
| language | Language information about this post | text | YES | | NULL | |
|
||||||
|
@ -24,7 +25,7 @@ Fields
|
||||||
| target-type | ActivityStreams target type if applicable (URI) | varchar(100) | NO | | | |
|
| target-type | ActivityStreams target type if applicable (URI) | varchar(100) | NO | | | |
|
||||||
| target | JSON encoded target structure if used | text | YES | | NULL | |
|
| target | JSON encoded target structure if used | text | YES | | NULL | |
|
||||||
| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(32) | NO | | | |
|
| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(32) | NO | | | |
|
||||||
| plink | permalink or URL to a displayable copy of the message at its source | varchar(255) | NO | | | |
|
| plink | permalink or URL to a displayable copy of the message at its source | varbinary(383) | NO | | | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
------------
|
------------
|
||||||
|
@ -35,6 +36,7 @@ Indexes
|
||||||
| plink | plink(191) |
|
| plink | plink(191) |
|
||||||
| resource-id | resource-id |
|
| resource-id | resource-id |
|
||||||
| title-content-warning-body | FULLTEXT, title, content-warning, body |
|
| title-content-warning-body | FULLTEXT, title, content-warning, body |
|
||||||
|
| quote-uri-id | quote-uri-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
------------
|
------------
|
||||||
|
@ -42,5 +44,6 @@ Foreign Keys
|
||||||
| Field | Target Table | Target Field |
|
| Field | Target Table | Target Field |
|
||||||
|-------|--------------|--------------|
|
|-------|--------------|--------------|
|
||||||
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
| quote-uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
|
||||||
Return to [database documentation](help/database)
|
Return to [database documentation](help/database)
|
||||||
|
|
|
@ -7,7 +7,7 @@ Fields
|
||||||
------
|
------
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------ | ---- | --- | ------------------- | ----- |
|
| --------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------- | ---- | --- | ------------------- | ----- |
|
||||||
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | PRI | NULL | |
|
||||||
| edited | Date of edit | datetime | NO | PRI | 0001-01-01 00:00:00 | |
|
| edited | Date of edit | datetime | NO | PRI | 0001-01-01 00:00:00 | |
|
||||||
| title | item title | varchar(255) | NO | | | |
|
| title | item title | varchar(255) | NO | | | |
|
||||||
|
@ -25,7 +25,7 @@ Fields
|
||||||
| target-type | ActivityStreams target type if applicable (URI) | varchar(100) | NO | | | |
|
| target-type | ActivityStreams target type if applicable (URI) | varchar(100) | NO | | | |
|
||||||
| target | JSON encoded target structure if used | text | YES | | NULL | |
|
| target | JSON encoded target structure if used | text | YES | | NULL | |
|
||||||
| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(32) | NO | | | |
|
| resource-id | Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type | varchar(32) | NO | | | |
|
||||||
| plink | permalink or URL to a displayable copy of the message at its source | varchar(255) | NO | | | |
|
| plink | permalink or URL to a displayable copy of the message at its source | varbinary(383) | NO | | | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -7,10 +7,11 @@ Fields
|
||||||
------
|
------
|
||||||
|
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| --------------- | --------------------------------------------------------- | ----------------- | ---- | --- | ------- | -------------- |
|
| --------------- | ------------------------------------------------------------------ | ----------------- | ---- | --- | ------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
|
| uri-id | Id of the item-uri table entry that contains the item uri | int unsigned | NO | | NULL | |
|
||||||
| url | Media URL | varbinary(1024) | NO | | NULL | |
|
| url | Media URL | varbinary(1024) | NO | | NULL | |
|
||||||
|
| media-uri-id | Id of the item-uri table entry that contains the activities uri-id | int unsigned | YES | | NULL | |
|
||||||
| type | Media type | tinyint unsigned | NO | | 0 | |
|
| type | Media type | tinyint unsigned | NO | | 0 | |
|
||||||
| mimetype | | varchar(60) | YES | | NULL | |
|
| mimetype | | varchar(60) | YES | | NULL | |
|
||||||
| height | Height of the media | smallint unsigned | YES | | NULL | |
|
| height | Height of the media | smallint unsigned | YES | | NULL | |
|
||||||
|
@ -21,21 +22,22 @@ Fields
|
||||||
| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | |
|
| preview-width | Width of the preview picture | smallint unsigned | YES | | NULL | |
|
||||||
| description | | text | YES | | NULL | |
|
| description | | text | YES | | NULL | |
|
||||||
| name | Name of the media | varchar(255) | YES | | NULL | |
|
| name | Name of the media | varchar(255) | YES | | NULL | |
|
||||||
| author-url | URL of the author of the media | varbinary(255) | YES | | NULL | |
|
| author-url | URL of the author of the media | varbinary(383) | YES | | NULL | |
|
||||||
| author-name | Name of the author of the media | varchar(255) | YES | | NULL | |
|
| author-name | Name of the author of the media | varchar(255) | YES | | NULL | |
|
||||||
| author-image | Image of the author of the media | varbinary(255) | YES | | NULL | |
|
| author-image | Image of the author of the media | varbinary(383) | YES | | NULL | |
|
||||||
| publisher-url | URL of the publisher of the media | varbinary(255) | YES | | NULL | |
|
| publisher-url | URL of the publisher of the media | varbinary(383) | YES | | NULL | |
|
||||||
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
|
| publisher-name | Name of the publisher of the media | varchar(255) | YES | | NULL | |
|
||||||
| publisher-image | Image of the publisher of the media | varbinary(255) | YES | | NULL | |
|
| publisher-image | Image of the publisher of the media | varbinary(383) | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
------------
|
------------
|
||||||
|
|
||||||
| Name | Fields |
|
| Name | Fields |
|
||||||
| ---------- | ------------------------ |
|
| ------------ | ------------------------ |
|
||||||
| PRIMARY | id |
|
| PRIMARY | id |
|
||||||
| uri-id-url | UNIQUE, uri-id, url(512) |
|
| uri-id-url | UNIQUE, uri-id, url(512) |
|
||||||
| uri-id-id | uri-id, id |
|
| uri-id-id | uri-id, id |
|
||||||
|
| media-uri-id | media-uri-id |
|
||||||
|
|
||||||
Foreign Keys
|
Foreign Keys
|
||||||
------------
|
------------
|
||||||
|
@ -43,5 +45,6 @@ Foreign Keys
|
||||||
| Field | Target Table | Target Field |
|
| Field | Target Table | Target Field |
|
||||||
|-------|--------------|--------------|
|
|-------|--------------|--------------|
|
||||||
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
| uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
| media-uri-id | [item-uri](help/database/db_item-uri) | id |
|
||||||
|
|
||||||
Return to [database documentation](help/database)
|
Return to [database documentation](help/database)
|
||||||
|
|
|
@ -60,6 +60,7 @@ Indexes
|
||||||
| author-id_uid | author-id, uid |
|
| author-id_uid | author-id, uid |
|
||||||
| author-id_received | author-id, received |
|
| author-id_received | author-id, received |
|
||||||
| parent-uri-id_uid | parent-uri-id, uid |
|
| parent-uri-id_uid | parent-uri-id, uid |
|
||||||
|
| uid_wall_received | uid, wall, received |
|
||||||
| uid_contactid | uid, contact-id |
|
| uid_contactid | uid, contact-id |
|
||||||
| uid_unseen_contactid | uid, unseen, contact-id |
|
| uid_unseen_contactid | uid, unseen, contact-id |
|
||||||
| uid_unseen | uid, unseen |
|
| uid_unseen | uid, unseen |
|
||||||
|
|
|
@ -47,8 +47,8 @@ Fields
|
||||||
| homepage | | varchar(255) | NO | | | |
|
| homepage | | varchar(255) | NO | | | |
|
||||||
| xmpp | XMPP address | varchar(255) | NO | | | |
|
| xmpp | XMPP address | varchar(255) | NO | | | |
|
||||||
| matrix | Matrix address | varchar(255) | NO | | | |
|
| matrix | Matrix address | varchar(255) | NO | | | |
|
||||||
| photo | | varchar(255) | NO | | | |
|
| photo | | varbinary(383) | NO | | | |
|
||||||
| thumb | | varchar(255) | NO | | | |
|
| thumb | | varbinary(383) | NO | | | |
|
||||||
| publish | publish default profile in local directory | boolean | NO | | 0 | |
|
| publish | publish default profile in local directory | boolean | NO | | 0 | |
|
||||||
| net-publish | publish profile in global directory | boolean | NO | | 0 | |
|
| net-publish | publish profile in global directory | boolean | NO | | 0 | |
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Fields
|
||||||
| ------------ | --------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
| ------------ | --------------------------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| uid | User id | mediumint unsigned | NO | | 0 | |
|
| uid | User id | mediumint unsigned | NO | | 0 | |
|
||||||
| callback_url | | varchar(255) | NO | | | |
|
| callback_url | | varbinary(383) | NO | | | |
|
||||||
| topic | | varchar(255) | NO | | | |
|
| topic | | varchar(255) | NO | | | |
|
||||||
| nickname | | varchar(255) | NO | | | |
|
| nickname | | varchar(255) | NO | | | |
|
||||||
| push | Retrial counter | tinyint | NO | | 0 | |
|
| push | Retrial counter | tinyint | NO | | 0 | |
|
||||||
|
|
|
@ -9,7 +9,7 @@ Fields
|
||||||
| Field | Description | Type | Null | Key | Default | Extra |
|
| Field | Description | Type | Null | Key | Default | Extra |
|
||||||
| -------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
| -------- | ------------- | ------------------ | ---- | --- | ------------------- | -------------- |
|
||||||
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | sequential ID | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| hash | | varchar(255) | NO | | | |
|
| hash | | varbinary(255) | NO | | | |
|
||||||
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
|
| created | | datetime | NO | | 0001-01-01 00:00:00 | |
|
||||||
| uid | User id | mediumint unsigned | NO | | 0 | |
|
| uid | User id | mediumint unsigned | NO | | 0 | |
|
||||||
| password | | varchar(255) | NO | | | |
|
| password | | varchar(255) | NO | | | |
|
||||||
|
|
|
@ -10,7 +10,7 @@ Fields
|
||||||
| ----- | ----------------------------------------------------------------------------- | ---------------- | ---- | --- | ------- | -------------- |
|
| ----- | ----------------------------------------------------------------------------- | ---------------- | ---- | --- | ------- | -------------- |
|
||||||
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
| id | | int unsigned | NO | PRI | NULL | auto_increment |
|
||||||
| name | | varchar(96) | NO | | | |
|
| name | | varchar(96) | NO | | | |
|
||||||
| url | | varbinary(255) | NO | | | |
|
| url | | varbinary(383) | NO | | | |
|
||||||
| type | Type of the tag (Unknown, General Collection, Follower Collection or Account) | tinyint unsigned | YES | | NULL | |
|
| type | Type of the tag (Unknown, General Collection, Follower Collection or Account) | tinyint unsigned | YES | | NULL | |
|
||||||
|
|
||||||
Indexes
|
Indexes
|
||||||
|
|
|
@ -24,7 +24,7 @@ Fields
|
||||||
| fetch_further_information | | tinyint unsigned | YES | | NULL | |
|
| fetch_further_information | | tinyint unsigned | YES | | NULL | |
|
||||||
| ffi_keyword_denylist | | text | YES | | NULL | |
|
| ffi_keyword_denylist | | text | YES | | NULL | |
|
||||||
| subhub | | boolean | YES | | NULL | |
|
| subhub | | boolean | YES | | NULL | |
|
||||||
| hub-verify | | varchar(255) | YES | | NULL | |
|
| hub-verify | | varbinary(383) | YES | | NULL | |
|
||||||
| protocol | Protocol of the contact | char(4) | YES | | NULL | |
|
| protocol | Protocol of the contact | char(4) | YES | | NULL | |
|
||||||
| rating | Automatically detected feed poll frequency | tinyint | YES | | NULL | |
|
| rating | Automatically detected feed poll frequency | tinyint | YES | | NULL | |
|
||||||
| priority | Feed poll priority | tinyint unsigned | YES | | NULL | |
|
| priority | Feed poll priority | tinyint unsigned | YES | | NULL | |
|
||||||
|
|
|
@ -405,6 +405,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
|
||||||
Hook::callAll('block', $hook_data);
|
Hook::callAll('block', $hook_data);
|
||||||
Hook::callAll('unblock', $hook_data);
|
Hook::callAll('unblock', $hook_data);
|
||||||
|
|
||||||
|
### src/Core/Logger/Factory.php
|
||||||
|
|
||||||
|
Hook::callAll('logger_instance', $data);
|
||||||
|
|
||||||
### src/Core/StorageManager
|
### src/Core/StorageManager
|
||||||
|
|
||||||
Hook::callAll('storage_instance', $data);
|
Hook::callAll('storage_instance', $data);
|
||||||
|
|
|
@ -31,7 +31,7 @@ Requirements
|
||||||
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
|
* Das POSIX Modul muss aktiviert sein ([CentOS, RHEL](http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7http://www.bigsoft.co.uk/blog/index.php/2014/12/08/posix-php-commands-not-working-under-centos-7) haben dies z.B. deaktiviert)
|
||||||
* Einen E-Mail Server, so dass PHP `mail()` funktioniert.
|
* Einen E-Mail Server, so dass PHP `mail()` funktioniert.
|
||||||
Wenn kein eigener E-Mail Server zur Verfügung steht, kann alternativ das [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) Addon mit einem externen SMTP Account verwendet werden.
|
Wenn kein eigener E-Mail Server zur Verfügung steht, kann alternativ das [phpmailer](https://github.com/friendica/friendica-addons/tree/develop/phpmailer) Addon mit einem externen SMTP Account verwendet werden.
|
||||||
* Mysql 5.6+ (oder eine äquivalente Alternative: MariaDB, Percona Server etc.)
|
* Mysql Server mit Unterstützung vom InnoDB und Barracuda (wir empfehlen MariaDB da die Entwicklung mit solchen Server erfolgt, aber Alternativen wie MySQL, Percona Server etc. sollten auch funktionieren)
|
||||||
* die Möglichkeit, wiederkehrende Aufgaben mit cron (Linux/Mac) oder "Scheduled Tasks" einzustellen (Windows) [Beachte: andere Optionen sind in Abschnitt 7 dieser Dokumentation zu finden]
|
* die Möglichkeit, wiederkehrende Aufgaben mit cron (Linux/Mac) oder "Scheduled Tasks" einzustellen (Windows) [Beachte: andere Optionen sind in Abschnitt 7 dieser Dokumentation zu finden]
|
||||||
* Installation in einer Top-Level-Domain oder Subdomain (ohne eine Verzeichnis/Pfad-Komponente in der URL) wird bevorzugt. Verzeichnispfade sind für diesen Zweck nicht so günstig und wurden auch nicht ausführlich getestet.
|
* Installation in einer Top-Level-Domain oder Subdomain (ohne eine Verzeichnis/Pfad-Komponente in der URL) wird bevorzugt. Verzeichnispfade sind für diesen Zweck nicht so günstig und wurden auch nicht ausführlich getestet.
|
||||||
|
|
||||||
|
|
|
@ -123,13 +123,13 @@ The selected 1st part will be saved in the database by the theme_post function.
|
||||||
|
|
||||||
function theme_post(App $a){
|
function theme_post(App $a){
|
||||||
// non local users shall not pass
|
// non local users shall not pass
|
||||||
if (! local_user()) {
|
if (!Session::getLocalUser()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if the one specific submit button was pressed then proceed
|
// if the one specific submit button was pressed then proceed
|
||||||
if (isset($_POST['duepuntozero-settings-submit'])){
|
if (isset($_POST['duepuntozero-settings-submit'])){
|
||||||
// and save the selection key into the personal config of the user
|
// and save the selection key into the personal config of the user
|
||||||
DI::pConfig()->set(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
|
DI::pConfig()->set(Session::getLocalUser(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ Now that this information is set in the database, what should friendica do with
|
||||||
For this, have a look at the theme.php file of the *duepunto zero*.
|
For this, have a look at the theme.php file of the *duepunto zero*.
|
||||||
There you'll find somethink alike
|
There you'll find somethink alike
|
||||||
|
|
||||||
$colorset = DI::pConfig()->get( local_user(), 'duepuntozero','colorset');
|
$colorset = DI::pConfig()->get(Session::getLocalUser(), 'duepuntozero','colorset');
|
||||||
if (!$colorset)
|
if (!$colorset)
|
||||||
$colorset = DI::config()->get('duepuntozero', 'colorset');
|
$colorset = DI::config()->get('duepuntozero', 'colorset');
|
||||||
if ($colorset) {
|
if ($colorset) {
|
||||||
|
|
17
mod/cal.php
17
mod/cal.php
|
@ -27,7 +27,6 @@ use Friendica\App;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Content\Widget;
|
use Friendica\Content\Widget;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -42,7 +41,7 @@ use Friendica\Util\Temporal;
|
||||||
|
|
||||||
function cal_init(App $a)
|
function cal_init(App $a)
|
||||||
{
|
{
|
||||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,14 +111,14 @@ function cal_content(App $a)
|
||||||
$owner_uid = intval($owner['uid']);
|
$owner_uid = intval($owner['uid']);
|
||||||
$nick = $owner['nickname'];
|
$nick = $owner['nickname'];
|
||||||
|
|
||||||
$contact_id = Session::getRemoteContactID($owner['uid']);
|
$contact_id = DI::userSession()->getRemoteContactID($owner['uid']);
|
||||||
|
|
||||||
$remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]);
|
$remote_contact = $contact_id && DBA::exists('contact', ['id' => $contact_id, 'uid' => $owner['uid']]);
|
||||||
|
|
||||||
$is_owner = local_user() == $owner['uid'];
|
$is_owner = DI::userSession()->getLocalUserId() == $owner['uid'];
|
||||||
|
|
||||||
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
|
if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
|
||||||
notice(DI::l10n()->t('Access to this profile has been restricted.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +261,7 @@ function cal_content(App $a)
|
||||||
|
|
||||||
if ($mode == 'export') {
|
if ($mode == 'export') {
|
||||||
if (!$owner_uid) {
|
if (!$owner_uid) {
|
||||||
notice(DI::l10n()->t('User not found'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,14 +270,14 @@ function cal_content(App $a)
|
||||||
|
|
||||||
if (!$evexport["success"]) {
|
if (!$evexport["success"]) {
|
||||||
if ($evexport["content"]) {
|
if ($evexport["content"]) {
|
||||||
notice(DI::l10n()->t('This calendar format is not supported'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('This calendar format is not supported'));
|
||||||
} else {
|
} else {
|
||||||
notice(DI::l10n()->t('No exportable data found'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No exportable data found'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it the own calendar return to the events page
|
// If it the own calendar return to the events page
|
||||||
// otherwise to the profile calendar page
|
// otherwise to the profile calendar page
|
||||||
if (local_user() === $owner_uid) {
|
if (DI::userSession()->getLocalUserId() === $owner_uid) {
|
||||||
$return_path = "events";
|
$return_path = "events";
|
||||||
} else {
|
} else {
|
||||||
$return_path = "cal/" . $nick;
|
$return_path = "cal/" . $nick;
|
||||||
|
|
|
@ -24,7 +24,6 @@ use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Content\Widget;
|
use Friendica\Content\Widget;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -46,14 +45,14 @@ function display_init(App $a)
|
||||||
(new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run();
|
(new Objects(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), $_SERVER, ['guid' => DI::args()->getArgv()[1] ?? null]))->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nick = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
|
$nick = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
|
||||||
|
|
||||||
$item = null;
|
$item = null;
|
||||||
$item_user = local_user();
|
$item_user = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$fields = ['uri-id', 'parent-uri-id', 'author-id', 'author-link', 'body', 'uid', 'guid', 'gravity'];
|
$fields = ['uri-id', 'parent-uri-id', 'author-id', 'author-link', 'body', 'uid', 'guid', 'gravity'];
|
||||||
|
|
||||||
|
@ -62,18 +61,18 @@ function display_init(App $a)
|
||||||
$nick = '';
|
$nick = '';
|
||||||
|
|
||||||
// Does the local user have this item?
|
// Does the local user have this item?
|
||||||
if (local_user()) {
|
if (DI::userSession()->getLocalUserId()) {
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => local_user()]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['guid' => DI::args()->getArgv()[1], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
$nick = $a->getLoggedInUserNickname();
|
$nick = $a->getLoggedInUserNickname();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is this item private but could be visible to the remove visitor?
|
// Is this item private but could be visible to the remove visitor?
|
||||||
if (!DBA::isResult($item) && remote_user()) {
|
if (!DBA::isResult($item) && DI::userSession()->getRemoteUserId()) {
|
||||||
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
|
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
if (!Contact::isFollower(remote_user(), $item['uid'])) {
|
if (!Contact::isFollower(DI::userSession()->getRemoteUserId(), $item['uid'])) {
|
||||||
$item = null;
|
$item = null;
|
||||||
} else {
|
} else {
|
||||||
$item_user = $item['uid'];
|
$item_user = $item['uid'];
|
||||||
|
@ -83,14 +82,14 @@ function display_init(App $a)
|
||||||
|
|
||||||
// Is it an item with uid=0?
|
// Is it an item with uid=0?
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['guid' => DI::args()->getArgv()[1], 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
|
||||||
}
|
}
|
||||||
} elseif (DI::args()->getArgc() >= 3 && $nick == 'feed-item') {
|
} elseif (DI::args()->getArgc() >= 3 && $nick == 'feed-item') {
|
||||||
$uri_id = DI::args()->getArgv()[2];
|
$uri_id = DI::args()->getArgv()[2];
|
||||||
if (substr($uri_id, -5) == '.atom') {
|
if (substr($uri_id, -5) == '.atom') {
|
||||||
$uri_id = substr($uri_id, 0, -5);
|
$uri_id = substr($uri_id, 0, -5);
|
||||||
}
|
}
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['uri-id' => $uri_id, 'private' => [Item::PUBLIC, Item::UNLISTED], 'uid' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
|
@ -102,11 +101,11 @@ function display_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
|
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
|
||||||
Logger::info('Directly serving XML for uri-id '.$item['uri-id']);
|
Logger::debug('Directly serving XML', ['uri-id' => $item['uri-id']]);
|
||||||
displayShowFeed($item['uri-id'], $item['uid'], false);
|
displayShowFeed($item['uri-id'], $item['uid'], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['gravity'] != GRAVITY_PARENT) {
|
if ($item['gravity'] != Item::GRAVITY_PARENT) {
|
||||||
$parent = Post::selectFirstForUser($item_user, $fields, ['uid' => [0, $item_user], 'uri-id' => $item['parent-uri-id']], ['order' => ['uid' => true]]);
|
$parent = Post::selectFirstForUser($item_user, $fields, ['uid' => [0, $item_user], 'uri-id' => $item['parent-uri-id']], ['order' => ['uid' => true]]);
|
||||||
$item = $parent ?: $item;
|
$item = $parent ?: $item;
|
||||||
}
|
}
|
||||||
|
@ -123,11 +122,9 @@ function display_init(App $a)
|
||||||
|
|
||||||
function display_fetchauthor($item)
|
function display_fetchauthor($item)
|
||||||
{
|
{
|
||||||
if (Diaspora::isReshare($item['body'], true)) {
|
$shared = DI::contentItem()->getSharedPost($item, ['author-link']);
|
||||||
$shared = Item::getShareArray($item);
|
if (!empty($shared) && empty($shared['comment'])) {
|
||||||
if (!empty($shared['profile'])) {
|
$contact = Contact::getByURLForUser($shared['post']['author-link'], DI::userSession()->getLocalUserId());
|
||||||
$contact = Contact::getByURLForUser($shared['profile'], local_user());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($contact)) {
|
if (empty($contact)) {
|
||||||
|
@ -139,7 +136,7 @@ function display_fetchauthor($item)
|
||||||
|
|
||||||
function display_content(App $a, $update = false, $update_uid = 0)
|
function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
{
|
{
|
||||||
if (DI::config()->get('system','block_public') && !Session::isAuthenticated()) {
|
if (DI::config()->get('system','block_public') && !DI::userSession()->isAuthenticated()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Public access denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,18 +178,18 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
if (DI::args()->getArgc() == 2) {
|
if (DI::args()->getArgc() == 2) {
|
||||||
$fields = ['uri-id', 'parent-uri-id', 'uid'];
|
$fields = ['uri-id', 'parent-uri-id', 'uid'];
|
||||||
|
|
||||||
if (local_user()) {
|
if (DI::userSession()->getLocalUserId()) {
|
||||||
$condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, local_user()]];
|
$condition = ['guid' => DI::args()->getArgv()[1], 'uid' => [0, DI::userSession()->getLocalUserId()]];
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, $condition, ['order' => ['uid' => true]]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, $condition, ['order' => ['uid' => true]]);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
$uri_id = $item['uri-id'];
|
$uri_id = $item['uri-id'];
|
||||||
$parent_uri_id = $item['parent-uri-id'];
|
$parent_uri_id = $item['parent-uri-id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($parent_uri_id == 0) && remote_user()) {
|
if (($parent_uri_id == 0) && DI::userSession()->getRemoteUserId()) {
|
||||||
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
|
$item = Post::selectFirst($fields, ['guid' => DI::args()->getArgv()[1], 'private' => Item::PRIVATE, 'origin' => true]);
|
||||||
if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) {
|
if (DBA::isResult($item) && Contact::isFollower(DI::userSession()->getRemoteUserId(), $item['uid'])) {
|
||||||
$uri_id = $item['uri-id'];
|
$uri_id = $item['uri-id'];
|
||||||
$parent_uri_id = $item['parent-uri-id'];
|
$parent_uri_id = $item['parent-uri-id'];
|
||||||
}
|
}
|
||||||
|
@ -200,7 +197,7 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
|
|
||||||
if ($parent_uri_id == 0) {
|
if ($parent_uri_id == 0) {
|
||||||
$condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => DI::args()->getArgv()[1], 'uid' => 0];
|
$condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => DI::args()->getArgv()[1], 'uid' => 0];
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, $condition);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, $condition);
|
||||||
if (DBA::isResult($item)) {
|
if (DBA::isResult($item)) {
|
||||||
$uri_id = $item['uri-id'];
|
$uri_id = $item['uri-id'];
|
||||||
$parent_uri_id = $item['parent-uri-id'];
|
$parent_uri_id = $item['parent-uri-id'];
|
||||||
|
@ -213,9 +210,9 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
|
throw new HTTPException\NotFoundException(DI::l10n()->t('The requested item doesn\'t exist or has been deleted.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DI::pConfig()->get(local_user(), 'system', 'detailed_notif')) {
|
if (!DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'detailed_notif')) {
|
||||||
DI::notification()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
|
DI::notification()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['parent-uri-id' => $item['parent-uri-id']]);
|
||||||
DI::notify()->setAllSeenForUser(local_user(), ['parent-uri-id' => $item['parent-uri-id']]);
|
DI::notify()->setAllSeenForUser(DI::userSession()->getLocalUserId(), ['parent-uri-id' => $item['parent-uri-id']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are displaying an "alternate" link if that post was public. See issue 2864
|
// We are displaying an "alternate" link if that post was public. See issue 2864
|
||||||
|
@ -234,17 +231,17 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
'$conversation' => $conversation]);
|
'$conversation' => $conversation]);
|
||||||
|
|
||||||
$is_remote_contact = false;
|
$is_remote_contact = false;
|
||||||
$item_uid = local_user();
|
$item_uid = DI::userSession()->getLocalUserId();
|
||||||
$page_uid = 0;
|
$page_uid = 0;
|
||||||
|
|
||||||
$parent = null;
|
$parent = null;
|
||||||
if (!local_user() && !empty($parent_uri_id)) {
|
if (!DI::userSession()->getLocalUserId() && !empty($parent_uri_id)) {
|
||||||
$parent = Post::selectFirst(['uid'], ['uri-id' => $parent_uri_id, 'wall' => true]);
|
$parent = Post::selectFirst(['uid'], ['uri-id' => $parent_uri_id, 'wall' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBA::isResult($parent)) {
|
if (DBA::isResult($parent)) {
|
||||||
$page_uid = $page_uid ?? 0 ?: $parent['uid'];
|
$page_uid = $page_uid ?? 0 ?: $parent['uid'];
|
||||||
$is_remote_contact = Session::getRemoteContactID($page_uid);
|
$is_remote_contact = DI::userSession()->getRemoteContactID($page_uid);
|
||||||
if ($is_remote_contact) {
|
if ($is_remote_contact) {
|
||||||
$item_uid = $parent['uid'];
|
$item_uid = $parent['uid'];
|
||||||
}
|
}
|
||||||
|
@ -252,11 +249,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
$page_uid = $item['uid'];
|
$page_uid = $item['uid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($page_uid) && ($page_uid != local_user())) {
|
if (!empty($page_uid) && ($page_uid != DI::userSession()->getLocalUserId())) {
|
||||||
$page_user = User::getById($page_uid);
|
$page_user = User::getById($page_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_owner = local_user() && (in_array($page_uid, [local_user(), 0]));
|
$is_owner = DI::userSession()->getLocalUserId() && (in_array($page_uid, [DI::userSession()->getLocalUserId(), 0]));
|
||||||
|
|
||||||
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
|
if (!empty($page_user['hidewall']) && !$is_owner && !$is_remote_contact) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
|
||||||
|
@ -268,8 +265,8 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
}
|
}
|
||||||
$sql_extra = Item::getPermissionsSQLByUserId($page_uid);
|
$sql_extra = Item::getPermissionsSQLByUserId($page_uid);
|
||||||
|
|
||||||
if (local_user() && (local_user() == $page_uid)) {
|
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_uid)) {
|
||||||
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true];
|
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => DI::userSession()->getLocalUserId(), 'unseen' => true];
|
||||||
$unseen = Post::exists($condition);
|
$unseen = Post::exists($condition);
|
||||||
} else {
|
} else {
|
||||||
$unseen = false;
|
$unseen = false;
|
||||||
|
@ -290,11 +287,11 @@ function display_content(App $a, $update = false, $update_uid = 0)
|
||||||
$item['uri-id'] = $item['parent-uri-id'];
|
$item['uri-id'] = $item['parent-uri-id'];
|
||||||
|
|
||||||
if ($unseen) {
|
if ($unseen) {
|
||||||
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => local_user(), 'unseen' => true];
|
$condition = ['parent-uri-id' => $parent_uri_id, 'uid' => DI::userSession()->getLocalUserId(), 'unseen' => true];
|
||||||
Item::update(['unseen' => false], $condition);
|
Item::update(['unseen' => false], $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$update && local_user()) {
|
if (!$update && DI::userSession()->getLocalUserId()) {
|
||||||
$o .= "<script> var netargs = '?uri_id=" . $item['uri-id'] . "'; </script>";
|
$o .= "<script> var netargs = '?uri_id=" . $item['uri-id'] . "'; </script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,29 +34,29 @@ function editpost_content(App $a)
|
||||||
{
|
{
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
||||||
|
|
||||||
if (!$post_id) {
|
if (!$post_id) {
|
||||||
notice(DI::l10n()->t('Item not found'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
|
$fields = ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
|
||||||
'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
|
'body', 'title', 'uri-id', 'wall', 'post-type', 'guid'];
|
||||||
|
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), $fields, ['id' => $post_id, 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
|
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
notice(DI::l10n()->t('Item not found'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = User::getById(local_user());
|
$user = User::getById(DI::userSession()->getLocalUserId());
|
||||||
|
|
||||||
$geotag = '';
|
$geotag = '';
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ function editpost_content(App $a)
|
||||||
'$jotnets' => $jotnets,
|
'$jotnets' => $jotnets,
|
||||||
'$title' => $item['title'],
|
'$title' => $item['title'],
|
||||||
'$placeholdertitle' => DI::l10n()->t('Set title'),
|
'$placeholdertitle' => DI::l10n()->t('Set title'),
|
||||||
'$category' => Post\Category::getCSVByURIId($item['uri-id'], local_user(), Post\Category::CATEGORY),
|
'$category' => Post\Category::getCSVByURIId($item['uri-id'], DI::userSession()->getLocalUserId(), Post\Category::CATEGORY),
|
||||||
'$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
|
'$placeholdercategory' => (Feature::isEnabled(DI::userSession()->getLocalUserId(),'categories') ? DI::l10n()->t("Categories \x28comma-separated list\x29") : ''),
|
||||||
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
|
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
|
||||||
'$lockstate' => $lockstate,
|
'$lockstate' => $lockstate,
|
||||||
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
|
'$acl' => '', // populate_acl((($group) ? $group_acl : $a->user)),
|
||||||
|
|
|
@ -46,7 +46,7 @@ use Friendica\Worker\Delivery;
|
||||||
|
|
||||||
function events_init(App $a)
|
function events_init(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ function events_init(App $a)
|
||||||
DI::page()['aside'] = '';
|
DI::page()['aside'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cal_widget = CalendarExport::getHTML(local_user());
|
$cal_widget = CalendarExport::getHTML(DI::userSession()->getLocalUserId());
|
||||||
|
|
||||||
DI::page()['aside'] .= $cal_widget;
|
DI::page()['aside'] .= $cal_widget;
|
||||||
|
|
||||||
|
@ -64,13 +64,13 @@ function events_init(App $a)
|
||||||
function events_post(App $a)
|
function events_post(App $a)
|
||||||
{
|
{
|
||||||
Logger::debug('post', ['request' => $_REQUEST]);
|
Logger::debug('post', ['request' => $_REQUEST]);
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0;
|
$event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0;
|
||||||
$cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0;
|
$cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0;
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$start_text = Strings::escapeHtml($_REQUEST['start_text'] ?? '');
|
$start_text = Strings::escapeHtml($_REQUEST['start_text'] ?? '');
|
||||||
$finish_text = Strings::escapeHtml($_REQUEST['finish_text'] ?? '');
|
$finish_text = Strings::escapeHtml($_REQUEST['finish_text'] ?? '');
|
||||||
|
@ -121,7 +121,7 @@ function events_post(App $a)
|
||||||
$onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
|
$onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
|
||||||
|
|
||||||
if (strcmp($finish, $start) < 0 && !$nofinish) {
|
if (strcmp($finish, $start) < 0 && !$nofinish) {
|
||||||
notice(DI::l10n()->t('Event can not end before it has started.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Event can not end before it has started.'));
|
||||||
if (intval($_REQUEST['preview'])) {
|
if (intval($_REQUEST['preview'])) {
|
||||||
System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
|
System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ function events_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$summary || ($start === DBA::NULL_DATETIME)) {
|
if (!$summary || ($start === DBA::NULL_DATETIME)) {
|
||||||
notice(DI::l10n()->t('Event title and start time are required.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Event title and start time are required.'));
|
||||||
if (intval($_REQUEST['preview'])) {
|
if (intval($_REQUEST['preview'])) {
|
||||||
System::httpExit(DI::l10n()->t('Event title and start time are required.'));
|
System::httpExit(DI::l10n()->t('Event title and start time are required.'));
|
||||||
}
|
}
|
||||||
|
@ -173,22 +173,23 @@ function events_post(App $a)
|
||||||
$private_event = true;
|
$private_event = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datarray = [];
|
$datarray = [
|
||||||
$datarray['start'] = $start;
|
'start' => $start,
|
||||||
$datarray['finish'] = $finish;
|
'finish' => $finish,
|
||||||
$datarray['summary'] = $summary;
|
'summary' => $summary,
|
||||||
$datarray['desc'] = $desc;
|
'desc' => $desc,
|
||||||
$datarray['location'] = $location;
|
'location' => $location,
|
||||||
$datarray['type'] = $type;
|
'type' => $type,
|
||||||
$datarray['nofinish'] = $nofinish;
|
'nofinish' => $nofinish,
|
||||||
$datarray['uid'] = $uid;
|
'uid' => $uid,
|
||||||
$datarray['cid'] = $cid;
|
'cid' => $cid,
|
||||||
$datarray['allow_cid'] = $str_contact_allow;
|
'allow_cid' => $str_contact_allow,
|
||||||
$datarray['allow_gid'] = $str_group_allow;
|
'allow_gid' => $str_group_allow,
|
||||||
$datarray['deny_cid'] = $str_contact_deny;
|
'deny_cid' => $str_contact_deny,
|
||||||
$datarray['deny_gid'] = $str_group_deny;
|
'deny_gid' => $str_group_deny,
|
||||||
$datarray['private'] = $private_event;
|
'private' => $private_event,
|
||||||
$datarray['id'] = $event_id;
|
'id' => $event_id,
|
||||||
|
];
|
||||||
|
|
||||||
if (intval($_REQUEST['preview'])) {
|
if (intval($_REQUEST['preview'])) {
|
||||||
System::httpExit(Event::getHTML($datarray));
|
System::httpExit(Event::getHTML($datarray));
|
||||||
|
@ -205,7 +206,7 @@ function events_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$cid && $uri_id) {
|
if (!$cid && $uri_id) {
|
||||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
|
Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('events');
|
DI::baseUrl()->redirect('events');
|
||||||
|
@ -213,8 +214,8 @@ function events_post(App $a)
|
||||||
|
|
||||||
function events_content(App $a)
|
function events_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return Login::form();
|
return Login::form();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,11 +224,11 @@ function events_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'ignore') && intval(DI::args()->getArgv()[2])) {
|
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'ignore') && intval(DI::args()->getArgv()[2])) {
|
||||||
DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
|
DBA::update('event', ['ignore' => true], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'unignore') && intval(DI::args()->getArgv()[2])) {
|
if ((DI::args()->getArgc() > 2) && (DI::args()->getArgv()[1] === 'unignore') && intval(DI::args()->getArgv()[2])) {
|
||||||
DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
|
DBA::update('event', ['ignore' => false], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($a->getThemeInfoValue('events_in_profile')) {
|
if ($a->getThemeInfoValue('events_in_profile')) {
|
||||||
|
@ -322,9 +323,9 @@ function events_content(App $a)
|
||||||
|
|
||||||
// get events by id or by date
|
// get events by id or by date
|
||||||
if ($event_params['event_id']) {
|
if ($event_params['event_id']) {
|
||||||
$r = Event::getListById(local_user(), $event_params['event_id']);
|
$r = Event::getListById(DI::userSession()->getLocalUserId(), $event_params['event_id']);
|
||||||
} else {
|
} else {
|
||||||
$r = Event::getListByDate(local_user(), $event_params);
|
$r = Event::getListByDate(DI::userSession()->getLocalUserId(), $event_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
$links = [];
|
$links = [];
|
||||||
|
@ -395,7 +396,7 @@ function events_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($mode === 'edit' || $mode === 'copy') && $event_id) {
|
if (($mode === 'edit' || $mode === 'copy') && $event_id) {
|
||||||
$orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => local_user()]);
|
$orig_event = DBA::selectFirst('event', [], ['id' => $event_id, 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Passed parameters overrides anything found in the DB
|
// Passed parameters overrides anything found in the DB
|
||||||
|
@ -404,8 +405,8 @@ function events_content(App $a)
|
||||||
$share_disabled = '';
|
$share_disabled = '';
|
||||||
|
|
||||||
if (empty($orig_event)) {
|
if (empty($orig_event)) {
|
||||||
$orig_event = User::getById(local_user(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);;
|
$orig_event = User::getById(DI::userSession()->getLocalUserId(), ['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid']);;
|
||||||
} elseif ($orig_event['allow_cid'] !== '<' . local_user() . '>'
|
} elseif ($orig_event['allow_cid'] !== '<' . DI::userSession()->getLocalUserId() . '>'
|
||||||
|| $orig_event['allow_gid']
|
|| $orig_event['allow_gid']
|
||||||
|| $orig_event['deny_cid']
|
|| $orig_event['deny_cid']
|
||||||
|| $orig_event['deny_gid']) {
|
|| $orig_event['deny_gid']) {
|
||||||
|
@ -523,15 +524,15 @@ function events_content(App $a)
|
||||||
|
|
||||||
// Remove an event from the calendar and its related items
|
// Remove an event from the calendar and its related items
|
||||||
if ($mode === 'drop' && $event_id) {
|
if ($mode === 'drop' && $event_id) {
|
||||||
$ev = Event::getListById(local_user(), $event_id);
|
$ev = Event::getListById(DI::userSession()->getLocalUserId(), $event_id);
|
||||||
|
|
||||||
// Delete only real events (no birthdays)
|
// Delete only real events (no birthdays)
|
||||||
if (DBA::isResult($ev) && $ev[0]['type'] == 'event') {
|
if (DBA::isResult($ev) && $ev[0]['type'] == 'event') {
|
||||||
Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
|
Item::deleteForUser(['id' => $ev[0]['itemid']], DI::userSession()->getLocalUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Post::exists(['id' => $ev[0]['itemid']])) {
|
if (Post::exists(['id' => $ev[0]['itemid']])) {
|
||||||
notice(DI::l10n()->t('Failed to remove event'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to remove event'));
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('events');
|
DI::baseUrl()->redirect('events');
|
||||||
|
|
|
@ -38,7 +38,7 @@ use Friendica\Util\Strings;
|
||||||
*/
|
*/
|
||||||
function fbrowser_content(App $a)
|
function fbrowser_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ function fbrowser_content(App $a)
|
||||||
|
|
||||||
if (DI::args()->getArgc() == 2) {
|
if (DI::args()->getArgc() == 2) {
|
||||||
$photos = DBA::toArray(DBA::p("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
|
$photos = DBA::toArray(DBA::p("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = ? AND NOT `photo-type` IN (?, ?)",
|
||||||
local_user(),
|
DI::userSession()->getLocalUserId(),
|
||||||
Photo::CONTACT_AVATAR,
|
Photo::CONTACT_AVATAR,
|
||||||
Photo::CONTACT_BANNER
|
Photo::CONTACT_BANNER
|
||||||
));
|
));
|
||||||
|
@ -84,7 +84,7 @@ function fbrowser_content(App $a)
|
||||||
min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created`
|
min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created`
|
||||||
FROM `photo` WHERE `uid` = ? $sql_extra AND NOT `photo-type` IN (?, ?)
|
FROM `photo` WHERE `uid` = ? $sql_extra AND NOT `photo-type` IN (?, ?)
|
||||||
GROUP BY `resource-id` $sql_extra2",
|
GROUP BY `resource-id` $sql_extra2",
|
||||||
local_user(),
|
DI::userSession()->getLocalUserId(),
|
||||||
Photo::CONTACT_AVATAR,
|
Photo::CONTACT_AVATAR,
|
||||||
Photo::CONTACT_BANNER
|
Photo::CONTACT_BANNER
|
||||||
));
|
));
|
||||||
|
@ -103,7 +103,8 @@ function fbrowser_content(App $a)
|
||||||
return [
|
return [
|
||||||
DI::baseUrl() . '/photos/' . $a->getLoggedInUserNickname() . '/image/' . $rr['resource-id'],
|
DI::baseUrl() . '/photos/' . $a->getLoggedInUserNickname() . '/image/' . $rr['resource-id'],
|
||||||
$filename_e,
|
$filename_e,
|
||||||
DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
|
DI::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext,
|
||||||
|
$rr['desc']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
$files = array_map("_map_files1", $r);
|
$files = array_map("_map_files1", $r);
|
||||||
|
@ -123,7 +124,7 @@ function fbrowser_content(App $a)
|
||||||
break;
|
break;
|
||||||
case "file":
|
case "file":
|
||||||
if (DI::args()->getArgc()==2) {
|
if (DI::args()->getArgc()==2) {
|
||||||
$files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => local_user()]);
|
$files = DBA::selectToArray('attach', ['id', 'filename', 'filetype'], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
|
|
||||||
function _map_files2($rr)
|
function _map_files2($rr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
function follow_post(App $a)
|
function follow_post(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,13 +52,13 @@ function follow_content(App $a)
|
||||||
{
|
{
|
||||||
$return_path = 'contact';
|
$return_path = 'contact';
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
|
$url = Probe::cleanURI(trim($_REQUEST['url'] ?? ''));
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ function follow_content(App $a)
|
||||||
|
|
||||||
if (DBA::isResult($user_contact)) {
|
if (DBA::isResult($user_contact)) {
|
||||||
if ($user_contact['pending']) {
|
if ($user_contact['pending']) {
|
||||||
notice(DI::l10n()->t('You already added this contact.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('You already added this contact.'));
|
||||||
$submit = '';
|
$submit = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ function follow_content(App $a)
|
||||||
// Possibly it is a remote item and not an account
|
// Possibly it is a remote item and not an account
|
||||||
follow_remote_item($url);
|
follow_remote_item($url);
|
||||||
|
|
||||||
notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
|
||||||
$submit = '';
|
$submit = '';
|
||||||
$contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => ''];
|
$contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => ''];
|
||||||
}
|
}
|
||||||
|
@ -105,12 +105,12 @@ function follow_content(App $a)
|
||||||
$protocol = Contact::getProtocol($contact['url'], $contact['network']);
|
$protocol = Contact::getProtocol($contact['url'], $contact['network']);
|
||||||
|
|
||||||
if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
|
if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
|
||||||
notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
|
||||||
$submit = '';
|
$submit = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
|
if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
|
||||||
notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
|
||||||
$submit = '';
|
$submit = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ function follow_content(App $a)
|
||||||
|
|
||||||
$owner = User::getOwnerDataById($uid);
|
$owner = User::getOwnerDataById($uid);
|
||||||
if (empty($owner)) {
|
if (empty($owner)) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -181,21 +181,21 @@ function follow_process(App $a, string $url)
|
||||||
follow_remote_item($url);
|
follow_remote_item($url);
|
||||||
|
|
||||||
if ($result['message']) {
|
if ($result['message']) {
|
||||||
notice($result['message']);
|
DI::sysmsg()->addNotice($result['message']);
|
||||||
}
|
}
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
} elseif ($result['cid']) {
|
} elseif ($result['cid']) {
|
||||||
DI::baseUrl()->redirect('contact/' . $result['cid']);
|
DI::baseUrl()->redirect('contact/' . $result['cid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
notice(DI::l10n()->t('The contact could not be added.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('The contact could not be added.'));
|
||||||
|
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
function follow_remote_item($url)
|
function follow_remote_item($url)
|
||||||
{
|
{
|
||||||
$item_id = Item::fetchByLink($url, local_user());
|
$item_id = Item::fetchByLink($url, DI::userSession()->getLocalUserId());
|
||||||
if (!$item_id) {
|
if (!$item_id) {
|
||||||
// If the user-specific search failed, we search and probe a public post
|
// If the user-specific search failed, we search and probe a public post
|
||||||
$item_id = Item::fetchByLink($url);
|
$item_id = Item::fetchByLink($url);
|
||||||
|
|
250
mod/item.php
250
mod/item.php
|
@ -34,8 +34,8 @@ use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Attach;
|
use Friendica\Model\Attach;
|
||||||
|
@ -57,11 +57,11 @@ use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\ParseUrl;
|
use Friendica\Util\ParseUrl;
|
||||||
|
|
||||||
function item_post(App $a) {
|
function item_post(App $a) {
|
||||||
if (!Session::isAuthenticated()) {
|
if (!DI::userSession()->isAuthenticated()) {
|
||||||
throw new HTTPException\ForbiddenException();
|
throw new HTTPException\ForbiddenException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
if (!empty($_REQUEST['dropitems'])) {
|
if (!empty($_REQUEST['dropitems'])) {
|
||||||
$arr_drop = explode(',', $_REQUEST['dropitems']);
|
$arr_drop = explode(',', $_REQUEST['dropitems']);
|
||||||
|
@ -89,7 +89,7 @@ function item_post(App $a) {
|
||||||
*/
|
*/
|
||||||
if (!$preview && !empty($_REQUEST['post_id_random'])) {
|
if (!$preview && !empty($_REQUEST['post_id_random'])) {
|
||||||
if (!empty($_SESSION['post-random']) && $_SESSION['post-random'] == $_REQUEST['post_id_random']) {
|
if (!empty($_SESSION['post-random']) && $_SESSION['post-random'] == $_REQUEST['post_id_random']) {
|
||||||
Logger::info('item post: duplicate post');
|
Logger::warning('duplicate post');
|
||||||
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
||||||
} else {
|
} else {
|
||||||
$_SESSION['post-random'] = $_REQUEST['post_id_random'];
|
$_SESSION['post-random'] = $_REQUEST['post_id_random'];
|
||||||
|
@ -106,7 +106,7 @@ function item_post(App $a) {
|
||||||
$toplevel_user_id = null;
|
$toplevel_user_id = null;
|
||||||
|
|
||||||
$objecttype = null;
|
$objecttype = null;
|
||||||
$profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: local_user();
|
$profile_uid = ($_REQUEST['profile_uid'] ?? 0) ?: DI::userSession()->getLocalUserId();
|
||||||
$posttype = ($_REQUEST['post_type'] ?? '') ?: Item::PT_ARTICLE;
|
$posttype = ($_REQUEST['post_type'] ?? '') ?: Item::PT_ARTICLE;
|
||||||
|
|
||||||
if ($parent_item_id || $thr_parent_uri) {
|
if ($parent_item_id || $thr_parent_uri) {
|
||||||
|
@ -122,13 +122,13 @@ function item_post(App $a) {
|
||||||
$thr_parent_uri = $parent_item['uri'];
|
$thr_parent_uri = $parent_item['uri'];
|
||||||
$toplevel_item = $parent_item;
|
$toplevel_item = $parent_item;
|
||||||
|
|
||||||
if ($parent_item['gravity'] != GRAVITY_PARENT) {
|
if ($parent_item['gravity'] != Item::GRAVITY_PARENT) {
|
||||||
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $toplevel_item['parent']]);
|
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $toplevel_item['parent']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($toplevel_item)) {
|
if (!DBA::isResult($toplevel_item)) {
|
||||||
notice(DI::l10n()->t('Unable to locate original post.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate original post.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ function item_post(App $a) {
|
||||||
// When commenting on a public post then store the post for the current user
|
// When commenting on a public post then store the post for the current user
|
||||||
// This enables interaction like starring and saving into folders
|
// This enables interaction like starring and saving into folders
|
||||||
if ($toplevel_item['uid'] == 0) {
|
if ($toplevel_item['uid'] == 0) {
|
||||||
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], local_user(), ['post-reason' => Item::PR_ACTIVITY]);
|
$stored = Item::storeForUserByUriId($toplevel_item['uri-id'], DI::userSession()->getLocalUserId(), ['post-reason' => Item::PR_ACTIVITY]);
|
||||||
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $uid, 'stored' => $stored]);
|
Logger::info('Public item stored for user', ['uri-id' => $toplevel_item['uri-id'], 'uid' => $uid, 'stored' => $stored]);
|
||||||
if ($stored) {
|
if ($stored) {
|
||||||
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $stored]);
|
$toplevel_item = Post::selectFirst(Item::ITEM_FIELDLIST, ['id' => $stored]);
|
||||||
|
@ -168,17 +168,17 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that the user id in a thread always stay the same
|
// Ensure that the user id in a thread always stay the same
|
||||||
if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [local_user(), 0])) {
|
if (!is_null($toplevel_user_id) && in_array($toplevel_user_id, [DI::userSession()->getLocalUserId(), 0])) {
|
||||||
$profile_uid = $toplevel_user_id;
|
$profile_uid = $toplevel_user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow commenting if it is an answer to a public post
|
// Allow commenting if it is an answer to a public post
|
||||||
$allow_comment = local_user() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
|
$allow_comment = DI::userSession()->getLocalUserId() && $toplevel_item_id && in_array($toplevel_item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($toplevel_item['network'], Protocol::FEDERATED);
|
||||||
|
|
||||||
// Now check that valid personal details have been provided
|
// Now check that valid personal details have been provided
|
||||||
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
|
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
|
||||||
Logger::notice('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
|
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ function item_post(App $a) {
|
||||||
// for non native networks use the network of the original post as network of the item
|
// for non native networks use the network of the original post as network of the item
|
||||||
if (($toplevel_item['network'] != Protocol::DIASPORA)
|
if (($toplevel_item['network'] != Protocol::DIASPORA)
|
||||||
&& ($toplevel_item['network'] != Protocol::OSTATUS)
|
&& ($toplevel_item['network'] != Protocol::OSTATUS)
|
||||||
&& ($network == "")) {
|
&& ($network == '')) {
|
||||||
$network = $toplevel_item['network'];
|
$network = $toplevel_item['network'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,9 +323,9 @@ function item_post(App $a) {
|
||||||
$pubmail_enabled = ($_REQUEST['pubmail_enable'] ?? false) && !$private;
|
$pubmail_enabled = ($_REQUEST['pubmail_enable'] ?? false) && !$private;
|
||||||
|
|
||||||
// if using the API, we won't see pubmail_enable - figure out if it should be set
|
// if using the API, we won't see pubmail_enable - figure out if it should be set
|
||||||
if ($api_source && $profile_uid && $profile_uid == local_user() && !$private) {
|
if ($api_source && $profile_uid && $profile_uid == DI::userSession()->getLocalUserId() && !$private) {
|
||||||
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
|
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
|
||||||
$pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", local_user(), '']);
|
$pubmail_enabled = DBA::exists('mailacct', ["`uid` = ? AND `server` != ? AND `pubmail`", DI::userSession()->getLocalUserId(), '']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ function item_post(App $a) {
|
||||||
System::jsonExit(['preview' => '']);
|
System::jsonExit(['preview' => '']);
|
||||||
}
|
}
|
||||||
|
|
||||||
notice(DI::l10n()->t('Empty post discarded.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Empty post discarded.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -362,11 +362,11 @@ function item_post(App $a) {
|
||||||
$self = false;
|
$self = false;
|
||||||
$contact_id = 0;
|
$contact_id = 0;
|
||||||
|
|
||||||
if (local_user() && ((local_user() == $profile_uid) || $allow_comment)) {
|
if (DI::userSession()->getLocalUserId() && ((DI::userSession()->getLocalUserId() == $profile_uid) || $allow_comment)) {
|
||||||
$self = true;
|
$self = true;
|
||||||
$author = DBA::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
|
$author = DBA::selectFirst('contact', [], ['uid' => DI::userSession()->getLocalUserId(), 'self' => true]);
|
||||||
} elseif (!empty(Session::getRemoteContactID($profile_uid))) {
|
} elseif (!empty(DI::userSession()->getRemoteContactID($profile_uid))) {
|
||||||
$author = DBA::selectFirst('contact', [], ['id' => Session::getRemoteContactID($profile_uid)]);
|
$author = DBA::selectFirst('contact', [], ['id' => DI::userSession()->getRemoteContactID($profile_uid)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBA::isResult($author)) {
|
if (DBA::isResult($author)) {
|
||||||
|
@ -374,7 +374,7 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// get contact info for owner
|
// get contact info for owner
|
||||||
if ($profile_uid == local_user() || $allow_comment) {
|
if ($profile_uid == DI::userSession()->getLocalUserId() || $allow_comment) {
|
||||||
$contact_record = $author ?: [];
|
$contact_record = $author ?: [];
|
||||||
} else {
|
} else {
|
||||||
$contact_record = DBA::selectFirst('contact', [], ['uid' => $profile_uid, 'self' => true]) ?: [];
|
$contact_record = DBA::selectFirst('contact', [], ['uid' => $profile_uid, 'self' => true]) ?: [];
|
||||||
|
@ -384,8 +384,8 @@ function item_post(App $a) {
|
||||||
if ($posttype != Item::PT_PERSONAL_NOTE) {
|
if ($posttype != Item::PT_PERSONAL_NOTE) {
|
||||||
// Look for any tags and linkify them
|
// Look for any tags and linkify them
|
||||||
$item = [
|
$item = [
|
||||||
'uid' => local_user() ? local_user() : $profile_uid,
|
'uid' => DI::userSession()->getLocalUserId() ? DI::userSession()->getLocalUserId() : $profile_uid,
|
||||||
'gravity' => $toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT,
|
'gravity' => $toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT,
|
||||||
'network' => $network,
|
'network' => $network,
|
||||||
'body' => $body,
|
'body' => $body,
|
||||||
'postopts' => $postopts,
|
'postopts' => $postopts,
|
||||||
|
@ -462,7 +462,7 @@ function item_post(App $a) {
|
||||||
|
|
||||||
$data = BBCode::getAttachmentData($body);
|
$data = BBCode::getAttachmentData($body);
|
||||||
$match = [];
|
$match = [];
|
||||||
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"]))
|
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data['type']))
|
||||||
&& ($posttype != Item::PT_PERSONAL_NOTE)) {
|
&& ($posttype != Item::PT_PERSONAL_NOTE)) {
|
||||||
$posttype = Item::PT_PAGE;
|
$posttype = Item::PT_PAGE;
|
||||||
$objecttype = Activity\ObjectType::BOOKMARK;
|
$objecttype = Activity\ObjectType::BOOKMARK;
|
||||||
|
@ -477,11 +477,11 @@ function item_post(App $a) {
|
||||||
$objecttype = Activity\ObjectType::NOTE; // Default value
|
$objecttype = Activity\ObjectType::NOTE; // Default value
|
||||||
$objectdata = BBCode::getAttachedData($body);
|
$objectdata = BBCode::getAttachedData($body);
|
||||||
|
|
||||||
if ($objectdata["type"] == "link") {
|
if ($objectdata['type'] == 'link') {
|
||||||
$objecttype = Activity\ObjectType::BOOKMARK;
|
$objecttype = Activity\ObjectType::BOOKMARK;
|
||||||
} elseif ($objectdata["type"] == "video") {
|
} elseif ($objectdata['type'] == 'video') {
|
||||||
$objecttype = Activity\ObjectType::VIDEO;
|
$objecttype = Activity\ObjectType::VIDEO;
|
||||||
} elseif ($objectdata["type"] == "photo") {
|
} elseif ($objectdata['type'] == 'photo') {
|
||||||
$objecttype = Activity\ObjectType::IMAGE;
|
$objecttype = Activity\ObjectType::IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,11 +509,11 @@ function item_post(App $a) {
|
||||||
$verb = Activity::POST;
|
$verb = Activity::POST;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($network == "") {
|
if ($network == '') {
|
||||||
$network = Protocol::DFRN;
|
$network = Protocol::DFRN;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gravity = ($toplevel_item_id ? GRAVITY_COMMENT : GRAVITY_PARENT);
|
$gravity = ($toplevel_item_id ? Item::GRAVITY_COMMENT : Item::GRAVITY_PARENT);
|
||||||
|
|
||||||
// even if the post arrived via API we are considering that it
|
// even if the post arrived via API we are considering that it
|
||||||
// originated on this site by default for determining relayability.
|
// originated on this site by default for determining relayability.
|
||||||
|
@ -532,77 +532,67 @@ function item_post(App $a) {
|
||||||
$thr_parent_uri = $uri;
|
$thr_parent_uri = $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datarray = [];
|
$datarray = [
|
||||||
$datarray['uid'] = $profile_uid;
|
'uid' => $profile_uid,
|
||||||
$datarray['wall'] = $wall;
|
'wall' => $wall,
|
||||||
$datarray['gravity'] = $gravity;
|
'gravity' => $gravity,
|
||||||
$datarray['network'] = $network;
|
'network' => $network,
|
||||||
$datarray['contact-id'] = $contact_id;
|
'contact-id' => $contact_id,
|
||||||
$datarray['owner-name'] = $contact_record['name'] ?? '';
|
'owner-name' => $contact_record['name'] ?? '',
|
||||||
$datarray['owner-link'] = $contact_record['url'] ?? '';
|
'owner-link' => $contact_record['url'] ?? '',
|
||||||
$datarray['owner-avatar'] = $contact_record['thumb'] ?? '';
|
'owner-avatar' => $contact_record['thumb'] ?? '',
|
||||||
$datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']);
|
'author-name' => $author['name'],
|
||||||
$datarray['author-name'] = $author['name'];
|
'author-link' => $author['url'],
|
||||||
$datarray['author-link'] = $author['url'];
|
'author-avatar' => $author['thumb'],
|
||||||
$datarray['author-avatar'] = $author['thumb'];
|
'created' => empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at'],
|
||||||
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link']);
|
'received' => DateTimeFormat::utcNow(),
|
||||||
$datarray['created'] = empty($_REQUEST['created_at']) ? DateTimeFormat::utcNow() : $_REQUEST['created_at'];
|
'extid' => $extid,
|
||||||
$datarray['edited'] = $datarray['created'];
|
'guid' => $guid,
|
||||||
$datarray['commented'] = $datarray['created'];
|
'uri' => $uri,
|
||||||
$datarray['changed'] = $datarray['created'];
|
'title' => $title,
|
||||||
$datarray['received'] = DateTimeFormat::utcNow();
|
'body' => $body,
|
||||||
$datarray['extid'] = $extid;
|
'app' => $app,
|
||||||
$datarray['guid'] = $guid;
|
'location' => $location,
|
||||||
$datarray['uri'] = $uri;
|
'coord' => $coord,
|
||||||
$datarray['title'] = $title;
|
'file' => $categories,
|
||||||
$datarray['body'] = $body;
|
'inform' => $inform,
|
||||||
$datarray['app'] = $app;
|
'verb' => $verb,
|
||||||
$datarray['location'] = $location;
|
'post-type' => $posttype,
|
||||||
$datarray['coord'] = $coord;
|
'object-type' => $objecttype,
|
||||||
$datarray['file'] = $categories;
|
'allow_cid' => $str_contact_allow,
|
||||||
$datarray['inform'] = $inform;
|
'allow_gid' => $str_group_allow,
|
||||||
$datarray['verb'] = $verb;
|
'deny_cid' => $str_contact_deny,
|
||||||
$datarray['post-type'] = $posttype;
|
'deny_gid' => $str_group_deny,
|
||||||
$datarray['object-type'] = $objecttype;
|
'private' => $private,
|
||||||
$datarray['allow_cid'] = $str_contact_allow;
|
'pubmail' => $pubmail_enabled,
|
||||||
$datarray['allow_gid'] = $str_group_allow;
|
'attach' => $attachments,
|
||||||
$datarray['deny_cid'] = $str_contact_deny;
|
'thr-parent' => $thr_parent_uri,
|
||||||
$datarray['deny_gid'] = $str_group_deny;
|
'postopts' => $postopts,
|
||||||
$datarray['private'] = $private;
|
'origin' => $origin,
|
||||||
$datarray['pubmail'] = $pubmail_enabled;
|
'object' => $object,
|
||||||
$datarray['attach'] = $attachments;
|
'attachments' => $_REQUEST['attachments'] ?? [],
|
||||||
|
|
||||||
$datarray['thr-parent'] = $thr_parent_uri;
|
|
||||||
|
|
||||||
$datarray['postopts'] = $postopts;
|
|
||||||
$datarray['origin'] = $origin;
|
|
||||||
$datarray['object'] = $object;
|
|
||||||
|
|
||||||
$datarray['attachments'] = $_REQUEST['attachments'] ?? [];
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These fields are for the convenience of addons...
|
* These fields are for the convenience of addons...
|
||||||
* 'self' if true indicates the owner is posting on their own wall
|
* 'self' if true indicates the owner is posting on their own wall
|
||||||
* If parent is 0 it is a top-level post.
|
* If parent is 0 it is a top-level post.
|
||||||
*/
|
*/
|
||||||
$datarray['parent'] = $toplevel_item_id;
|
'parent' => $toplevel_item_id,
|
||||||
$datarray['self'] = $self;
|
'self' => $self,
|
||||||
|
|
||||||
// This triggers posts via API and the mirror functions
|
// This triggers posts via API and the mirror functions
|
||||||
$datarray['api_source'] = $api_source;
|
'api_source' => $api_source,
|
||||||
|
|
||||||
// This field is for storing the raw conversation data
|
// This field is for storing the raw conversation data
|
||||||
$datarray['protocol'] = Conversation::PARCEL_DIRECT;
|
'protocol' => Conversation::PARCEL_DIRECT,
|
||||||
$datarray['direction'] = Conversation::PUSH;
|
'direction' => Conversation::PUSH,
|
||||||
|
];
|
||||||
|
|
||||||
if ($orig_post) {
|
// These cannot be part of above initialization ...
|
||||||
$datarray['edit'] = true;
|
$datarray['edited'] = $datarray['created'];
|
||||||
} else {
|
$datarray['commented'] = $datarray['created'];
|
||||||
// If this was a share, add missing data here
|
$datarray['changed'] = $datarray['created'];
|
||||||
$datarray = Item::addShareDataFromOriginal($datarray);
|
$datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']);
|
||||||
|
$datarray['author-id'] = Contact::getIdForURL($datarray['author-link']);
|
||||||
|
|
||||||
$datarray['edit'] = false;
|
$datarray['edit'] = $orig_post;
|
||||||
}
|
|
||||||
|
|
||||||
// Check for hashtags in the body and repair or add hashtag links
|
// Check for hashtags in the body and repair or add hashtag links
|
||||||
if ($preview || $orig_post) {
|
if ($preview || $orig_post) {
|
||||||
|
@ -613,14 +603,16 @@ function item_post(App $a) {
|
||||||
if ($preview) {
|
if ($preview) {
|
||||||
// We set the datarray ID to -1 because in preview mode the dataray
|
// We set the datarray ID to -1 because in preview mode the dataray
|
||||||
// doesn't have an ID.
|
// doesn't have an ID.
|
||||||
$datarray["id"] = -1;
|
$datarray['id'] = -1;
|
||||||
$datarray["uri-id"] = -1;
|
$datarray['uri-id'] = -1;
|
||||||
$datarray["author-network"] = Protocol::DFRN;
|
$datarray['author-network'] = Protocol::DFRN;
|
||||||
$datarray["author-updated"] = '';
|
$datarray['author-updated'] = '';
|
||||||
$datarray["author-gsid"] = 0;
|
$datarray['author-gsid'] = 0;
|
||||||
$datarray["author-uri-id"] = ItemURI::getIdByURI($datarray["author-link"]);
|
$datarray['author-uri-id'] = ItemURI::getIdByURI($datarray['author-link']);
|
||||||
$datarray["owner-updated"] = '';
|
$datarray['owner-updated'] = '';
|
||||||
$datarray["has-media"] = false;
|
$datarray['has-media'] = false;
|
||||||
|
$datarray['quote-uri-id'] = Item::getQuoteUriId($datarray['body'], $datarray['uid']);
|
||||||
|
$datarray['body'] = BBCode::removeSharedData($datarray['body']);
|
||||||
|
|
||||||
$o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
|
$o = DI::conversation()->create([array_merge($contact_record, $datarray)], 'search', false, true);
|
||||||
|
|
||||||
|
@ -641,7 +633,7 @@ function item_post(App $a) {
|
||||||
unset($datarray['self']);
|
unset($datarray['self']);
|
||||||
unset($datarray['api_source']);
|
unset($datarray['api_source']);
|
||||||
|
|
||||||
Post\Delayed::add($datarray['uri'], $datarray, PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
|
Post\Delayed::add($datarray['uri'], $datarray, Worker::PRIORITY_HIGH, Post\Delayed::PREPARED_NO_HOOK, $scheduled_at);
|
||||||
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -662,6 +654,12 @@ function item_post(App $a) {
|
||||||
|
|
||||||
$datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
|
$datarray['uri-id'] = ItemURI::getIdByURI($datarray['uri']);
|
||||||
|
|
||||||
|
$quote_uri_id = Item::getQuoteUriId($datarray['body'], $datarray['uid']);
|
||||||
|
if (!empty($quote_uri_id)) {
|
||||||
|
$datarray['quote-uri-id'] = $quote_uri_id;
|
||||||
|
$datarray['body'] = BBCode::removeSharedData($datarray['body']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($orig_post) {
|
if ($orig_post) {
|
||||||
$fields = [
|
$fields = [
|
||||||
'title' => $datarray['title'],
|
'title' => $datarray['title'],
|
||||||
|
@ -689,7 +687,7 @@ function item_post(App $a) {
|
||||||
$post_id = Item::insert($datarray);
|
$post_id = Item::insert($datarray);
|
||||||
|
|
||||||
if (!$post_id) {
|
if (!$post_id) {
|
||||||
notice(DI::l10n()->t('Item wasn\'t stored.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Item wasn\'t stored.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -710,7 +708,7 @@ function item_post(App $a) {
|
||||||
|
|
||||||
Tag::storeFromBody($datarray['uri-id'], $datarray['body']);
|
Tag::storeFromBody($datarray['uri-id'], $datarray['body']);
|
||||||
|
|
||||||
if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == GRAVITY_COMMENT)) {
|
if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == Item::GRAVITY_COMMENT)) {
|
||||||
Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']);
|
Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,7 +739,7 @@ function item_post(App $a) {
|
||||||
|
|
||||||
Hook::callAll('post_local_end', $datarray);
|
Hook::callAll('post_local_end', $datarray);
|
||||||
|
|
||||||
if (strlen($emailcc) && $profile_uid == local_user()) {
|
if (strlen($emailcc) && $profile_uid == DI::userSession()->getLocalUserId()) {
|
||||||
$recipients = explode(',', $emailcc);
|
$recipients = explode(',', $emailcc);
|
||||||
if (count($recipients)) {
|
if (count($recipients)) {
|
||||||
foreach ($recipients as $recipient) {
|
foreach ($recipients as $recipient) {
|
||||||
|
@ -755,7 +753,7 @@ function item_post(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info('post_complete');
|
Logger::debug('post_complete');
|
||||||
|
|
||||||
if ($api_source) {
|
if ($api_source) {
|
||||||
return $post_id;
|
return $post_id;
|
||||||
|
@ -780,14 +778,14 @@ function item_post_return($baseurl, $api_source, $return_path)
|
||||||
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
|
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info('post_json', ['json' => $json]);
|
Logger::debug('post_json', ['json' => $json]);
|
||||||
|
|
||||||
System::jsonExit($json);
|
System::jsonExit($json);
|
||||||
}
|
}
|
||||||
|
|
||||||
function item_content(App $a)
|
function item_content(App $a)
|
||||||
{
|
{
|
||||||
if (!Session::isAuthenticated()) {
|
if (!DI::userSession()->isAuthenticated()) {
|
||||||
throw new HTTPException\UnauthorizedException();
|
throw new HTTPException\UnauthorizedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,9 +799,9 @@ function item_content(App $a)
|
||||||
switch ($args->get(1)) {
|
switch ($args->get(1)) {
|
||||||
case 'drop':
|
case 'drop':
|
||||||
if (DI::mode()->isAjax()) {
|
if (DI::mode()->isAjax()) {
|
||||||
Item::deleteForUser(['id' => $args->get(2)], local_user());
|
Item::deleteForUser(['id' => $args->get(2)], DI::userSession()->getLocalUserId());
|
||||||
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
||||||
System::jsonExit([intval($args->get(2)), local_user()]);
|
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
|
||||||
} else {
|
} else {
|
||||||
if (!empty($args->get(3))) {
|
if (!empty($args->get(3))) {
|
||||||
$o = drop_item($args->get(2), $args->get(3));
|
$o = drop_item($args->get(2), $args->get(3));
|
||||||
|
@ -812,17 +810,18 @@ function item_content(App $a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'block':
|
case 'block':
|
||||||
$item = Post::selectFirstForUser(local_user(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
|
||||||
if (empty($item['author-id'])) {
|
if (empty($item['author-id'])) {
|
||||||
throw new HTTPException\NotFoundException('Item not found');
|
throw new HTTPException\NotFoundException('Item not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
Contact\User::setBlocked($item['author-id'], local_user(), true);
|
Contact\User::setBlocked($item['author-id'], DI::userSession()->getLocalUserId(), true);
|
||||||
|
|
||||||
if (DI::mode()->isAjax()) {
|
if (DI::mode()->isAjax()) {
|
||||||
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
// ajax return: [<item id>, 0 (no perm) | <owner id>]
|
||||||
System::jsonExit([intval($args->get(2)), local_user()]);
|
System::jsonExit([intval($args->get(2)), DI::userSession()->getLocalUserId()]);
|
||||||
} else {
|
} else {
|
||||||
item_redirect_after_action($item, $args->get(3));
|
item_redirect_after_action($item, $args->get(3));
|
||||||
}
|
}
|
||||||
|
@ -838,15 +837,15 @@ function item_content(App $a)
|
||||||
* @return string
|
* @return string
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
function drop_item(int $id, string $return = '')
|
function drop_item(int $id, string $return = ''): string
|
||||||
{
|
{
|
||||||
// locate item to be deleted
|
// Locate item to be deleted
|
||||||
$fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'];
|
$item = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'], ['id' => $id]);
|
||||||
$item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]);
|
|
||||||
|
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
notice(DI::l10n()->t('Item not found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
|
||||||
DI::baseUrl()->redirect('network');
|
DI::baseUrl()->redirect('network');
|
||||||
|
//NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['deleted']) {
|
if ($item['deleted']) {
|
||||||
|
@ -856,18 +855,19 @@ function drop_item(int $id, string $return = '')
|
||||||
$contact_id = 0;
|
$contact_id = 0;
|
||||||
|
|
||||||
// check if logged in user is either the author or owner of this item
|
// check if logged in user is either the author or owner of this item
|
||||||
if (Session::getRemoteContactID($item['uid']) == $item['contact-id']) {
|
if (DI::userSession()->getRemoteContactID($item['uid']) == $item['contact-id']) {
|
||||||
$contact_id = $item['contact-id'];
|
$contact_id = $item['contact-id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((local_user() == $item['uid']) || $contact_id) {
|
if ((DI::userSession()->getLocalUserId() == $item['uid']) || $contact_id) {
|
||||||
// delete the item
|
// delete the item
|
||||||
Item::deleteForUser(['id' => $item['id']], local_user());
|
Item::deleteForUser(['id' => $item['id']], DI::userSession()->getLocalUserId());
|
||||||
|
|
||||||
item_redirect_after_action($item, $return);
|
item_redirect_after_action($item, $return);
|
||||||
|
//NOTREACHED
|
||||||
} else {
|
} else {
|
||||||
Logger::notice('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
|
Logger::warning('Permission denied.', ['local' => DI::userSession()->getLocalUserId(), 'uid' => $item['uid'], 'cid' => $contact_id]);
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect('display/' . $item['guid']);
|
DI::baseUrl()->redirect('display/' . $item['guid']);
|
||||||
//NOTREACHED
|
//NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -875,17 +875,17 @@ function drop_item(int $id, string $return = '')
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function item_redirect_after_action($item, $returnUrlHex)
|
function item_redirect_after_action(array $item, string $returnUrlHex)
|
||||||
{
|
{
|
||||||
$return_url = hex2bin($returnUrlHex);
|
$return_url = hex2bin($returnUrlHex);
|
||||||
|
|
||||||
// removes update_* from return_url to ignore Ajax refresh
|
// removes update_* from return_url to ignore Ajax refresh
|
||||||
$return_url = str_replace("update_", "", $return_url);
|
$return_url = str_replace('update_', '', $return_url);
|
||||||
|
|
||||||
// Check if delete a comment
|
// Check if delete a comment
|
||||||
if ($item['gravity'] == GRAVITY_COMMENT) {
|
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
|
||||||
if (!empty($item['parent'])) {
|
if (!empty($item['parent'])) {
|
||||||
$parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]);
|
$parentitem = Post::selectFirstForUser(DI::userSession()->getLocalUserId(), ['guid'], ['id' => $item['parent']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return to parent guid
|
// Return to parent guid
|
||||||
|
|
|
@ -37,7 +37,7 @@ function lostpass_post(App $a)
|
||||||
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
|
$condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
|
||||||
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
|
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
notice(DI::l10n()->t('No valid account found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No valid account found.'));
|
||||||
DI::baseUrl()->redirect();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ function lostpass_post(App $a)
|
||||||
];
|
];
|
||||||
$result = DBA::update('user', $fields, ['uid' => $user['uid']]);
|
$result = DBA::update('user', $fields, ['uid' => $user['uid']]);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
info(DI::l10n()->t('Password reset request issued. Check your email.'));
|
DI::sysmsg()->addInfo(DI::l10n()->t('Password reset request issued. Check your email.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sitename = DI::config()->get('config', 'sitename');
|
$sitename = DI::config()->get('config', 'sitename');
|
||||||
|
@ -97,7 +97,7 @@ function lostpass_content(App $a)
|
||||||
|
|
||||||
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]);
|
$user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]);
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
|
||||||
|
|
||||||
return lostpass_form();
|
return lostpass_form();
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ function lostpass_content(App $a)
|
||||||
];
|
];
|
||||||
DBA::update('user', $fields, ['uid' => $user['uid']]);
|
DBA::update('user', $fields, ['uid' => $user['uid']]);
|
||||||
|
|
||||||
notice(DI::l10n()->t('Request has expired, please make a new one.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Request has expired, please make a new one.'));
|
||||||
|
|
||||||
return lostpass_form();
|
return lostpass_form();
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ function lostpass_generate_password($user)
|
||||||
'$newpass' => $new_password,
|
'$newpass' => $new_password,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
info(DI::l10n()->t("Your password has been reset."));
|
DI::sysmsg()->addInfo(DI::l10n()->t("Your password has been reset."));
|
||||||
|
|
||||||
$sitename = DI::config()->get('config', 'sitename');
|
$sitename = DI::config()->get('config', 'sitename');
|
||||||
$preamble = Strings::deindent(DI::l10n()->t('
|
$preamble = Strings::deindent(DI::l10n()->t('
|
||||||
|
|
|
@ -44,7 +44,7 @@ use Friendica\Module\Contact as ModuleContact;
|
||||||
*/
|
*/
|
||||||
function match_content(App $a)
|
function match_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,13 +53,13 @@ function match_content(App $a)
|
||||||
|
|
||||||
$_SESSION['return_path'] = DI::args()->getCommand();
|
$_SESSION['return_path'] = DI::args()->getCommand();
|
||||||
|
|
||||||
$profile = Profile::getByUID(local_user());
|
$profile = Profile::getByUID(DI::userSession()->getLocalUserId());
|
||||||
|
|
||||||
if (!DBA::isResult($profile)) {
|
if (!DBA::isResult($profile)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
|
if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
|
||||||
notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,10 +67,10 @@ function match_content(App $a)
|
||||||
$tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']);
|
$tags = trim($profile['pub_keywords'] . ' ' . $profile['prv_keywords']);
|
||||||
|
|
||||||
if (DI::mode()->isMobile()) {
|
if (DI::mode()->isMobile()) {
|
||||||
$limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
|
$limit = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
|
||||||
DI::config()->get('system', 'itemspage_network_mobile'));
|
DI::config()->get('system', 'itemspage_network_mobile'));
|
||||||
} else {
|
} else {
|
||||||
$limit = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
|
$limit = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
|
||||||
DI::config()->get('system', 'itemspage_network'));
|
DI::config()->get('system', 'itemspage_network'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function match_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($entries)) {
|
if (empty($entries)) {
|
||||||
info(DI::l10n()->t('No matches'));
|
DI::sysmsg()->addInfo(DI::l10n()->t('No matches'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
|
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
|
||||||
|
@ -114,12 +114,12 @@ function match_get_contacts($msearch, $entries, $limit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Already known contact
|
// Already known contact
|
||||||
$contact = Contact::getByURL($profile->url, null, ['rel'], local_user());
|
$contact = Contact::getByURL($profile->url, null, ['rel'], DI::userSession()->getLocalUserId());
|
||||||
if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
|
if (!empty($contact) && in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = Contact::getByURLForUser($profile->url, local_user());
|
$contact = Contact::getByURLForUser($profile->url, DI::userSession()->getLocalUserId());
|
||||||
if (!empty($contact)) {
|
if (!empty($contact)) {
|
||||||
$entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact);
|
$entries[$contact['id']] = ModuleContact::getContactTemplateVars($contact);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ function message_init(App $a)
|
||||||
$tabs = '';
|
$tabs = '';
|
||||||
|
|
||||||
if (DI::args()->getArgc() > 1 && is_numeric(DI::args()->getArgv()[1])) {
|
if (DI::args()->getArgc() > 1 && is_numeric(DI::args()->getArgv()[1])) {
|
||||||
$tabs = render_messages(get_messages(local_user(), 0, 5), 'mail_list.tpl');
|
$tabs = render_messages(get_messages(DI::userSession()->getLocalUserId(), 0, 5), 'mail_list.tpl');
|
||||||
}
|
}
|
||||||
|
|
||||||
$new = [
|
$new = [
|
||||||
|
@ -65,8 +65,8 @@ function message_init(App $a)
|
||||||
|
|
||||||
function message_post(App $a)
|
function message_post(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,17 +80,20 @@ function message_post(App $a)
|
||||||
|
|
||||||
switch ($ret) {
|
switch ($ret) {
|
||||||
case -1:
|
case -1:
|
||||||
notice(DI::l10n()->t('No recipient selected.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
|
||||||
$norecip = true;
|
$norecip = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -2:
|
case -2:
|
||||||
notice(DI::l10n()->t('Unable to locate contact information.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.'));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -3:
|
case -3:
|
||||||
notice(DI::l10n()->t('Message could not be sent.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -4:
|
case -4:
|
||||||
notice(DI::l10n()->t('Message collection failure.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +110,8 @@ function message_content(App $a)
|
||||||
$o = '';
|
$o = '';
|
||||||
Nav::setSelected('messages');
|
Nav::setSelected('messages');
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return Login::form();
|
return Login::form();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,29 +144,29 @@ function message_content(App $a)
|
||||||
|
|
||||||
$cmd = DI::args()->getArgv()[1];
|
$cmd = DI::args()->getArgv()[1];
|
||||||
if ($cmd === 'drop') {
|
if ($cmd === 'drop') {
|
||||||
$message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
|
$message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if(!DBA::isResult($message)){
|
if(!DBA::isResult($message)){
|
||||||
notice(DI::l10n()->t('Conversation not found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.'));
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) {
|
if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()])) {
|
||||||
notice(DI::l10n()->t('Message was not deleted.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
|
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if(!DBA::isResult($conversation)){
|
if(!DBA::isResult($conversation)){
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('message/' . $conversation['id'] );
|
DI::baseUrl()->redirect('message/' . $conversation['id'] );
|
||||||
} else {
|
} else {
|
||||||
$parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
|
$parentmail = DBA::selectFirst('mail', ['parent-uri'], ['id' => DI::args()->getArgv()[2], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (DBA::isResult($parentmail)) {
|
if (DBA::isResult($parentmail)) {
|
||||||
$parent = $parentmail['parent-uri'];
|
$parent = $parentmail['parent-uri'];
|
||||||
|
|
||||||
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
|
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => DI::userSession()->getLocalUserId()])) {
|
||||||
notice(DI::l10n()->t('Conversation was not removed.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
|
@ -212,14 +215,14 @@ function message_content(App $a)
|
||||||
|
|
||||||
$o .= $header;
|
$o .= $header;
|
||||||
|
|
||||||
$total = DBA::count('mail', ['uid' => local_user()], ['distinct' => true, 'expression' => 'parent-uri']);
|
$total = DBA::count('mail', ['uid' => DI::userSession()->getLocalUserId()], ['distinct' => true, 'expression' => 'parent-uri']);
|
||||||
|
|
||||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
||||||
|
|
||||||
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
$r = get_messages(DI::userSession()->getLocalUserId(), $pager->getStart(), $pager->getItemsPerPage());
|
||||||
|
|
||||||
if (!DBA::isResult($r)) {
|
if (!DBA::isResult($r)) {
|
||||||
notice(DI::l10n()->t('No messages.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,14 +243,14 @@ function message_content(App $a)
|
||||||
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
|
LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
|
||||||
WHERE `mail`.`uid` = ? AND `mail`.`id` = ?
|
WHERE `mail`.`uid` = ? AND `mail`.`id` = ?
|
||||||
LIMIT 1",
|
LIMIT 1",
|
||||||
local_user(),
|
DI::userSession()->getLocalUserId(),
|
||||||
DI::args()->getArgv()[1]
|
DI::args()->getArgv()[1]
|
||||||
);
|
);
|
||||||
if (DBA::isResult($message)) {
|
if (DBA::isResult($message)) {
|
||||||
$contact_id = $message['contact-id'];
|
$contact_id = $message['contact-id'];
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
local_user(),
|
DI::userSession()->getLocalUserId(),
|
||||||
$message['parent-uri']
|
$message['parent-uri']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -269,13 +272,13 @@ function message_content(App $a)
|
||||||
|
|
||||||
$messages = DBA::toArray($messages_stmt);
|
$messages = DBA::toArray($messages_stmt);
|
||||||
|
|
||||||
DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]);
|
DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
} else {
|
} else {
|
||||||
$messages = false;
|
$messages = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($messages)) {
|
if (!DBA::isResult($messages)) {
|
||||||
notice(DI::l10n()->t('Message not available.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.'));
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +344,6 @@ function message_content(App $a)
|
||||||
'$canreply' => (($unknown) ? false : '1'),
|
'$canreply' => (($unknown) ? false : '1'),
|
||||||
'$unknown_text' => DI::l10n()->t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
|
'$unknown_text' => DI::l10n()->t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."),
|
||||||
'$mails' => $mails,
|
'$mails' => $mails,
|
||||||
|
|
||||||
// reply
|
// reply
|
||||||
'$header' => DI::l10n()->t('Send Reply'),
|
'$header' => DI::l10n()->t('Send Reply'),
|
||||||
'$to' => DI::l10n()->t('To:'),
|
'$to' => DI::l10n()->t('To:'),
|
||||||
|
@ -368,7 +370,7 @@ function message_content(App $a)
|
||||||
* @param int $limit
|
* @param int $limit
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_messages(int $uid, int $start, int $limit)
|
function get_messages(int $uid, int $start, int $limit): array
|
||||||
{
|
{
|
||||||
return DBA::toArray(DBA::p('SELECT
|
return DBA::toArray(DBA::p('SELECT
|
||||||
m.`id`,
|
m.`id`,
|
||||||
|
@ -414,7 +416,7 @@ function get_messages(int $uid, int $start, int $limit)
|
||||||
, $uid, $uid, $start, $limit));
|
, $uid, $uid, $start, $limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_messages(array $msg, $t)
|
function render_messages(array $msg, string $t): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Module\BaseProfile;
|
||||||
|
|
||||||
function notes_init(App $a)
|
function notes_init(App $a)
|
||||||
{
|
{
|
||||||
if (! local_user()) {
|
if (! DI::userSession()->getLocalUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ function notes_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function notes_content(App $a, $update = false)
|
function notes_content(App $a, bool $update = false)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ function notes_content(App $a, $update = false)
|
||||||
|
|
||||||
$x = [
|
$x = [
|
||||||
'lockstate' => 'lock',
|
'lockstate' => 'lock',
|
||||||
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(local_user(), DI::l10n()->t('Personal notes are visible only by yourself.')),
|
'acl' => \Friendica\Core\ACL::getSelfOnlyHTML(DI::userSession()->getLocalUserId(), DI::l10n()->t('Personal notes are visible only by yourself.')),
|
||||||
'button' => DI::l10n()->t('Save'),
|
'button' => DI::l10n()->t('Save'),
|
||||||
'acl_data' => '',
|
'acl_data' => '',
|
||||||
];
|
];
|
||||||
|
@ -60,14 +60,14 @@ function notes_content(App $a, $update = false)
|
||||||
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
|
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
|
||||||
}
|
}
|
||||||
|
|
||||||
$condition = ['uid' => local_user(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => GRAVITY_PARENT,
|
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
|
||||||
'contact-id'=> $a->getContactId()];
|
'contact-id'=> $a->getContactId()];
|
||||||
|
|
||||||
if (DI::mode()->isMobile()) {
|
if (DI::mode()->isMobile()) {
|
||||||
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network',
|
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
|
||||||
DI::config()->get('system', 'itemspage_network_mobile'));
|
DI::config()->get('system', 'itemspage_network_mobile'));
|
||||||
} else {
|
} else {
|
||||||
$itemsPerPage = DI::pConfig()->get(local_user(), 'system', 'itemspage_network',
|
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
|
||||||
DI::config()->get('system', 'itemspage_network'));
|
DI::config()->get('system', 'itemspage_network'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ function notes_content(App $a, $update = false)
|
||||||
|
|
||||||
$params = ['order' => ['created' => true],
|
$params = ['order' => ['created' => true],
|
||||||
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
$r = Post::selectThreadForUser(local_user(), ['uri-id'], $condition, $params);
|
$r = Post::selectThreadForUser(DI::userSession()->getLocalUserId(), ['uri-id'], $condition, $params);
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
|
|
|
@ -20,25 +20,84 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Content\Text\BBCode;
|
||||||
|
use Friendica\Content\Text\HTML;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
use Friendica\Module\Security\Login;
|
use Friendica\Module\Security\Login;
|
||||||
|
use Friendica\Util\XML;
|
||||||
|
|
||||||
function oexchange_init(App $a) {
|
function oexchange_init(App $a)
|
||||||
|
{
|
||||||
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'xrd')) {
|
if ((DI::args()->getArgc() <= 1) || (DI::args()->getArgv()[1] != 'xrd')) {
|
||||||
$tpl = Renderer::getMarkupTemplate('oexchange_xrd.tpl');
|
return;
|
||||||
|
|
||||||
$o = Renderer::replaceMacros($tpl, ['$base' => DI::baseUrl()]);
|
|
||||||
System::httpExit($o, Response::TYPE_XML, 'application/xrd+xml');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function oexchange_content(App $a) {
|
$baseURL = DI::baseUrl()->get();
|
||||||
|
|
||||||
if (!local_user()) {
|
$xml = null;
|
||||||
|
|
||||||
|
XML::fromArray([
|
||||||
|
'XRD' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'xmlns' => 'http://docs.oasis-open.org/ns/xri/xrd-1.0',
|
||||||
|
],
|
||||||
|
'Subject' => $baseURL,
|
||||||
|
'1:Property' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'type' => 'http://www.oexchange.org/spec/0.8/prop/vendor',
|
||||||
|
],
|
||||||
|
'Friendica'
|
||||||
|
],
|
||||||
|
'2:Property' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'type' => 'http://www.oexchange.org/spec/0.8/prop/title',
|
||||||
|
],
|
||||||
|
'Friendica Social Network'
|
||||||
|
],
|
||||||
|
'3:Property' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'type' => 'http://www.oexchange.org/spec/0.8/prop/name',
|
||||||
|
],
|
||||||
|
'Friendica'
|
||||||
|
],
|
||||||
|
'4:Property' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'type' => 'http://www.oexchange.org/spec/0.8/prop/prompt',
|
||||||
|
],
|
||||||
|
'Send to Friendica'
|
||||||
|
],
|
||||||
|
'1:link' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'rel' => 'icon',
|
||||||
|
'type' => 'image/png',
|
||||||
|
'href' => $baseURL . '/images/friendica-16.png'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'2:link' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'rel' => 'icon32',
|
||||||
|
'type' => 'image/png',
|
||||||
|
'href' => $baseURL . '/images/friendica-32.png'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'3:link' => [
|
||||||
|
'@attributes' => [
|
||||||
|
'rel' => 'http://www.oexchange.org/spec/0.8/rel/offer',
|
||||||
|
'type' => 'text/html',
|
||||||
|
'href' => $baseURL . '/oexchange'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
],
|
||||||
|
], $xml);
|
||||||
|
|
||||||
|
System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/xrd+xml');
|
||||||
|
}
|
||||||
|
|
||||||
|
function oexchange_content(App $a)
|
||||||
|
{
|
||||||
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
$o = Login::form();
|
$o = Login::form();
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +111,7 @@ function oexchange_content(App $a) {
|
||||||
$description = !empty($_REQUEST['description']) ? trim($_REQUEST['description']) : '';
|
$description = !empty($_REQUEST['description']) ? trim($_REQUEST['description']) : '';
|
||||||
$tags = !empty($_REQUEST['tags']) ? trim($_REQUEST['tags']) : '';
|
$tags = !empty($_REQUEST['tags']) ? trim($_REQUEST['tags']) : '';
|
||||||
|
|
||||||
$s = \Friendica\Content\Text\BBCode::embedURL($url, true, $title, $description, $tags);
|
$s = BBCode::embedURL($url, true, $title, $description, $tags);
|
||||||
|
|
||||||
if (!strlen($s)) {
|
if (!strlen($s)) {
|
||||||
return;
|
return;
|
||||||
|
@ -60,11 +119,11 @@ function oexchange_content(App $a) {
|
||||||
|
|
||||||
$post = [];
|
$post = [];
|
||||||
|
|
||||||
$post['profile_uid'] = local_user();
|
$post['profile_uid'] = DI::userSession()->getLocalUserId();
|
||||||
$post['return'] = '/oexchange/done';
|
$post['return'] = '/oexchange/done';
|
||||||
$post['body'] = Friendica\Content\Text\HTML::toBBCode($s);
|
$post['body'] = HTML::toBBCode($s);
|
||||||
|
|
||||||
$_REQUEST = $post;
|
$_REQUEST = $post;
|
||||||
require_once('mod/item.php');
|
require_once 'mod/item.php';
|
||||||
item_post($a);
|
item_post($a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,22 +27,21 @@ use Friendica\Model\Contact;
|
||||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||||
use Friendica\Protocol\ActivityPub;
|
use Friendica\Protocol\ActivityPub;
|
||||||
|
|
||||||
function ostatus_subscribe_content(App $a)
|
function ostatus_subscribe_content(App $a): string
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect('ostatus_subscribe');
|
DI::baseUrl()->redirect('ostatus_subscribe');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$o = '<h2>' . DI::l10n()->t('Subscribing to contacts') . '</h2>';
|
$o = '<h2>' . DI::l10n()->t('Subscribing to contacts') . '</h2>';
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$counter = intval($_REQUEST['counter'] ?? 0);
|
$counter = intval($_REQUEST['counter'] ?? 0);
|
||||||
|
|
||||||
if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') {
|
if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') {
|
||||||
|
|
||||||
if ($_REQUEST['url'] == '') {
|
if ($_REQUEST['url'] == '') {
|
||||||
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
|
DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
|
||||||
return $o . DI::l10n()->t('No contact provided.');
|
return $o . DI::l10n()->t('No contact provided.');
|
||||||
|
|
173
mod/photos.php
173
mod/photos.php
|
@ -30,7 +30,6 @@ use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -55,9 +54,9 @@ use Friendica\Util\Temporal;
|
||||||
use Friendica\Util\XML;
|
use Friendica\Util\XML;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
|
|
||||||
function photos_init(App $a) {
|
function photos_init(App $a)
|
||||||
|
{
|
||||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,11 +68,11 @@ function photos_init(App $a) {
|
||||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_owner = (local_user() && (local_user() == $owner['uid']));
|
$is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner['uid']));
|
||||||
|
|
||||||
$albums = Photo::getAlbums($owner['uid']);
|
$albums = Photo::getAlbums($owner['uid']);
|
||||||
|
|
||||||
$albums_visible = ((intval($owner['hidewall']) && !Session::isAuthenticated()) ? false : true);
|
$albums_visible = ((intval($owner['hidewall']) && !DI::userSession()->isAuthenticated()) ? false : true);
|
||||||
|
|
||||||
// add various encodings to the array so we can just loop through and pick them out in a template
|
// add various encodings to the array so we can just loop through and pick them out in a template
|
||||||
$ret = ['success' => false];
|
$ret = ['success' => false];
|
||||||
|
@ -96,7 +95,7 @@ function photos_init(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (local_user() && $owner['uid'] == local_user()) {
|
if (DI::userSession()->getLocalUserId() && $owner['uid'] == DI::userSession()->getLocalUserId()) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
} else {
|
} else {
|
||||||
$can_post = false;
|
$can_post = false;
|
||||||
|
@ -148,23 +147,23 @@ function photos_post(App $a)
|
||||||
$page_owner_uid = intval($user['uid']);
|
$page_owner_uid = intval($user['uid']);
|
||||||
$community_page = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
$community_page = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||||
|
|
||||||
if (local_user() && (local_user() == $page_owner_uid)) {
|
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
|
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
|
||||||
$contact_id = Session::getRemoteContactID($page_owner_uid);
|
$contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
$visitor = $contact_id;
|
$visitor = $contact_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$can_post) {
|
if (!$can_post) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner_record = User::getOwnerDataById($page_owner_uid);
|
$owner_record = User::getOwnerDataById($page_owner_uid);
|
||||||
|
|
||||||
if (!$owner_record) {
|
if (!$owner_record) {
|
||||||
notice(DI::l10n()->t('Contact information unavailable'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Contact information unavailable'));
|
||||||
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
DI::logger()->info('photos_post: unable to locate contact record for page owner. uid=' . $page_owner_uid);
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
@ -193,7 +192,7 @@ function photos_post(App $a)
|
||||||
$album = hex2bin(DI::args()->getArgv()[3]);
|
$album = hex2bin(DI::args()->getArgv()[3]);
|
||||||
|
|
||||||
if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid, 'photo-type' => Photo::DEFAULT])) {
|
if (!DBA::exists('photo', ['album' => $album, 'uid' => $page_owner_uid, 'photo-type' => Photo::DEFAULT])) {
|
||||||
notice(DI::l10n()->t('Album not found.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Album not found.'));
|
||||||
DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album');
|
DI::baseUrl()->redirect('photos/' . $user['nickname'] . '/album');
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -229,7 +228,7 @@ function photos_post(App $a)
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$r = DBA::toArray(DBA::p("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = ? AND `album` = ?",
|
$r = DBA::toArray(DBA::p("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = ? AND `album` = ?",
|
||||||
local_user(),
|
DI::userSession()->getLocalUserId(),
|
||||||
$album
|
$album
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -247,9 +246,9 @@ function photos_post(App $a)
|
||||||
|
|
||||||
// Update the photo albums cache
|
// Update the photo albums cache
|
||||||
Photo::clearAlbumCache($page_owner_uid);
|
Photo::clearAlbumCache($page_owner_uid);
|
||||||
notice(DI::l10n()->t('Album successfully deleted'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Album successfully deleted'));
|
||||||
} else {
|
} else {
|
||||||
notice(DI::l10n()->t('Album was empty.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Album was empty.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +267,7 @@ function photos_post(App $a)
|
||||||
$condition = ['contact-id' => $visitor, 'uid' => $page_owner_uid, 'resource-id' => DI::args()->getArgv()[3]];
|
$condition = ['contact-id' => $visitor, 'uid' => $page_owner_uid, 'resource-id' => DI::args()->getArgv()[3]];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$condition = ['uid' => local_user(), 'resource-id' => DI::args()->getArgv()[3]];
|
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'resource-id' => DI::args()->getArgv()[3]];
|
||||||
}
|
}
|
||||||
|
|
||||||
$photo = DBA::selectFirst('photo', ['resource-id'], $condition);
|
$photo = DBA::selectFirst('photo', ['resource-id'], $condition);
|
||||||
|
@ -281,7 +280,7 @@ function photos_post(App $a)
|
||||||
// Update the photo albums cache
|
// Update the photo albums cache
|
||||||
Photo::clearAlbumCache($page_owner_uid);
|
Photo::clearAlbumCache($page_owner_uid);
|
||||||
} else {
|
} else {
|
||||||
notice(DI::l10n()->t('Failed to delete the photo.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to delete the photo.'));
|
||||||
DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1] . '/image/' . DI::args()->getArgv()[3]);
|
DI::baseUrl()->redirect('photos/' . DI::args()->getArgv()[1] . '/image/' . DI::args()->getArgv()[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +303,7 @@ function photos_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
|
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
|
||||||
Logger::notice('rotate');
|
Logger::debug('rotate');
|
||||||
|
|
||||||
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);
|
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);
|
||||||
|
|
||||||
|
@ -526,44 +525,40 @@ function photos_post(App $a)
|
||||||
foreach ($taginfo as $tagged) {
|
foreach ($taginfo as $tagged) {
|
||||||
$uri = Item::newURI();
|
$uri = Item::newURI();
|
||||||
|
|
||||||
$arr = [];
|
$arr = [
|
||||||
$arr['guid'] = System::createUUID();
|
'guid' => System::createUUID(),
|
||||||
$arr['uid'] = $page_owner_uid;
|
'uid' => $page_owner_uid,
|
||||||
$arr['uri'] = $uri;
|
'uri' => $uri,
|
||||||
$arr['wall'] = 1;
|
'wall' => 1,
|
||||||
$arr['contact-id'] = $owner_record['id'];
|
'contact-id' => $owner_record['id'],
|
||||||
$arr['owner-name'] = $owner_record['name'];
|
'owner-name' => $owner_record['name'],
|
||||||
$arr['owner-link'] = $owner_record['url'];
|
'owner-link' => $owner_record['url'],
|
||||||
$arr['owner-avatar'] = $owner_record['thumb'];
|
'owner-avatar' => $owner_record['thumb'],
|
||||||
$arr['author-name'] = $owner_record['name'];
|
'author-name' => $owner_record['name'],
|
||||||
$arr['author-link'] = $owner_record['url'];
|
'author-link' => $owner_record['url'],
|
||||||
$arr['author-avatar'] = $owner_record['thumb'];
|
'author-avatar' => $owner_record['thumb'],
|
||||||
$arr['title'] = '';
|
'title' => '',
|
||||||
$arr['allow_cid'] = $photo['allow_cid'];
|
'allow_cid' => $photo['allow_cid'],
|
||||||
$arr['allow_gid'] = $photo['allow_gid'];
|
'allow_gid' => $photo['allow_gid'],
|
||||||
$arr['deny_cid'] = $photo['deny_cid'];
|
'deny_cid' => $photo['deny_cid'],
|
||||||
$arr['deny_gid'] = $photo['deny_gid'];
|
'deny_gid' => $photo['deny_gid'],
|
||||||
$arr['visible'] = 0;
|
'visible' => 0,
|
||||||
$arr['verb'] = Activity::TAG;
|
'verb' => Activity::TAG,
|
||||||
$arr['gravity'] = GRAVITY_PARENT;
|
'gravity' => Item::GRAVITY_PARENT,
|
||||||
$arr['object-type'] = Activity\ObjectType::PERSON;
|
'object-type' => Activity\ObjectType::PERSON,
|
||||||
$arr['target-type'] = Activity\ObjectType::IMAGE;
|
'target-type' => Activity\ObjectType::IMAGE,
|
||||||
$arr['inform'] = $tagged[2];
|
'inform' => $tagged[2],
|
||||||
$arr['origin'] = 1;
|
'origin' => 1,
|
||||||
$arr['body'] = DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
|
'body' => DI::l10n()->t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . DI::l10n()->t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') . "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . '/photo/' . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n",
|
||||||
$arr['body'] .= "\n\n" . '[url=' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
|
'object' => '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n"),
|
||||||
|
'target' => '<target><type>' . Activity\ObjectType::IMAGE . '</type><title>' . $photo['desc'] . '</title><id>' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="' . $photo['type'] . '" href="' . DI::baseUrl() . '/photo/' . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>',
|
||||||
|
];
|
||||||
|
|
||||||
$arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
|
|
||||||
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
|
|
||||||
if ($tagged[3]) {
|
if ($tagged[3]) {
|
||||||
$arr['object'] .= XML::escape('<link rel="photo" type="' . $photo['type'] . '" href="' . $tagged[3]['photo'] . '" />' . "\n");
|
$arr['object'] .= XML::escape('<link rel="photo" type="' . $photo['type'] . '" href="' . $tagged[3]['photo'] . '" />' . "\n");
|
||||||
}
|
}
|
||||||
$arr['object'] .= '</link></object>' . "\n";
|
$arr['object'] .= '</link></object>' . "\n";
|
||||||
|
|
||||||
$arr['target'] = '<target><type>' . Activity\ObjectType::IMAGE . '</type><title>' . $photo['desc'] . '</title><id>'
|
|
||||||
. DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '</id>';
|
|
||||||
$arr['target'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . DI::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . '" />' . "\n" . '<link rel="preview" type="' . $photo['type'] . '" href="' . DI::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
|
|
||||||
|
|
||||||
Item::insert($arr);
|
Item::insert($arr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -580,7 +575,7 @@ function photos_post(App $a)
|
||||||
$album = trim($_REQUEST['album'] ?? '');
|
$album = trim($_REQUEST['album'] ?? '');
|
||||||
$newalbum = trim($_REQUEST['newalbum'] ?? '');
|
$newalbum = trim($_REQUEST['newalbum'] ?? '');
|
||||||
|
|
||||||
Logger::info('album= ' . $album . ' newalbum= ' . $newalbum);
|
Logger::debug('album= ' . $album . ' newalbum= ' . $newalbum);
|
||||||
|
|
||||||
if (!strlen($album)) {
|
if (!strlen($album)) {
|
||||||
if (strlen($newalbum)) {
|
if (strlen($newalbum)) {
|
||||||
|
@ -633,21 +628,21 @@ function photos_post(App $a)
|
||||||
if ($error !== UPLOAD_ERR_OK) {
|
if ($error !== UPLOAD_ERR_OK) {
|
||||||
switch ($error) {
|
switch ($error) {
|
||||||
case UPLOAD_ERR_INI_SIZE:
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
notice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', ini_get('upload_max_filesize')));
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_FORM_SIZE:
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($_REQUEST['MAX_FILE_SIZE'] ?? 0)));
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_PARTIAL:
|
case UPLOAD_ERR_PARTIAL:
|
||||||
notice(DI::l10n()->t('Image upload didn\'t complete, please try again'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image upload didn\'t complete, please try again'));
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_FILE:
|
case UPLOAD_ERR_NO_FILE:
|
||||||
notice(DI::l10n()->t('Image file is missing'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image file is missing'));
|
||||||
break;
|
break;
|
||||||
case UPLOAD_ERR_NO_TMP_DIR:
|
case UPLOAD_ERR_NO_TMP_DIR:
|
||||||
case UPLOAD_ERR_CANT_WRITE:
|
case UPLOAD_ERR_CANT_WRITE:
|
||||||
case UPLOAD_ERR_EXTENSION:
|
case UPLOAD_ERR_EXTENSION:
|
||||||
notice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Server can\'t accept new file upload at this time, please contact your administrator'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
|
@ -663,7 +658,7 @@ function photos_post(App $a)
|
||||||
$maximagesize = DI::config()->get('system', 'maximagesize');
|
$maximagesize = DI::config()->get('system', 'maximagesize');
|
||||||
|
|
||||||
if ($maximagesize && ($filesize > $maximagesize)) {
|
if ($maximagesize && ($filesize > $maximagesize)) {
|
||||||
notice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)));
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
$foo = 0;
|
$foo = 0;
|
||||||
Hook::callAll('photo_post_end', $foo);
|
Hook::callAll('photo_post_end', $foo);
|
||||||
|
@ -671,22 +666,22 @@ function photos_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$filesize) {
|
if (!$filesize) {
|
||||||
notice(DI::l10n()->t('Image file is empty.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image file is empty.'));
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
$foo = 0;
|
$foo = 0;
|
||||||
Hook::callAll('photo_post_end', $foo);
|
Hook::callAll('photo_post_end', $foo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info('loading the contents of ' . $src);
|
Logger::debug('loading contents', ['src' => $src]);
|
||||||
|
|
||||||
$imagedata = @file_get_contents($src);
|
$imagedata = @file_get_contents($src);
|
||||||
|
|
||||||
$image = new Image($imagedata, $type);
|
$image = new Image($imagedata, $type);
|
||||||
|
|
||||||
if (!$image->isValid()) {
|
if (!$image->isValid()) {
|
||||||
Logger::info('unable to process image');
|
Logger::notice('unable to process image');
|
||||||
notice(DI::l10n()->t('Unable to process image.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Unable to process image.'));
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
$foo = 0;
|
$foo = 0;
|
||||||
Hook::callAll('photo_post_end',$foo);
|
Hook::callAll('photo_post_end',$foo);
|
||||||
|
@ -711,8 +706,8 @@ function photos_post(App $a)
|
||||||
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0 , Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
|
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0 , Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
|
||||||
|
|
||||||
if (!$r) {
|
if (!$r) {
|
||||||
Logger::info('image store failed');
|
Logger::warning('image store failed');
|
||||||
notice(DI::l10n()->t('Image upload failed.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Image upload failed.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,13 +793,13 @@ function photos_content(App $a)
|
||||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
|
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
|
||||||
notice(DI::l10n()->t('Public access denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($user)) {
|
if (empty($user)) {
|
||||||
notice(DI::l10n()->t('No photos selected'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('No photos selected'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,10 +839,10 @@ function photos_content(App $a)
|
||||||
|
|
||||||
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
|
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
|
||||||
|
|
||||||
if (local_user() && (local_user() == $owner_uid)) {
|
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
} elseif ($community_page && !empty(Session::getRemoteContactID($owner_uid))) {
|
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($owner_uid))) {
|
||||||
$contact_id = Session::getRemoteContactID($owner_uid);
|
$contact_id = DI::userSession()->getRemoteContactID($owner_uid);
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
||||||
|
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
|
@ -858,22 +853,22 @@ function photos_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// perhaps they're visiting - but not a community page, so they wouldn't have write access
|
// perhaps they're visiting - but not a community page, so they wouldn't have write access
|
||||||
if (!empty(Session::getRemoteContactID($owner_uid)) && !$visitor) {
|
if (!empty(DI::userSession()->getRemoteContactID($owner_uid)) && !$visitor) {
|
||||||
$contact_id = Session::getRemoteContactID($owner_uid);
|
$contact_id = DI::userSession()->getRemoteContactID($owner_uid);
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
||||||
|
|
||||||
$remote_contact = DBA::isResult($contact);
|
$remote_contact = DBA::isResult($contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$remote_contact && local_user()) {
|
if (!$remote_contact && DI::userSession()->getLocalUserId()) {
|
||||||
$contact_id = $_SESSION['cid'];
|
$contact_id = $_SESSION['cid'];
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => $owner_uid, 'blocked' => false, 'pending' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user['hidewall'] && (local_user() != $owner_uid) && !$remote_contact) {
|
if ($user['hidewall'] && (DI::userSession()->getLocalUserId() != $owner_uid) && !$remote_contact) {
|
||||||
notice(DI::l10n()->t('Access to this item is restricted.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Access to this item is restricted.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -882,13 +877,13 @@ function photos_content(App $a)
|
||||||
$o = "";
|
$o = "";
|
||||||
|
|
||||||
// tabs
|
// tabs
|
||||||
$is_owner = (local_user() && (local_user() == $owner_uid));
|
$is_owner = (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $owner_uid));
|
||||||
$o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
|
$o .= BaseProfile::getTabsHTML($a, 'photos', $is_owner, $user['nickname'], $profile['hide-friends']);
|
||||||
|
|
||||||
// Display upload form
|
// Display upload form
|
||||||
if ($datatype === 'upload') {
|
if ($datatype === 'upload') {
|
||||||
if (!$can_post) {
|
if (!$can_post) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,9 +1083,9 @@ function photos_content(App $a)
|
||||||
|
|
||||||
if (!DBA::isResult($ph)) {
|
if (!DBA::isResult($ph)) {
|
||||||
if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
|
if (DBA::exists('photo', ['resource-id' => $datum, 'uid' => $owner_uid])) {
|
||||||
notice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied. Access to this item may be restricted.'));
|
||||||
} else {
|
} else {
|
||||||
notice(DI::l10n()->t('Photo not available'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Photo not available'));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1201,7 +1196,7 @@ function photos_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$ph[0]['uid'] == local_user()
|
$ph[0]['uid'] == DI::userSession()->getLocalUserId()
|
||||||
&& (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
|
&& (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid']) || strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid']))
|
||||||
) {
|
) {
|
||||||
$tools['lock'] = DI::l10n()->t('Private Photo');
|
$tools['lock'] = DI::l10n()->t('Private Photo');
|
||||||
|
@ -1233,7 +1228,7 @@ function photos_content(App $a)
|
||||||
$link_item = Post::selectFirst([], ["`resource-id` = ?" . $sql_extra, $datum]);
|
$link_item = Post::selectFirst([], ["`resource-id` = ?" . $sql_extra, $datum]);
|
||||||
|
|
||||||
if (!empty($link_item['parent']) && !empty($link_item['uid'])) {
|
if (!empty($link_item['parent']) && !empty($link_item['uid'])) {
|
||||||
$condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], GRAVITY_COMMENT];
|
$condition = ["`parent` = ? AND `gravity` = ?", $link_item['parent'], Item::GRAVITY_COMMENT];
|
||||||
$total = Post::count($condition);
|
$total = Post::count($condition);
|
||||||
|
|
||||||
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
|
||||||
|
@ -1241,7 +1236,7 @@ function photos_content(App $a)
|
||||||
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
|
||||||
$items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params));
|
$items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params));
|
||||||
|
|
||||||
if (local_user() == $link_item['uid']) {
|
if (DI::userSession()->getLocalUserId() == $link_item['uid']) {
|
||||||
Item::update(['unseen' => false], ['parent' => $link_item['parent']]);
|
Item::update(['unseen' => false], ['parent' => $link_item['parent']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1319,7 +1314,7 @@ function photos_content(App $a)
|
||||||
*/
|
*/
|
||||||
$qcomment = null;
|
$qcomment = null;
|
||||||
if (Addon::isEnabled('qcomment')) {
|
if (Addon::isEnabled('qcomment')) {
|
||||||
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
|
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
|
||||||
$qcomment = $words ? explode("\n", $words) : [];
|
$qcomment = $words ? explode("\n", $words) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1350,7 +1345,7 @@ function photos_content(App $a)
|
||||||
'attendmaybe' => []
|
'attendmaybe' => []
|
||||||
];
|
];
|
||||||
|
|
||||||
if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) {
|
if (DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike')) {
|
||||||
unset($conv_responses['dislike']);
|
unset($conv_responses['dislike']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1375,7 +1370,7 @@ function photos_content(App $a)
|
||||||
*/
|
*/
|
||||||
$qcomment = null;
|
$qcomment = null;
|
||||||
if (Addon::isEnabled('qcomment')) {
|
if (Addon::isEnabled('qcomment')) {
|
||||||
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
|
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
|
||||||
$qcomment = $words ? explode("\n", $words) : [];
|
$qcomment = $words ? explode("\n", $words) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1404,7 +1399,7 @@ function photos_content(App $a)
|
||||||
|
|
||||||
if (($activity->match($item['verb'], Activity::LIKE) ||
|
if (($activity->match($item['verb'], Activity::LIKE) ||
|
||||||
$activity->match($item['verb'], Activity::DISLIKE)) &&
|
$activity->match($item['verb'], Activity::DISLIKE)) &&
|
||||||
($item['gravity'] != GRAVITY_PARENT)) {
|
($item['gravity'] != Item::GRAVITY_PARENT)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,7 +1412,7 @@ function photos_content(App $a)
|
||||||
$sparkle = '';
|
$sparkle = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == local_user()));
|
$dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == DI::userSession()->getLocalUserId()));
|
||||||
$drop = [
|
$drop = [
|
||||||
'dropping' => $dropping,
|
'dropping' => $dropping,
|
||||||
'pagedrop' => false,
|
'pagedrop' => false,
|
||||||
|
@ -1449,7 +1444,7 @@ function photos_content(App $a)
|
||||||
*/
|
*/
|
||||||
$qcomment = null;
|
$qcomment = null;
|
||||||
if (Addon::isEnabled('qcomment')) {
|
if (Addon::isEnabled('qcomment')) {
|
||||||
$words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
|
$words = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'qcomment', 'words');
|
||||||
$qcomment = $words ? explode("\n", $words) : [];
|
$qcomment = $words ? explode("\n", $words) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1488,7 +1483,7 @@ function photos_content(App $a)
|
||||||
'$dislike' => DI::l10n()->t('Dislike'),
|
'$dislike' => DI::l10n()->t('Dislike'),
|
||||||
'$wait' => DI::l10n()->t('Please wait'),
|
'$wait' => DI::l10n()->t('Please wait'),
|
||||||
'$dislike_title' => DI::l10n()->t('I don\'t like this (toggle)'),
|
'$dislike_title' => DI::l10n()->t('I don\'t like this (toggle)'),
|
||||||
'$hide_dislike' => DI::pConfig()->get(local_user(), 'system', 'hide_dislike'),
|
'$hide_dislike' => DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike'),
|
||||||
'$responses' => $responses,
|
'$responses' => $responses,
|
||||||
'$return_path' => DI::args()->getQueryString(),
|
'$return_path' => DI::args()->getQueryString(),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -24,13 +24,10 @@ use Friendica\App;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Renderer;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Module\Response;
|
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\XML;
|
|
||||||
|
|
||||||
function poco_init(App $a) {
|
function poco_init(App $a) {
|
||||||
if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
|
if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
|
||||||
|
@ -229,12 +226,9 @@ function poco_init(App $a) {
|
||||||
|
|
||||||
Logger::info("End of poco");
|
Logger::info("End of poco");
|
||||||
|
|
||||||
if ($format === 'xml') {
|
|
||||||
System::httpExit(Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret])), Response::TYPE_XML);
|
|
||||||
}
|
|
||||||
if ($format === 'json') {
|
if ($format === 'json') {
|
||||||
System::jsonExit($ret);
|
System::jsonExit($ret);
|
||||||
} else {
|
} else {
|
||||||
throw new \Friendica\Network\HTTPException\InternalServerErrorException();
|
throw new \Friendica\Network\HTTPException\UnsupportedMediaTypeException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ function pubsub_post(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only import feeds from OStatus here
|
// We only import feeds from OStatus here
|
||||||
if ($contact['network'] != Protocol::OSTATUS) {
|
if (!in_array($contact['network'], [Protocol::ACTIVITYPUB, Protocol::OSTATUS])) {
|
||||||
Logger::warning('Unexpected network', ['contact' => $contact]);
|
Logger::warning('Unexpected network', ['contact' => $contact]);
|
||||||
hub_post_return();
|
hub_post_return();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -32,7 +31,7 @@ use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
function redir_init(App $a) {
|
function redir_init(App $a) {
|
||||||
if (!Session::isAuthenticated()) {
|
if (!DI::userSession()->isAuthenticated()) {
|
||||||
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +51,7 @@ function redir_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name'];
|
$fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name'];
|
||||||
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
|
$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, DI::userSession()->getLocalUserId()]]);
|
||||||
if (!DBA::isResult($contact)) {
|
if (!DBA::isResult($contact)) {
|
||||||
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
|
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
|
||||||
}
|
}
|
||||||
|
@ -65,10 +64,10 @@ function redir_init(App $a) {
|
||||||
$a->redirect($url ?: $contact_url);
|
$a->redirect($url ?: $contact_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['uid'] == 0 && local_user()) {
|
if ($contact['uid'] == 0 && DI::userSession()->getLocalUserId()) {
|
||||||
// Let's have a look if there is an established connection
|
// Let's have a look if there is an established connection
|
||||||
// between the public contact we have found and the local user.
|
// between the public contact we have found and the local user.
|
||||||
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
|
$contact = DBA::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
|
|
||||||
if (DBA::isResult($contact)) {
|
if (DBA::isResult($contact)) {
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
|
@ -83,7 +82,7 @@ function redir_init(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remote_user()) {
|
if (DI::userSession()->getRemoteUserId()) {
|
||||||
$host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3);
|
$host = substr(DI::baseUrl()->getUrlPath() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''), strpos(DI::baseUrl()->getUrlPath(), '://') + 3);
|
||||||
$remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
|
$remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
|
||||||
|
|
||||||
|
@ -91,7 +90,7 @@ function redir_init(App $a) {
|
||||||
// with the local contact. Otherwise the local user would ask the local contact
|
// with the local contact. Otherwise the local user would ask the local contact
|
||||||
// for authentification everytime he/she is visiting a profile page of the local
|
// for authentification everytime he/she is visiting a profile page of the local
|
||||||
// contact.
|
// contact.
|
||||||
if (($host == $remotehost) && (Session::getRemoteContactID(Session::get('visitor_visiting')) == Session::get('visitor_id'))) {
|
if (($host == $remotehost) && (DI::userSession()->getRemoteContactID(DI::session()->get('visitor_visiting')) == DI::session()->get('visitor_id'))) {
|
||||||
// Remote user is already authenticated.
|
// Remote user is already authenticated.
|
||||||
redir_check_url($contact_url, $url);
|
redir_check_url($contact_url, $url);
|
||||||
$target_url = $url ?: $contact_url;
|
$target_url = $url ?: $contact_url;
|
||||||
|
|
|
@ -28,11 +28,11 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
function removeme_post(App $a)
|
function removeme_post(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_SESSION['submanage'])) {
|
if (DI::userSession()->getSubManagedUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ function removeme_post(App $a)
|
||||||
->withMessage(
|
->withMessage(
|
||||||
$l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'),
|
$l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'),
|
||||||
$l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
|
$l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
|
||||||
$l10n->t('The user id is %d', local_user()))
|
$l10n->t('The user id is %d', DI::userSession()->getLocalUserId()))
|
||||||
->forUser($admin)
|
->forUser($admin)
|
||||||
->withRecipient($admin['email'])
|
->withRecipient($admin['email'])
|
||||||
->build();
|
->build();
|
||||||
|
@ -83,7 +83,7 @@ function removeme_post(App $a)
|
||||||
|
|
||||||
function removeme_content(App $a)
|
function removeme_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
DI::baseUrl()->redirect();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,15 @@ use Friendica\Model\Contact;
|
||||||
|
|
||||||
function repair_ostatus_content(App $a) {
|
function repair_ostatus_content(App $a) {
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect('ostatus_repair');
|
DI::baseUrl()->redirect('ostatus_repair');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$o = '<h2>' . DI::l10n()->t('Resubscribing to OStatus contacts') . '</h2>';
|
$o = '<h2>' . DI::l10n()->t('Resubscribing to OStatus contacts') . '</h2>';
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$counter = intval($_REQUEST['counter'] ?? 0);
|
$counter = intval($_REQUEST['counter'] ?? 0);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function repair_ostatus_content(App $a) {
|
||||||
$total = DBA::count('contact', $condition);
|
$total = DBA::count('contact', $condition);
|
||||||
|
|
||||||
if (!$total) {
|
if (!$total) {
|
||||||
return ($o . DI::l10n()->t('Error'));
|
return ($o . DI::l10n()->tt('Error', 'Errors', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = Contact::selectToArray(['url'], $condition, ['order' => ['url'], 'limit' => [$counter++, 1]]);
|
$contact = Contact::selectToArray(['url'], $condition, ['order' => ['url'], 'limit' => [$counter++, 1]]);
|
||||||
|
|
|
@ -36,8 +36,8 @@ use Friendica\Protocol\Email;
|
||||||
|
|
||||||
function settings_init(App $a)
|
function settings_init(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,11 +47,11 @@ function settings_init(App $a)
|
||||||
function settings_post(App $a)
|
function settings_post(App $a)
|
||||||
{
|
{
|
||||||
if (!$a->isLoggedIn()) {
|
if (!$a->isLoggedIn()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_SESSION['submanage'])) {
|
if (DI::userSession()->getSubManagedUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,13 +69,13 @@ function settings_post(App $a)
|
||||||
BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_connectors');
|
BaseModule::checkFormSecurityTokenRedirectOnError(DI::args()->getQueryString(), 'settings_connectors');
|
||||||
|
|
||||||
if (!empty($_POST['general-submit'])) {
|
if (!empty($_POST['general-submit'])) {
|
||||||
DI::pConfig()->set(local_user(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
|
||||||
DI::pConfig()->set(local_user(), 'system', 'disable_cw', !intval($_POST['enable_cw']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'disable_cw', !intval($_POST['enable_cw']));
|
||||||
DI::pConfig()->set(local_user(), 'system', 'enable_cw_self', intval($_POST['enable_cw_self']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'enable_cw_self', intval($_POST['enable_cw_self']));
|
||||||
DI::pConfig()->set(local_user(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_intelligent_shortening', !intval($_POST['enable_smart_shortening']));
|
||||||
DI::pConfig()->set(local_user(), 'system', 'simple_shortening', intval($_POST['simple_shortening']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'simple_shortening', intval($_POST['simple_shortening']));
|
||||||
DI::pConfig()->set(local_user(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
|
||||||
DI::pConfig()->set(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
|
||||||
} elseif (!empty($_POST['mail-submit'])) {
|
} elseif (!empty($_POST['mail-submit'])) {
|
||||||
$mail_server = $_POST['mail_server'] ?? '';
|
$mail_server = $_POST['mail_server'] ?? '';
|
||||||
$mail_port = $_POST['mail_port'] ?? '';
|
$mail_port = $_POST['mail_port'] ?? '';
|
||||||
|
@ -88,13 +88,13 @@ function settings_post(App $a)
|
||||||
$mail_pubmail = $_POST['mail_pubmail'] ?? '';
|
$mail_pubmail = $_POST['mail_pubmail'] ?? '';
|
||||||
|
|
||||||
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
|
if (function_exists('imap_open') && !DI::config()->get('system', 'imap_disabled')) {
|
||||||
if (!DBA::exists('mailacct', ['uid' => local_user()])) {
|
if (!DBA::exists('mailacct', ['uid' => DI::userSession()->getLocalUserId()])) {
|
||||||
DBA::insert('mailacct', ['uid' => local_user()]);
|
DBA::insert('mailacct', ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
}
|
}
|
||||||
if (strlen($mail_pass)) {
|
if (strlen($mail_pass)) {
|
||||||
$pass = '';
|
$pass = '';
|
||||||
openssl_public_encrypt($mail_pass, $pass, $user['pubkey']);
|
openssl_public_encrypt($mail_pass, $pass, $user['pubkey']);
|
||||||
DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]);
|
DBA::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = DBA::update('mailacct', [
|
$r = DBA::update('mailacct', [
|
||||||
|
@ -107,10 +107,10 @@ function settings_post(App $a)
|
||||||
'mailbox' => 'INBOX',
|
'mailbox' => 'INBOX',
|
||||||
'reply_to' => $mail_replyto,
|
'reply_to' => $mail_replyto,
|
||||||
'pubmail' => $mail_pubmail
|
'pubmail' => $mail_pubmail
|
||||||
], ['uid' => local_user()]);
|
], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
|
|
||||||
Logger::notice('updating mailaccount', ['response' => $r]);
|
Logger::debug('updating mailaccount', ['response' => $r]);
|
||||||
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]);
|
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (DBA::isResult($mailacct)) {
|
if (DBA::isResult($mailacct)) {
|
||||||
$mb = Email::constructMailboxName($mailacct);
|
$mb = Email::constructMailboxName($mailacct);
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ function settings_post(App $a)
|
||||||
$mbox = Email::connect($mb, $mail_user, $dcrpass);
|
$mbox = Email::connect($mb, $mail_user, $dcrpass);
|
||||||
unset($dcrpass);
|
unset($dcrpass);
|
||||||
if (!$mbox) {
|
if (!$mbox) {
|
||||||
notice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Failed to connect with email account using the settings provided.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ function settings_post(App $a)
|
||||||
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features');
|
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features');
|
||||||
foreach ($_POST as $k => $v) {
|
foreach ($_POST as $k => $v) {
|
||||||
if (strpos($k, 'feature_') === 0) {
|
if (strpos($k, 'feature_') === 0) {
|
||||||
DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
|
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -148,13 +148,13 @@ function settings_content(App $a)
|
||||||
$o = '';
|
$o = '';
|
||||||
Nav::setSelected('settings');
|
Nav::setSelected('settings');
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
//notice(DI::l10n()->t('Permission denied.'));
|
//DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return Login::form();
|
return Login::form();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_SESSION['submanage'])) {
|
if (DI::userSession()->getSubManagedUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,12 +162,12 @@ function settings_content(App $a)
|
||||||
if ((DI::args()->getArgc() > 3) && (DI::args()->getArgv()[2] === 'delete')) {
|
if ((DI::args()->getArgc() > 3) && (DI::args()->getArgv()[2] === 'delete')) {
|
||||||
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
|
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
|
||||||
|
|
||||||
DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => local_user()]);
|
DBA::delete('application-token', ['application-id' => DI::args()->getArgv()[3], 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
DI::baseUrl()->redirect('settings/oauth/', true);
|
DI::baseUrl()->redirect('settings/oauth/', true);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => local_user()]);
|
$applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
|
$tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
|
||||||
$o .= Renderer::replaceMacros($tpl, [
|
$o .= Renderer::replaceMacros($tpl, [
|
||||||
|
@ -226,7 +226,7 @@ function settings_content(App $a)
|
||||||
$arr[$fname] = [];
|
$arr[$fname] = [];
|
||||||
$arr[$fname][0] = $fdata[0];
|
$arr[$fname][0] = $fdata[0];
|
||||||
foreach (array_slice($fdata,1) as $f) {
|
foreach (array_slice($fdata,1) as $f) {
|
||||||
$arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(local_user(), $f[0]), $f[2]];
|
$arr[$fname][1][] = ['feature_' . $f[0], $f[1], Feature::isEnabled(DI::userSession()->getLocalUserId(), $f[0]), $f[2]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,13 +241,13 @@ function settings_content(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors')) {
|
if ((DI::args()->getArgc() > 1) && (DI::args()->getArgv()[1] === 'connectors')) {
|
||||||
$accept_only_sharer = intval(DI::pConfig()->get(local_user(), 'system', 'accept_only_sharer'));
|
$accept_only_sharer = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'accept_only_sharer'));
|
||||||
$enable_cw = !intval(DI::pConfig()->get(local_user(), 'system', 'disable_cw'));
|
$enable_cw = !intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'disable_cw'));
|
||||||
$enable_cw_self = intval(DI::pConfig()->get(local_user(), 'system', 'enable_cw_self'));
|
$enable_cw_self = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'enable_cw_self'));
|
||||||
$enable_smart_shortening = !intval(DI::pConfig()->get(local_user(), 'system', 'no_intelligent_shortening'));
|
$enable_smart_shortening = !intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_intelligent_shortening'));
|
||||||
$simple_shortening = intval(DI::pConfig()->get(local_user(), 'system', 'simple_shortening'));
|
$simple_shortening = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'simple_shortening'));
|
||||||
$attach_link_title = intval(DI::pConfig()->get(local_user(), 'system', 'attach_link_title'));
|
$attach_link_title = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'attach_link_title'));
|
||||||
$legacy_contact = DI::pConfig()->get(local_user(), 'ostatus', 'legacy_contact');
|
$legacy_contact = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'ostatus', 'legacy_contact');
|
||||||
|
|
||||||
if (!empty($legacy_contact)) {
|
if (!empty($legacy_contact)) {
|
||||||
/// @todo Isn't it supposed to be a $a->internalRedirect() call?
|
/// @todo Isn't it supposed to be a $a->internalRedirect() call?
|
||||||
|
@ -281,7 +281,7 @@ function settings_content(App $a)
|
||||||
|
|
||||||
$mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (!DI::config()->get('system', 'imap_disabled'))) ? 0 : 1);
|
||||||
if (!$mail_disabled) {
|
if (!$mail_disabled) {
|
||||||
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]);
|
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
} else {
|
} else {
|
||||||
$mailacct = null;
|
$mailacct = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,32 +30,22 @@ use Friendica\Model\Post;
|
||||||
function share_init(App $a) {
|
function share_init(App $a) {
|
||||||
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
||||||
|
|
||||||
if (!$post_id || !local_user()) {
|
if (!$post_id || !DI::userSession()->getLocalUserId()) {
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = ['private', 'body', 'author-name', 'author-link', 'author-avatar',
|
$fields = ['private', 'body', 'uri'];
|
||||||
'guid', 'created', 'plink', 'title'];
|
|
||||||
$item = Post::selectFirst($fields, ['id' => $post_id]);
|
$item = Post::selectFirst($fields, ['id' => $post_id]);
|
||||||
|
|
||||||
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
|
if (!DBA::isResult($item) || $item['private'] == Item::PRIVATE) {
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strpos($item['body'], "[/share]") !== false) {
|
$shared = DI::contentItem()->getSharedPost($item, ['uri']);
|
||||||
$pos = strpos($item['body'], "[share");
|
if (!empty($shared) && empty($shared['comment'])) {
|
||||||
$o = substr($item['body'], $pos);
|
$content = '[share]' . $shared['post']['uri'] . '[/share]';
|
||||||
} else {
|
} else {
|
||||||
$o = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid']);
|
$content = '[share]' . $item['uri'] . '[/share]';
|
||||||
|
|
||||||
if ($item['title']) {
|
|
||||||
$o .= '[h3]'.$item['title'].'[/h3]'."\n";
|
|
||||||
}
|
}
|
||||||
|
System::httpExit($content);
|
||||||
$o .= $item['body'];
|
|
||||||
$o .= "[/share]";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $o;
|
|
||||||
System::exit();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Network\HTTPException;
|
||||||
|
|
||||||
function suggest_content(App $a)
|
function suggest_content(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ function suggest_content(App $a)
|
||||||
DI::page()['aside'] .= Widget::findPeople();
|
DI::page()['aside'] .= Widget::findPeople();
|
||||||
DI::page()['aside'] .= Widget::follow();
|
DI::page()['aside'] .= Widget::follow();
|
||||||
|
|
||||||
$contacts = Contact\Relation::getSuggestions(local_user());
|
$contacts = Contact\Relation::getSuggestions(DI::userSession()->getLocalUserId());
|
||||||
if (!DBA::isResult($contacts)) {
|
if (!DBA::isResult($contacts)) {
|
||||||
return DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.');
|
return DI::l10n()->t('No suggestions available. If this is a new site, please try again in 24 hours.');
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -35,9 +34,9 @@ use Friendica\Protocol\Activity;
|
||||||
use Friendica\Util\XML;
|
use Friendica\Util\XML;
|
||||||
use Friendica\Worker\Delivery;
|
use Friendica\Worker\Delivery;
|
||||||
|
|
||||||
function tagger_content(App $a) {
|
function tagger_content(App $a)
|
||||||
|
{
|
||||||
if (!Session::isAuthenticated()) {
|
if (!DI::userSession()->isAuthenticated()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +50,7 @@ function tagger_content(App $a) {
|
||||||
|
|
||||||
$item_id = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : 0);
|
$item_id = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : 0);
|
||||||
|
|
||||||
Logger::notice('tagger: tag ' . $term . ' item ' . $item_id);
|
Logger::info('tagger: tag', ['term' => $term, 'item' => $item_id]);
|
||||||
|
|
||||||
|
|
||||||
$item = Post::selectFirst([], ['id' => $item_id]);
|
$item = Post::selectFirst([], ['id' => $item_id]);
|
||||||
|
@ -63,13 +62,13 @@ function tagger_content(App $a) {
|
||||||
|
|
||||||
$owner_uid = $item['uid'];
|
$owner_uid = $item['uid'];
|
||||||
|
|
||||||
if (local_user() != $owner_uid) {
|
if (DI::userSession()->getLocalUserId() != $owner_uid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]);
|
$contact = Contact::selectFirst([], ['self' => true, 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (!DBA::isResult($contact)) {
|
if (!DBA::isResult($contact)) {
|
||||||
Logger::notice('tagger: no contact_id');
|
Logger::warning('Self contact not found.', ['uid' => DI::userSession()->getLocalUserId()]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,41 +115,41 @@ EOT;
|
||||||
|
|
||||||
$termlink = html_entity_decode('⌗') . '[url=' . DI::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]';
|
$termlink = html_entity_decode('⌗') . '[url=' . DI::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]';
|
||||||
|
|
||||||
$arr = [];
|
|
||||||
|
|
||||||
$arr['guid'] = System::createUUID();
|
|
||||||
$arr['uri'] = $uri;
|
|
||||||
$arr['uid'] = $owner_uid;
|
|
||||||
$arr['contact-id'] = $contact['id'];
|
|
||||||
$arr['wall'] = $item['wall'];
|
|
||||||
$arr['gravity'] = GRAVITY_COMMENT;
|
|
||||||
$arr['parent'] = $item['id'];
|
|
||||||
$arr['thr-parent'] = $item['uri'];
|
|
||||||
$arr['owner-name'] = $item['author-name'];
|
|
||||||
$arr['owner-link'] = $item['author-link'];
|
|
||||||
$arr['owner-avatar'] = $item['author-avatar'];
|
|
||||||
$arr['author-name'] = $contact['name'];
|
|
||||||
$arr['author-link'] = $contact['url'];
|
|
||||||
$arr['author-avatar'] = $contact['thumb'];
|
|
||||||
|
|
||||||
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||||
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
|
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
|
||||||
$plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]';
|
$plink = '[url=' . $item['plink'] . ']' . $post_type . '[/url]';
|
||||||
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink, $termlink );
|
|
||||||
|
|
||||||
$arr['verb'] = Activity::TAG;
|
$arr = [
|
||||||
$arr['target-type'] = $targettype;
|
'guid' => System::createUUID(),
|
||||||
$arr['target'] = $target;
|
'uri' => $uri,
|
||||||
$arr['object-type'] = $objtype;
|
'uid' => $owner_uid,
|
||||||
$arr['object'] = $obj;
|
'contact-id' => $contact['id'],
|
||||||
$arr['private'] = $item['private'];
|
'wall' => $item['wall'],
|
||||||
$arr['allow_cid'] = $item['allow_cid'];
|
'gravity' => Item::GRAVITY_COMMENT,
|
||||||
$arr['allow_gid'] = $item['allow_gid'];
|
'parent' => $item['id'],
|
||||||
$arr['deny_cid'] = $item['deny_cid'];
|
'thr-parent' => $item['uri'],
|
||||||
$arr['deny_gid'] = $item['deny_gid'];
|
'owner-name' => $item['author-name'],
|
||||||
$arr['visible'] = 1;
|
'owner-link' => $item['author-link'],
|
||||||
$arr['unseen'] = 1;
|
'owner-avatar' => $item['author-avatar'],
|
||||||
$arr['origin'] = 1;
|
'author-name' => $contact['name'],
|
||||||
|
'author-link' => $contact['url'],
|
||||||
|
'author-avatar' => $contact['thumb'],
|
||||||
|
'body' => sprintf($bodyverb, $ulink, $alink, $plink, $termlink),
|
||||||
|
'verb' => Activity::TAG,
|
||||||
|
'target-type' => $targettype,
|
||||||
|
'target' => $target,
|
||||||
|
'object-type' => $objtype,
|
||||||
|
'object' => $obj,
|
||||||
|
'private' => $item['private'],
|
||||||
|
'allow_cid' => $item['allow_cid'],
|
||||||
|
'allow_gid' => $item['allow_gid'],
|
||||||
|
'deny_cid' => $item['deny_cid'],
|
||||||
|
'deny_gid' => $item['deny_gid'],
|
||||||
|
'visible' => 1,
|
||||||
|
'unseen' => 1,
|
||||||
|
'origin' => 1,
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
$post_id = Item::insert($arr);
|
$post_id = Item::insert($arr);
|
||||||
|
|
||||||
|
@ -166,6 +165,6 @@ EOT;
|
||||||
|
|
||||||
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
|
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
|
||||||
|
|
||||||
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
Worker::add(Worker::PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Friendica\Model\Tag;
|
||||||
|
|
||||||
function tagrm_post(App $a)
|
function tagrm_post(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
DI::baseUrl()->redirect($_SESSION['photo_return']);
|
DI::baseUrl()->redirect($_SESSION['photo_return']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ function update_tags($item_id, $tags)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
|
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ function tagrm_content(App $a)
|
||||||
|
|
||||||
$photo_return = $_SESSION['photo_return'] ?? '';
|
$photo_return = $_SESSION['photo_return'] ?? '';
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
DI::baseUrl()->redirect($photo_return);
|
DI::baseUrl()->redirect($photo_return);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ function tagrm_content(App $a)
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => local_user()]);
|
$item = Post::selectFirst(['uri-id'], ['id' => $item_id, 'uid' => DI::userSession()->getLocalUserId()]);
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
DI::baseUrl()->redirect($photo_return);
|
DI::baseUrl()->redirect($photo_return);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\DI;
|
||||||
function uimport_post(App $a)
|
function uimport_post(App $a)
|
||||||
{
|
{
|
||||||
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ function uimport_post(App $a)
|
||||||
function uimport_content(App $a)
|
function uimport_content(App $a)
|
||||||
{
|
{
|
||||||
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
if ((DI::config()->get('config', 'register_policy') != \Friendica\Module\Register::OPEN) && !$a->isSiteAdmin()) {
|
||||||
notice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('User imports on closed servers can only be done by an administrator.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ function uimport_content(App $a)
|
||||||
$total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]);
|
$total = DBA::count('user', ["`register_date` > UTC_TIMESTAMP - INTERVAL 1 DAY"]);
|
||||||
if ($total >= $max_dailies) {
|
if ($total >= $max_dailies) {
|
||||||
Logger::notice('max daily registrations exceeded.');
|
Logger::notice('max daily registrations exceeded.');
|
||||||
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
function unfollow_post(App $a)
|
function unfollow_post(App $a)
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect('login');
|
DI::baseUrl()->redirect('login');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -46,29 +46,29 @@ function unfollow_content(App $a)
|
||||||
{
|
{
|
||||||
$base_return_path = 'contact';
|
$base_return_path = 'contact';
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect('login');
|
DI::baseUrl()->redirect('login');
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
$url = trim($_REQUEST['url']);
|
$url = trim($_REQUEST['url']);
|
||||||
|
|
||||||
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
|
$condition = ["`uid` = ? AND (`rel` = ? OR `rel` = ?) AND (`nurl` = ? OR `alias` = ? OR `alias` = ?)",
|
||||||
local_user(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
|
DI::userSession()->getLocalUserId(), Contact::SHARING, Contact::FRIEND, Strings::normaliseLink($url),
|
||||||
Strings::normaliseLink($url), $url];
|
Strings::normaliseLink($url), $url];
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition);
|
$contact = DBA::selectFirst('contact', ['url', 'id', 'uid', 'network', 'addr', 'name'], $condition);
|
||||||
|
|
||||||
if (!DBA::isResult($contact)) {
|
if (!DBA::isResult($contact)) {
|
||||||
notice(DI::l10n()->t("You aren't following this contact."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact."));
|
||||||
DI::baseUrl()->redirect($base_return_path);
|
DI::baseUrl()->redirect($base_return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Protocol::supportsFollow($contact['network'])) {
|
if (!Protocol::supportsFollow($contact['network'])) {
|
||||||
notice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Unfollowing is currently not supported by your network.'));
|
||||||
DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
|
DI::baseUrl()->redirect($base_return_path . '/' . $contact['id']);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ function unfollow_content(App $a)
|
||||||
$self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
|
$self = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
|
||||||
|
|
||||||
if (!DBA::isResult($self)) {
|
if (!DBA::isResult($self)) {
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
DI::baseUrl()->redirect($base_return_path);
|
DI::baseUrl()->redirect($base_return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ function unfollow_process(string $url)
|
||||||
{
|
{
|
||||||
$base_return_path = 'contact';
|
$base_return_path = 'contact';
|
||||||
|
|
||||||
$uid = local_user();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
|
|
||||||
$owner = User::getOwnerDataById($uid);
|
$owner = User::getOwnerDataById($uid);
|
||||||
if (!$owner) {
|
if (!$owner) {
|
||||||
|
@ -131,7 +131,7 @@ function unfollow_process(string $url)
|
||||||
$contact = DBA::selectFirst('contact', [], $condition);
|
$contact = DBA::selectFirst('contact', [], $condition);
|
||||||
|
|
||||||
if (!DBA::isResult($contact)) {
|
if (!DBA::isResult($contact)) {
|
||||||
notice(DI::l10n()->t("You aren't following this contact."));
|
DI::sysmsg()->addNotice(DI::l10n()->t("You aren't following this contact."));
|
||||||
DI::baseUrl()->redirect($base_return_path);
|
DI::baseUrl()->redirect($base_return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,6 @@ function unfollow_process(string $url)
|
||||||
$notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator');
|
$notice_message = DI::l10n()->t('Unable to unfollow this contact, please contact your administrator');
|
||||||
}
|
}
|
||||||
|
|
||||||
notice($notice_message);
|
DI::sysmsg()->addNotice($notice_message);
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Model\Contact;
|
||||||
|
|
||||||
function update_contact_content(App $a)
|
function update_contact_content(App $a)
|
||||||
{
|
{
|
||||||
if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update'))) {
|
if (!empty(DI::args()->get(1)) && (!empty($_GET['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update'))) {
|
||||||
$contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']);
|
$contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']);
|
||||||
if (DBA::isResult($contact) && empty($contact['deleted'])) {
|
if (DBA::isResult($contact) && empty($contact['deleted'])) {
|
||||||
DI::page()['aside'] = '';
|
DI::page()['aside'] = '';
|
||||||
|
|
|
@ -24,11 +24,11 @@ use Friendica\App;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
require_once("mod/notes.php");
|
require_once 'mod/notes.php';
|
||||||
|
|
||||||
function update_notes_content(App $a) {
|
function update_notes_content(App $a)
|
||||||
|
{
|
||||||
$profile_uid = intval($_GET["p"]);
|
$profile_uid = intval($_GET['p']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Session;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -28,21 +28,23 @@ use Friendica\Model\Attach;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
function wall_attach_post(App $a) {
|
function wall_attach_post(App $a)
|
||||||
|
{
|
||||||
$r_json = (!empty($_GET['response']) && $_GET['response']=='json');
|
$isJson = (!empty($_GET['response']) && $_GET['response'] == 'json');
|
||||||
|
|
||||||
if (DI::args()->getArgc() > 1) {
|
if (DI::args()->getArgc() > 1) {
|
||||||
$nick = DI::args()->getArgv()[1];
|
$nick = DI::args()->getArgv()[1];
|
||||||
$owner = User::getOwnerDataByNick($nick);
|
$owner = User::getOwnerDataByNick($nick);
|
||||||
if (!DBA::isResult($owner)) {
|
if (!DBA::isResult($owner)) {
|
||||||
if ($r_json) {
|
Logger::warning('owner is not a valid record:', ['owner' => $owner, 'nick' => $nick]);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($r_json) {
|
Logger::warning('Argument count is zero or one (invalid)');
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,77 +57,80 @@ function wall_attach_post(App $a) {
|
||||||
$page_owner_cid = $owner['id'];
|
$page_owner_cid = $owner['id'];
|
||||||
$community_page = $owner['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
$community_page = $owner['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||||
|
|
||||||
if (local_user() && (local_user() == $page_owner_uid)) {
|
if (DI::userSession()->getLocalUserId() && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
|
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
|
||||||
$contact_id = Session::getRemoteContactID($page_owner_uid);
|
$contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
|
||||||
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
|
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$can_post) {
|
if (!$can_post) {
|
||||||
if ($r_json) {
|
Logger::warning('User does not have required permissions', ['contact_id' => $contact_id, 'page_owner_uid' => $page_owner_uid]);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Permission denied.') . EOL );
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_FILES['userfile'])) {
|
if (empty($_FILES['userfile'])) {
|
||||||
if ($r_json) {
|
Logger::warning('No file uploaded (empty userfile)');
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$src = $_FILES['userfile']['tmp_name'];
|
$tempFileName = $_FILES['userfile']['tmp_name'];
|
||||||
$filename = basename($_FILES['userfile']['name']);
|
$fileName = basename($_FILES['userfile']['name']);
|
||||||
$filesize = intval($_FILES['userfile']['size']);
|
$fileSize = intval($_FILES['userfile']['size']);
|
||||||
|
$maxFileSize = DI::config()->get('system', 'maxfilesize');
|
||||||
|
|
||||||
$maxfilesize = DI::config()->get('system','maxfilesize');
|
/*
|
||||||
|
* Found html code written in text field of form, when trying to upload a
|
||||||
/* Found html code written in text field of form,
|
* file with filesize greater than upload_max_filesize. Cause is unknown.
|
||||||
* when trying to upload a file with filesize
|
|
||||||
* greater than upload_max_filesize. Cause is unknown.
|
|
||||||
* Then Filesize gets <= 0.
|
* Then Filesize gets <= 0.
|
||||||
*/
|
*/
|
||||||
|
if ($fileSize <= 0) {
|
||||||
if ($filesize <= 0) {
|
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . '<br />' . DI::l10n()->t('Or - did you try to upload an empty file?');
|
||||||
$msg = DI::l10n()->t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(DI::l10n()->t('Or - did you try to upload an empty file?'));
|
Logger::warning($msg, ['fileSize' => $fileSize]);
|
||||||
@unlink($src);
|
@unlink($tempFileName);
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
notice($msg);
|
DI::sysmsg()->addNotice($msg);
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($maxfilesize && $filesize > $maxfilesize) {
|
if ($maxFileSize && $fileSize > $maxFileSize) {
|
||||||
$msg = DI::l10n()->t('File exceeds size limit of %s', Strings::formatBytes($maxfilesize));
|
$msg = DI::l10n()->t('File exceeds size limit of %s', Strings::formatBytes($maxFileSize));
|
||||||
@unlink($src);
|
Logger::warning($msg, ['fileSize' => $fileSize]);
|
||||||
if ($r_json) {
|
@unlink($tempFileName);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
echo $msg . EOL;
|
echo $msg . '<br />';
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$newid = Attach::storeFile($src, $page_owner_uid, $filename, '<' . $page_owner_cid . '>');
|
$newid = Attach::storeFile($tempFileName, $page_owner_uid, $fileName, '<' . $page_owner_cid . '>');
|
||||||
|
|
||||||
@unlink($src);
|
@unlink($tempFileName);
|
||||||
|
|
||||||
if ($newid === false) {
|
if ($newid === false) {
|
||||||
$msg = DI::l10n()->t('File upload failed.');
|
$msg = DI::l10n()->t('File upload failed.');
|
||||||
if ($r_json) {
|
Logger::warning($msg);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
echo $msg . EOL;
|
echo $msg . '<br />';
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['ok' => true, 'id' => $newid]);
|
System::jsonExit(['ok' => true, 'id' => $newid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Session;
|
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -40,9 +39,9 @@ use Friendica\Util\Strings;
|
||||||
|
|
||||||
function wall_upload_post(App $a, $desktopmode = true)
|
function wall_upload_post(App $a, $desktopmode = true)
|
||||||
{
|
{
|
||||||
Logger::info("wall upload: starting new upload");
|
Logger::info('wall upload: starting new upload');
|
||||||
|
|
||||||
$r_json = (!empty($_GET['response']) && $_GET['response'] == 'json');
|
$isJson = (!empty($_GET['response']) && $_GET['response'] == 'json');
|
||||||
$album = trim($_GET['album'] ?? '');
|
$album = trim($_GET['album'] ?? '');
|
||||||
|
|
||||||
if (DI::args()->getArgc() > 1) {
|
if (DI::args()->getArgc() > 1) {
|
||||||
|
@ -50,7 +49,8 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
$nick = DI::args()->getArgv()[1];
|
$nick = DI::args()->getArgv()[1];
|
||||||
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['nickname' => $nick, 'blocked' => false]);
|
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['nickname' => $nick, 'blocked' => false]);
|
||||||
if (!DBA::isResult($user)) {
|
if (!DBA::isResult($user)) {
|
||||||
if ($r_json) {
|
Logger::warning('wall upload: user instance is not valid', ['user' => $user, 'nickname' => $nick]);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -59,7 +59,8 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['uid' => BaseApi::getCurrentUserID(), 'blocked' => false]);
|
$user = DBA::selectFirst('owner-view', ['id', 'uid', 'nickname', 'page-flags'], ['uid' => BaseApi::getCurrentUserID(), 'blocked' => false]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($r_json) {
|
Logger:warning('Argument count is zero or one (invalid)');
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -74,26 +75,29 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
$page_owner_uid = $user['uid'];
|
$page_owner_uid = $user['uid'];
|
||||||
$default_cid = $user['id'];
|
$default_cid = $user['id'];
|
||||||
$page_owner_nick = $user['nickname'];
|
$page_owner_nick = $user['nickname'];
|
||||||
$community_page = (($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY) ? true : false);
|
$community_page = ($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY);
|
||||||
|
|
||||||
if ((local_user()) && (local_user() == $page_owner_uid)) {
|
if ((DI::userSession()->getLocalUserId()) && (DI::userSession()->getLocalUserId() == $page_owner_uid)) {
|
||||||
$can_post = true;
|
$can_post = true;
|
||||||
} elseif ($community_page && !empty(Session::getRemoteContactID($page_owner_uid))) {
|
} elseif ($community_page && !empty(DI::userSession()->getRemoteContactID($page_owner_uid))) {
|
||||||
$contact_id = Session::getRemoteContactID($page_owner_uid);
|
$contact_id = DI::userSession()->getRemoteContactID($page_owner_uid);
|
||||||
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
|
$can_post = DBA::exists('contact', ['blocked' => false, 'pending' => false, 'id' => $contact_id, 'uid' => $page_owner_uid]);
|
||||||
$visitor = $contact_id;
|
$visitor = $contact_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$can_post) {
|
if (!$can_post) {
|
||||||
if ($r_json) {
|
Logger::warning('No permission to upload files', ['contact_id' => $contact_id, 'page_owner_uid' => $page_owner_uid]);
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Permission denied.')]);
|
$msg = DI::l10n()->t('Permission denied.');
|
||||||
|
if ($isJson) {
|
||||||
|
System::jsonExit(['error' => $msg]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice($msg);
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
|
if (empty($_FILES['userfile']) && empty($_FILES['media'])) {
|
||||||
if ($r_json) {
|
Logger::warning('Empty "userfile" and "media" field');
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
|
@ -103,12 +107,12 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
$filename = '';
|
$filename = '';
|
||||||
$filesize = 0;
|
$filesize = 0;
|
||||||
$filetype = '';
|
$filetype = '';
|
||||||
|
|
||||||
if (!empty($_FILES['userfile'])) {
|
if (!empty($_FILES['userfile'])) {
|
||||||
$src = $_FILES['userfile']['tmp_name'];
|
$src = $_FILES['userfile']['tmp_name'];
|
||||||
$filename = basename($_FILES['userfile']['name']);
|
$filename = basename($_FILES['userfile']['name']);
|
||||||
$filesize = intval($_FILES['userfile']['size']);
|
$filesize = intval($_FILES['userfile']['size']);
|
||||||
$filetype = $_FILES['userfile']['type'];
|
$filetype = $_FILES['userfile']['type'];
|
||||||
|
|
||||||
} elseif (!empty($_FILES['media'])) {
|
} elseif (!empty($_FILES['media'])) {
|
||||||
if (!empty($_FILES['media']['tmp_name'])) {
|
if (!empty($_FILES['media']['tmp_name'])) {
|
||||||
if (is_array($_FILES['media']['tmp_name'])) {
|
if (is_array($_FILES['media']['tmp_name'])) {
|
||||||
|
@ -143,29 +147,36 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($src == "") {
|
if ($src == '') {
|
||||||
if ($r_json) {
|
Logger::warning('File source (temporary file) cannot be determined');
|
||||||
System::jsonExit(['error' => DI::l10n()->t('Invalid request.')]);
|
$msg = DI::l10n()->t('Invalid request.');
|
||||||
|
if ($isJson) {
|
||||||
|
System::jsonExit(['error' => $msg]);
|
||||||
}
|
}
|
||||||
notice(DI::l10n()->t('Invalid request.'));
|
DI::sysmsg()->addNotice($msg);
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
|
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
|
||||||
|
|
||||||
Logger::info("File upload src: " . $src . " - filename: " . $filename .
|
Logger::info('File upload:', [
|
||||||
" - size: " . $filesize . " - type: " . $filetype);
|
'src' => $src,
|
||||||
|
'filename' => $filename,
|
||||||
|
'filesize' => $filesize,
|
||||||
|
'filetype' => $filetype,
|
||||||
|
]);
|
||||||
|
|
||||||
$imagedata = @file_get_contents($src);
|
$imagedata = @file_get_contents($src);
|
||||||
$image = new Image($imagedata, $filetype);
|
$image = new Image($imagedata, $filetype);
|
||||||
|
|
||||||
if (!$image->isValid()) {
|
if (!$image->isValid()) {
|
||||||
$msg = DI::l10n()->t('Unable to process image.');
|
$msg = DI::l10n()->t('Unable to process image.');
|
||||||
|
Logger::warning($msg, ['imagedata[]' => gettype($imagedata), 'filetype' => $filetype]);
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg . '<br />';
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
@ -177,7 +188,7 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
if ($max_length > 0) {
|
if ($max_length > 0) {
|
||||||
$image->scaleDown($max_length);
|
$image->scaleDown($max_length);
|
||||||
$filesize = strlen($image->asString());
|
$filesize = strlen($image->asString());
|
||||||
Logger::info("File upload: Scaling picture to new size " . $max_length);
|
Logger::info('File upload: Scaling picture to new size', ['max_length' => $max_length]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$width = $image->getWidth();
|
$width = $image->getWidth();
|
||||||
|
@ -200,10 +211,10 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
Logger::notice('Image size is too big', ['size' => $filesize, 'max' => $maximagesize]);
|
Logger::notice('Image size is too big', ['size' => $filesize, 'max' => $maximagesize]);
|
||||||
$msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
|
$msg = DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize));
|
||||||
@unlink($src);
|
@unlink($src);
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg . '<br />';
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
@ -224,10 +235,11 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
|
|
||||||
if (!$r) {
|
if (!$r) {
|
||||||
$msg = DI::l10n()->t('Image upload failed.');
|
$msg = DI::l10n()->t('Image upload failed.');
|
||||||
if ($r_json) {
|
Logger::warning('Photo::store() failed', ['r' => $r]);
|
||||||
|
if ($isJson) {
|
||||||
System::jsonExit(['error' => $msg]);
|
System::jsonExit(['error' => $msg]);
|
||||||
} else {
|
} else {
|
||||||
echo $msg. EOL;
|
echo $msg . '<br />';
|
||||||
}
|
}
|
||||||
System::exit();
|
System::exit();
|
||||||
}
|
}
|
||||||
|
@ -251,32 +263,34 @@ function wall_upload_post(App $a, $desktopmode = true)
|
||||||
if (!$desktopmode) {
|
if (!$desktopmode) {
|
||||||
$photo = Photo::selectFirst(['id', 'datasize', 'width', 'height', 'type'], ['resource-id' => $resource_id], ['order' => ['width']]);
|
$photo = Photo::selectFirst(['id', 'datasize', 'width', 'height', 'type'], ['resource-id' => $resource_id], ['order' => ['width']]);
|
||||||
if (!$photo) {
|
if (!$photo) {
|
||||||
if ($r_json) {
|
Logger::warning('Cannot find photo in database', ['resource-id' => $resource_id]);
|
||||||
System::jsonExit(['error' => '']);
|
if ($isJson) {
|
||||||
|
System::jsonExit(['error' => 'Cannot find photo']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$picture = [];
|
|
||||||
|
|
||||||
$picture["id"] = $photo["id"];
|
$picture = [
|
||||||
$picture["size"] = $photo["datasize"];
|
'id' => $photo['id'],
|
||||||
$picture["width"] = $photo["width"];
|
'size' => $photo['datasize'],
|
||||||
$picture["height"] = $photo["height"];
|
'width' => $photo['width'],
|
||||||
$picture["type"] = $photo["type"];
|
'height' => $photo['height'],
|
||||||
$picture["albumpage"] = DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id;
|
'type' => $photo['type'],
|
||||||
$picture["picture"] = DI::baseUrl() . "/photo/{$resource_id}-0." . $image->getExt();
|
'albumpage' => DI::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $resource_id,
|
||||||
$picture["preview"] = DI::baseUrl() . "/photo/{$resource_id}-{$smallest}." . $image->getExt();
|
'picture' => DI::baseUrl() . "/photo/{$resource_id}-0." . $image->getExt(),
|
||||||
|
'preview' => DI::baseUrl() . "/photo/{$resource_id}-{$smallest}." . $image->getExt(),
|
||||||
|
];
|
||||||
|
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['picture' => $picture]);
|
System::jsonExit(['picture' => $picture]);
|
||||||
}
|
}
|
||||||
Logger::info("upload done");
|
Logger::info('upload done');
|
||||||
return $picture;
|
return $picture;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info("upload done");
|
Logger::info('upload done');
|
||||||
|
|
||||||
if ($r_json) {
|
if ($isJson) {
|
||||||
System::jsonExit(['ok' => true]);
|
System::jsonExit(['ok' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,146 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* @copyright Copyright (C) 2010-2022, the Friendica project
|
|
||||||
*
|
|
||||||
* @license GNU AGPL version 3 or any later version
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\Core\Logger;
|
|
||||||
use Friendica\Core\Renderer;
|
|
||||||
use Friendica\Database\DBA;
|
|
||||||
use Friendica\DI;
|
|
||||||
use Friendica\Model\Mail;
|
|
||||||
use Friendica\Model\Profile;
|
|
||||||
use Friendica\Model\User;
|
|
||||||
use Friendica\Util\DateTimeFormat;
|
|
||||||
use Friendica\Util\Strings;
|
|
||||||
|
|
||||||
function wallmessage_post(App $a) {
|
|
||||||
|
|
||||||
$replyto = Profile::getMyURL();
|
|
||||||
if (!$replyto) {
|
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$subject = trim($_REQUEST['subject'] ?? '');
|
|
||||||
$body = Strings::escapeHtml(trim($_REQUEST['body'] ?? ''));
|
|
||||||
|
|
||||||
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
|
|
||||||
if ((! $recipient) || (! $body)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = User::getByNickname($recipient);
|
|
||||||
if (empty($r)) {
|
|
||||||
Logger::notice('wallmessage: no recipient');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user['unkmail']) {
|
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
|
|
||||||
if ($total > $user['cntunkmail']) {
|
|
||||||
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$ret = Mail::sendWall($user, $body, $subject, $replyto);
|
|
||||||
|
|
||||||
switch ($ret) {
|
|
||||||
case -1:
|
|
||||||
notice(DI::l10n()->t('No recipient selected.'));
|
|
||||||
break;
|
|
||||||
case -2:
|
|
||||||
notice(DI::l10n()->t('Unable to check your home location.'));
|
|
||||||
break;
|
|
||||||
case -3:
|
|
||||||
notice(DI::l10n()->t('Message could not be sent.'));
|
|
||||||
break;
|
|
||||||
case -4:
|
|
||||||
notice(DI::l10n()->t('Message collection failure.'));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
DI::baseUrl()->redirect('profile/'.$user['nickname']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function wallmessage_content(App $a) {
|
|
||||||
|
|
||||||
if (!Profile::getMyURL()) {
|
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$recipient = ((DI::args()->getArgc() > 1) ? DI::args()->getArgv()[1] : '');
|
|
||||||
|
|
||||||
if (!$recipient) {
|
|
||||||
notice(DI::l10n()->t('No recipient.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = User::getByNickname($recipient);
|
|
||||||
|
|
||||||
if (empty($user)) {
|
|
||||||
notice(DI::l10n()->t('No recipient.'));
|
|
||||||
Logger::notice('wallmessage: no recipient');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user['unkmail']) {
|
|
||||||
notice(DI::l10n()->t('Permission denied.'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
|
|
||||||
if ($total > $user['cntunkmail']) {
|
|
||||||
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('wallmsg-header.tpl');
|
|
||||||
DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
|
|
||||||
'$baseurl' => DI::baseUrl()->get(true),
|
|
||||||
'$nickname' => $user['nickname'],
|
|
||||||
'$linkurl' => DI::l10n()->t('Please enter a link URL:')
|
|
||||||
]);
|
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('wallmessage.tpl');
|
|
||||||
$o = Renderer::replaceMacros($tpl, [
|
|
||||||
'$header' => DI::l10n()->t('Send Private Message'),
|
|
||||||
'$subheader' => DI::l10n()->t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.', $user['username']),
|
|
||||||
'$to' => DI::l10n()->t('To:'),
|
|
||||||
'$subject' => DI::l10n()->t('Subject:'),
|
|
||||||
'$recipname' => $user['username'],
|
|
||||||
'$nickname' => $user['nickname'],
|
|
||||||
'$subjtxt' => $_REQUEST['subject'] ?? '',
|
|
||||||
'$text' => $_REQUEST['body'] ?? '',
|
|
||||||
'$readonly' => '',
|
|
||||||
'$yourmessage'=> DI::l10n()->t('Your message:'),
|
|
||||||
'$parent' => '',
|
|
||||||
'$upload' => DI::l10n()->t('Upload photo'),
|
|
||||||
'$insert' => DI::l10n()->t('Insert web link'),
|
|
||||||
'$wait' => DI::l10n()->t('Please wait')
|
|
||||||
]);
|
|
||||||
|
|
||||||
return $o;
|
|
||||||
}
|
|
|
@ -29,7 +29,7 @@ return [
|
||||||
// ****************************************************************
|
// ****************************************************************
|
||||||
|
|
||||||
'config' => [
|
'config' => [
|
||||||
'hostname' => 'friendica.local',
|
'hostname' => '192.168.56.10',
|
||||||
'admin_email' => 'admin@friendica.local',
|
'admin_email' => 'admin@friendica.local',
|
||||||
'sitename' => 'Friendica Social Network',
|
'sitename' => 'Friendica Social Network',
|
||||||
'register_policy' => \Friendica\Module\Register::OPEN,
|
'register_policy' => \Friendica\Module\Register::OPEN,
|
||||||
|
|
|
@ -19,7 +19,6 @@ static/
|
||||||
vendor/
|
vendor/
|
||||||
view/
|
view/
|
||||||
.htaccess-dist
|
.htaccess-dist
|
||||||
boot.php
|
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
CREDITS.txt
|
CREDITS.txt
|
||||||
database.sql
|
database.sql
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Contact: mailto:info@friendi.ca
|
Contact: mailto:info@friendi.ca
|
||||||
|
|
||||||
Expires: Sun, 31 Dec 2022 23:59 +0000
|
Expires: Sun, 30 Jun 2023 23:59 +0000
|
||||||
|
|
||||||
Preferred-Languages: en
|
Preferred-Languages: en
|
||||||
|
|
||||||
|
|
49
src/App.php
49
src/App.php
|
@ -26,6 +26,7 @@ use Friendica\App\Arguments;
|
||||||
use Friendica\App\BaseURL;
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Factory\Config;
|
use Friendica\Core\Config\Factory\Config;
|
||||||
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Module\Maintenance;
|
use Friendica\Module\Maintenance;
|
||||||
use Friendica\Security\Authentication;
|
use Friendica\Security\Authentication;
|
||||||
use Friendica\Core\Config\ValueObject\Cache;
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
|
@ -58,6 +59,10 @@ use Psr\Log\LoggerInterface;
|
||||||
*/
|
*/
|
||||||
class App
|
class App
|
||||||
{
|
{
|
||||||
|
const PLATFORM = 'Friendica';
|
||||||
|
const CODENAME = 'Giant Rhubarb';
|
||||||
|
const VERSION = '2022.12-dev';
|
||||||
|
|
||||||
// Allow themes to control internal parameters
|
// Allow themes to control internal parameters
|
||||||
// by changing App values in theme.php
|
// by changing App values in theme.php
|
||||||
private $theme_info = [
|
private $theme_info = [
|
||||||
|
@ -123,6 +128,11 @@ class App
|
||||||
*/
|
*/
|
||||||
private $pConfig;
|
private $pConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IHandleUserSessions
|
||||||
|
*/
|
||||||
|
private $session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the user ID
|
* Set the user ID
|
||||||
*
|
*
|
||||||
|
@ -147,7 +157,7 @@ class App
|
||||||
|
|
||||||
public function isLoggedIn(): bool
|
public function isLoggedIn(): bool
|
||||||
{
|
{
|
||||||
return local_user() && $this->user_id && ($this->user_id == local_user());
|
return $this->session->getLocalUserId() && $this->user_id && ($this->user_id == $this->session->getLocalUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,7 +171,7 @@ class App
|
||||||
|
|
||||||
$adminlist = explode(',', str_replace(' ', '', $admin_email));
|
$adminlist = explode(',', str_replace(' ', '', $admin_email));
|
||||||
|
|
||||||
return local_user() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
|
return $this->session->getLocalUserId() && $admin_email && $this->database->exists('user', ['uid' => $this->getLoggedInUserId(), 'email' => $adminlist]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -324,8 +334,9 @@ class App
|
||||||
* @param L10n $l10n The translator instance
|
* @param L10n $l10n The translator instance
|
||||||
* @param App\Arguments $args The Friendica Arguments of the call
|
* @param App\Arguments $args The Friendica Arguments of the call
|
||||||
* @param IManagePersonalConfigValues $pConfig Personal configuration
|
* @param IManagePersonalConfigValues $pConfig Personal configuration
|
||||||
|
* @param IHandleUserSessions $session The (User)Session handler
|
||||||
*/
|
*/
|
||||||
public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig)
|
public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session)
|
||||||
{
|
{
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
@ -336,6 +347,7 @@ class App
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
$this->args = $args;
|
$this->args = $args;
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
|
$this->session = $session;
|
||||||
|
|
||||||
$this->load();
|
$this->load();
|
||||||
}
|
}
|
||||||
|
@ -347,6 +359,11 @@ class App
|
||||||
{
|
{
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
|
// Normally this constant is defined - but not if "pcntl" isn't installed
|
||||||
|
if (!defined('SIGTERM')) {
|
||||||
|
define('SIGTERM', 15);
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure that all "strtotime" operations do run timezone independent
|
// Ensure that all "strtotime" operations do run timezone independent
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
@ -406,7 +423,7 @@ class App
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specific mobile theme override
|
// Specific mobile theme override
|
||||||
if (($this->mode->isMobile() || $this->mode->isTablet()) && Core\Session::get('show-mobile', true)) {
|
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
|
||||||
$user_mobile_theme = $this->getCurrentMobileTheme();
|
$user_mobile_theme = $this->getCurrentMobileTheme();
|
||||||
|
|
||||||
// --- means same mobile theme as desktop
|
// --- means same mobile theme as desktop
|
||||||
|
@ -478,16 +495,16 @@ class App
|
||||||
|
|
||||||
$page_theme = null;
|
$page_theme = null;
|
||||||
// Find the theme that belongs to the user whose stuff we are looking at
|
// Find the theme that belongs to the user whose stuff we are looking at
|
||||||
if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) {
|
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
|
||||||
// Allow folks to override user themes and always use their own on their own site.
|
// Allow folks to override user themes and always use their own on their own site.
|
||||||
// This works only if the user is on the same server
|
// This works only if the user is on the same server
|
||||||
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
|
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
|
||||||
if ($this->database->isResult($user) && !local_user()) {
|
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
|
||||||
$page_theme = $user['theme'];
|
$page_theme = $user['theme'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$theme_name = $page_theme ?: Core\Session::get('theme', $system_theme);
|
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
|
||||||
|
|
||||||
$theme_name = Strings::sanitizeFilePathItem($theme_name);
|
$theme_name = Strings::sanitizeFilePathItem($theme_name);
|
||||||
if ($theme_name
|
if ($theme_name
|
||||||
|
@ -511,15 +528,15 @@ class App
|
||||||
|
|
||||||
$page_mobile_theme = null;
|
$page_mobile_theme = null;
|
||||||
// Find the theme that belongs to the user whose stuff we are looking at
|
// Find the theme that belongs to the user whose stuff we are looking at
|
||||||
if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) {
|
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
|
||||||
// Allow folks to override user themes and always use their own on their own site.
|
// Allow folks to override user themes and always use their own on their own site.
|
||||||
// This works only if the user is on the same server
|
// This works only if the user is on the same server
|
||||||
if (!local_user()) {
|
if (!$this->session->getLocalUserId()) {
|
||||||
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
|
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mobile_theme_name = $page_mobile_theme ?: Core\Session::get('mobile-theme', $system_mobile_theme);
|
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
|
||||||
|
|
||||||
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
|
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
|
||||||
if ($mobile_theme_name == '---'
|
if ($mobile_theme_name == '---'
|
||||||
|
@ -586,7 +603,7 @@ class App
|
||||||
$this->profiler->set(microtime(true), 'classinit');
|
$this->profiler->set(microtime(true), 'classinit');
|
||||||
|
|
||||||
$moduleName = $this->args->getModuleName();
|
$moduleName = $this->args->getModuleName();
|
||||||
$page->setLogging($this->args->getCommand(), $this->args->getMethod());
|
$page->setLogging($this->args->getMethod(), $this->args->getModuleName(), $this->args->getCommand());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Missing DB connection: ERROR
|
// Missing DB connection: ERROR
|
||||||
|
@ -611,14 +628,14 @@ class App
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZRL
|
// ZRL
|
||||||
if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !local_user()) {
|
if (!empty($_GET['zrl']) && $this->mode->isNormal() && !$this->mode->isBackend() && !$this->session->getLocalUserId()) {
|
||||||
// Only continue when the given profile link seems valid
|
// Only continue when the given profile link seems valid
|
||||||
// Valid profile links contain a path with "/profile/" and no query parameters
|
// Valid profile links contain a path with "/profile/" and no query parameters
|
||||||
if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') &&
|
if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == '') &&
|
||||||
strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) {
|
strstr(parse_url($_GET['zrl'], PHP_URL_PATH), '/profile/')) {
|
||||||
if (Core\Session::get('visitor_home') != $_GET['zrl']) {
|
if ($this->session->get('visitor_home') != $_GET['zrl']) {
|
||||||
Core\Session::set('my_url', $_GET['zrl']);
|
$this->session->set('my_url', $_GET['zrl']);
|
||||||
Core\Session::set('authenticated', 0);
|
$this->session->set('authenticated', 0);
|
||||||
|
|
||||||
$remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']);
|
$remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']);
|
||||||
if (!empty($remote_contact['subscribe'])) {
|
if (!empty($remote_contact['subscribe'])) {
|
||||||
|
@ -719,7 +736,7 @@ class App
|
||||||
$response = $module->run($input);
|
$response = $module->run($input);
|
||||||
$this->profiler->set(microtime(true) - $timestamp, 'content');
|
$this->profiler->set(microtime(true) - $timestamp, 'content');
|
||||||
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
|
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
|
||||||
$page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
|
$page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $this->session->getLocalUserId());
|
||||||
} else {
|
} else {
|
||||||
$page->exit($response);
|
$page->exit($response);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,9 @@ class Page implements ArrayAccess
|
||||||
private $basePath;
|
private $basePath;
|
||||||
|
|
||||||
private $timestamp = 0;
|
private $timestamp = 0;
|
||||||
private $command = '';
|
|
||||||
private $method = '';
|
private $method = '';
|
||||||
|
private $module = '';
|
||||||
|
private $command = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $basepath The Page basepath
|
* @param string $basepath The Page basepath
|
||||||
|
@ -92,21 +93,25 @@ class Page implements ArrayAccess
|
||||||
$this->basePath = $basepath;
|
$this->basePath = $basepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLogging(string $command, string $method)
|
public function setLogging(string $method, string $module, string $command)
|
||||||
{
|
{
|
||||||
$this->command = $command;
|
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
|
$this->module = $module;
|
||||||
|
$this->command = $command;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logRuntime(IManageConfigValues $config, string $origin = '')
|
public function logRuntime(IManageConfigValues $config, string $origin = '')
|
||||||
{
|
{
|
||||||
if (in_array($this->command, $config->get('system', 'runtime_ignore'))) {
|
$ignore = $config->get('system', 'runtime_ignore');
|
||||||
|
if (in_array($this->module, $ignore) || in_array($this->command, $ignore)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$signature = !empty($_SERVER['HTTP_SIGNATURE']);
|
||||||
|
$load = number_format(System::currentLoad(), 2);
|
||||||
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
||||||
if ($runtime > $config->get('system', 'runtime_loglimit')) {
|
if ($runtime > $config->get('system', 'runtime_loglimit')) {
|
||||||
Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime, 'origin' => $origin]);
|
Logger::debug('Runtime', ['method' => $this->method, 'module' => $this->module, 'runtime' => $runtime, 'load' => $load, 'origin' => $origin, 'signature' => $signature, 'request' => $_SERVER['REQUEST_URI'] ?? '']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,7 +202,7 @@ class Page implements ArrayAccess
|
||||||
*/
|
*/
|
||||||
public function registerStylesheet(string $path, string $media = 'screen')
|
public function registerStylesheet(string $path, string $media = 'screen')
|
||||||
{
|
{
|
||||||
$path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]);
|
$path = Network::appendQueryParam($path, ['v' => App::VERSION]);
|
||||||
|
|
||||||
if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) {
|
if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) {
|
||||||
$path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR));
|
$path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR));
|
||||||
|
@ -221,12 +226,13 @@ class Page implements ArrayAccess
|
||||||
* @param L10n $l10n The l10n language instance
|
* @param L10n $l10n The l10n language instance
|
||||||
* @param IManageConfigValues $config The Friendica configuration
|
* @param IManageConfigValues $config The Friendica configuration
|
||||||
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
|
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
|
||||||
|
* @param int $localUID The local user id
|
||||||
*
|
*
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig)
|
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, int $localUID)
|
||||||
{
|
{
|
||||||
$interval = ((local_user()) ? $pConfig->get(local_user(), 'system', 'update_interval') : 40000);
|
$interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
|
||||||
|
|
||||||
// If the update is 'deactivated' set it to the highest integer number (~24 days)
|
// If the update is 'deactivated' set it to the highest integer number (~24 days)
|
||||||
if ($interval < 0) {
|
if ($interval < 0) {
|
||||||
|
@ -271,8 +277,8 @@ class Page implements ArrayAccess
|
||||||
* being first
|
* being first
|
||||||
*/
|
*/
|
||||||
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
|
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
|
||||||
'$local_user' => local_user(),
|
'$local_user' => $localUID,
|
||||||
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
|
'$generator' => 'Friendica' . ' ' . App::VERSION,
|
||||||
'$delitem' => $l10n->t('Delete this item?'),
|
'$delitem' => $l10n->t('Delete this item?'),
|
||||||
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
|
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
|
||||||
'$update_interval' => $interval,
|
'$update_interval' => $interval,
|
||||||
|
@ -390,7 +396,7 @@ class Page implements ArrayAccess
|
||||||
*/
|
*/
|
||||||
public function registerFooterScript($path)
|
public function registerFooterScript($path)
|
||||||
{
|
{
|
||||||
$path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]);
|
$path = Network::appendQueryParam($path, ['v' => App::VERSION]);
|
||||||
|
|
||||||
$url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
|
$url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
|
||||||
|
|
||||||
|
@ -438,10 +444,11 @@ class Page implements ArrayAccess
|
||||||
* @param L10n $l10n The l10n language class
|
* @param L10n $l10n The l10n language class
|
||||||
* @param IManageConfigValues $config The Configuration of this node
|
* @param IManageConfigValues $config The Configuration of this node
|
||||||
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
|
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
|
||||||
|
* @param int $localUID The UID of the local user
|
||||||
*
|
*
|
||||||
* @throws HTTPException\InternalServerErrorException|HTTPException\ServiceUnavailableException
|
* @throws HTTPException\InternalServerErrorException|HTTPException\ServiceUnavailableException
|
||||||
*/
|
*/
|
||||||
public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
|
public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig, int $localUID)
|
||||||
{
|
{
|
||||||
$moduleName = $args->getModuleName();
|
$moduleName = $args->getModuleName();
|
||||||
|
|
||||||
|
@ -475,7 +482,7 @@ class Page implements ArrayAccess
|
||||||
* all the module functions have executed so that all
|
* all the module functions have executed so that all
|
||||||
* theme choices made by the modules can take effect.
|
* theme choices made by the modules can take effect.
|
||||||
*/
|
*/
|
||||||
$this->initHead($app, $args, $l10n, $config, $pconfig);
|
$this->initHead($app, $args, $l10n, $config, $pconfig, $localUID);
|
||||||
|
|
||||||
/* Build the page ending -- this is stuff that goes right before
|
/* Build the page ending -- this is stuff that goes right before
|
||||||
* the closing </body> tag
|
* the closing </body> tag
|
||||||
|
@ -538,7 +545,7 @@ class Page implements ArrayAccess
|
||||||
|
|
||||||
$page = $this->page;
|
$page = $this->page;
|
||||||
|
|
||||||
header("X-Friendica-Version: " . FRIENDICA_VERSION);
|
header("X-Friendica-Version: " . App::VERSION);
|
||||||
header("Content-type: text/html; charset=utf-8");
|
header("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) {
|
if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) {
|
||||||
|
|
|
@ -34,6 +34,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Lock\Capability\ICanLock;
|
use Friendica\Core\Lock\Capability\ICanLock;
|
||||||
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\LegacyModule;
|
use Friendica\LegacyModule;
|
||||||
use Friendica\Module\HTTPException\MethodNotAllowed;
|
use Friendica\Module\HTTPException\MethodNotAllowed;
|
||||||
use Friendica\Module\HTTPException\PageNotFound;
|
use Friendica\Module\HTTPException\PageNotFound;
|
||||||
|
@ -98,6 +99,9 @@ class Router
|
||||||
/** @var LoggerInterface */
|
/** @var LoggerInterface */
|
||||||
private $logger;
|
private $logger;
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private $isLocalUser;
|
||||||
|
|
||||||
/** @var float */
|
/** @var float */
|
||||||
private $dice_profiler_threshold;
|
private $dice_profiler_threshold;
|
||||||
|
|
||||||
|
@ -120,9 +124,10 @@ class Router
|
||||||
* @param Arguments $args
|
* @param Arguments $args
|
||||||
* @param LoggerInterface $logger
|
* @param LoggerInterface $logger
|
||||||
* @param Dice $dice
|
* @param Dice $dice
|
||||||
|
* @param IHandleUserSessions $userSession
|
||||||
* @param RouteCollector|null $routeCollector
|
* @param RouteCollector|null $routeCollector
|
||||||
*/
|
*/
|
||||||
public function __construct(array $server, string $baseRoutesFilepath, L10n $l10n, ICanCache $cache, ICanLock $lock, IManageConfigValues $config, Arguments $args, LoggerInterface $logger, Dice $dice, RouteCollector $routeCollector = null)
|
public function __construct(array $server, string $baseRoutesFilepath, L10n $l10n, ICanCache $cache, ICanLock $lock, IManageConfigValues $config, Arguments $args, LoggerInterface $logger, Dice $dice, IHandleUserSessions $userSession, RouteCollector $routeCollector = null)
|
||||||
{
|
{
|
||||||
$this->baseRoutesFilepath = $baseRoutesFilepath;
|
$this->baseRoutesFilepath = $baseRoutesFilepath;
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
|
@ -133,6 +138,7 @@ class Router
|
||||||
$this->dice = $dice;
|
$this->dice = $dice;
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
$this->isLocalUser = !empty($userSession->getLocalUserId());
|
||||||
$this->dice_profiler_threshold = $config->get('system', 'dice_profiler_threshold', 0);
|
$this->dice_profiler_threshold = $config->get('system', 'dice_profiler_threshold', 0);
|
||||||
|
|
||||||
$this->routeCollector = $routeCollector ?? new RouteCollector(new Std(), new GroupCountBased());
|
$this->routeCollector = $routeCollector ?? new RouteCollector(new Std(), new GroupCountBased());
|
||||||
|
@ -308,7 +314,7 @@ class Router
|
||||||
if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
|
if (Addon::isEnabled($moduleName) && file_exists("addon/{$moduleName}/{$moduleName}.php")) {
|
||||||
//Check if module is an app and if public access to apps is allowed or not
|
//Check if module is an app and if public access to apps is allowed or not
|
||||||
$privateapps = $this->config->get('config', 'private_addons', false);
|
$privateapps = $this->config->get('config', 'private_addons', false);
|
||||||
if ((!local_user()) && Hook::isAddonApp($moduleName) && $privateapps) {
|
if (!$this->isLocalUser && Hook::isAddonApp($moduleName) && $privateapps) {
|
||||||
throw new MethodNotAllowedException($this->l10n->t("You must be logged in to use addons. "));
|
throw new MethodNotAllowedException($this->l10n->t("You must be logged in to use addons. "));
|
||||||
} else {
|
} else {
|
||||||
include_once "addon/{$moduleName}/{$moduleName}.php";
|
include_once "addon/{$moduleName}/{$moduleName}.php";
|
||||||
|
@ -339,7 +345,7 @@ class Router
|
||||||
if ($this->dice_profiler_threshold > 0) {
|
if ($this->dice_profiler_threshold > 0) {
|
||||||
$dur = floatval(microtime(true) - $stamp);
|
$dur = floatval(microtime(true) - $stamp);
|
||||||
if ($dur >= $this->dice_profiler_threshold) {
|
if ($dur >= $this->dice_profiler_threshold) {
|
||||||
$this->logger->warning('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $module_class, 'parameters' => $module_parameters]);
|
$this->logger->notice('Dice module creation lasts too long.', ['duration' => round($dur, 3), 'module' => $module_class, 'parameters' => $module_parameters]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
|
|
||||||
public static function getFormSecurityStandardErrorMessage(): string
|
public static function getFormSecurityStandardErrorMessage(): string
|
||||||
{
|
{
|
||||||
return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.") . EOL;
|
return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function checkFormSecurityTokenRedirectOnError(string $err_redirect, string $typename = '', string $formname = 'form_security_token')
|
public static function checkFormSecurityTokenRedirectOnError(string $err_redirect, string $typename = '', string $formname = 'form_security_token')
|
||||||
|
@ -397,7 +397,7 @@ abstract class BaseModule implements ICanHandleRequests
|
||||||
if (!self::checkFormSecurityToken($typename, $formname)) {
|
if (!self::checkFormSecurityToken($typename, $formname)) {
|
||||||
Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename);
|
Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename);
|
||||||
Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
|
Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
|
||||||
notice(self::getFormSecurityStandardErrorMessage());
|
DI::sysmsg()->addNotice(self::getFormSecurityStandardErrorMessage());
|
||||||
DI::baseUrl()->redirect($err_redirect);
|
DI::baseUrl()->redirect($err_redirect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,9 +75,8 @@ HELP;
|
||||||
$arr = [];
|
$arr = [];
|
||||||
|
|
||||||
$files = array_merge(
|
$files = array_merge(
|
||||||
['index.php', 'boot.php'],
|
['index.php'],
|
||||||
glob('mod/*'),
|
glob('mod/*'),
|
||||||
glob('include/*'),
|
|
||||||
glob('addon/*/*'),
|
glob('addon/*/*'),
|
||||||
$this->globRecursive('src')
|
$this->globRecursive('src')
|
||||||
);
|
);
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
|
use Friendica\Model\Contact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tool to find and merge duplicated contact entries.
|
* tool to find and merge duplicated contact entries.
|
||||||
|
@ -137,7 +138,7 @@ HELP;
|
||||||
$this->updateTable('post-thread-user', 'contact-id', $from, $to, false);
|
$this->updateTable('post-thread-user', 'contact-id', $from, $to, false);
|
||||||
$this->updateTable('user-contact', 'cid', $from, $to, true);
|
$this->updateTable('user-contact', 'cid', $from, $to, true);
|
||||||
|
|
||||||
if (!$this->dba->delete('contact', ['id' => $from])) {
|
if (!Contact::deleteById($from)) {
|
||||||
$this->err($this->l10n->t('Deletion of id %d failed', $from));
|
$this->err($this->l10n->t('Deletion of id %d failed', $from));
|
||||||
} else {
|
} else {
|
||||||
$this->out($this->l10n->t('Deletion of id %d was successful', $from));
|
$this->out($this->l10n->t('Deletion of id %d was successful', $from));
|
||||||
|
|
|
@ -46,7 +46,7 @@ class MoveToAvatarCache extends \Asika\SimpleConsole\Console
|
||||||
/**
|
/**
|
||||||
* @var $baseurl Friendica\App\BaseURL
|
* @var $baseurl Friendica\App\BaseURL
|
||||||
*/
|
*/
|
||||||
private $baseurl;
|
private $baseUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var L10n
|
* @var L10n
|
||||||
|
@ -75,12 +75,12 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(\Friendica\Database\Database $dba, BaseURL $baseurl, L10n $l10n, IManageConfigValues $config, array $argv = null)
|
public function __construct(\Friendica\Database\Database $dba, BaseURL $baseUrl, L10n $l10n, IManageConfigValues $config, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->baseurl = $baseurl;
|
$this->baseUrl = $baseUrl;
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ HELP;
|
||||||
|
|
||||||
$fields = ['id', 'avatar', 'photo', 'thumb', 'micro', 'uri-id', 'url', 'avatar', 'network'];
|
$fields = ['id', 'avatar', 'photo', 'thumb', 'micro', 'uri-id', 'url', 'avatar', 'network'];
|
||||||
$condition = ["NOT `self` AND `avatar` != ? AND `photo` LIKE ? AND `uid` = ? AND `uri-id` != ? AND NOT `uri-id` IS NULL AND NOT `network` IN (?, ?)",
|
$condition = ["NOT `self` AND `avatar` != ? AND `photo` LIKE ? AND `uid` = ? AND `uri-id` != ? AND NOT `uri-id` IS NULL AND NOT `network` IN (?, ?)",
|
||||||
'', $this->baseurl->get() . '/photo/%', 0, 0, Protocol::MAIL, Protocol::FEED];
|
'', $this->baseUrl->get() . '/photo/%', 0, 0, Protocol::MAIL, Protocol::FEED];
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$total = $this->dba->count('contact', $condition);
|
$total = $this->dba->count('contact', $condition);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue